From 20f630e2805d004d753ee727c6f74a839c2ebf90 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 6 Jun 2023 11:54:54 +0200 Subject: [PATCH 01/66] track branch from max --- .gitmodules | 2 +- extern/Microphysics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f61e8946a..117c3565b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,4 +10,4 @@ [submodule "extern/Microphysics"] path = extern/Microphysics url = https://github.com/psharda/Microphysics - branch = development + branch = track-max-has-xn diff --git a/extern/Microphysics b/extern/Microphysics index bf8034609..edf31fd4f 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit bf80346094d2424703ee008e5f03f5016fb98584 +Subproject commit edf31fd4ff186e6f89ba9cf5dab6a4545aaf20fe From bfe6e05896c065237077275f800106dc1ecb01a4 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 13 Jun 2023 23:53:21 +0200 Subject: [PATCH 02/66] enable two-EOS compilation --- src/CMakeLists.txt | 11 +++++++++-- src/PrimordialChem/CMakeLists.txt | 14 +++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb4e2f939..2993af248 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -80,7 +80,13 @@ include_directories(${fmt_INCLUDE_DIRS_RET}) include_directories(${HDF5_INCLUDE_DIRS_RET}) include_directories(${Boost_INCLUDE_DIRS_RET}) include_directories(${CMAKE_SOURCE_DIR}/src) -include_directories(${primordial_chem_dirs} ${CMAKE_BINARY_DIR} "includes/extern_parameters.H" "includes/network_properties.H") + +# default network_name (for Microphysics EOS) for all tests: +set(microphysics_network_name "gamma_law") +# default output_dir (for Microphysics EOS) for all tests: +set(microphysics_output_dir "${CMAKE_CURRENT_BINARY_DIR}/") +setup_target_for_microphysics_compilation(${microphysics_network_name} "${CMAKE_CURRENT_BINARY_DIR}/") +include_directories(${gamma_law_dirs} ${CMAKE_CURRENT_BINARY_DIR} "includes/extern_parameters.H" "includes/network_properties.H") link_libraries(AMReX::amrex) link_libraries(fmt::fmt) @@ -90,12 +96,13 @@ include(CTest) #create an object library for files that should be compiled with all test problems set (QuokkaObjSources "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/CloudyCooling.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GrackleDataReader.cpp") -add_library(QuokkaObj OBJECT ${QuokkaObjSources}) +add_library(QuokkaObj OBJECT ${QuokkaObjSources} ${gamma_law_sources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(QuokkaObj) endif() + link_libraries(QuokkaObj) add_subdirectory(HydroShocktubeCMA) diff --git a/src/PrimordialChem/CMakeLists.txt b/src/PrimordialChem/CMakeLists.txt index 9aea318e5..ae31fc9ca 100644 --- a/src/PrimordialChem/CMakeLists.txt +++ b/src/PrimordialChem/CMakeLists.txt @@ -1,6 +1,18 @@ -add_executable(test_primordial_chem test_primordial_chem.cpp ../Chemistry.cpp ${primordial_chem_sources}) +set(microphysics_network_name "primordial_chem") #this will override network_name to primordial_chem for this directory only +setup_target_for_microphysics_compilation(${microphysics_network_name} "${CMAKE_CURRENT_BINARY_DIR}/") + +include_directories(${primordial_chem_dirs} "${CMAKE_CURRENT_BINARY_DIR}/" "includes/extern_parameters.H" "includes/network_properties.H") + +add_executable(test_primordial_chem test_primordial_chem.cpp ../main.cpp ../GrackleDataReader.cpp ../CloudyCooling.cpp ../Chemistry.cpp ${primordial_chem_sources}) target_compile_definitions(test_primordial_chem PUBLIC PRIMORDIAL_CHEM) #this will add #define PRIMORDIAL_CHEM +#de-link QuokkaObj from this target to avoid multiple definitions of same variables +#this is also why we build main.cpp CloudyCooling.cpp GrackleDataReader.cpp again for this target +get_target_property(tlink_libs test_primordial_chem LINK_LIBRARIES) +list(REMOVE_ITEM tlink_libs QuokkaObj) +set_property(TARGET test_primordial_chem PROPERTY LINK_LIBRARIES ${tlink_libs}) + + if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_primordial_chem) endif(AMReX_GPU_BACKEND MATCHES "CUDA") From 2040e588b7429721d57bba85b4e2107a8f959ed3 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 13 Jun 2023 23:53:49 +0200 Subject: [PATCH 03/66] use ifdefs for primordial chem --- src/Chemistry.hpp | 5 +- src/EOS.hpp | 131 +++++++++++++++++++++++----------------------- 2 files changed, 69 insertions(+), 67 deletions(-) diff --git a/src/Chemistry.hpp b/src/Chemistry.hpp index a8bb4a6f4..acad14186 100644 --- a/src/Chemistry.hpp +++ b/src/Chemistry.hpp @@ -20,9 +20,11 @@ #include "hydro_system.hpp" #include "radiation_system.hpp" -#include "burn_type.H" +#ifdef PRIMORDIAL_CHEM +#include "actual_eos_data.H" #include "eos.H" #include "extern_parameters.H" +#include "burn_type.H" namespace quokka::chemistry { @@ -133,4 +135,5 @@ template void computeChemistry(amrex::MultiFab &mf, const R } } // namespace quokka::chemistry +#endif #endif // CHEMISTRY_HPP_ diff --git a/src/EOS.hpp b/src/EOS.hpp index 6ec1028fe..8716ad5cf 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -20,11 +20,10 @@ #include "extern_parameters.H" #ifdef PRIMORDIAL_CHEM -constexpr bool PRIMORDIAL_CHEM_ENABLED = true; -#else -constexpr bool PRIMORDIAL_CHEM_ENABLED = false; +#include "actual_eos_data.H" #endif + namespace quokka { static constexpr double boltzmann_constant_cgs = 1.380658e-16; // cgs @@ -66,30 +65,30 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin // return temperature for an ideal gas amrex::Real Tgas = NAN; - if constexpr (PRIMORDIAL_CHEM_ENABLED) { - burn_t chemstate; - chemstate.rho = rho; - chemstate.e = Eint / rho; - // initialize array of number densities - for (int ii = 0; ii < NumSpec; ++ii) { - chemstate.xn[ii] = -1.0; - } +#ifdef PRIMORDIAL_CHEM + burn_t chemstate; + chemstate.rho = rho; + chemstate.e = Eint / rho; + // initialize array of number densities + for (int ii = 0; ii < NumSpec; ++ii) { + chemstate.xn[ii] = -1.0; + } - if (massScalars) { - const auto &massArray = *massScalars; - for (int nn = 0; nn < nmscalars_; ++nn) { - chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) - } + if (massScalars) { + const auto &massArray = *massScalars; + for (int nn = 0; nn < nmscalars_; ++nn) { + chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) } + } - eos(eos_input_re, chemstate); - Tgas = chemstate.T; - } else { - if constexpr (gamma_ != 1.0) { - const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - Tgas = Eint / (rho * c_v); - } + eos(eos_input_re, chemstate); + Tgas = chemstate.T; +#else + if constexpr (gamma_ != 1.0) { + const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + Tgas = Eint / (rho * c_v); } +#endif return Tgas; } @@ -101,32 +100,32 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromTga // return internal energy density for a gamma-law ideal gas amrex::Real Eint = NAN; - if constexpr (PRIMORDIAL_CHEM_ENABLED) { - burn_t chemstate; - chemstate.rho = rho; - // Define and initialize Tgas here - amrex::Real const Tgas_value = Tgas; - chemstate.T = Tgas_value; - // initialize array of number densities - for (int ii = 0; ii < NumSpec; ++ii) { - chemstate.xn[ii] = -1.0; - } +#ifdef PRIMORDIAL_CHEM + burn_t chemstate; + chemstate.rho = rho; + // Define and initialize Tgas here + amrex::Real const Tgas_value = Tgas; + chemstate.T = Tgas_value; + // initialize array of number densities + for (int ii = 0; ii < NumSpec; ++ii) { + chemstate.xn[ii] = -1.0; + } - if (massScalars) { - const auto &massArray = *massScalars; - for (int nn = 0; nn < nmscalars_; ++nn) { - chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) - } + if (massScalars) { + const auto &massArray = *massScalars; + for (int nn = 0; nn < nmscalars_; ++nn) { + chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) } + } - eos(eos_input_rt, chemstate); - Eint = chemstate.e * chemstate.rho; - } else { - if constexpr (gamma_ != 1.0) { - const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - Eint = rho * c_v * Tgas; - } + eos(eos_input_rt, chemstate); + Eint = chemstate.e * chemstate.rho; +#else + if constexpr (gamma_ != 1.0) { + const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + Eint = rho * c_v * Tgas; } +#endif return Eint; } @@ -138,31 +137,31 @@ EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Re // compute derivative of internal energy w/r/t temperature amrex::Real dEint_dT = NAN; - if constexpr (PRIMORDIAL_CHEM_ENABLED) { - burn_t chemstate; - chemstate.rho = rho; - // we don't need Tgas to find chemstate.dedT, but we still need to initialize chemstate.T because we are using the 'rt' EOS mode - chemstate.T = NAN; - // initialize array of number densities - for (int ii = 0; ii < NumSpec; ++ii) { - chemstate.xn[ii] = -1.0; - } +#ifdef PRIMORDIAL_CHEM + burn_t chemstate; + chemstate.rho = rho; + // we don't need Tgas to find chemstate.dedT, but we still need to initialize chemstate.T because we are using the 'rt' EOS mode + chemstate.T = NAN; + // initialize array of number densities + for (int ii = 0; ii < NumSpec; ++ii) { + chemstate.xn[ii] = -1.0; + } - if (massScalars) { - const auto &massArray = *massScalars; - for (int nn = 0; nn < nmscalars_; ++nn) { - chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) - } + if (massScalars) { + const auto &massArray = *massScalars; + for (int nn = 0; nn < nmscalars_; ++nn) { + chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) } + } - eos(eos_input_rt, chemstate); - dEint_dT = chemstate.dedT * chemstate.rho; - } else { - if constexpr (gamma_ != 1.0) { - const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - dEint_dT = rho * c_v; - } + eos(eos_input_rt, chemstate); + dEint_dT = chemstate.dedT * chemstate.rho; +#else + if constexpr (gamma_ != 1.0) { + const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + dEint_dT = rho * c_v; } +#endif return dEint_dT; } From 9c3c5c2e58a0efd4e7d7e271246b0bc5e92aac11 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 13 Jun 2023 23:54:43 +0200 Subject: [PATCH 04/66] include actual eos data header --- src/PrimordialChem/test_primordial_chem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PrimordialChem/test_primordial_chem.cpp b/src/PrimordialChem/test_primordial_chem.cpp index 26b44f64b..b4306c61c 100644 --- a/src/PrimordialChem/test_primordial_chem.cpp +++ b/src/PrimordialChem/test_primordial_chem.cpp @@ -33,6 +33,7 @@ #include "eos.H" #include "extern_parameters.H" #include "network.H" +#include "actual_eos_data.H" using amrex::Real; From ba1dadbe8c5ae623efb32fed52fd6ca410419212 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:58:23 +0000 Subject: [PATCH 05/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/Chemistry.hpp | 2 +- src/EOS.hpp | 1 - src/PrimordialChem/test_primordial_chem.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Chemistry.hpp b/src/Chemistry.hpp index acad14186..1a30a0c99 100644 --- a/src/Chemistry.hpp +++ b/src/Chemistry.hpp @@ -22,9 +22,9 @@ #ifdef PRIMORDIAL_CHEM #include "actual_eos_data.H" +#include "burn_type.H" #include "eos.H" #include "extern_parameters.H" -#include "burn_type.H" namespace quokka::chemistry { diff --git a/src/EOS.hpp b/src/EOS.hpp index 8716ad5cf..d324af982 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -23,7 +23,6 @@ #include "actual_eos_data.H" #endif - namespace quokka { static constexpr double boltzmann_constant_cgs = 1.380658e-16; // cgs diff --git a/src/PrimordialChem/test_primordial_chem.cpp b/src/PrimordialChem/test_primordial_chem.cpp index b4306c61c..8d2d4b946 100644 --- a/src/PrimordialChem/test_primordial_chem.cpp +++ b/src/PrimordialChem/test_primordial_chem.cpp @@ -29,11 +29,11 @@ #include "radiation_system.hpp" #include "test_primordial_chem.hpp" +#include "actual_eos_data.H" #include "burn_type.H" #include "eos.H" #include "extern_parameters.H" #include "network.H" -#include "actual_eos_data.H" using amrex::Real; From de5ef247561331cfe2ecb4add0265a5ad8647d70 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 14 Jun 2023 00:07:42 +0200 Subject: [PATCH 06/66] updated microp --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index edf31fd4f..3b44dee2c 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit edf31fd4ff186e6f89ba9cf5dab6a4545aaf20fe +Subproject commit 3b44dee2c2d86ea87c2be96642f4443c7b203e01 From 4b8ba3cbc454f5ad95992731d3e8bee0fda5d709 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 14 Jun 2023 00:12:02 +0200 Subject: [PATCH 07/66] updated microp --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index 3b44dee2c..9fe32bc42 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 3b44dee2c2d86ea87c2be96642f4443c7b203e01 +Subproject commit 9fe32bc420243652acb9c7c4a4c0ae782d22b896 From ca15bbea0f76db712e1b592ca77e0aabc5e3a1c4 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 14 Jun 2023 15:56:52 +0200 Subject: [PATCH 08/66] update microp --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index 9fe32bc42..6645e7257 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 9fe32bc420243652acb9c7c4a4c0ae782d22b896 +Subproject commit 6645e725708ffc5b5eda9b924dbd1d7892f3877e From d8f9120d33c91dcd06acf2b2cb67dc485b75d60e Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 14 Jun 2023 17:01:59 +0200 Subject: [PATCH 09/66] updated microphysics --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index 6645e7257..c9cddd120 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 6645e725708ffc5b5eda9b924dbd1d7892f3877e +Subproject commit c9cddd120cf0d5b3d0174aae2c2efd7b220cd3e4 From 6b1786c6bd0d2a884512c55b7ef24aeace136dfc Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 14 Jun 2023 17:02:19 +0200 Subject: [PATCH 10/66] use BEFORE keyword to set right priority of include dirs --- src/PrimordialChem/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PrimordialChem/CMakeLists.txt b/src/PrimordialChem/CMakeLists.txt index ae31fc9ca..75f47d09a 100644 --- a/src/PrimordialChem/CMakeLists.txt +++ b/src/PrimordialChem/CMakeLists.txt @@ -1,7 +1,9 @@ set(microphysics_network_name "primordial_chem") #this will override network_name to primordial_chem for this directory only setup_target_for_microphysics_compilation(${microphysics_network_name} "${CMAKE_CURRENT_BINARY_DIR}/") -include_directories(${primordial_chem_dirs} "${CMAKE_CURRENT_BINARY_DIR}/" "includes/extern_parameters.H" "includes/network_properties.H") +#use the BEFORE keyword so that these files get priority in compilation for targets in this directory +#this is critical to ensure the correct Microphysics files are linked to primordial chem target +include_directories(BEFORE ${primordial_chem_dirs} "${CMAKE_CURRENT_BINARY_DIR}/" "includes/extern_parameters.H" "includes/network_properties.H") add_executable(test_primordial_chem test_primordial_chem.cpp ../main.cpp ../GrackleDataReader.cpp ../CloudyCooling.cpp ../Chemistry.cpp ${primordial_chem_sources}) target_compile_definitions(test_primordial_chem PUBLIC PRIMORDIAL_CHEM) #this will add #define PRIMORDIAL_CHEM From ad854abbe928b4780bf4e76d4507b0471067e119 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 14 Jun 2023 17:51:22 +0200 Subject: [PATCH 11/66] updated microp: remove gammalaw eos params from primordial chem eos --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index c9cddd120..18387e090 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit c9cddd120cf0d5b3d0174aae2c2efd7b220cd3e4 +Subproject commit 18387e09007f161738e42d15ad669ee062bb97c0 From c988c1995f608cd8fdbe80159b24fe4604b98541 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 16:24:24 +0200 Subject: [PATCH 12/66] updated microp --- .gitmodules | 2 +- extern/Microphysics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 117c3565b..f61e8946a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,4 +10,4 @@ [submodule "extern/Microphysics"] path = extern/Microphysics url = https://github.com/psharda/Microphysics - branch = track-max-has-xn + branch = development diff --git a/extern/Microphysics b/extern/Microphysics index 18387e090..6a5ff9f00 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 18387e09007f161738e42d15ad669ee062bb97c0 +Subproject commit 6a5ff9f00bc2a75a6bc70e325f19ce4ce4d8c625 From da60ddcdaaa14634399048983cb978ec85b46c61 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 20:22:23 +0200 Subject: [PATCH 13/66] include QuokkaObjSources --- src/Advection/CMakeLists.txt | 2 +- src/Advection2D/CMakeLists.txt | 2 +- src/AdvectionSemiellipse/CMakeLists.txt | 2 +- src/SphericalCollapse/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Advection/CMakeLists.txt b/src/Advection/CMakeLists.txt index c9fc1854f..6e6552314 100644 --- a/src/Advection/CMakeLists.txt +++ b/src/Advection/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_advection test_advection.cpp ../fextract.cpp) +add_executable(test_advection test_advection.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_advection) diff --git a/src/Advection2D/CMakeLists.txt b/src/Advection2D/CMakeLists.txt index 25dd5d9f6..1e5e1f35c 100644 --- a/src/Advection2D/CMakeLists.txt +++ b/src/Advection2D/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_advection2d test_advection2d.cpp) + add_executable(test_advection2d test_advection2d.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_advection2d) endif() diff --git a/src/AdvectionSemiellipse/CMakeLists.txt b/src/AdvectionSemiellipse/CMakeLists.txt index 01c40fdb2..b47351d5e 100644 --- a/src/AdvectionSemiellipse/CMakeLists.txt +++ b/src/AdvectionSemiellipse/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_advection_se test_advection_semiellipse.cpp ../fextract.cpp) +add_executable(test_advection_se test_advection_semiellipse.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_advection_se) diff --git a/src/SphericalCollapse/CMakeLists.txt b/src/SphericalCollapse/CMakeLists.txt index 721b1b677..660ce1e5b 100644 --- a/src/SphericalCollapse/CMakeLists.txt +++ b/src/SphericalCollapse/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM EQUAL 3) - add_executable(spherical_collapse spherical_collapse.cpp) + add_executable(spherical_collapse spherical_collapse.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(spherical_collapse) endif() From 9b5169bfd06798f601c021b6ceffb1a361536c9b Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 20:22:55 +0200 Subject: [PATCH 14/66] updated microp --- .gitmodules | 2 +- extern/Microphysics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f61e8946a..272df3f35 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,4 +10,4 @@ [submodule "extern/Microphysics"] path = extern/Microphysics url = https://github.com/psharda/Microphysics - branch = development + branch = del-eos-comp diff --git a/extern/Microphysics b/extern/Microphysics index 6a5ff9f00..86de91841 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 6a5ff9f00bc2a75a6bc70e325f19ce4ce4d8c625 +Subproject commit 86de91841595c2e11663a53f94512bd9a98f6995 From 8c50e09bfb87b07196751e1b4e21476689da18ab Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 20:23:29 +0200 Subject: [PATCH 15/66] remove de-linking quokkaobj lib --- src/PrimordialChem/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PrimordialChem/CMakeLists.txt b/src/PrimordialChem/CMakeLists.txt index 75f47d09a..9bb2b1d70 100644 --- a/src/PrimordialChem/CMakeLists.txt +++ b/src/PrimordialChem/CMakeLists.txt @@ -10,9 +10,9 @@ target_compile_definitions(test_primordial_chem PUBLIC PRIMORDIAL_CHEM) #this wi #de-link QuokkaObj from this target to avoid multiple definitions of same variables #this is also why we build main.cpp CloudyCooling.cpp GrackleDataReader.cpp again for this target -get_target_property(tlink_libs test_primordial_chem LINK_LIBRARIES) -list(REMOVE_ITEM tlink_libs QuokkaObj) -set_property(TARGET test_primordial_chem PROPERTY LINK_LIBRARIES ${tlink_libs}) +#get_target_property(tlink_libs test_primordial_chem LINK_LIBRARIES) +#list(REMOVE_ITEM tlink_libs QuokkaObj) +#set_property(TARGET test_primordial_chem PROPERTY LINK_LIBRARIES ${tlink_libs}) if(AMReX_GPU_BACKEND MATCHES "CUDA") From 8b18029a8a68afd21da2123aa7a56314a2a58d28 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 20:49:02 +0200 Subject: [PATCH 16/66] only build some tests --- src/CMakeLists.txt | 90 +++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2993af248..f68784e76 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,16 +96,14 @@ include(CTest) #create an object library for files that should be compiled with all test problems set (QuokkaObjSources "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/CloudyCooling.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GrackleDataReader.cpp") -add_library(QuokkaObj OBJECT ${QuokkaObjSources} ${gamma_law_sources}) +#add_library(QuokkaObj OBJECT ${QuokkaObjSources} ${gamma_law_sources}) -if(AMReX_GPU_BACKEND MATCHES "CUDA") - setup_target_for_cuda_compilation(QuokkaObj) -endif() - - -link_libraries(QuokkaObj) +#if(AMReX_GPU_BACKEND MATCHES "CUDA") +# setup_target_for_cuda_compilation(QuokkaObj) +#endif() +#link_libraries(QuokkaObj) -add_subdirectory(HydroShocktubeCMA) +#add_subdirectory(HydroShocktubeCMA) add_subdirectory(PrimordialChem) add_subdirectory(Advection) @@ -113,43 +111,43 @@ add_subdirectory(Advection2D) add_subdirectory(AdvectionSemiellipse) -add_subdirectory(HydroBlast2D) -add_subdirectory(HydroBlast3D) -add_subdirectory(HydroContact) -add_subdirectory(HydroKelvinHelmholz) -add_subdirectory(HydroLeblanc) -add_subdirectory(HydroRichtmeyerMeshkov) -add_subdirectory(HydroShocktube) -add_subdirectory(HydroShuOsher) -add_subdirectory(HydroSMS) -add_subdirectory(HydroVacuum) -add_subdirectory(HydroWave) -add_subdirectory(HydroQuirk) -add_subdirectory(HydroHighMach) -add_subdirectory(RayleighTaylor2D) -add_subdirectory(RayleighTaylor3D) -add_subdirectory(RadBeam) -add_subdirectory(RadForce) -add_subdirectory(RadMarshak) -add_subdirectory(RadMarshakCGS) -add_subdirectory(RadMarshakAsymptotic) -add_subdirectory(RadMatterCoupling) -add_subdirectory(RadMatterCouplingRSLA) -add_subdirectory(RadPulse) -add_subdirectory(RadShadow) -add_subdirectory(RadStreaming) -add_subdirectory(RadSuOlson) -add_subdirectory(RadTophat) -add_subdirectory(RadTube) - -add_subdirectory(RadhydroShell) -add_subdirectory(RadhydroShock) -add_subdirectory(RadhydroShockCGS) - -add_subdirectory(ODEIntegration) -add_subdirectory(Cooling) -add_subdirectory(ShockCloud) -add_subdirectory(PassiveScalar) -add_subdirectory(FCQuantities) +#add_subdirectory(HydroBlast2D) +#add_subdirectory(HydroBlast3D) +#add_subdirectory(HydroContact) +#add_subdirectory(HydroKelvinHelmholz) +#add_subdirectory(HydroLeblanc) +#add_subdirectory(HydroRichtmeyerMeshkov) +#add_subdirectory(HydroShocktube) +#add_subdirectory(HydroShuOsher) +#add_subdirectory(HydroSMS) +#add_subdirectory(HydroVacuum) +#add_subdirectory(HydroWave) +#add_subdirectory(HydroQuirk) +#add_subdirectory(HydroHighMach) +#add_subdirectory(RayleighTaylor2D) +#add_subdirectory(RayleighTaylor3D) +#add_subdirectory(RadBeam) +#add_subdirectory(RadForce) +#add_subdirectory(RadMarshak) +#add_subdirectory(RadMarshakCGS) +#add_subdirectory(RadMarshakAsymptotic) +#add_subdirectory(RadMatterCoupling) +#add_subdirectory(RadMatterCouplingRSLA) +#add_subdirectory(RadPulse) +#add_subdirectory(RadShadow) +#add_subdirectory(RadStreaming) +#add_subdirectory(RadSuOlson) +#add_subdirectory(RadTophat) +#add_subdirectory(RadTube) + +#add_subdirectory(RadhydroShell) +#add_subdirectory(RadhydroShock) +#add_subdirectory(RadhydroShockCGS) + +#add_subdirectory(ODEIntegration) +#add_subdirectory(Cooling) +#add_subdirectory(ShockCloud) +#add_subdirectory(PassiveScalar) +#add_subdirectory(FCQuantities) add_subdirectory(SphericalCollapse) From 358e2cd2d36499c1d3263ee3bce6d8971c3c8818 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 21:01:35 +0200 Subject: [PATCH 17/66] reattached microp --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index 86de91841..5b4b3feee 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 86de91841595c2e11663a53f94512bd9a98f6995 +Subproject commit 5b4b3feee521f460d46401e80f34200846a1545f From 2135136fb6741400fa167f94ff74fd1a0f54e33c Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 21:12:21 +0200 Subject: [PATCH 18/66] add QuokkaObjSources --- src/Cooling/CMakeLists.txt | 2 +- src/FCQuantities/CMakeLists.txt | 2 +- src/HydroBlast2D/CMakeLists.txt | 2 +- src/HydroBlast3D/CMakeLists.txt | 2 +- src/HydroContact/CMakeLists.txt | 2 +- src/HydroHighMach/CMakeLists.txt | 2 +- src/HydroKelvinHelmholz/CMakeLists.txt | 2 +- src/HydroLeblanc/CMakeLists.txt | 2 +- src/HydroQuirk/CMakeLists.txt | 2 +- src/HydroRichtmeyerMeshkov/CMakeLists.txt | 2 +- src/HydroSMS/CMakeLists.txt | 2 +- src/HydroShocktube/CMakeLists.txt | 2 +- src/HydroShocktubeCMA/CMakeLists.txt | 2 +- src/HydroShuOsher/CMakeLists.txt | 2 +- src/HydroVacuum/CMakeLists.txt | 2 +- src/HydroWave/CMakeLists.txt | 2 +- src/ODEIntegration/CMakeLists.txt | 2 +- src/PassiveScalar/CMakeLists.txt | 2 +- src/RadBeam/CMakeLists.txt | 2 +- src/RadForce/CMakeLists.txt | 2 +- src/RadMarshak/CMakeLists.txt | 2 +- src/RadMarshakAsymptotic/CMakeLists.txt | 2 +- src/RadMarshakCGS/CMakeLists.txt | 2 +- src/RadMatterCoupling/CMakeLists.txt | 2 +- src/RadMatterCouplingRSLA/CMakeLists.txt | 2 +- src/RadPulse/CMakeLists.txt | 2 +- src/RadShadow/CMakeLists.txt | 2 +- src/RadStreaming/CMakeLists.txt | 2 +- src/RadSuOlson/CMakeLists.txt | 2 +- src/RadTophat/CMakeLists.txt | 2 +- src/RadTube/CMakeLists.txt | 2 +- src/RadhydroShell/CMakeLists.txt | 2 +- src/RadhydroShock/CMakeLists.txt | 2 +- src/RadhydroShockCGS/CMakeLists.txt | 2 +- src/RayleighTaylor2D/CMakeLists.txt | 2 +- src/RayleighTaylor3D/CMakeLists.txt | 2 +- src/ShockCloud/CMakeLists.txt | 4 ++-- 37 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Cooling/CMakeLists.txt b/src/Cooling/CMakeLists.txt index abfae84cd..e157a97e1 100644 --- a/src/Cooling/CMakeLists.txt +++ b/src/Cooling/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_cooling test_cooling.cpp) + add_executable(test_cooling test_cooling.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_cooling) diff --git a/src/FCQuantities/CMakeLists.txt b/src/FCQuantities/CMakeLists.txt index f9d6b1100..723c70cb4 100644 --- a/src/FCQuantities/CMakeLists.txt +++ b/src/FCQuantities/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_fc_quantities test_fc_quantities.cpp ../interpolate.cpp) +add_executable(test_fc_quantities test_fc_quantities.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_fc_quantities) diff --git a/src/HydroBlast2D/CMakeLists.txt b/src/HydroBlast2D/CMakeLists.txt index d2cff4957..dea0f03e2 100644 --- a/src/HydroBlast2D/CMakeLists.txt +++ b/src/HydroBlast2D/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_hydro2d_blast test_hydro2d_blast.cpp) + add_executable(test_hydro2d_blast test_hydro2d_blast.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro2d_blast) endif() diff --git a/src/HydroBlast3D/CMakeLists.txt b/src/HydroBlast3D/CMakeLists.txt index 68af75fa0..6f8b88173 100644 --- a/src/HydroBlast3D/CMakeLists.txt +++ b/src/HydroBlast3D/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM EQUAL 3) - add_executable(test_hydro3d_blast test_hydro3d_blast.cpp) + add_executable(test_hydro3d_blast test_hydro3d_blast.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro3d_blast) endif() diff --git a/src/HydroContact/CMakeLists.txt b/src/HydroContact/CMakeLists.txt index 995e61e3f..b4ab180a4 100644 --- a/src/HydroContact/CMakeLists.txt +++ b/src/HydroContact/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_contact test_hydro_contact.cpp ../fextract.cpp) +add_executable(test_hydro_contact test_hydro_contact.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_contact) diff --git a/src/HydroHighMach/CMakeLists.txt b/src/HydroHighMach/CMakeLists.txt index 3bff58a02..bd55f1dfc 100644 --- a/src/HydroHighMach/CMakeLists.txt +++ b/src/HydroHighMach/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_highmach test_hydro_highmach.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_hydro_highmach test_hydro_highmach.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_highmach) diff --git a/src/HydroKelvinHelmholz/CMakeLists.txt b/src/HydroKelvinHelmholz/CMakeLists.txt index 43dcefe15..c4b37afb4 100644 --- a/src/HydroKelvinHelmholz/CMakeLists.txt +++ b/src/HydroKelvinHelmholz/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_hydro2d_kh test_hydro2d_kh.cpp) + add_executable(test_hydro2d_kh test_hydro2d_kh.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro2d_kh) endif() diff --git a/src/HydroLeblanc/CMakeLists.txt b/src/HydroLeblanc/CMakeLists.txt index 2713b4a19..ceeb7eec6 100644 --- a/src/HydroLeblanc/CMakeLists.txt +++ b/src/HydroLeblanc/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_leblanc test_hydro_leblanc.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_hydro_leblanc test_hydro_leblanc.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_leblanc) diff --git a/src/HydroQuirk/CMakeLists.txt b/src/HydroQuirk/CMakeLists.txt index 03c36c951..ab63744d1 100644 --- a/src/HydroQuirk/CMakeLists.txt +++ b/src/HydroQuirk/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_quirk test_quirk.cpp) + add_executable(test_quirk test_quirk.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_quirk) endif() diff --git a/src/HydroRichtmeyerMeshkov/CMakeLists.txt b/src/HydroRichtmeyerMeshkov/CMakeLists.txt index 746117af5..db948c555 100644 --- a/src/HydroRichtmeyerMeshkov/CMakeLists.txt +++ b/src/HydroRichtmeyerMeshkov/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_hydro2d_rm test_hydro2d_rm.cpp) + add_executable(test_hydro2d_rm test_hydro2d_rm.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro2d_rm) endif() diff --git a/src/HydroSMS/CMakeLists.txt b/src/HydroSMS/CMakeLists.txt index 1921f4baa..727f45f29 100644 --- a/src/HydroSMS/CMakeLists.txt +++ b/src/HydroSMS/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_sms test_hydro_sms.cpp ../fextract.cpp) +add_executable(test_hydro_sms test_hydro_sms.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_sms) diff --git a/src/HydroShocktube/CMakeLists.txt b/src/HydroShocktube/CMakeLists.txt index af483450b..d2df0c931 100644 --- a/src/HydroShocktube/CMakeLists.txt +++ b/src/HydroShocktube/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_shocktube test_hydro_shocktube.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_hydro_shocktube test_hydro_shocktube.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_shocktube) diff --git a/src/HydroShocktubeCMA/CMakeLists.txt b/src/HydroShocktubeCMA/CMakeLists.txt index d94e640f8..8dc0fd18f 100644 --- a/src/HydroShocktubeCMA/CMakeLists.txt +++ b/src/HydroShocktubeCMA/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_shocktube_cma test_hydro_shocktube_cma.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_hydro_shocktube_cma test_hydro_shocktube_cma.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_shocktube_cma) diff --git a/src/HydroShuOsher/CMakeLists.txt b/src/HydroShuOsher/CMakeLists.txt index 8e27df7b6..f71e7ea69 100644 --- a/src/HydroShuOsher/CMakeLists.txt +++ b/src/HydroShuOsher/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_shuosher test_hydro_shuosher.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_hydro_shuosher test_hydro_shuosher.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_shuosher) diff --git a/src/HydroVacuum/CMakeLists.txt b/src/HydroVacuum/CMakeLists.txt index d2e0c6983..80cf953b4 100644 --- a/src/HydroVacuum/CMakeLists.txt +++ b/src/HydroVacuum/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_vacuum test_hydro_vacuum.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_hydro_vacuum test_hydro_vacuum.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_vacuum) diff --git a/src/HydroWave/CMakeLists.txt b/src/HydroWave/CMakeLists.txt index 6c9dcbc65..f82ddaf55 100644 --- a/src/HydroWave/CMakeLists.txt +++ b/src/HydroWave/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_hydro_wave test_hydro_wave.cpp ../fextract.cpp) +add_executable(test_hydro_wave test_hydro_wave.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro_wave) diff --git a/src/ODEIntegration/CMakeLists.txt b/src/ODEIntegration/CMakeLists.txt index e9b2864eb..f597ec1dc 100644 --- a/src/ODEIntegration/CMakeLists.txt +++ b/src/ODEIntegration/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_ode test_ode.cpp) +add_executable(test_ode test_ode.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_ode) diff --git a/src/PassiveScalar/CMakeLists.txt b/src/PassiveScalar/CMakeLists.txt index eb432aa0b..e7759df84 100644 --- a/src/PassiveScalar/CMakeLists.txt +++ b/src/PassiveScalar/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_scalars test_scalars.cpp ../fextract.cpp) +add_executable(test_scalars test_scalars.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_scalars) diff --git a/src/RadBeam/CMakeLists.txt b/src/RadBeam/CMakeLists.txt index b9742b7fd..5b9772e04 100644 --- a/src/RadBeam/CMakeLists.txt +++ b/src/RadBeam/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_radiation_beam test_radiation_beam.cpp) + add_executable(test_radiation_beam test_radiation_beam.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_beam) diff --git a/src/RadForce/CMakeLists.txt b/src/RadForce/CMakeLists.txt index 9d96ffa0d..751dc9389 100644 --- a/src/RadForce/CMakeLists.txt +++ b/src/RadForce/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radiation_force test_radiation_force.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_force test_radiation_force.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_force) diff --git a/src/RadMarshak/CMakeLists.txt b/src/RadMarshak/CMakeLists.txt index 0a6b70d91..7db8e9084 100644 --- a/src/RadMarshak/CMakeLists.txt +++ b/src/RadMarshak/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(test_radiation_marshak test_radiation_marshak.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_marshak test_radiation_marshak.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_marshak) diff --git a/src/RadMarshakAsymptotic/CMakeLists.txt b/src/RadMarshakAsymptotic/CMakeLists.txt index 8922224d3..153e6a9a6 100644 --- a/src/RadMarshakAsymptotic/CMakeLists.txt +++ b/src/RadMarshakAsymptotic/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radiation_marshak_asymptotic test_radiation_marshak_asymptotic.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_marshak_asymptotic test_radiation_marshak_asymptotic.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_marshak_asymptotic) diff --git a/src/RadMarshakCGS/CMakeLists.txt b/src/RadMarshakCGS/CMakeLists.txt index b3311963f..f42e782bd 100644 --- a/src/RadMarshakCGS/CMakeLists.txt +++ b/src/RadMarshakCGS/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(test_radiation_marshak_cgs test_radiation_marshak_cgs.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_marshak_cgs test_radiation_marshak_cgs.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_marshak_cgs) diff --git a/src/RadMatterCoupling/CMakeLists.txt b/src/RadMatterCoupling/CMakeLists.txt index 6e5ac44f3..1f36fb53c 100644 --- a/src/RadMatterCoupling/CMakeLists.txt +++ b/src/RadMatterCoupling/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(test_radiation_matter_coupling test_radiation_matter_coupling.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_matter_coupling test_radiation_matter_coupling.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_matter_coupling) diff --git a/src/RadMatterCouplingRSLA/CMakeLists.txt b/src/RadMatterCouplingRSLA/CMakeLists.txt index 882ff88d8..13dc7880c 100644 --- a/src/RadMatterCouplingRSLA/CMakeLists.txt +++ b/src/RadMatterCouplingRSLA/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radiation_matter_coupling_rsla test_radiation_matter_coupling_rsla.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_matter_coupling_rsla test_radiation_matter_coupling_rsla.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_matter_coupling_rsla) diff --git a/src/RadPulse/CMakeLists.txt b/src/RadPulse/CMakeLists.txt index f160d6b77..00a127eb5 100644 --- a/src/RadPulse/CMakeLists.txt +++ b/src/RadPulse/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radiation_pulse test_radiation_pulse.cpp ../fextract.cpp) +add_executable(test_radiation_pulse test_radiation_pulse.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_pulse) diff --git a/src/RadShadow/CMakeLists.txt b/src/RadShadow/CMakeLists.txt index b03f8032c..c44f189b0 100644 --- a/src/RadShadow/CMakeLists.txt +++ b/src/RadShadow/CMakeLists.txt @@ -1,6 +1,6 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_radiation_shadow test_radiation_shadow.cpp) + add_executable(test_radiation_shadow test_radiation_shadow.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_shadow) diff --git a/src/RadStreaming/CMakeLists.txt b/src/RadStreaming/CMakeLists.txt index 21674f092..18460b38e 100644 --- a/src/RadStreaming/CMakeLists.txt +++ b/src/RadStreaming/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radiation_streaming test_radiation_streaming.cpp ../fextract.cpp) +add_executable(test_radiation_streaming test_radiation_streaming.cpp ../fextract.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_streaming) diff --git a/src/RadSuOlson/CMakeLists.txt b/src/RadSuOlson/CMakeLists.txt index 59102efad..539d0f803 100644 --- a/src/RadSuOlson/CMakeLists.txt +++ b/src/RadSuOlson/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(test_radiation_SuOlson test_radiation_SuOlson.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_SuOlson test_radiation_SuOlson.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_SuOlson) diff --git a/src/RadTophat/CMakeLists.txt b/src/RadTophat/CMakeLists.txt index 10afb5b41..88ee6e5e6 100644 --- a/src/RadTophat/CMakeLists.txt +++ b/src/RadTophat/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_radiation_tophat test_radiation_tophat.cpp) + add_executable(test_radiation_tophat test_radiation_tophat.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_tophat) endif() diff --git a/src/RadTube/CMakeLists.txt b/src/RadTube/CMakeLists.txt index 5d6a3c0a6..67360d7d2 100644 --- a/src/RadTube/CMakeLists.txt +++ b/src/RadTube/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radiation_tube test_radiation_tube.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radiation_tube test_radiation_tube.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radiation_tube) diff --git a/src/RadhydroShell/CMakeLists.txt b/src/RadhydroShell/CMakeLists.txt index c68f3f613..48cdc13fd 100644 --- a/src/RadhydroShell/CMakeLists.txt +++ b/src/RadhydroShell/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM EQUAL 3) - add_executable(test_radhydro3d_shell test_radhydro_shell.cpp ../interpolate.cpp) + add_executable(test_radhydro3d_shell test_radhydro_shell.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radhydro3d_shell) diff --git a/src/RadhydroShock/CMakeLists.txt b/src/RadhydroShock/CMakeLists.txt index 468a2dc60..5862d34a7 100644 --- a/src/RadhydroShock/CMakeLists.txt +++ b/src/RadhydroShock/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radhydro_shock test_radhydro_shock.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radhydro_shock test_radhydro_shock.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radhydro_shock) diff --git a/src/RadhydroShockCGS/CMakeLists.txt b/src/RadhydroShockCGS/CMakeLists.txt index c714914cd..40ac5ae71 100644 --- a/src/RadhydroShockCGS/CMakeLists.txt +++ b/src/RadhydroShockCGS/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable(test_radhydro_shock_cgs test_radhydro_shock_cgs.cpp ../fextract.cpp ../interpolate.cpp) +add_executable(test_radhydro_shock_cgs test_radhydro_shock_cgs.cpp ../fextract.cpp ../interpolate.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_radhydro_shock_cgs) diff --git a/src/RayleighTaylor2D/CMakeLists.txt b/src/RayleighTaylor2D/CMakeLists.txt index 2a7d1fe13..bbc3c3079 100644 --- a/src/RayleighTaylor2D/CMakeLists.txt +++ b/src/RayleighTaylor2D/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM GREATER_EQUAL 2) - add_executable(test_hydro2d_rt test_hydro2d_rt.cpp) + add_executable(test_hydro2d_rt test_hydro2d_rt.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro2d_rt) endif() diff --git a/src/RayleighTaylor3D/CMakeLists.txt b/src/RayleighTaylor3D/CMakeLists.txt index b27a403a4..ff546ea5e 100644 --- a/src/RayleighTaylor3D/CMakeLists.txt +++ b/src/RayleighTaylor3D/CMakeLists.txt @@ -1,5 +1,5 @@ if (AMReX_SPACEDIM EQUAL 3) - add_executable(test_hydro3d_rt test_hydro3d_rt.cpp) + add_executable(test_hydro3d_rt test_hydro3d_rt.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(test_hydro3d_rt) endif() diff --git a/src/ShockCloud/CMakeLists.txt b/src/ShockCloud/CMakeLists.txt index 105b623a4..c89f5f9f6 100644 --- a/src/ShockCloud/CMakeLists.txt +++ b/src/ShockCloud/CMakeLists.txt @@ -1,6 +1,6 @@ if (AMReX_SPACEDIM GREATER_EQUAL 3) - add_executable(shock_cloud cloud.cpp) - add_executable(test_cloudy test_cloudy.cpp) + add_executable(shock_cloud cloud.cpp ${QuokkaObjSources}) + add_executable(test_cloudy test_cloudy.cpp ${QuokkaObjSources}) if(AMReX_GPU_BACKEND MATCHES "CUDA") setup_target_for_cuda_compilation(shock_cloud) From 95e17447a06f543033fac191ae4b2ed2c4878436 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 21 Jun 2023 21:14:22 +0200 Subject: [PATCH 19/66] build all tests --- src/CMakeLists.txt | 80 +++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f68784e76..a6b1db367 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,14 +96,14 @@ include(CTest) #create an object library for files that should be compiled with all test problems set (QuokkaObjSources "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/CloudyCooling.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GrackleDataReader.cpp") +#we don't use it anymore because it gives issues on Cray systems #add_library(QuokkaObj OBJECT ${QuokkaObjSources} ${gamma_law_sources}) - #if(AMReX_GPU_BACKEND MATCHES "CUDA") # setup_target_for_cuda_compilation(QuokkaObj) #endif() #link_libraries(QuokkaObj) -#add_subdirectory(HydroShocktubeCMA) +add_subdirectory(HydroShocktubeCMA) add_subdirectory(PrimordialChem) add_subdirectory(Advection) @@ -111,43 +111,43 @@ add_subdirectory(Advection2D) add_subdirectory(AdvectionSemiellipse) -#add_subdirectory(HydroBlast2D) -#add_subdirectory(HydroBlast3D) -#add_subdirectory(HydroContact) -#add_subdirectory(HydroKelvinHelmholz) -#add_subdirectory(HydroLeblanc) -#add_subdirectory(HydroRichtmeyerMeshkov) -#add_subdirectory(HydroShocktube) -#add_subdirectory(HydroShuOsher) -#add_subdirectory(HydroSMS) -#add_subdirectory(HydroVacuum) -#add_subdirectory(HydroWave) -#add_subdirectory(HydroQuirk) -#add_subdirectory(HydroHighMach) -#add_subdirectory(RayleighTaylor2D) -#add_subdirectory(RayleighTaylor3D) -#add_subdirectory(RadBeam) -#add_subdirectory(RadForce) -#add_subdirectory(RadMarshak) -#add_subdirectory(RadMarshakCGS) -#add_subdirectory(RadMarshakAsymptotic) -#add_subdirectory(RadMatterCoupling) -#add_subdirectory(RadMatterCouplingRSLA) -#add_subdirectory(RadPulse) -#add_subdirectory(RadShadow) -#add_subdirectory(RadStreaming) -#add_subdirectory(RadSuOlson) -#add_subdirectory(RadTophat) -#add_subdirectory(RadTube) - -#add_subdirectory(RadhydroShell) -#add_subdirectory(RadhydroShock) -#add_subdirectory(RadhydroShockCGS) - -#add_subdirectory(ODEIntegration) -#add_subdirectory(Cooling) -#add_subdirectory(ShockCloud) -#add_subdirectory(PassiveScalar) -#add_subdirectory(FCQuantities) +add_subdirectory(HydroBlast2D) +add_subdirectory(HydroBlast3D) +add_subdirectory(HydroContact) +add_subdirectory(HydroKelvinHelmholz) +add_subdirectory(HydroLeblanc) +add_subdirectory(HydroRichtmeyerMeshkov) +add_subdirectory(HydroShocktube) +add_subdirectory(HydroShuOsher) +add_subdirectory(HydroSMS) +add_subdirectory(HydroVacuum) +add_subdirectory(HydroWave) +add_subdirectory(HydroQuirk) +add_subdirectory(HydroHighMach) +add_subdirectory(RayleighTaylor2D) +add_subdirectory(RayleighTaylor3D) +add_subdirectory(RadBeam) +add_subdirectory(RadForce) +add_subdirectory(RadMarshak) +add_subdirectory(RadMarshakCGS) +add_subdirectory(RadMarshakAsymptotic) +add_subdirectory(RadMatterCoupling) +add_subdirectory(RadMatterCouplingRSLA) +add_subdirectory(RadPulse) +add_subdirectory(RadShadow) +add_subdirectory(RadStreaming) +add_subdirectory(RadSuOlson) +add_subdirectory(RadTophat) +add_subdirectory(RadTube) + +add_subdirectory(RadhydroShell) +add_subdirectory(RadhydroShock) +add_subdirectory(RadhydroShockCGS) + +add_subdirectory(ODEIntegration) +add_subdirectory(Cooling) +add_subdirectory(ShockCloud) +add_subdirectory(PassiveScalar) +add_subdirectory(FCQuantities) add_subdirectory(SphericalCollapse) From 03f4f6fbbbec331848fae89c50f80b00fe19f1c2 Mon Sep 17 00:00:00 2001 From: psharda Date: Thu, 22 Jun 2023 17:09:42 +0200 Subject: [PATCH 20/66] use microp EOS for all tests --- src/EOS.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index d324af982..14ab5460b 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -84,8 +84,14 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin Tgas = chemstate.T; #else if constexpr (gamma_ != 1.0) { - const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - Tgas = Eint / (rho * c_v); + // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + // Tgas = Eint / (rho * c_v); + burn_t chemstate; + chemstate.rho = rho; + chemstate.e = Eint/rho; + chemstate.mu = mean_molecular_weight_; + eos(eos_input_re, chemstate); + Tgas = chemstate.T; } #endif return Tgas; From 811a0779ffe4607794cf6f2199bae868d2e8c879 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:15:15 +0000 Subject: [PATCH 21/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/EOS.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 14ab5460b..c4fe86500 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -88,7 +88,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin // Tgas = Eint / (rho * c_v); burn_t chemstate; chemstate.rho = rho; - chemstate.e = Eint/rho; + chemstate.e = Eint / rho; chemstate.mu = mean_molecular_weight_; eos(eos_input_re, chemstate); Tgas = chemstate.T; From b03c827223ce6b414af9e0bc1610f829637d19ec Mon Sep 17 00:00:00 2001 From: psharda Date: Thu, 22 Jun 2023 18:12:16 +0200 Subject: [PATCH 22/66] add gamma_law_sources to all tests --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6b1db367..18ef20512 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -95,7 +95,9 @@ link_libraries(hdf5::hdf5) include(CTest) #create an object library for files that should be compiled with all test problems -set (QuokkaObjSources "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/CloudyCooling.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GrackleDataReader.cpp") +set (QuokkaObjSources "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/CloudyCooling.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/GrackleDataReader.cpp" + "${gamma_law_sources}") #we don't use it anymore because it gives issues on Cray systems #add_library(QuokkaObj OBJECT ${QuokkaObjSources} ${gamma_law_sources}) #if(AMReX_GPU_BACKEND MATCHES "CUDA") From 7a5d80bd3d81192d5a77d0a0c9144d689ad71f61 Mon Sep 17 00:00:00 2001 From: psharda Date: Thu, 22 Jun 2023 21:17:28 +0200 Subject: [PATCH 23/66] initializes Microphysics EOS --- src/RadhydroSimulation.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/RadhydroSimulation.hpp b/src/RadhydroSimulation.hpp index e24f34caf..2eba846a7 100644 --- a/src/RadhydroSimulation.hpp +++ b/src/RadhydroSimulation.hpp @@ -52,6 +52,8 @@ #include "radiation_system.hpp" #include "simulation.hpp" +#include "eos.H" + // Simulation class should be initialized only once per program (i.e., is a singleton) template class RadhydroSimulation : public AMRSimulation { @@ -127,6 +129,10 @@ template class RadhydroSimulation : public AMRSimulation &BCs_cc) : AMRSimulation(BCs_cc) @@ -134,6 +140,10 @@ template class RadhydroSimulation : public AMRSimulation std::vector; From 7ce992887740ebaa4a85cb7b34da1105d7a8366c Mon Sep 17 00:00:00 2001 From: psharda Date: Thu, 22 Jun 2023 21:26:54 +0200 Subject: [PATCH 24/66] initialize extern_params --- src/RadhydroSimulation.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RadhydroSimulation.hpp b/src/RadhydroSimulation.hpp index 2eba846a7..0ded9fc67 100644 --- a/src/RadhydroSimulation.hpp +++ b/src/RadhydroSimulation.hpp @@ -129,10 +129,12 @@ template class RadhydroSimulation : public AMRSimulation &BCs_cc) : AMRSimulation(BCs_cc) @@ -140,10 +142,12 @@ template class RadhydroSimulation : public AMRSimulation std::vector; From 71233f4c762d01b7adf41c1674eb5800fd5b4adf Mon Sep 17 00:00:00 2001 From: psharda Date: Thu, 22 Jun 2023 22:35:28 +0200 Subject: [PATCH 25/66] use the new chem_eos_t struct --- src/EOS.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index c4fe86500..927996331 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -12,6 +12,7 @@ #include "AMReX_Array.H" #include "AMReX_GpuQualifiers.H" +#include #include "AMReX_REAL.H" #include "physics_info.hpp" @@ -86,11 +87,13 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin if constexpr (gamma_ != 1.0) { // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); // Tgas = Eint / (rho * c_v); - burn_t chemstate; + chem_eos_t chemstate; chemstate.rho = rho; chemstate.e = Eint / rho; chemstate.mu = mean_molecular_weight_; + //amrex::Print() << "Tgas before " << chemstate.rho << " " << chemstate.e << " "<< chemstate.mu << " " << std::endl; eos(eos_input_re, chemstate); + //amrex::Print() << "Tgas after "<< chemstate << std::endl; Tgas = chemstate.T; } #endif From b4439e288db103b2ff4b887d060c43a1f213f2b6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 20:35:43 +0000 Subject: [PATCH 26/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/EOS.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 927996331..60003ce9f 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -12,9 +12,9 @@ #include "AMReX_Array.H" #include "AMReX_GpuQualifiers.H" -#include #include "AMReX_REAL.H" #include "physics_info.hpp" +#include #include "burn_type.H" #include "eos.H" @@ -91,9 +91,9 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin chemstate.rho = rho; chemstate.e = Eint / rho; chemstate.mu = mean_molecular_weight_; - //amrex::Print() << "Tgas before " << chemstate.rho << " " << chemstate.e << " "<< chemstate.mu << " " << std::endl; + // amrex::Print() << "Tgas before " << chemstate.rho << " " << chemstate.e << " "<< chemstate.mu << " " << std::endl; eos(eos_input_re, chemstate); - //amrex::Print() << "Tgas after "<< chemstate << std::endl; + // amrex::Print() << "Tgas after "<< chemstate << std::endl; Tgas = chemstate.T; } #endif From 44e630014104921717c0ecf60b4cc362f2769139 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 13:56:38 +0200 Subject: [PATCH 27/66] updated microp --- .gitmodules | 2 +- extern/Microphysics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 272df3f35..f61e8946a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,4 +10,4 @@ [submodule "extern/Microphysics"] path = extern/Microphysics url = https://github.com/psharda/Microphysics - branch = del-eos-comp + branch = development diff --git a/extern/Microphysics b/extern/Microphysics index 5b4b3feee..3fe76693f 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 5b4b3feee521f460d46401e80f34200846a1545f +Subproject commit 3fe76693fe41634b2f335b9662a563b09872af57 From 7a872aab79520f66e03698d4a5db185c3559afde Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 14:00:45 +0200 Subject: [PATCH 28/66] updated microp --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index 3fe76693f..716dc7f9e 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 3fe76693fe41634b2f335b9662a563b09872af57 +Subproject commit 716dc7f9e1bbd56aedc456275fd397aced53d136 From 6402f4e15d88d12584aa78184be36ea73e235a74 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 16:05:20 +0200 Subject: [PATCH 29/66] added hydrogen_mass_code_units as an EOS_Trait --- src/EOS.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 60003ce9f..35ee0b90c 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -36,6 +36,7 @@ template struct EOS_Traits { static constexpr double cs_isothermal = NAN; // only used when gamma = 1 static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = hydrogen_mass_cgs; }; template class EOS @@ -90,7 +91,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin chem_eos_t chemstate; chemstate.rho = rho; chemstate.e = Eint / rho; - chemstate.mu = mean_molecular_weight_; + chemstate.mu = mean_molecular_weight_ / hydrogen_mass_code_units; // amrex::Print() << "Tgas before " << chemstate.rho << " " << chemstate.e << " "<< chemstate.mu << " " << std::endl; eos(eos_input_re, chemstate); // amrex::Print() << "Tgas after "<< chemstate << std::endl; From 7480a3c0665d43a48cac165032e4835a68d86a68 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 16:05:35 +0200 Subject: [PATCH 30/66] removed EOS_traits --- src/PrimordialChem/test_primordial_chem.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/PrimordialChem/test_primordial_chem.cpp b/src/PrimordialChem/test_primordial_chem.cpp index 8d2d4b946..f5f4b5e17 100644 --- a/src/PrimordialChem/test_primordial_chem.cpp +++ b/src/PrimordialChem/test_primordial_chem.cpp @@ -40,12 +40,6 @@ using amrex::Real; struct PrimordialChemTest { }; // dummy type to allow compile-type polymorphism via template specialization -// Currently, microphysics uses its own EOS, and this one below is used by hydro. Need to only have one EOS at some point. -template <> struct quokka::EOS_Traits { - static constexpr double gamma = 5. / 3.; // default value - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; -}; template <> struct Physics_Traits { // cell-centred From 4a6b40a709b9862243804966b2421695ca8add80 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 16:06:56 +0200 Subject: [PATCH 31/66] defined hydrogen_mass_code_units in EOS traits --- src/Cooling/test_cooling.cpp | 1 + src/FCQuantities/test_fc_quantities.cpp | 1 + src/HydroBlast2D/test_hydro2d_blast.cpp | 1 + src/HydroBlast3D/test_hydro3d_blast.cpp | 1 + src/HydroContact/test_hydro_contact.cpp | 1 + src/HydroHighMach/test_hydro_highmach.cpp | 1 + src/HydroKelvinHelmholz/test_hydro2d_kh.cpp | 1 + src/HydroLeblanc/test_hydro_leblanc.cpp | 1 + src/HydroQuirk/test_quirk.cpp | 1 + src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp | 1 + src/HydroSMS/test_hydro_sms.cpp | 1 + src/HydroShocktube/test_hydro_shocktube.cpp | 1 + src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp | 1 + src/HydroShuOsher/test_hydro_shuosher.cpp | 1 + src/HydroVacuum/test_hydro_vacuum.cpp | 1 + src/HydroWave/test_hydro_wave.cpp | 1 + src/ODEIntegration/test_ode.cpp | 1 + src/PassiveScalar/test_scalars.cpp | 1 + src/RadBeam/test_radiation_beam.cpp | 1 + src/RadForce/test_radiation_force.cpp | 1 + src/RadMarshak/test_radiation_marshak.cpp | 1 + src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp | 1 + src/RadMarshakCGS/test_radiation_marshak_cgs.cpp | 1 + src/RadMatterCoupling/test_radiation_matter_coupling.cpp | 1 + .../test_radiation_matter_coupling_rsla.cpp | 1 + src/RadPulse/test_radiation_pulse.cpp | 1 + src/RadShadow/test_radiation_shadow.cpp | 1 + src/RadTophat/test_radiation_tophat.cpp | 1 + src/RadTube/test_radiation_tube.cpp | 1 + src/RadhydroShell/test_radhydro_shell.cpp | 1 + src/RadhydroShock/test_radhydro_shock.cpp | 1 + src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 1 + src/RayleighTaylor2D/test_hydro2d_rt.cpp | 1 + src/RayleighTaylor3D/test_hydro3d_rt.cpp | 1 + src/ShockCloud/cloud.cpp | 1 + src/SphericalCollapse/spherical_collapse.cpp | 1 + 36 files changed, 36 insertions(+) diff --git a/src/Cooling/test_cooling.cpp b/src/Cooling/test_cooling.cpp index e602c79cf..afd062b7c 100644 --- a/src/Cooling/test_cooling.cpp +++ b/src/Cooling/test_cooling.cpp @@ -37,6 +37,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; // default value static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/FCQuantities/test_fc_quantities.cpp b/src/FCQuantities/test_fc_quantities.cpp index bed07a180..71f53a27b 100644 --- a/src/FCQuantities/test_fc_quantities.cpp +++ b/src/FCQuantities/test_fc_quantities.cpp @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroBlast2D/test_hydro2d_blast.cpp b/src/HydroBlast2D/test_hydro2d_blast.cpp index 8ed15ee54..36e274985 100644 --- a/src/HydroBlast2D/test_hydro2d_blast.cpp +++ b/src/HydroBlast2D/test_hydro2d_blast.cpp @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroBlast3D/test_hydro3d_blast.cpp b/src/HydroBlast3D/test_hydro3d_blast.cpp index 42222dada..c973424ea 100644 --- a/src/HydroBlast3D/test_hydro3d_blast.cpp +++ b/src/HydroBlast3D/test_hydro3d_blast.cpp @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroContact/test_hydro_contact.cpp b/src/HydroContact/test_hydro_contact.cpp index 411e5afdd..8185861a4 100644 --- a/src/HydroContact/test_hydro_contact.cpp +++ b/src/HydroContact/test_hydro_contact.cpp @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroHighMach/test_hydro_highmach.cpp b/src/HydroHighMach/test_hydro_highmach.cpp index a621e9453..b85965cdb 100644 --- a/src/HydroHighMach/test_hydro_highmach.cpp +++ b/src/HydroHighMach/test_hydro_highmach.cpp @@ -32,6 +32,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp b/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp index 1885767c2..a79997def 100644 --- a/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp +++ b/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroLeblanc/test_hydro_leblanc.cpp b/src/HydroLeblanc/test_hydro_leblanc.cpp index 9ce017f9a..66ba954ba 100644 --- a/src/HydroLeblanc/test_hydro_leblanc.cpp +++ b/src/HydroLeblanc/test_hydro_leblanc.cpp @@ -32,6 +32,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = (5. / 3.); static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroQuirk/test_quirk.cpp b/src/HydroQuirk/test_quirk.cpp index bc3d4ec6f..33a8c69eb 100644 --- a/src/HydroQuirk/test_quirk.cpp +++ b/src/HydroQuirk/test_quirk.cpp @@ -45,6 +45,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp b/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp index 7dbbe13f4..ec9c4f507 100644 --- a/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp +++ b/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroSMS/test_hydro_sms.cpp b/src/HydroSMS/test_hydro_sms.cpp index b6495394a..5193c4444 100644 --- a/src/HydroSMS/test_hydro_sms.cpp +++ b/src/HydroSMS/test_hydro_sms.cpp @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroShocktube/test_hydro_shocktube.cpp b/src/HydroShocktube/test_hydro_shocktube.cpp index 6211d0612..e26734470 100644 --- a/src/HydroShocktube/test_hydro_shocktube.cpp +++ b/src/HydroShocktube/test_hydro_shocktube.cpp @@ -30,6 +30,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp b/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp index 3a39ad0c8..63e5cdb87 100644 --- a/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp +++ b/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp @@ -35,6 +35,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroShuOsher/test_hydro_shuosher.cpp b/src/HydroShuOsher/test_hydro_shuosher.cpp index 5201c8ec3..cb896b7d2 100644 --- a/src/HydroShuOsher/test_hydro_shuosher.cpp +++ b/src/HydroShuOsher/test_hydro_shuosher.cpp @@ -27,6 +27,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroVacuum/test_hydro_vacuum.cpp b/src/HydroVacuum/test_hydro_vacuum.cpp index a30dffdb6..1aa291c5e 100644 --- a/src/HydroVacuum/test_hydro_vacuum.cpp +++ b/src/HydroVacuum/test_hydro_vacuum.cpp @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/HydroWave/test_hydro_wave.cpp b/src/HydroWave/test_hydro_wave.cpp index 654501929..d20bdd81c 100644 --- a/src/HydroWave/test_hydro_wave.cpp +++ b/src/HydroWave/test_hydro_wave.cpp @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index c674ec1af..c08dbbb61 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -19,6 +19,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; struct ODEUserData { diff --git a/src/PassiveScalar/test_scalars.cpp b/src/PassiveScalar/test_scalars.cpp index 2bea41404..a6b072f14 100644 --- a/src/PassiveScalar/test_scalars.cpp +++ b/src/PassiveScalar/test_scalars.cpp @@ -27,6 +27,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/RadBeam/test_radiation_beam.cpp b/src/RadBeam/test_radiation_beam.cpp index ad1ea6148..6bec35e01 100644 --- a/src/RadBeam/test_radiation_beam.cpp +++ b/src/RadBeam/test_radiation_beam.cpp @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadForce/test_radiation_force.cpp b/src/RadForce/test_radiation_force.cpp index bfa8f4cdc..9c5796b1f 100644 --- a/src/RadForce/test_radiation_force.cpp +++ b/src/RadForce/test_radiation_force.cpp @@ -48,6 +48,7 @@ template <> struct quokka::EOS_Traits { static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = gamma_gas; static constexpr double cs_isothermal = a0; // only used when gamma = 1 + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshak/test_radiation_marshak.cpp b/src/RadMarshak/test_radiation_marshak.cpp index c4f4ec104..c04db4b00 100644 --- a/src/RadMarshak/test_radiation_marshak.cpp +++ b/src/RadMarshak/test_radiation_marshak.cpp @@ -34,6 +34,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = 1.0; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp b/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp index d805efca0..f237df424 100644 --- a/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp +++ b/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp b/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp index 8309cc633..54a275efd 100644 --- a/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp +++ b/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadMatterCoupling/test_radiation_matter_coupling.cpp b/src/RadMatterCoupling/test_radiation_matter_coupling.cpp index 515ab9e4b..227407ac7 100644 --- a/src/RadMatterCoupling/test_radiation_matter_coupling.cpp +++ b/src/RadMatterCoupling/test_radiation_matter_coupling.cpp @@ -34,6 +34,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp b/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp index b99dc52b6..8130492dd 100644 --- a/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp +++ b/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index 49bd9ce92..764bfe652 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -30,6 +30,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; + static constexpr hydrogen_mass_code_units = 1.0; }; template <> struct RadSystem_Traits { diff --git a/src/RadShadow/test_radiation_shadow.cpp b/src/RadShadow/test_radiation_shadow.cpp index d414a0b29..a4fe46930 100644 --- a/src/RadShadow/test_radiation_shadow.cpp +++ b/src/RadShadow/test_radiation_shadow.cpp @@ -37,6 +37,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 10. * quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadTophat/test_radiation_tophat.cpp b/src/RadTophat/test_radiation_tophat.cpp index 613289074..1025d5ff5 100644 --- a/src/RadTophat/test_radiation_tophat.cpp +++ b/src/RadTophat/test_radiation_tophat.cpp @@ -41,6 +41,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadTube/test_radiation_tube.cpp b/src/RadTube/test_radiation_tube.cpp index c90f74bd4..fb44e7c5f 100644 --- a/src/RadTube/test_radiation_tube.cpp +++ b/src/RadTube/test_radiation_tube.cpp @@ -40,6 +40,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = gamma_gas; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadhydroShell/test_radhydro_shell.cpp b/src/RadhydroShell/test_radhydro_shell.cpp index f6b2262fb..0ef90d795 100644 --- a/src/RadhydroShell/test_radhydro_shell.cpp +++ b/src/RadhydroShell/test_radhydro_shell.cpp @@ -48,6 +48,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 2.2 * m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { diff --git a/src/RadhydroShock/test_radhydro_shock.cpp b/src/RadhydroShock/test_radhydro_shock.cpp index 64ad5e96a..0e8f29254 100644 --- a/src/RadhydroShock/test_radhydro_shock.cpp +++ b/src/RadhydroShock/test_radhydro_shock.cpp @@ -65,6 +65,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; + static constexpr double hydrogen_mass_code_units = 1.0; }; template <> struct Physics_Traits { diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index c0249b895..5bf3b9958 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -68,6 +68,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/RayleighTaylor2D/test_hydro2d_rt.cpp b/src/RayleighTaylor2D/test_hydro2d_rt.cpp index 03bced418..db56d8831 100644 --- a/src/RayleighTaylor2D/test_hydro2d_rt.cpp +++ b/src/RayleighTaylor2D/test_hydro2d_rt.cpp @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { diff --git a/src/RayleighTaylor3D/test_hydro3d_rt.cpp b/src/RayleighTaylor3D/test_hydro3d_rt.cpp index cf4e66e0a..97599b55d 100644 --- a/src/RayleighTaylor3D/test_hydro3d_rt.cpp +++ b/src/RayleighTaylor3D/test_hydro3d_rt.cpp @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { diff --git a/src/ShockCloud/cloud.cpp b/src/ShockCloud/cloud.cpp index c04a08615..1b81e075b 100644 --- a/src/ShockCloud/cloud.cpp +++ b/src/ShockCloud/cloud.cpp @@ -42,6 +42,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; // default value static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct Physics_Traits { diff --git a/src/SphericalCollapse/spherical_collapse.cpp b/src/SphericalCollapse/spherical_collapse.cpp index a5273f0f2..3087596eb 100644 --- a/src/SphericalCollapse/spherical_collapse.cpp +++ b/src/SphericalCollapse/spherical_collapse.cpp @@ -30,6 +30,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct HydroSystem_Traits { From a54498901bca37e6fd95885d18b0d27e2e9839fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:08:25 +0000 Subject: [PATCH 32/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/PrimordialChem/test_primordial_chem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PrimordialChem/test_primordial_chem.cpp b/src/PrimordialChem/test_primordial_chem.cpp index f5f4b5e17..e944dd166 100644 --- a/src/PrimordialChem/test_primordial_chem.cpp +++ b/src/PrimordialChem/test_primordial_chem.cpp @@ -40,7 +40,6 @@ using amrex::Real; struct PrimordialChemTest { }; // dummy type to allow compile-type polymorphism via template specialization - template <> struct Physics_Traits { // cell-centred static constexpr bool is_hydro_enabled = true; From 7d027d33f346497261a3465542f296761b50d7a4 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 17:06:05 +0200 Subject: [PATCH 33/66] specify code units in EOS class --- src/EOS.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 35ee0b90c..5f39a6612 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -56,6 +56,7 @@ template class EOS static constexpr amrex::Real gamma_ = EOS_Traits::gamma; static constexpr amrex::Real boltzmann_constant_ = EOS_Traits::boltzmann_constant; static constexpr amrex::Real mean_molecular_weight_ = EOS_Traits::mean_molecular_weight; + static constexpr amrex::Real hydrogen_mass_code_units_ = EOS_Traits::hydrogen_mass_code_units; }; template @@ -91,7 +92,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin chem_eos_t chemstate; chemstate.rho = rho; chemstate.e = Eint / rho; - chemstate.mu = mean_molecular_weight_ / hydrogen_mass_code_units; + chemstate.mu = mean_molecular_weight_ / hydrogen_mass_code_units_; // amrex::Print() << "Tgas before " << chemstate.rho << " " << chemstate.e << " "<< chemstate.mu << " " << std::endl; eos(eos_input_re, chemstate); // amrex::Print() << "Tgas after "<< chemstate << std::endl; From a68c1cfd44398c8220f40aa5e4fb32637be8a500 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 17:11:12 +0200 Subject: [PATCH 34/66] add code units --- src/RadPulse/test_radiation_pulse.cpp | 2 +- src/RadStreaming/test_radiation_streaming.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index 764bfe652..7a433d5f3 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -30,7 +30,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; - static constexpr hydrogen_mass_code_units = 1.0; + static constexpr double hydrogen_mass_code_units = 1.0; }; template <> struct RadSystem_Traits { diff --git a/src/RadStreaming/test_radiation_streaming.cpp b/src/RadStreaming/test_radiation_streaming.cpp index 156902dee..5876cd474 100644 --- a/src/RadStreaming/test_radiation_streaming.cpp +++ b/src/RadStreaming/test_radiation_streaming.cpp @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; + static constexpr double hydrogen_mass_code_units = 1.0; }; template <> struct RadSystem_Traits { From 40983b1696ad17c255a6f683a740b36fb33c2810 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:08:23 +0200 Subject: [PATCH 35/66] initialize EOS --- src/ODEIntegration/test_ode.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index c08dbbb61..d10cc16c8 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -9,6 +9,8 @@ #include "test_ode.hpp" #include "radiation_system.hpp" +#include "eos.H" +#include "extern_parameters.H" using amrex::Real; @@ -53,6 +55,12 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto user_rhs(Real /*t*/, quokka::valar auto problem_main() -> int { + // initialize EOS + init_extern_parameters(); + Real small_temp = 1e-10; + Real small_dens = 1e-100; + eos_init(small_temp, small_dens); + // set up initial conditions const Real Eint0 = quokka::EOS::ComputeEintFromTgas(rho0, Tgas0); const Real Edot0 = cooling_function(rho0, Tgas0); From b110065d3a8279a5d10c732793355ce02edf6cbc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:09:30 +0000 Subject: [PATCH 36/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/ODEIntegration/test_ode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index d10cc16c8..d707871cc 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -8,9 +8,9 @@ /// #include "test_ode.hpp" -#include "radiation_system.hpp" #include "eos.H" #include "extern_parameters.H" +#include "radiation_system.hpp" using amrex::Real; From f7cbb251e9efbcf5bb7dfdea9a8f1211911a9f2d Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:12:37 +0200 Subject: [PATCH 37/66] corrected the name for mean_molecular_weight --- src/RadForce/test_radiation_force.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RadForce/test_radiation_force.cpp b/src/RadForce/test_radiation_force.cpp index 9c5796b1f..a0042bba5 100644 --- a/src/RadForce/test_radiation_force.cpp +++ b/src/RadForce/test_radiation_force.cpp @@ -44,7 +44,7 @@ constexpr double g0 = kappa0 * Frad0 / c_light_cgs_; // cm s^{-2} constexpr double Lx = (a0 * a0) / g0; // cm template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_mass = mu; + static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = gamma_gas; static constexpr double cs_isothermal = a0; // only used when gamma = 1 From 6c94d94bfa9832ab78ead2cf1a701f503f022182 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:23:40 +0200 Subject: [PATCH 38/66] corrected code units --- src/RadPulse/test_radiation_pulse.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index 7a433d5f3..c961bef4f 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -9,6 +9,7 @@ #include "test_radiation_pulse.hpp" #include "AMReX_BC_TYPES.H" +#include "AMReX_Print.H" #include "RadhydroSimulation.hpp" #include "fextract.hpp" @@ -30,7 +31,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0; + static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; }; template <> struct RadSystem_Traits { From 4631866181020c1dbb678c476786e819445140d9 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:45:39 +0200 Subject: [PATCH 39/66] corrected code units --- src/RadhydroShock/test_radhydro_shock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RadhydroShock/test_radhydro_shock.cpp b/src/RadhydroShock/test_radhydro_shock.cpp index 0e8f29254..5e4d3c085 100644 --- a/src/RadhydroShock/test_radhydro_shock.cpp +++ b/src/RadhydroShock/test_radhydro_shock.cpp @@ -65,7 +65,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = 1.0; + static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; }; template <> struct Physics_Traits { From 96d9d86bc96d58a29bcd6382cb598bb69c5dccf3 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:46:27 +0200 Subject: [PATCH 40/66] scale Tgas by k_B --- src/EOS.hpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 5f39a6612..618f595c3 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -26,7 +26,7 @@ namespace quokka { -static constexpr double boltzmann_constant_cgs = 1.380658e-16; // cgs +static constexpr double boltzmann_constant_cgs = C::k_B; // cgs static constexpr double hydrogen_mass_cgs = 1.6726231e-24; // cgs // specify default values for ideal gamma-law EOS @@ -87,16 +87,15 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin Tgas = chemstate.T; #else if constexpr (gamma_ != 1.0) { - // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - // Tgas = Eint / (rho * c_v); - chem_eos_t chemstate; - chemstate.rho = rho; - chemstate.e = Eint / rho; - chemstate.mu = mean_molecular_weight_ / hydrogen_mass_code_units_; - // amrex::Print() << "Tgas before " << chemstate.rho << " " << chemstate.e << " "<< chemstate.mu << " " << std::endl; - eos(eos_input_re, chemstate); - // amrex::Print() << "Tgas after "<< chemstate << std::endl; - Tgas = chemstate.T; + //const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + //Tgas = Eint / (rho * c_v); + chem_eos_t estate; + estate.rho = rho; + estate.e = Eint / rho; + estate.mu = mean_molecular_weight_ / hydrogen_mass_code_units_; + eos(eos_input_re, estate); + // scale returned temperature in case boltzmann constant is dimensionless + Tgas = estate.T * C::k_B / boltzmann_constant_; } #endif return Tgas; From bee8c9c35c17daf168b7ecfba420c84b4cabfa70 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:52:42 +0200 Subject: [PATCH 41/66] use microphysics k_B --- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 5bf3b9958..2ab482900 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -24,8 +24,8 @@ struct ShockProblem { constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 -constexpr double k_B = 1.380658e-16; // erg K^-1 -constexpr double m_H = 1.6726231e-24; // mass of hydrogen atom [g] +constexpr double k_B = C::k_B; // erg K^-1 +constexpr double m_H = quokka::hydrogen_mass_cgs; // mass of hydrogen atom [g] // constexpr double P0 = 1.0e-4; // equal to P_0 in dimensionless units // constexpr double sigma_a = 1.0e6; // absorption cross section From b309e4c4e5f8a593e2aafa2d26810f381e26c710 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:53:45 +0000 Subject: [PATCH 42/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/EOS.hpp | 8 ++++---- src/RadPulse/test_radiation_pulse.cpp | 2 +- src/RadhydroShock/test_radhydro_shock.cpp | 2 +- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 618f595c3..54e71d39b 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -26,8 +26,8 @@ namespace quokka { -static constexpr double boltzmann_constant_cgs = C::k_B; // cgs -static constexpr double hydrogen_mass_cgs = 1.6726231e-24; // cgs +static constexpr double boltzmann_constant_cgs = C::k_B; // cgs +static constexpr double hydrogen_mass_cgs = 1.6726231e-24; // cgs // specify default values for ideal gamma-law EOS // @@ -87,8 +87,8 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin Tgas = chemstate.T; #else if constexpr (gamma_ != 1.0) { - //const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - //Tgas = Eint / (rho * c_v); + // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + // Tgas = Eint / (rho * c_v); chem_eos_t estate; estate.rho = rho; estate.e = Eint / rho; diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index c961bef4f..7767ffdfa 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -31,7 +31,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; + static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; }; template <> struct RadSystem_Traits { diff --git a/src/RadhydroShock/test_radhydro_shock.cpp b/src/RadhydroShock/test_radhydro_shock.cpp index 5e4d3c085..a518618e0 100644 --- a/src/RadhydroShock/test_radhydro_shock.cpp +++ b/src/RadhydroShock/test_radhydro_shock.cpp @@ -65,7 +65,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; + static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; }; template <> struct Physics_Traits { diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 2ab482900..08b2ee9ec 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -22,9 +22,9 @@ struct ShockProblem { // parameters taken from Section 9.5 of Skinner et al. (2019) // [The Astrophysical Journal Supplement Series, 241:7 (27pp), 2019 March] -constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 -constexpr double c = 2.99792458e10; // cm s^-1 -constexpr double k_B = C::k_B; // erg K^-1 +constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 +constexpr double c = 2.99792458e10; // cm s^-1 +constexpr double k_B = C::k_B; // erg K^-1 constexpr double m_H = quokka::hydrogen_mass_cgs; // mass of hydrogen atom [g] // constexpr double P0 = 1.0e-4; // equal to P_0 in dimensionless units From 7b6e6b06a41c211acd5b9f349903eec5e33f6657 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 27 Jun 2023 22:58:26 +0200 Subject: [PATCH 43/66] corrected code units --- src/RadMarshak/test_radiation_marshak.cpp | 2 +- src/RadStreaming/test_radiation_streaming.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RadMarshak/test_radiation_marshak.cpp b/src/RadMarshak/test_radiation_marshak.cpp index c04db4b00..9f28237da 100644 --- a/src/RadMarshak/test_radiation_marshak.cpp +++ b/src/RadMarshak/test_radiation_marshak.cpp @@ -34,7 +34,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0; + static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; }; template <> struct RadSystem_Traits { diff --git a/src/RadStreaming/test_radiation_streaming.cpp b/src/RadStreaming/test_radiation_streaming.cpp index 5876cd474..93e22cbdb 100644 --- a/src/RadStreaming/test_radiation_streaming.cpp +++ b/src/RadStreaming/test_radiation_streaming.cpp @@ -26,7 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0; + static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; }; template <> struct RadSystem_Traits { From 52eb94c56c1493d8c7794ec3b51245ad4700e422 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:59:40 +0000 Subject: [PATCH 44/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/RadMarshak/test_radiation_marshak.cpp | 2 +- src/RadStreaming/test_radiation_streaming.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RadMarshak/test_radiation_marshak.cpp b/src/RadMarshak/test_radiation_marshak.cpp index 9f28237da..acb7529db 100644 --- a/src/RadMarshak/test_radiation_marshak.cpp +++ b/src/RadMarshak/test_radiation_marshak.cpp @@ -34,7 +34,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; + static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; }; template <> struct RadSystem_Traits { diff --git a/src/RadStreaming/test_radiation_streaming.cpp b/src/RadStreaming/test_radiation_streaming.cpp index 93e22cbdb..009acf805 100644 --- a/src/RadStreaming/test_radiation_streaming.cpp +++ b/src/RadStreaming/test_radiation_streaming.cpp @@ -26,7 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; + static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; }; template <> struct RadSystem_Traits { From ddeb81465ec225bccbb00e8df59c26643c0cf2bd Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 28 Jun 2023 00:52:36 +0200 Subject: [PATCH 45/66] code unit changed to 1/n_A --- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 08b2ee9ec..a91b92580 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -68,7 +68,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; }; template <> struct Physics_Traits { From dc6bceb38dde384a521d1be2b759f11ae06b11f3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 22:52:52 +0000 Subject: [PATCH 46/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index a91b92580..3230a6562 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -68,7 +68,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = 1.0/C::n_A; + static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; }; template <> struct Physics_Traits { From 9c63d01946c39474a2b01a9bb04eb4dac29fc915 Mon Sep 17 00:00:00 2001 From: psharda Date: Sun, 23 Jul 2023 19:16:10 +0200 Subject: [PATCH 47/66] updated microp --- extern/Microphysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/Microphysics b/extern/Microphysics index 716dc7f9e..ea4204146 160000 --- a/extern/Microphysics +++ b/extern/Microphysics @@ -1 +1 @@ -Subproject commit 716dc7f9e1bbd56aedc456275fd397aced53d136 +Subproject commit ea4204146eb2269605764e432a022cb1ae090398 From 379f970ba5f360b43a5f88bc868dcec85ba537f2 Mon Sep 17 00:00:00 2001 From: psharda Date: Sun, 23 Jul 2023 19:27:12 +0200 Subject: [PATCH 48/66] use microp constant for hydrogen mass --- src/EOS.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 54e71d39b..952d12eca 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -27,7 +27,7 @@ namespace quokka { static constexpr double boltzmann_constant_cgs = C::k_B; // cgs -static constexpr double hydrogen_mass_cgs = 1.6726231e-24; // cgs +static constexpr double hydrogen_mass_cgs = C::m_p + C::m_e; // cgs // specify default values for ideal gamma-law EOS // From b13a5402576b95532b4386752d4ad005e1107190 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 23 Jul 2023 18:08:11 +0000 Subject: [PATCH 49/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/EOS.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 952d12eca..e2873b898 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -26,7 +26,7 @@ namespace quokka { -static constexpr double boltzmann_constant_cgs = C::k_B; // cgs +static constexpr double boltzmann_constant_cgs = C::k_B; // cgs static constexpr double hydrogen_mass_cgs = C::m_p + C::m_e; // cgs // specify default values for ideal gamma-law EOS From dfef3f19253deae3f8c671bd9a7d88d685b2d6e7 Mon Sep 17 00:00:00 2001 From: psharda Date: Sun, 23 Jul 2023 20:16:27 +0200 Subject: [PATCH 50/66] changed mass units --- src/RadPulse/test_radiation_pulse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index 7767ffdfa..c5c7ea3d9 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -31,7 +31,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; + static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; }; template <> struct RadSystem_Traits { From 607d203642ed93812bd3adfefa3151b6615b9587 Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 15:31:25 +0200 Subject: [PATCH 51/66] use amu and k_B from microphysics instead of m_H and k_B in quokka --- src/CloudyCooling.hpp | 14 +++++++------- src/Cooling/test_cooling.cpp | 8 ++++---- src/EOS.hpp | 10 ++++------ src/FCQuantities/test_fc_quantities.cpp | 6 +++--- src/HydroBlast2D/test_hydro2d_blast.cpp | 4 ++-- src/HydroBlast3D/test_hydro3d_blast.cpp | 4 ++-- src/HydroContact/test_hydro_contact.cpp | 6 +++--- src/HydroHighMach/test_hydro_highmach.cpp | 4 ++-- src/HydroKelvinHelmholz/test_hydro2d_kh.cpp | 4 ++-- src/HydroLeblanc/test_hydro_leblanc.cpp | 6 +++--- src/HydroQuirk/test_quirk.cpp | 4 ++-- src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp | 4 ++-- src/HydroSMS/test_hydro_sms.cpp | 6 +++--- src/HydroShocktube/test_hydro_shocktube.cpp | 4 ++-- src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp | 4 ++-- src/HydroShuOsher/test_hydro_shuosher.cpp | 6 +++--- src/HydroVacuum/test_hydro_vacuum.cpp | 4 ++-- src/HydroWave/test_hydro_wave.cpp | 6 +++--- src/ODEIntegration/test_ode.cpp | 10 +++++----- src/PassiveScalar/test_scalars.cpp | 6 +++--- src/RadBeam/test_radiation_beam.cpp | 4 ++-- src/RadForce/test_radiation_force.cpp | 6 +++--- src/RadMarshak/test_radiation_marshak.cpp | 2 +- .../test_radiation_marshak_asymptotic.cpp | 8 ++++---- src/RadMarshakCGS/test_radiation_marshak_cgs.cpp | 6 +++--- .../test_radiation_matter_coupling.cpp | 6 +++--- .../test_radiation_matter_coupling_rsla.cpp | 6 +++--- src/RadPulse/test_radiation_pulse.cpp | 2 +- src/RadShadow/test_radiation_shadow.cpp | 6 +++--- src/RadStreaming/test_radiation_streaming.cpp | 2 +- src/RadTophat/test_radiation_tophat.cpp | 6 +++--- src/RadTube/test_radiation_tube.cpp | 10 +++++----- src/RadhydroShell/test_radhydro_shell.cpp | 6 +++--- src/RadhydroShock/test_radhydro_shock.cpp | 2 +- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 4 ++-- src/RayleighTaylor2D/test_hydro2d_rt.cpp | 4 ++-- src/RayleighTaylor3D/test_hydro3d_rt.cpp | 6 +++--- src/SphericalCollapse/spherical_collapse.cpp | 4 ++-- 38 files changed, 104 insertions(+), 106 deletions(-) diff --git a/src/CloudyCooling.hpp b/src/CloudyCooling.hpp index 2e5dfe50c..7473e5d1d 100644 --- a/src/CloudyCooling.hpp +++ b/src/CloudyCooling.hpp @@ -81,7 +81,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cloudy_cooling_function(Real const { // interpolate cooling rates from Cloudy tables const Real rhoH = rho * cloudy_H_mass_fraction; // mass density of H species - const Real nH = rhoH / quokka::hydrogen_mass_cgs; + const Real nH = rhoH / C::m_u; const Real log_nH = std::log10(nH); const Real log_T = std::log10(T); @@ -102,7 +102,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cloudy_cooling_function(Real const // compute electron density // N.B. it is absolutely critical to include the metal contribution here! - double n_e = (rho / quokka::hydrogen_mass_cgs) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / quokka::hydrogen_mass_cgs)); + double n_e = (rho / C::m_u) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / C::m_u)); // the approximation for the metals contribution to e- fails at high densities (~1e3 or higher) n_e = std::max(n_e, 1.0e-4 * nH); @@ -118,7 +118,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cloudy_cooling_function(Real const // Compton term (CMB photons) // [e.g., Hirata 2018: doi:10.1093/mnras/stx2854] constexpr double Gamma_C = (8. * sigma_T * E_cmb) / (3. * electron_mass_cgs * c_light_cgs_); - constexpr double C_n = Gamma_C * quokka::boltzmann_constant_cgs / (5. / 3. - 1.0); + constexpr double C_n = Gamma_C * C::k_B / (5. / 3. - 1.0); const double compton_CMB = -C_n * (T - T_cmb) * n_e; Edot += compton_CMB; @@ -129,13 +129,13 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeEgasFromTgas(double rho, do { // convert Egas (internal gas energy) to temperature const Real rhoH = rho * cloudy_H_mass_fraction; - const Real nH = rhoH / quokka::hydrogen_mass_cgs; + const Real nH = rhoH / C::m_u; // compute mu from mu(T) table const Real mu = interpolate2d(std::log10(nH), std::log10(Tgas), tables.log_nH, tables.log_Tgas, tables.meanMolWeight); // compute thermal gas energy - const Real Egas = (rho / (quokka::hydrogen_mass_cgs * mu)) * quokka::boltzmann_constant_cgs * Tgas / (gamma - 1.); + const Real Egas = (rho / (C::m_u * mu)) * C::k_B * Tgas / (gamma - 1.); return Egas; } @@ -157,12 +157,12 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeTgasFromEgas(double rho, do // solve for temperature given Eint (with fixed adiabatic index gamma) const Real rhoH = rho * cloudy_H_mass_fraction; - const Real nH = rhoH / quokka::hydrogen_mass_cgs; + const Real nH = rhoH / C::m_u; const Real log_nH = std::log10(nH); // mean molecular weight (in Grackle tables) is defined w/r/t // hydrogen_mass_cgs_ - const Real C = (gamma - 1.) * Egas / (quokka::boltzmann_constant_cgs * (rho / quokka::hydrogen_mass_cgs)); + const Real C = (gamma - 1.) * Egas / (C::k_B * (rho / C::m_u)); // solve for mu(T)*C == T. // (Grackle does this with a fixed-point iteration. We use a more robust diff --git a/src/Cooling/test_cooling.cpp b/src/Cooling/test_cooling.cpp index afd062b7c..86690a21d 100644 --- a/src/Cooling/test_cooling.cpp +++ b/src/Cooling/test_cooling.cpp @@ -30,14 +30,14 @@ using amrex::Real; struct CoolingTest { }; // dummy type to allow compile-type polymorphism via template specialization -constexpr double m_H = quokka::hydrogen_mass_cgs; +constexpr double m_H = C::m_u; constexpr double seconds_in_year = 3.154e7; template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; // default value - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/EOS.hpp b/src/EOS.hpp index e2873b898..acc045f10 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -26,8 +26,6 @@ namespace quokka { -static constexpr double boltzmann_constant_cgs = C::k_B; // cgs -static constexpr double hydrogen_mass_cgs = C::m_p + C::m_e; // cgs // specify default values for ideal gamma-law EOS // @@ -35,8 +33,8 @@ template struct EOS_Traits { static constexpr double gamma = 5. / 3.; // default value static constexpr double cs_isothermal = NAN; // only used when gamma = 1 static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template class EOS @@ -56,7 +54,7 @@ template class EOS static constexpr amrex::Real gamma_ = EOS_Traits::gamma; static constexpr amrex::Real boltzmann_constant_ = EOS_Traits::boltzmann_constant; static constexpr amrex::Real mean_molecular_weight_ = EOS_Traits::mean_molecular_weight; - static constexpr amrex::Real hydrogen_mass_code_units_ = EOS_Traits::hydrogen_mass_code_units; + static constexpr amrex::Real mass_code_units_ = EOS_Traits::mass_code_units; }; template @@ -92,7 +90,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin chem_eos_t estate; estate.rho = rho; estate.e = Eint / rho; - estate.mu = mean_molecular_weight_ / hydrogen_mass_code_units_; + estate.mu = mean_molecular_weight_ / mass_code_units_; eos(eos_input_re, estate); // scale returned temperature in case boltzmann constant is dimensionless Tgas = estate.T * C::k_B / boltzmann_constant_; diff --git a/src/FCQuantities/test_fc_quantities.cpp b/src/FCQuantities/test_fc_quantities.cpp index 71f53a27b..669902d31 100644 --- a/src/FCQuantities/test_fc_quantities.cpp +++ b/src/FCQuantities/test_fc_quantities.cpp @@ -27,9 +27,9 @@ struct FCQuantities { template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroBlast2D/test_hydro2d_blast.cpp b/src/HydroBlast2D/test_hydro2d_blast.cpp index 36e274985..bad9323a4 100644 --- a/src/HydroBlast2D/test_hydro2d_blast.cpp +++ b/src/HydroBlast2D/test_hydro2d_blast.cpp @@ -28,8 +28,8 @@ struct BlastProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroBlast3D/test_hydro3d_blast.cpp b/src/HydroBlast3D/test_hydro3d_blast.cpp index c973424ea..8a14bf0f6 100644 --- a/src/HydroBlast3D/test_hydro3d_blast.cpp +++ b/src/HydroBlast3D/test_hydro3d_blast.cpp @@ -35,8 +35,8 @@ bool test_passes = false; // if one of the energy checks fails, set to false template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroContact/test_hydro_contact.cpp b/src/HydroContact/test_hydro_contact.cpp index 8185861a4..fd8414be8 100644 --- a/src/HydroContact/test_hydro_contact.cpp +++ b/src/HydroContact/test_hydro_contact.cpp @@ -23,9 +23,9 @@ struct ContactProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroHighMach/test_hydro_highmach.cpp b/src/HydroHighMach/test_hydro_highmach.cpp index b85965cdb..4ee7af891 100644 --- a/src/HydroHighMach/test_hydro_highmach.cpp +++ b/src/HydroHighMach/test_hydro_highmach.cpp @@ -31,8 +31,8 @@ struct HighMachProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp b/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp index a79997def..793b1de38 100644 --- a/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp +++ b/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp @@ -25,8 +25,8 @@ struct KelvinHelmholzProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroLeblanc/test_hydro_leblanc.cpp b/src/HydroLeblanc/test_hydro_leblanc.cpp index 66ba954ba..21f772bc4 100644 --- a/src/HydroLeblanc/test_hydro_leblanc.cpp +++ b/src/HydroLeblanc/test_hydro_leblanc.cpp @@ -30,9 +30,9 @@ struct ShocktubeProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = (5. / 3.); - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroQuirk/test_quirk.cpp b/src/HydroQuirk/test_quirk.cpp index 33a8c69eb..9e77087da 100644 --- a/src/HydroQuirk/test_quirk.cpp +++ b/src/HydroQuirk/test_quirk.cpp @@ -44,8 +44,8 @@ struct QuirkProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp b/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp index ec9c4f507..2ff34a2f2 100644 --- a/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp +++ b/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp @@ -24,8 +24,8 @@ struct RichtmeyerMeshkovProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroSMS/test_hydro_sms.cpp b/src/HydroSMS/test_hydro_sms.cpp index 5193c4444..9e8b8626a 100644 --- a/src/HydroSMS/test_hydro_sms.cpp +++ b/src/HydroSMS/test_hydro_sms.cpp @@ -23,9 +23,9 @@ struct ShocktubeProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroShocktube/test_hydro_shocktube.cpp b/src/HydroShocktube/test_hydro_shocktube.cpp index e26734470..6eb3bf5b0 100644 --- a/src/HydroShocktube/test_hydro_shocktube.cpp +++ b/src/HydroShocktube/test_hydro_shocktube.cpp @@ -29,8 +29,8 @@ struct ShocktubeProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp b/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp index 63e5cdb87..803c89455 100644 --- a/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp +++ b/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp @@ -34,8 +34,8 @@ template <> struct SimulationData { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroShuOsher/test_hydro_shuosher.cpp b/src/HydroShuOsher/test_hydro_shuosher.cpp index cb896b7d2..93a4900a8 100644 --- a/src/HydroShuOsher/test_hydro_shuosher.cpp +++ b/src/HydroShuOsher/test_hydro_shuosher.cpp @@ -25,9 +25,9 @@ struct ShocktubeProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroVacuum/test_hydro_vacuum.cpp b/src/HydroVacuum/test_hydro_vacuum.cpp index 1aa291c5e..822084e60 100644 --- a/src/HydroVacuum/test_hydro_vacuum.cpp +++ b/src/HydroVacuum/test_hydro_vacuum.cpp @@ -28,8 +28,8 @@ struct ShocktubeProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroWave/test_hydro_wave.cpp b/src/HydroWave/test_hydro_wave.cpp index d20bdd81c..d4ddc8be1 100644 --- a/src/HydroWave/test_hydro_wave.cpp +++ b/src/HydroWave/test_hydro_wave.cpp @@ -23,9 +23,9 @@ struct WaveProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index d707871cc..198d0608e 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -15,13 +15,13 @@ using amrex::Real; constexpr double Tgas0 = 6000.; // K -constexpr double rho0 = 0.01 * quokka::hydrogen_mass_cgs; // g cm^-3 +constexpr double rho0 = 0.01 * C::m_u; // g cm^-3 template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; struct ODEUserData { @@ -33,7 +33,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cooling_function(Real const rho, R // use fitting function from Koyama & Inutsuka (2002) Real gamma_heat = 2.0e-26; Real lambda_cool = gamma_heat * (1.0e7 * std::exp(-114800. / (T + 1000.)) + 14. * std::sqrt(T) * std::exp(-92. / T)); - Real rho_over_mh = rho / quokka::hydrogen_mass_cgs; + Real rho_over_mh = rho / C::m_u; Real cooling_source_term = rho_over_mh * gamma_heat - (rho_over_mh * rho_over_mh) * lambda_cool; return cooling_source_term; } diff --git a/src/PassiveScalar/test_scalars.cpp b/src/PassiveScalar/test_scalars.cpp index a6b072f14..325eec117 100644 --- a/src/PassiveScalar/test_scalars.cpp +++ b/src/PassiveScalar/test_scalars.cpp @@ -25,9 +25,9 @@ struct ScalarProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/RadBeam/test_radiation_beam.cpp b/src/RadBeam/test_radiation_beam.cpp index 6bec35e01..20aab6296 100644 --- a/src/RadBeam/test_radiation_beam.cpp +++ b/src/RadBeam/test_radiation_beam.cpp @@ -33,10 +33,10 @@ constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadForce/test_radiation_force.cpp b/src/RadForce/test_radiation_force.cpp index a0042bba5..94095d5c5 100644 --- a/src/RadForce/test_radiation_force.cpp +++ b/src/RadForce/test_radiation_force.cpp @@ -29,7 +29,7 @@ struct TubeProblem { }; constexpr double kappa0 = 5.0; // cm^2 g^-1 -constexpr double mu = 2.33 * quokka::hydrogen_mass_cgs; // g +constexpr double mu = 2.33 * C::m_u; // g constexpr double gamma_gas = 1.0; // isothermal gas EOS constexpr double a0 = 0.2e5; // cm s^-1 constexpr double tau = 1.0e-6; // optical depth (dimensionless) @@ -45,10 +45,10 @@ constexpr double Lx = (a0 * a0) / g0; // cm template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = gamma_gas; static constexpr double cs_isothermal = a0; // only used when gamma = 1 - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshak/test_radiation_marshak.cpp b/src/RadMarshak/test_radiation_marshak.cpp index acb7529db..34113ff5b 100644 --- a/src/RadMarshak/test_radiation_marshak.cpp +++ b/src/RadMarshak/test_radiation_marshak.cpp @@ -34,7 +34,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp b/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp index f237df424..756858c55 100644 --- a/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp +++ b/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp @@ -23,13 +23,13 @@ constexpr double T_initial = 300.; // K // constexpr double kelvin_to_eV = 8.617385e-5; constexpr double a_rad = radiation_constant_cgs_; -constexpr double c_v = (quokka::boltzmann_constant_cgs / quokka::hydrogen_mass_cgs) / (5. / 3. - 1.); +constexpr double c_v = (C::k_B / C::m_u) / (5. / 3. - 1.); template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp b/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp index 54a275efd..2ca6d339b 100644 --- a/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp +++ b/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp @@ -33,10 +33,10 @@ constexpr double alpha_SuOlson = 4.0 * a_rad / eps_SuOlson; constexpr double T_initial = 1.0e4; // K template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_mass = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_mass = C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMatterCoupling/test_radiation_matter_coupling.cpp b/src/RadMatterCoupling/test_radiation_matter_coupling.cpp index 227407ac7..36a27893d 100644 --- a/src/RadMatterCoupling/test_radiation_matter_coupling.cpp +++ b/src/RadMatterCoupling/test_radiation_matter_coupling.cpp @@ -31,10 +31,10 @@ template <> struct SimulationData { }; template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_mass = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_mass = C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp b/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp index 8130492dd..8c33cd432 100644 --- a/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp +++ b/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp @@ -33,10 +33,10 @@ template <> struct SimulationData { }; template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_mass = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_mass = C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index c5c7ea3d9..6cdbf86ca 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -31,7 +31,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadShadow/test_radiation_shadow.cpp b/src/RadShadow/test_radiation_shadow.cpp index a4fe46930..37d60b60a 100644 --- a/src/RadShadow/test_radiation_shadow.cpp +++ b/src/RadShadow/test_radiation_shadow.cpp @@ -34,10 +34,10 @@ constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = 10. * quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_weight = 10. * C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadStreaming/test_radiation_streaming.cpp b/src/RadStreaming/test_radiation_streaming.cpp index 009acf805..8ae3c62f9 100644 --- a/src/RadStreaming/test_radiation_streaming.cpp +++ b/src/RadStreaming/test_radiation_streaming.cpp @@ -26,7 +26,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadTophat/test_radiation_tophat.cpp b/src/RadTophat/test_radiation_tophat.cpp index 1025d5ff5..e97f782e1 100644 --- a/src/RadTophat/test_radiation_tophat.cpp +++ b/src/RadTophat/test_radiation_tophat.cpp @@ -38,10 +38,10 @@ constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double mean_molecular_weight = C::m_u; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadTube/test_radiation_tube.cpp b/src/RadTube/test_radiation_tube.cpp index fb44e7c5f..f3a9121ca 100644 --- a/src/RadTube/test_radiation_tube.cpp +++ b/src/RadTube/test_radiation_tube.cpp @@ -26,7 +26,7 @@ struct TubeProblem { }; constexpr double kappa0 = 100.; // cm^2 g^-1 -constexpr double mu = 2.33 * quokka::hydrogen_mass_cgs; // g +constexpr double mu = 2.33 * C::m_u; // g constexpr double gamma_gas = 5. / 3.; constexpr double rho0 = 1.0; // g cm^-3 @@ -38,9 +38,9 @@ constexpr double a0 = 4.0295519855200705e7; // cm s^-1 template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { @@ -184,7 +184,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect &iv consVar(i, j, k, RadSystem::x2RadFlux_index) = 0.; consVar(i, j, k, RadSystem::x3RadFlux_index) = 0.; - const double Egas = (quokka::boltzmann_constant_cgs / mu) * rho0 * T0 / (gamma_gas - 1.0); + const double Egas = (C::k_B / mu) * rho0 * T0 / (gamma_gas - 1.0); const double x1Mom = consVar(lo[0], j, k, RadSystem::x1GasMomentum_index); const double Ekin = 0.5 * (x1Mom * x1Mom) / rho0; consVar(i, j, k, RadSystem::gasEnergy_index) = Egas + Ekin; @@ -203,7 +203,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect &iv consVar(i, j, k, RadSystem::x2RadFlux_index) = 0; consVar(i, j, k, RadSystem::x3RadFlux_index) = 0; - const double Egas = (quokka::boltzmann_constant_cgs / mu) * rho1 * T1 / (gamma_gas - 1.0); + const double Egas = (C::k_B / mu) * rho1 * T1 / (gamma_gas - 1.0); const double x1Mom = consVar(hi[0], j, k, RadSystem::x1GasMomentum_index); const double Ekin = 0.5 * (x1Mom * x1Mom) / rho1; consVar(i, j, k, RadSystem::gasEnergy_index) = Egas + Ekin; diff --git a/src/RadhydroShell/test_radhydro_shell.cpp b/src/RadhydroShell/test_radhydro_shell.cpp index 0ef90d795..fbcaf9ac5 100644 --- a/src/RadhydroShell/test_radhydro_shell.cpp +++ b/src/RadhydroShell/test_radhydro_shell.cpp @@ -40,15 +40,15 @@ constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 constexpr double a0 = 2.0e5; // ('reference' sound speed) [cm s^-1] constexpr double chat = 860. * a0; // cm s^-1 -constexpr double k_B = 1.380658e-16; // erg K^-1 -constexpr double m_H = 1.6726231e-24; // mass of hydrogen atom [g] +constexpr double k_B = C::k_B; // erg K^-1 +constexpr double m_H = C::m_u; // atomic mass unit constexpr double gamma_gas = 5. / 3.; template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 2.2 * m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadhydroShock/test_radhydro_shock.cpp b/src/RadhydroShock/test_radhydro_shock.cpp index a518618e0..99a9ce487 100644 --- a/src/RadhydroShock/test_radhydro_shock.cpp +++ b/src/RadhydroShock/test_radhydro_shock.cpp @@ -65,7 +65,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 3230a6562..9cfef29de 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -25,7 +25,7 @@ struct ShockProblem { constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 constexpr double k_B = C::k_B; // erg K^-1 -constexpr double m_H = quokka::hydrogen_mass_cgs; // mass of hydrogen atom [g] +constexpr double m_H = C::m_u; // atomic mass unit // constexpr double P0 = 1.0e-4; // equal to P_0 in dimensionless units // constexpr double sigma_a = 1.0e6; // absorption cross section @@ -68,7 +68,7 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double hydrogen_mass_code_units = 1.0 / C::n_A; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/RayleighTaylor2D/test_hydro2d_rt.cpp b/src/RayleighTaylor2D/test_hydro2d_rt.cpp index db56d8831..02e6450e6 100644 --- a/src/RayleighTaylor2D/test_hydro2d_rt.cpp +++ b/src/RayleighTaylor2D/test_hydro2d_rt.cpp @@ -25,8 +25,8 @@ struct RTProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/RayleighTaylor3D/test_hydro3d_rt.cpp b/src/RayleighTaylor3D/test_hydro3d_rt.cpp index 97599b55d..5dba55e03 100644 --- a/src/RayleighTaylor3D/test_hydro3d_rt.cpp +++ b/src/RayleighTaylor3D/test_hydro3d_rt.cpp @@ -24,9 +24,9 @@ struct RTProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; - static constexpr double mean_molecular_weight = quokka::hydrogen_mass_cgs; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double mean_molecular_weight = C::m_U; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/SphericalCollapse/spherical_collapse.cpp b/src/SphericalCollapse/spherical_collapse.cpp index 3087596eb..8671eeef1 100644 --- a/src/SphericalCollapse/spherical_collapse.cpp +++ b/src/SphericalCollapse/spherical_collapse.cpp @@ -29,8 +29,8 @@ struct CollapseProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double hydrogen_mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { From e65dcafd4c7dbd71fce5638c073e9dab88b7a2d5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 13:31:48 +0000 Subject: [PATCH 52/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/ODEIntegration/test_ode.cpp | 2 +- src/RadForce/test_radiation_force.cpp | 8 ++++---- src/RadTube/test_radiation_tube.cpp | 2 +- src/RadhydroShell/test_radhydro_shell.cpp | 12 ++++++------ src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index 198d0608e..c1a6b228c 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -14,7 +14,7 @@ using amrex::Real; -constexpr double Tgas0 = 6000.; // K +constexpr double Tgas0 = 6000.; // K constexpr double rho0 = 0.01 * C::m_u; // g cm^-3 template <> struct quokka::EOS_Traits { diff --git a/src/RadForce/test_radiation_force.cpp b/src/RadForce/test_radiation_force.cpp index 94095d5c5..c9aa14ebc 100644 --- a/src/RadForce/test_radiation_force.cpp +++ b/src/RadForce/test_radiation_force.cpp @@ -28,11 +28,11 @@ struct TubeProblem { }; -constexpr double kappa0 = 5.0; // cm^2 g^-1 +constexpr double kappa0 = 5.0; // cm^2 g^-1 constexpr double mu = 2.33 * C::m_u; // g -constexpr double gamma_gas = 1.0; // isothermal gas EOS -constexpr double a0 = 0.2e5; // cm s^-1 -constexpr double tau = 1.0e-6; // optical depth (dimensionless) +constexpr double gamma_gas = 1.0; // isothermal gas EOS +constexpr double a0 = 0.2e5; // cm s^-1 +constexpr double tau = 1.0e-6; // optical depth (dimensionless) constexpr double rho0 = 1.0e5 * mu; // g cm^-3 constexpr double Mach0 = 1.1; // Mach number at wind base diff --git a/src/RadTube/test_radiation_tube.cpp b/src/RadTube/test_radiation_tube.cpp index f3a9121ca..1f9ee1d67 100644 --- a/src/RadTube/test_radiation_tube.cpp +++ b/src/RadTube/test_radiation_tube.cpp @@ -25,7 +25,7 @@ struct TubeProblem { }; -constexpr double kappa0 = 100.; // cm^2 g^-1 +constexpr double kappa0 = 100.; // cm^2 g^-1 constexpr double mu = 2.33 * C::m_u; // g constexpr double gamma_gas = 5. / 3.; diff --git a/src/RadhydroShell/test_radhydro_shell.cpp b/src/RadhydroShell/test_radhydro_shell.cpp index fbcaf9ac5..12f51d4d4 100644 --- a/src/RadhydroShell/test_radhydro_shell.cpp +++ b/src/RadhydroShell/test_radhydro_shell.cpp @@ -36,12 +36,12 @@ struct ShellProblem { // if false, use octant symmetry constexpr bool simulate_full_box = true; -constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 -constexpr double c = 2.99792458e10; // cm s^-1 -constexpr double a0 = 2.0e5; // ('reference' sound speed) [cm s^-1] -constexpr double chat = 860. * a0; // cm s^-1 -constexpr double k_B = C::k_B; // erg K^-1 -constexpr double m_H = C::m_u; // atomic mass unit +constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 +constexpr double c = 2.99792458e10; // cm s^-1 +constexpr double a0 = 2.0e5; // ('reference' sound speed) [cm s^-1] +constexpr double chat = 860. * a0; // cm s^-1 +constexpr double k_B = C::k_B; // erg K^-1 +constexpr double m_H = C::m_u; // atomic mass unit constexpr double gamma_gas = 5. / 3.; template <> struct quokka::EOS_Traits { diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 9cfef29de..94f3858de 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -22,10 +22,10 @@ struct ShockProblem { // parameters taken from Section 9.5 of Skinner et al. (2019) // [The Astrophysical Journal Supplement Series, 241:7 (27pp), 2019 March] -constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 -constexpr double c = 2.99792458e10; // cm s^-1 -constexpr double k_B = C::k_B; // erg K^-1 -constexpr double m_H = C::m_u; // atomic mass unit +constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 +constexpr double c = 2.99792458e10; // cm s^-1 +constexpr double k_B = C::k_B; // erg K^-1 +constexpr double m_H = C::m_u; // atomic mass unit // constexpr double P0 = 1.0e-4; // equal to P_0 in dimensionless units // constexpr double sigma_a = 1.0e6; // absorption cross section From 1cdc0d8e026969816b8fb152778c0e3818cbc124 Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 18:57:13 +0200 Subject: [PATCH 53/66] revert to hydrogen mass --- src/CloudyCooling.hpp | 8 ++++---- src/ODEIntegration/test_ode.cpp | 4 ++-- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/CloudyCooling.hpp b/src/CloudyCooling.hpp index 7473e5d1d..6eac60208 100644 --- a/src/CloudyCooling.hpp +++ b/src/CloudyCooling.hpp @@ -81,7 +81,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cloudy_cooling_function(Real const { // interpolate cooling rates from Cloudy tables const Real rhoH = rho * cloudy_H_mass_fraction; // mass density of H species - const Real nH = rhoH / C::m_u; + const Real nH = rhoH / (C::m_p + C::m_e); const Real log_nH = std::log10(nH); const Real log_T = std::log10(T); @@ -102,7 +102,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cloudy_cooling_function(Real const // compute electron density // N.B. it is absolutely critical to include the metal contribution here! - double n_e = (rho / C::m_u) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / C::m_u)); + double n_e = (rho / (C::m_p + C::m_e)) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / (C::m_p + C::m_e))); // the approximation for the metals contribution to e- fails at high densities (~1e3 or higher) n_e = std::max(n_e, 1.0e-4 * nH); @@ -129,7 +129,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeEgasFromTgas(double rho, do { // convert Egas (internal gas energy) to temperature const Real rhoH = rho * cloudy_H_mass_fraction; - const Real nH = rhoH / C::m_u; + const Real nH = rhoH / (C::m_p + C::m_e); // compute mu from mu(T) table const Real mu = interpolate2d(std::log10(nH), std::log10(Tgas), tables.log_nH, tables.log_Tgas, tables.meanMolWeight); @@ -157,7 +157,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeTgasFromEgas(double rho, do // solve for temperature given Eint (with fixed adiabatic index gamma) const Real rhoH = rho * cloudy_H_mass_fraction; - const Real nH = rhoH / C::m_u; + const Real nH = rhoH / (C::m_p + C::m_e); const Real log_nH = std::log10(nH); // mean molecular weight (in Grackle tables) is defined w/r/t diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index c1a6b228c..c94e61f12 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -15,7 +15,7 @@ using amrex::Real; constexpr double Tgas0 = 6000.; // K -constexpr double rho0 = 0.01 * C::m_u; // g cm^-3 +constexpr double rho0 = 0.01 * (C::m_p + C::m_e); // g cm^-3 template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_u; @@ -33,7 +33,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto cooling_function(Real const rho, R // use fitting function from Koyama & Inutsuka (2002) Real gamma_heat = 2.0e-26; Real lambda_cool = gamma_heat * (1.0e7 * std::exp(-114800. / (T + 1000.)) + 14. * std::sqrt(T) * std::exp(-92. / T)); - Real rho_over_mh = rho / C::m_u; + Real rho_over_mh = rho / (C::m_p + C::m_e); Real cooling_source_term = rho_over_mh * gamma_heat - (rho_over_mh * rho_over_mh) * lambda_cool; return cooling_source_term; } diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 94f3858de..d1a692ab4 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -25,7 +25,6 @@ struct ShockProblem { constexpr double a_rad = 7.5646e-15; // erg cm^-3 K^-4 constexpr double c = 2.99792458e10; // cm s^-1 constexpr double k_B = C::k_B; // erg K^-1 -constexpr double m_H = C::m_u; // atomic mass unit // constexpr double P0 = 1.0e-4; // equal to P_0 in dimensionless units // constexpr double sigma_a = 1.0e6; // absorption cross section @@ -34,7 +33,7 @@ constexpr double c_s0 = 1.73e7; // adiabatic sound speed [cm s^-1] constexpr double kappa = 577.0; // "opacity" == rho*kappa [cm^-1] (!!) constexpr double gamma_gas = (5. / 3.); -constexpr double mu = m_H; // mean molecular weight [grams] +constexpr double mu = C::m_u; // mean molecular weight [grams] constexpr double c_v = k_B / (mu * (gamma_gas - 1.0)); // specific heat [erg g^-1 K^-1] constexpr double T0 = 2.18e6; // K @@ -65,7 +64,7 @@ template <> struct RadSystem_Traits { }; template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = m_H; + static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; static constexpr double mass_code_units = C::m_u; From 2335402396d1de29f15acae388463cd4180613af Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:59:45 +0000 Subject: [PATCH 54/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/ODEIntegration/test_ode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index c94e61f12..da75d3fda 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -14,7 +14,7 @@ using amrex::Real; -constexpr double Tgas0 = 6000.; // K +constexpr double Tgas0 = 6000.; // K constexpr double rho0 = 0.01 * (C::m_p + C::m_e); // g cm^-3 template <> struct quokka::EOS_Traits { From 7a5749f3399d12d747c47ce9c75e0bc55721d56c Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 19:05:30 +0200 Subject: [PATCH 55/66] revert to hydrogen mass --- src/CloudyCooling.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CloudyCooling.hpp b/src/CloudyCooling.hpp index 6eac60208..ae5aca447 100644 --- a/src/CloudyCooling.hpp +++ b/src/CloudyCooling.hpp @@ -135,7 +135,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeEgasFromTgas(double rho, do const Real mu = interpolate2d(std::log10(nH), std::log10(Tgas), tables.log_nH, tables.log_Tgas, tables.meanMolWeight); // compute thermal gas energy - const Real Egas = (rho / (C::m_u * mu)) * C::k_B * Tgas / (gamma - 1.); + const Real Egas = (rho / ((C::m_p + C::m_e) * mu)) * C::k_B * Tgas / (gamma - 1.); return Egas; } @@ -162,7 +162,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto ComputeTgasFromEgas(double rho, do // mean molecular weight (in Grackle tables) is defined w/r/t // hydrogen_mass_cgs_ - const Real C = (gamma - 1.) * Egas / (C::k_B * (rho / C::m_u)); + const Real C = (gamma - 1.) * Egas / (C::k_B * (rho / (C::m_p + C::m_e))); // solve for mu(T)*C == T. // (Grackle does this with a fixed-point iteration. We use a more robust From ff5fb519e2bf28b6f1355ff5d37a94dd7497ea97 Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 19:07:34 +0200 Subject: [PATCH 56/66] use amu --- src/ShockCloud/cloud.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ShockCloud/cloud.cpp b/src/ShockCloud/cloud.cpp index 1b81e075b..244fcbe56 100644 --- a/src/ShockCloud/cloud.cpp +++ b/src/ShockCloud/cloud.cpp @@ -35,14 +35,13 @@ using amrex::Real; struct ShockCloud { }; // dummy type to allow compile-type polymorphism via template specialization -constexpr double m_H = quokka::hydrogen_mass_cgs; constexpr double seconds_in_year = 3.154e7; template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; // default value static constexpr double mean_molecular_weight = NAN; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; - static constexpr double hydrogen_mass_code_units = quokka::hydrogen_mass_cgs; + static constexpr double boltzmann_constant = C::k_B; + static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { @@ -66,9 +65,9 @@ constexpr Real nH1 = 1.0e-1; // cm^-3 constexpr Real R_cloud = 5.0 * 3.086e18; // cm [5 pc] constexpr Real M0 = 2.0; // Mach number of shock -constexpr Real P0 = nH0 * Tgas0 * quokka::boltzmann_constant_cgs; // erg cm^-3 -constexpr Real rho0 = nH0 * m_H; // g cm^-3 -constexpr Real rho1 = nH1 * m_H; +constexpr Real P0 = nH0 * Tgas0 * C::k_B; // erg cm^-3 +constexpr Real rho0 = nH0 * (C::m_p + C::m_e); // g cm^-3 +constexpr Real rho1 = nH1 * (C::m_p + C::m_e); // perturbation parameters const int kmin = 0; From c928b738fdcc163d32b8a5f2f7cfc020bbfebbb1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 17:07:47 +0000 Subject: [PATCH 57/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/ShockCloud/cloud.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ShockCloud/cloud.cpp b/src/ShockCloud/cloud.cpp index 244fcbe56..29066d880 100644 --- a/src/ShockCloud/cloud.cpp +++ b/src/ShockCloud/cloud.cpp @@ -65,8 +65,8 @@ constexpr Real nH1 = 1.0e-1; // cm^-3 constexpr Real R_cloud = 5.0 * 3.086e18; // cm [5 pc] constexpr Real M0 = 2.0; // Mach number of shock -constexpr Real P0 = nH0 * Tgas0 * C::k_B; // erg cm^-3 -constexpr Real rho0 = nH0 * (C::m_p + C::m_e); // g cm^-3 +constexpr Real P0 = nH0 * Tgas0 * C::k_B; // erg cm^-3 +constexpr Real rho0 = nH0 * (C::m_p + C::m_e); // g cm^-3 constexpr Real rho1 = nH1 * (C::m_p + C::m_e); // perturbation parameters From 5b70e5110542944f2e49315b635d0b65445acc50 Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 19:08:26 +0200 Subject: [PATCH 58/66] use amu --- src/SphericalCollapse/spherical_collapse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SphericalCollapse/spherical_collapse.cpp b/src/SphericalCollapse/spherical_collapse.cpp index 8671eeef1..c2d7900f9 100644 --- a/src/SphericalCollapse/spherical_collapse.cpp +++ b/src/SphericalCollapse/spherical_collapse.cpp @@ -30,7 +30,7 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double hydrogen_mass_code_units = C::m_u; + static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { From 2012264d68da60ef10e7001a347508ca4fc1e17b Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 22:08:58 +0200 Subject: [PATCH 59/66] revert to hydrogen mass --- src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index d1a692ab4..1d7c2a19e 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -33,8 +33,7 @@ constexpr double c_s0 = 1.73e7; // adiabatic sound speed [cm s^-1] constexpr double kappa = 577.0; // "opacity" == rho*kappa [cm^-1] (!!) constexpr double gamma_gas = (5. / 3.); -constexpr double mu = C::m_u; // mean molecular weight [grams] -constexpr double c_v = k_B / (mu * (gamma_gas - 1.0)); // specific heat [erg g^-1 K^-1] +constexpr double c_v = k_B / ((C::m_p + C::m_e) * (gamma_gas - 1.0)); // specific heat [erg g^-1 K^-1] constexpr double T0 = 2.18e6; // K constexpr double rho0 = 5.69; // g cm^-3 @@ -64,7 +63,7 @@ template <> struct RadSystem_Traits { }; template <> struct quokka::EOS_Traits { - static constexpr double mean_molecular_weight = C::m_u; + static constexpr double mean_molecular_weight = C::m_p + C::m_e; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; static constexpr double mass_code_units = C::m_u; From 63ed9d553c5c3462f6c3cf646aa901df34c38149 Mon Sep 17 00:00:00 2001 From: psharda Date: Mon, 24 Jul 2023 23:51:05 +0200 Subject: [PATCH 60/66] changed EOS functions to use microphysics --- src/EOS.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index acc045f10..f3318e559 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -129,8 +129,14 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromTga Eint = chemstate.e * chemstate.rho; #else if constexpr (gamma_ != 1.0) { - const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - Eint = rho * c_v * Tgas; + // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + // Eint = rho * c_v * Tgas; + chem_eos_t estate; + estate.rho = rho; + estate.T = Tgas; + estate.mu = mean_molecular_weight_ / mass_code_units_; + eos(eos_input_rt, estate); + Eint = estate.e * rho * boltzmann_constant_ / C::k_B; } #endif return Eint; @@ -138,7 +144,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromTga template AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto -EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Real /*Tgas*/, +EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Real Tgas, const std::optional> massScalars) -> amrex::Real { // compute derivative of internal energy w/r/t temperature @@ -165,8 +171,14 @@ EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Re dEint_dT = chemstate.dedT * chemstate.rho; #else if constexpr (gamma_ != 1.0) { - const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - dEint_dT = rho * c_v; + // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); + // dEint_dT = rho * c_v; + chem_eos_t estate; + estate.rho = rho; + estate.T = Tgas; + estate.mu = mean_molecular_weight_ / mass_code_units_; + eos(eos_input_rt, estate); + dEint_dT = estate.dedT * rho; } #endif return dEint_dT; From 58d27e73c265ea24dedfc9e325d0b27c848b9ae5 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 25 Jul 2023 09:32:22 +0200 Subject: [PATCH 61/66] scaled dedT by kB --- src/EOS.hpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index f3318e559..d642f0364 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -85,8 +85,6 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin Tgas = chemstate.T; #else if constexpr (gamma_ != 1.0) { - // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - // Tgas = Eint / (rho * c_v); chem_eos_t estate; estate.rho = rho; estate.e = Eint / rho; @@ -129,8 +127,6 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromTga Eint = chemstate.e * chemstate.rho; #else if constexpr (gamma_ != 1.0) { - // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - // Eint = rho * c_v * Tgas; chem_eos_t estate; estate.rho = rho; estate.T = Tgas; @@ -171,14 +167,12 @@ EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Re dEint_dT = chemstate.dedT * chemstate.rho; #else if constexpr (gamma_ != 1.0) { - // const amrex::Real c_v = boltzmann_constant_ / (mean_molecular_weight_ * (gamma_ - 1.0)); - // dEint_dT = rho * c_v; chem_eos_t estate; estate.rho = rho; estate.T = Tgas; estate.mu = mean_molecular_weight_ / mass_code_units_; eos(eos_input_rt, estate); - dEint_dT = estate.dedT * rho; + dEint_dT = estate.dedT * rho * boltzmann_constant_ / C::k_B; } #endif return dEint_dT; From 9f60a170fef4983b207a9d6c25a8c835032cf340 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 25 Jul 2023 11:24:31 +0200 Subject: [PATCH 62/66] fixed bug --- src/RadBeam/test_radiation_beam.cpp | 2 +- src/RayleighTaylor3D/test_hydro3d_rt.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RadBeam/test_radiation_beam.cpp b/src/RadBeam/test_radiation_beam.cpp index 20aab6296..53908f0be 100644 --- a/src/RadBeam/test_radiation_beam.cpp +++ b/src/RadBeam/test_radiation_beam.cpp @@ -34,7 +34,7 @@ constexpr double c = 2.99792458e10; // cm s^-1 template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_u; - static constexpr double boltzmann_constant = quokka::boltzmann_constant_cgs; + static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; static constexpr double mass_code_units = C::m_u; }; diff --git a/src/RayleighTaylor3D/test_hydro3d_rt.cpp b/src/RayleighTaylor3D/test_hydro3d_rt.cpp index 5dba55e03..2e63cb1b9 100644 --- a/src/RayleighTaylor3D/test_hydro3d_rt.cpp +++ b/src/RayleighTaylor3D/test_hydro3d_rt.cpp @@ -24,7 +24,7 @@ struct RTProblem { template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; - static constexpr double mean_molecular_weight = C::m_U; + static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double mass_code_units = C::m_u; }; From 99ec5f7c1ee98fdbb57a372ca969cd4ec73b7430 Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 25 Jul 2023 12:37:37 +0200 Subject: [PATCH 63/66] fixed bugs --- src/Cooling/test_cooling.cpp | 2 +- src/ShockCloud/test_cloudy.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cooling/test_cooling.cpp b/src/Cooling/test_cooling.cpp index 86690a21d..58678c55d 100644 --- a/src/Cooling/test_cooling.cpp +++ b/src/Cooling/test_cooling.cpp @@ -132,7 +132,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quo Real xmom = 0; Real ymom = 0; Real zmom = 0; - Real const P = 4.0e4 * quokka::boltzmann_constant_cgs; // erg cm^-3 + Real const P = 4.0e4 * C::k_B; // erg cm^-3 Real Eint = (quokka::EOS_Traits::gamma - 1.) * P; Real const Egas = RadSystem::ComputeEgasFromEint(rho, xmom, ymom, zmom, Eint); diff --git a/src/ShockCloud/test_cloudy.cpp b/src/ShockCloud/test_cloudy.cpp index 2ce6560bc..2f28f64a5 100644 --- a/src/ShockCloud/test_cloudy.cpp +++ b/src/ShockCloud/test_cloudy.cpp @@ -50,15 +50,15 @@ auto problem_main() -> int const Real T = ComputeTgasFromEgas(rho, Eint, quokka::EOS_Traits::gamma, tables); const Real rhoH = rho * cloudy_H_mass_fraction; - const Real nH = rhoH / quokka::hydrogen_mass_cgs; + const Real nH = rhoH / (C::m_p + C::m_e); const Real log_nH = std::log10(nH); - const Real C = (quokka::EOS_Traits::gamma - 1.) * Eint / (quokka::boltzmann_constant_cgs * (rho / quokka::hydrogen_mass_cgs)); + const Real C = (quokka::EOS_Traits::gamma - 1.) * Eint / (C::k_B * (rho / (C::m_p + C::m_e))); const Real mu = interpolate2d(log_nH, std::log10(T), tables.log_nH, tables.log_Tgas, tables.meanMolWeight); const Real relerr = std::abs((C * mu - T) / T); const Real n_e = - (rho / quokka::hydrogen_mass_cgs) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / quokka::hydrogen_mass_cgs)); + (rho / (C::m_p + C::m_e)) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / (C::m_p + C::m_e))); printf("\nrho = %.17e, Eint = %.17e, mu = %f, Tgas = %e, relerr = %e\n", rho, Eint, mu, T, relerr); printf("n_e = %e, n_e/n_H = %e\n", n_e, n_e / nH); From 9ce8fb723a696474f7a1b51796b61f420536074a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 10:38:47 +0000 Subject: [PATCH 64/66] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/ShockCloud/test_cloudy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ShockCloud/test_cloudy.cpp b/src/ShockCloud/test_cloudy.cpp index 2f28f64a5..336f8f095 100644 --- a/src/ShockCloud/test_cloudy.cpp +++ b/src/ShockCloud/test_cloudy.cpp @@ -57,8 +57,7 @@ auto problem_main() -> int const Real mu = interpolate2d(log_nH, std::log10(T), tables.log_nH, tables.log_Tgas, tables.meanMolWeight); const Real relerr = std::abs((C * mu - T) / T); - const Real n_e = - (rho / (C::m_p + C::m_e)) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / (C::m_p + C::m_e))); + const Real n_e = (rho / (C::m_p + C::m_e)) * (1.0 - mu * (X + Y / 4. + Z / mean_metals_A)) / (mu - (electron_mass_cgs / (C::m_p + C::m_e))); printf("\nrho = %.17e, Eint = %.17e, mu = %f, Tgas = %e, relerr = %e\n", rho, Eint, mu, T, relerr); printf("n_e = %e, n_e/n_H = %e\n", n_e, n_e / nH); From 852ee123434bc78f7321ec52ed4aaf0c3fd8ad4d Mon Sep 17 00:00:00 2001 From: psharda Date: Tue, 25 Jul 2023 15:12:43 +0200 Subject: [PATCH 65/66] remove mass_code_units --- src/EOS.hpp | 8 +++----- src/FCQuantities/test_fc_quantities.cpp | 1 - src/HydroBlast2D/test_hydro2d_blast.cpp | 1 - src/HydroBlast3D/test_hydro3d_blast.cpp | 1 - src/HydroContact/test_hydro_contact.cpp | 1 - src/HydroHighMach/test_hydro_highmach.cpp | 1 - src/HydroKelvinHelmholz/test_hydro2d_kh.cpp | 1 - src/HydroLeblanc/test_hydro_leblanc.cpp | 1 - src/HydroQuirk/test_quirk.cpp | 1 - src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp | 1 - src/HydroSMS/test_hydro_sms.cpp | 1 - src/HydroShocktube/test_hydro_shocktube.cpp | 1 - src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp | 1 - src/HydroShuOsher/test_hydro_shuosher.cpp | 1 - src/HydroVacuum/test_hydro_vacuum.cpp | 1 - src/HydroWave/test_hydro_wave.cpp | 1 - src/ODEIntegration/test_ode.cpp | 1 - src/PassiveScalar/test_scalars.cpp | 1 - src/RadBeam/test_radiation_beam.cpp | 1 - src/RadForce/test_radiation_force.cpp | 1 - src/RadMarshak/test_radiation_marshak.cpp | 1 - .../test_radiation_marshak_asymptotic.cpp | 1 - src/RadMarshakCGS/test_radiation_marshak_cgs.cpp | 1 - src/RadMatterCoupling/test_radiation_matter_coupling.cpp | 1 - .../test_radiation_matter_coupling_rsla.cpp | 1 - src/RadPulse/test_radiation_pulse.cpp | 1 - src/RadShadow/test_radiation_shadow.cpp | 1 - src/RadStreaming/test_radiation_streaming.cpp | 1 - src/RadTophat/test_radiation_tophat.cpp | 1 - src/RadTube/test_radiation_tube.cpp | 1 - src/RadhydroShell/test_radhydro_shell.cpp | 1 - src/RadhydroShock/test_radhydro_shock.cpp | 1 - src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp | 1 - src/RayleighTaylor2D/test_hydro2d_rt.cpp | 1 - src/RayleighTaylor3D/test_hydro3d_rt.cpp | 1 - src/ShockCloud/cloud.cpp | 1 - src/SphericalCollapse/spherical_collapse.cpp | 1 - 37 files changed, 3 insertions(+), 41 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index d642f0364..7dbf8f75d 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -34,7 +34,6 @@ template struct EOS_Traits { static constexpr double cs_isothermal = NAN; // only used when gamma = 1 static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template class EOS @@ -54,7 +53,6 @@ template class EOS static constexpr amrex::Real gamma_ = EOS_Traits::gamma; static constexpr amrex::Real boltzmann_constant_ = EOS_Traits::boltzmann_constant; static constexpr amrex::Real mean_molecular_weight_ = EOS_Traits::mean_molecular_weight; - static constexpr amrex::Real mass_code_units_ = EOS_Traits::mass_code_units; }; template @@ -88,7 +86,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeTgasFromEin chem_eos_t estate; estate.rho = rho; estate.e = Eint / rho; - estate.mu = mean_molecular_weight_ / mass_code_units_; + estate.mu = mean_molecular_weight_ / C::m_u; eos(eos_input_re, estate); // scale returned temperature in case boltzmann constant is dimensionless Tgas = estate.T * C::k_B / boltzmann_constant_; @@ -130,7 +128,7 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromTga chem_eos_t estate; estate.rho = rho; estate.T = Tgas; - estate.mu = mean_molecular_weight_ / mass_code_units_; + estate.mu = mean_molecular_weight_ / C::m_u; eos(eos_input_rt, estate); Eint = estate.e * rho * boltzmann_constant_ / C::k_B; } @@ -170,7 +168,7 @@ EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Re chem_eos_t estate; estate.rho = rho; estate.T = Tgas; - estate.mu = mean_molecular_weight_ / mass_code_units_; + estate.mu = mean_molecular_weight_ / C::m_u; eos(eos_input_rt, estate); dEint_dT = estate.dedT * rho * boltzmann_constant_ / C::k_B; } diff --git a/src/FCQuantities/test_fc_quantities.cpp b/src/FCQuantities/test_fc_quantities.cpp index 669902d31..38291fe22 100644 --- a/src/FCQuantities/test_fc_quantities.cpp +++ b/src/FCQuantities/test_fc_quantities.cpp @@ -29,7 +29,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroBlast2D/test_hydro2d_blast.cpp b/src/HydroBlast2D/test_hydro2d_blast.cpp index bad9323a4..e8a3988e4 100644 --- a/src/HydroBlast2D/test_hydro2d_blast.cpp +++ b/src/HydroBlast2D/test_hydro2d_blast.cpp @@ -29,7 +29,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroBlast3D/test_hydro3d_blast.cpp b/src/HydroBlast3D/test_hydro3d_blast.cpp index 8a14bf0f6..9a5e698a6 100644 --- a/src/HydroBlast3D/test_hydro3d_blast.cpp +++ b/src/HydroBlast3D/test_hydro3d_blast.cpp @@ -36,7 +36,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroContact/test_hydro_contact.cpp b/src/HydroContact/test_hydro_contact.cpp index fd8414be8..5576b7af3 100644 --- a/src/HydroContact/test_hydro_contact.cpp +++ b/src/HydroContact/test_hydro_contact.cpp @@ -25,7 +25,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroHighMach/test_hydro_highmach.cpp b/src/HydroHighMach/test_hydro_highmach.cpp index 4ee7af891..82075656a 100644 --- a/src/HydroHighMach/test_hydro_highmach.cpp +++ b/src/HydroHighMach/test_hydro_highmach.cpp @@ -32,7 +32,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp b/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp index 793b1de38..f561fe6f4 100644 --- a/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp +++ b/src/HydroKelvinHelmholz/test_hydro2d_kh.cpp @@ -26,7 +26,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroLeblanc/test_hydro_leblanc.cpp b/src/HydroLeblanc/test_hydro_leblanc.cpp index 21f772bc4..7a848bb98 100644 --- a/src/HydroLeblanc/test_hydro_leblanc.cpp +++ b/src/HydroLeblanc/test_hydro_leblanc.cpp @@ -32,7 +32,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = (5. / 3.); static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroQuirk/test_quirk.cpp b/src/HydroQuirk/test_quirk.cpp index 9e77087da..7ba3ac4b0 100644 --- a/src/HydroQuirk/test_quirk.cpp +++ b/src/HydroQuirk/test_quirk.cpp @@ -45,7 +45,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp b/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp index 2ff34a2f2..05b1e5ae6 100644 --- a/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp +++ b/src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp @@ -25,7 +25,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/HydroSMS/test_hydro_sms.cpp b/src/HydroSMS/test_hydro_sms.cpp index 9e8b8626a..ecfe6e42d 100644 --- a/src/HydroSMS/test_hydro_sms.cpp +++ b/src/HydroSMS/test_hydro_sms.cpp @@ -25,7 +25,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroShocktube/test_hydro_shocktube.cpp b/src/HydroShocktube/test_hydro_shocktube.cpp index 6eb3bf5b0..a1e6036f2 100644 --- a/src/HydroShocktube/test_hydro_shocktube.cpp +++ b/src/HydroShocktube/test_hydro_shocktube.cpp @@ -30,7 +30,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp b/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp index 803c89455..fa7f921f1 100644 --- a/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp +++ b/src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp @@ -35,7 +35,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroShuOsher/test_hydro_shuosher.cpp b/src/HydroShuOsher/test_hydro_shuosher.cpp index 93a4900a8..3ce5b26c5 100644 --- a/src/HydroShuOsher/test_hydro_shuosher.cpp +++ b/src/HydroShuOsher/test_hydro_shuosher.cpp @@ -27,7 +27,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroVacuum/test_hydro_vacuum.cpp b/src/HydroVacuum/test_hydro_vacuum.cpp index 822084e60..42b8fcf99 100644 --- a/src/HydroVacuum/test_hydro_vacuum.cpp +++ b/src/HydroVacuum/test_hydro_vacuum.cpp @@ -29,7 +29,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/HydroWave/test_hydro_wave.cpp b/src/HydroWave/test_hydro_wave.cpp index d4ddc8be1..a69cb1329 100644 --- a/src/HydroWave/test_hydro_wave.cpp +++ b/src/HydroWave/test_hydro_wave.cpp @@ -25,7 +25,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/ODEIntegration/test_ode.cpp b/src/ODEIntegration/test_ode.cpp index da75d3fda..e5841b4b2 100644 --- a/src/ODEIntegration/test_ode.cpp +++ b/src/ODEIntegration/test_ode.cpp @@ -21,7 +21,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; struct ODEUserData { diff --git a/src/PassiveScalar/test_scalars.cpp b/src/PassiveScalar/test_scalars.cpp index 325eec117..7f52c9859 100644 --- a/src/PassiveScalar/test_scalars.cpp +++ b/src/PassiveScalar/test_scalars.cpp @@ -27,7 +27,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/RadBeam/test_radiation_beam.cpp b/src/RadBeam/test_radiation_beam.cpp index 53908f0be..1f4a4adf2 100644 --- a/src/RadBeam/test_radiation_beam.cpp +++ b/src/RadBeam/test_radiation_beam.cpp @@ -36,7 +36,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadForce/test_radiation_force.cpp b/src/RadForce/test_radiation_force.cpp index c9aa14ebc..265e28146 100644 --- a/src/RadForce/test_radiation_force.cpp +++ b/src/RadForce/test_radiation_force.cpp @@ -48,7 +48,6 @@ template <> struct quokka::EOS_Traits { static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = gamma_gas; static constexpr double cs_isothermal = a0; // only used when gamma = 1 - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshak/test_radiation_marshak.cpp b/src/RadMarshak/test_radiation_marshak.cpp index 34113ff5b..c4f4ec104 100644 --- a/src/RadMarshak/test_radiation_marshak.cpp +++ b/src/RadMarshak/test_radiation_marshak.cpp @@ -34,7 +34,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp b/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp index 756858c55..9e99670ae 100644 --- a/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp +++ b/src/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp @@ -29,7 +29,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp b/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp index 2ca6d339b..39cdbf0ad 100644 --- a/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp +++ b/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp @@ -36,7 +36,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMatterCoupling/test_radiation_matter_coupling.cpp b/src/RadMatterCoupling/test_radiation_matter_coupling.cpp index 36a27893d..3e554b767 100644 --- a/src/RadMatterCoupling/test_radiation_matter_coupling.cpp +++ b/src/RadMatterCoupling/test_radiation_matter_coupling.cpp @@ -34,7 +34,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp b/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp index 8c33cd432..3c7f2e97c 100644 --- a/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp +++ b/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp @@ -36,7 +36,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_mass = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadPulse/test_radiation_pulse.cpp b/src/RadPulse/test_radiation_pulse.cpp index 6cdbf86ca..e51da1d32 100644 --- a/src/RadPulse/test_radiation_pulse.cpp +++ b/src/RadPulse/test_radiation_pulse.cpp @@ -31,7 +31,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = (2. / 3.); static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadShadow/test_radiation_shadow.cpp b/src/RadShadow/test_radiation_shadow.cpp index 37d60b60a..1d11cb5e9 100644 --- a/src/RadShadow/test_radiation_shadow.cpp +++ b/src/RadShadow/test_radiation_shadow.cpp @@ -37,7 +37,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 10. * C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadStreaming/test_radiation_streaming.cpp b/src/RadStreaming/test_radiation_streaming.cpp index 8ae3c62f9..156902dee 100644 --- a/src/RadStreaming/test_radiation_streaming.cpp +++ b/src/RadStreaming/test_radiation_streaming.cpp @@ -26,7 +26,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 1.0; static constexpr double boltzmann_constant = 1.0; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadTophat/test_radiation_tophat.cpp b/src/RadTophat/test_radiation_tophat.cpp index e97f782e1..5aae4dae4 100644 --- a/src/RadTophat/test_radiation_tophat.cpp +++ b/src/RadTophat/test_radiation_tophat.cpp @@ -41,7 +41,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = 5. / 3.; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadTube/test_radiation_tube.cpp b/src/RadTube/test_radiation_tube.cpp index 1f9ee1d67..13ddae128 100644 --- a/src/RadTube/test_radiation_tube.cpp +++ b/src/RadTube/test_radiation_tube.cpp @@ -40,7 +40,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = C::k_B; static constexpr double gamma = gamma_gas; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadhydroShell/test_radhydro_shell.cpp b/src/RadhydroShell/test_radhydro_shell.cpp index 12f51d4d4..80e8487ca 100644 --- a/src/RadhydroShell/test_radhydro_shell.cpp +++ b/src/RadhydroShell/test_radhydro_shell.cpp @@ -48,7 +48,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = 2.2 * m_H; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double mass_code_units = C::m_u; }; template <> struct RadSystem_Traits { diff --git a/src/RadhydroShock/test_radhydro_shock.cpp b/src/RadhydroShock/test_radhydro_shock.cpp index 99a9ce487..64ad5e96a 100644 --- a/src/RadhydroShock/test_radhydro_shock.cpp +++ b/src/RadhydroShock/test_radhydro_shock.cpp @@ -65,7 +65,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = mu; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 1d7c2a19e..cafce3c0e 100644 --- a/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -66,7 +66,6 @@ template <> struct quokka::EOS_Traits { static constexpr double mean_molecular_weight = C::m_p + C::m_e; static constexpr double boltzmann_constant = k_B; static constexpr double gamma = gamma_gas; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/RayleighTaylor2D/test_hydro2d_rt.cpp b/src/RayleighTaylor2D/test_hydro2d_rt.cpp index 02e6450e6..6255e9b8f 100644 --- a/src/RayleighTaylor2D/test_hydro2d_rt.cpp +++ b/src/RayleighTaylor2D/test_hydro2d_rt.cpp @@ -26,7 +26,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/RayleighTaylor3D/test_hydro3d_rt.cpp b/src/RayleighTaylor3D/test_hydro3d_rt.cpp index 2e63cb1b9..f05b814a3 100644 --- a/src/RayleighTaylor3D/test_hydro3d_rt.cpp +++ b/src/RayleighTaylor3D/test_hydro3d_rt.cpp @@ -26,7 +26,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 1.4; static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { diff --git a/src/ShockCloud/cloud.cpp b/src/ShockCloud/cloud.cpp index 29066d880..a60435dd9 100644 --- a/src/ShockCloud/cloud.cpp +++ b/src/ShockCloud/cloud.cpp @@ -41,7 +41,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; // default value static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits { diff --git a/src/SphericalCollapse/spherical_collapse.cpp b/src/SphericalCollapse/spherical_collapse.cpp index c2d7900f9..253f289b5 100644 --- a/src/SphericalCollapse/spherical_collapse.cpp +++ b/src/SphericalCollapse/spherical_collapse.cpp @@ -30,7 +30,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; static constexpr double mean_molecular_weight = NAN; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct HydroSystem_Traits { From 66d017cc5be42619a4b701d7b7e4f6a22948d461 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 26 Jul 2023 09:41:13 +0200 Subject: [PATCH 66/66] remove mass_code_units --- src/Cooling/test_cooling.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Cooling/test_cooling.cpp b/src/Cooling/test_cooling.cpp index 58678c55d..e88164691 100644 --- a/src/Cooling/test_cooling.cpp +++ b/src/Cooling/test_cooling.cpp @@ -37,7 +37,6 @@ template <> struct quokka::EOS_Traits { static constexpr double gamma = 5. / 3.; // default value static constexpr double mean_molecular_weight = C::m_u; static constexpr double boltzmann_constant = C::k_B; - static constexpr double mass_code_units = C::m_u; }; template <> struct Physics_Traits {