From 652d12e0923364df8d02d9977eda784938d1fa3b Mon Sep 17 00:00:00 2001 From: dmontgomeryNREL Date: Wed, 6 Nov 2024 16:48:46 -0700 Subject: [PATCH 1/4] Update PelePhysics and add new utility to Make.PeleLMeX --- Exec/Make.PeleLMeX | 1 + Submodules/AMReX-Hydro | 2 +- Submodules/PelePhysics | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Exec/Make.PeleLMeX b/Exec/Make.PeleLMeX index e31ee739..258f0af8 100644 --- a/Exec/Make.PeleLMeX +++ b/Exec/Make.PeleLMeX @@ -127,6 +127,7 @@ ChemDir = Mechanisms/$(Chemistry_Model) PPdirs := Source/Utility/PMF Source/Utility/TurbInflow Source/Utility/PltFileManager PPdirs += Source/Utility/Diagnostics Source/Utility/BlackBoxFunction +PPdirs += Source/Utility/Utilities PPdirs += Source $(ChemDir) Source/Reactions Source/Eos Source/Transport Bpack += $(foreach dir, $(PPdirs), $(PELE_PHYSICS_HOME)/$(dir)/Make.package) Blocs += $(foreach dir, $(PPdirs), $(PELE_PHYSICS_HOME)/$(dir)) diff --git a/Submodules/AMReX-Hydro b/Submodules/AMReX-Hydro index 3788361f..3ab98640 160000 --- a/Submodules/AMReX-Hydro +++ b/Submodules/AMReX-Hydro @@ -1 +1 @@ -Subproject commit 3788361fec234e29e6d4e8ba95010e68d9c426e7 +Subproject commit 3ab98640a6443e541d7f37ccc0ee7e4080397b88 diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index 06745608..e2653833 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit 06745608874aea5230088aadeb7571a5e9afb8f1 +Subproject commit e265383382bd57e4d69f7d647aff4b9e383667e5 From 89d15cc1001a02f2820a1bec64a279dc90768179 Mon Sep 17 00:00:00 2001 From: dmontgomeryNREL Date: Thu, 7 Nov 2024 06:38:01 -0700 Subject: [PATCH 2/4] Add PelePhysics utilities to CMake --- CMake/BuildPelePhysicsLib.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMake/BuildPelePhysicsLib.cmake b/CMake/BuildPelePhysicsLib.cmake index 59025652..81c6a74f 100644 --- a/CMake/BuildPelePhysicsLib.cmake +++ b/CMake/BuildPelePhysicsLib.cmake @@ -69,6 +69,13 @@ function(build_pele_physics_lib pele_physics_lib_name) ) target_include_directories(${pele_physics_lib_name} PUBLIC ${PELE_PHYSICS_UTILITY_DIR}/PMF) + target_sources(${pele_physics_lib_name} + PRIVATE + ${PELE_PHYSICS_UTILITY_DIR}/Utilities/Utilities.H + ${PELE_PHYSICS_UTILITY_DIR}/Utilities/UnitConversions.H + ) + target_include_directories(${pele_physics_lib_name} PUBLIC ${PELE_PHYSICS_UTILITY_DIR}/Utilities) + target_sources(${pele_physics_lib_name} PRIVATE ${AMREX_SUNDIALS_DIR}/AMReX_Sundials.H From bc6456d0bd6b48d5e6e44ea3ae929e3cb106a385 Mon Sep 17 00:00:00 2001 From: dmontgomeryNREL Date: Thu, 7 Nov 2024 17:08:46 -0700 Subject: [PATCH 3/4] Test PelePhysics:tidy against clang-tidy. --- Source/PeleLMeX.H | 1 + Source/PeleLMeX_K.H | 17 ++++++++++------- Submodules/PelePhysics | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Source/PeleLMeX.H b/Source/PeleLMeX.H index 0ac81e02..c2ccf6fa 100644 --- a/Source/PeleLMeX.H +++ b/Source/PeleLMeX.H @@ -21,6 +21,7 @@ #include #include #include +#include // AMReX-Hydro lib #include diff --git a/Source/PeleLMeX_K.H b/Source/PeleLMeX_K.H index c8c2e6e4..13f4a191 100644 --- a/Source/PeleLMeX_K.H +++ b/Source/PeleLMeX_K.H @@ -4,6 +4,9 @@ #include #include +namespace m2c = pele::physics::utilities::mks2cgs; +namespace c2m = pele::physics::utilities::cgs2mks; + template AMREX_GPU_DEVICE AMREX_FORCE_INLINE void getTransportCoeff( @@ -47,7 +50,7 @@ getTransportCoeff( amrex::Real Wbar = 0.0_rt; eos.Y2WBAR(y, Wbar); - rho *= 1.0e-3_rt; // MKS -> CGS conversion + rho = m2c::Rho(rho); // MKS -> CGS conversion amrex::Real rhoDi_cgs[NUM_SPECIES] = {0.0}; amrex::Real lambda_cgs = 0.0_rt; amrex::Real mu_cgs = 0.0_rt; @@ -66,32 +69,32 @@ getTransportCoeff( chi_loc, mu_cgs, dummy_xi, lambda_cgs, trans_parm); // Do CGS -> MKS conversions - mu(i, j, k) = mu_cgs * 1.0e-1_rt; + mu(i, j, k) = c2m::Mu(mu_cgs); if (do_fixed_Pr && do_fixed_Le) { // fixed Pr and Le, transport all dependent // on visc amrex::Real cpmix = 0.0_rt; eos.TY2Cp(T(i, j, k), y, cpmix); - lambda(i, j, k) = PrInv * cpmix * mu_cgs * 1.0e-5_rt; + lambda(i, j, k) = PrInv * c2m::Cp(cpmix) * c2m::Mu(mu_cgs); amrex::Real ScInv = PrInv * LeInv; for (int n = 0; n < NUM_SPECIES; n++) { - rhoDi(i, j, k, n) = ScInv * mu_cgs * 1.0e-1_rt; + rhoDi(i, j, k, n) = ScInv * c2m::Mu(mu_cgs); } } else if (do_fixed_Pr) { // fixed Pr, still use species diffs amrex::Real cpmix = 0.0_rt; eos.TY2Cp(T(i, j, k), y, cpmix); - lambda(i, j, k) = PrInv * cpmix * mu_cgs * 1.0e-5_rt; + lambda(i, j, k) = PrInv * c2m::Cp(cpmix) * c2m::Mu(mu_cgs); for (int n = 0; n < NUM_SPECIES; n++) { rhoDi(i, j, k, n) = rhoDi_cgs[n] * Wbar * mwtinv[n] * 1.0e-1_rt; } } else if (do_fixed_Le) { // fixed Le, still use thermal cond - lambda(i, j, k) = lambda_cgs * 1.0e-5_rt; + lambda(i, j, k) = c2m::Lambda(lambda_cgs); amrex::Real cpmix = 0.0_rt; eos.TY2Cp(T(i, j, k), y, cpmix); for (int n = 0; n < NUM_SPECIES; n++) { rhoDi(i, j, k, n) = lambda_cgs * 1.0e-1_rt * LeInv / cpmix; } } else { // full MA model, with Soret if needed - lambda(i, j, k) = lambda_cgs * 1.0e-5_rt; + lambda(i, j, k) = c2m::Lambda(lambda_cgs); for (int n = 0; n < NUM_SPECIES; n++) { rhoDi(i, j, k, n) = rhoDi_cgs[n] * Wbar * mwtinv[n] * 1.0e-1_rt; if (do_soret) { diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index e2653833..d050924d 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit e265383382bd57e4d69f7d647aff4b9e383667e5 +Subproject commit d050924dd995a151aeaa5ddfc8c633d104916009 From 78f4781078fa8dc37d64696a39e57fd6f9a5cd38 Mon Sep 17 00:00:00 2001 From: dmontgomeryNREL Date: Fri, 8 Nov 2024 13:40:01 -0700 Subject: [PATCH 4/4] Update PelePhysics submodule --- Submodules/PelePhysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index d050924d..327aadbe 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit d050924dd995a151aeaa5ddfc8c633d104916009 +Subproject commit 327aadbe6ae81a56ed1e864d34efa4e3c785754f