diff --git a/CMake/BuildPelePhysicsLib.cmake b/CMake/BuildPelePhysicsLib.cmake index 433c7009..1e1d07af 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 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/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 fe205d80..d7fffee5 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit fe205d80773d191231883effccb1c519631bee3e +Subproject commit d7fffee5c62f04850d1e8340ac34931930387381