Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use microphysics EOS in Quokka's EOS.hpp for all quokka tests + use amu instead of hydrogen mass throughout Quokka #324

Merged
merged 74 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
20f630e
track branch from max
psharda Jun 6, 2023
360e567
Merge branch 'quokka-astro:development' into micro-max
psharda Jun 13, 2023
bfe6e05
enable two-EOS compilation
psharda Jun 13, 2023
2040e58
use ifdefs for primordial chem
psharda Jun 13, 2023
9c3c5c2
include actual eos data header
psharda Jun 13, 2023
ba1dadb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 13, 2023
de5ef24
updated microp
psharda Jun 13, 2023
4b8ba3c
updated microp
psharda Jun 13, 2023
ca15bbe
update microp
psharda Jun 14, 2023
d8f9120
updated microphysics
psharda Jun 14, 2023
6b1786c
use BEFORE keyword to set right priority of include dirs
psharda Jun 14, 2023
ad854ab
updated microp: remove gammalaw eos params from primordial chem eos
psharda Jun 14, 2023
8a33278
Merge branch 'quokka-astro:development' into micro-max
psharda Jun 15, 2023
e855760
Merge branch 'quokka-astro:development' into micro-max
psharda Jun 21, 2023
c988c19
updated microp
psharda Jun 21, 2023
da60ddc
include QuokkaObjSources
psharda Jun 21, 2023
9b5169b
updated microp
psharda Jun 21, 2023
8c50e09
remove de-linking quokkaobj lib
psharda Jun 21, 2023
8b18029
only build some tests
psharda Jun 21, 2023
358e2cd
reattached microp
psharda Jun 21, 2023
2135136
add QuokkaObjSources
psharda Jun 21, 2023
95e1744
build all tests
psharda Jun 21, 2023
df02fdb
Merge branch 'development' into micro-max
psharda Jun 21, 2023
8d20b48
Merge branch 'quokka-astro:development' into micro-max
psharda Jun 22, 2023
03f4f6f
use microp EOS for all tests
psharda Jun 22, 2023
811a077
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2023
b03c827
add gamma_law_sources to all tests
psharda Jun 22, 2023
7a5d80b
initializes Microphysics EOS
psharda Jun 22, 2023
7ce9928
initialize extern_params
psharda Jun 22, 2023
71233f4
use the new chem_eos_t struct
psharda Jun 22, 2023
b4439e2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2023
44e6300
updated microp
psharda Jun 27, 2023
7a872aa
updated microp
psharda Jun 27, 2023
6402f4e
added hydrogen_mass_code_units as an EOS_Trait
psharda Jun 27, 2023
7480a3c
removed EOS_traits
psharda Jun 27, 2023
4a6b40a
defined hydrogen_mass_code_units in EOS traits
psharda Jun 27, 2023
a544989
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
7d027d3
specify code units in EOS class
psharda Jun 27, 2023
a68c1cf
add code units
psharda Jun 27, 2023
40983b1
initialize EOS
psharda Jun 27, 2023
b110065
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
f7cbb25
corrected the name for mean_molecular_weight
psharda Jun 27, 2023
3ceb89e
Merge branch 'micro-max' of github.com:psharda/quokka into micro-max
psharda Jun 27, 2023
6c94d94
corrected code units
psharda Jun 27, 2023
4631866
corrected code units
psharda Jun 27, 2023
96d9d86
scale Tgas by k_B
psharda Jun 27, 2023
bee8c9c
use microphysics k_B
psharda Jun 27, 2023
b309e4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
7b6e6b0
corrected code units
psharda Jun 27, 2023
52eb94c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
ddeb814
code unit changed to 1/n_A
psharda Jun 27, 2023
dc6bceb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
1a54ffa
Merge branch 'quokka-astro:development' into micro-max
psharda Jul 23, 2023
9c63d01
updated microp
psharda Jul 23, 2023
379f970
use microp constant for hydrogen mass
psharda Jul 23, 2023
b13a540
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 23, 2023
dfef3f1
changed mass units
psharda Jul 23, 2023
607d203
use amu and k_B from microphysics instead of m_H and k_B in quokka
psharda Jul 24, 2023
e65dcaf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2023
1cdc0d8
revert to hydrogen mass
psharda Jul 24, 2023
2335402
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2023
7a5749f
revert to hydrogen mass
psharda Jul 24, 2023
ff5fb51
use amu
psharda Jul 24, 2023
c928b73
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2023
5b70e51
use amu
psharda Jul 24, 2023
f520195
Merge branch 'micro-max' of github.com:psharda/quokka into micro-max
psharda Jul 24, 2023
2012264
revert to hydrogen mass
psharda Jul 24, 2023
63ed9d5
changed EOS functions to use microphysics
psharda Jul 24, 2023
58d27e7
scaled dedT by kB
psharda Jul 25, 2023
9f60a17
fixed bug
psharda Jul 25, 2023
99ec5f7
fixed bugs
psharda Jul 25, 2023
9ce8fb7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2023
852ee12
remove mass_code_units
psharda Jul 25, 2023
66d017c
remove mass_code_units
psharda Jul 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
[submodule "extern/Microphysics"]
path = extern/Microphysics
url = https://github.com/psharda/Microphysics
branch = del-eos-comp
branch = development
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions src/Cooling/test_cooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ template <> struct quokka::EOS_Traits<CoolingTest> {
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<CoolingTest> {
Expand Down
14 changes: 12 additions & 2 deletions src/EOS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "AMReX_GpuQualifiers.H"
#include "AMReX_REAL.H"
#include "physics_info.hpp"
#include <AMReX_Print.H>

#include "burn_type.H"
#include "eos.H"
Expand All @@ -35,6 +36,7 @@ template <typename problem_t> 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;
psharda marked this conversation as resolved.
Show resolved Hide resolved
};

template <typename problem_t> class EOS
Expand Down Expand Up @@ -84,8 +86,16 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS<problem_t>::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 chemstate;
chemstate.rho = rho;
chemstate.e = Eint / rho;
chemstate.mu = mean_molecular_weight_ / hydrogen_mass_code_units;
psharda marked this conversation as resolved.
Show resolved Hide resolved
// 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
return Tgas;
Expand Down
1 change: 1 addition & 0 deletions src/FCQuantities/test_fc_quantities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits<FCQuantities> {
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<FCQuantities> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroBlast2D/test_hydro2d_blast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits<BlastProblem> {
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<BlastProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroBlast3D/test_hydro3d_blast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits<SedovProblem> {
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<SedovProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroContact/test_hydro_contact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits<ContactProblem> {
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<ContactProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroHighMach/test_hydro_highmach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ template <> struct quokka::EOS_Traits<HighMachProblem> {
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<HighMachProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroKelvinHelmholz/test_hydro2d_kh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits<KelvinHelmholzProblem> {
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<KelvinHelmholzProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroLeblanc/test_hydro_leblanc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ template <> struct quokka::EOS_Traits<ShocktubeProblem> {
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<ShocktubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroQuirk/test_quirk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ template <> struct quokka::EOS_Traits<QuirkProblem> {
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<QuirkProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits<RichtmeyerMeshkovProblem> {
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<RichtmeyerMeshkovProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroSMS/test_hydro_sms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits<ShocktubeProblem> {
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<ShocktubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroShocktube/test_hydro_shocktube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ template <> struct quokka::EOS_Traits<ShocktubeProblem> {
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<ShocktubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ template <> struct quokka::EOS_Traits<ShocktubeProblem> {
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<ShocktubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroShuOsher/test_hydro_shuosher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ template <> struct quokka::EOS_Traits<ShocktubeProblem> {
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<ShocktubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroVacuum/test_hydro_vacuum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits<ShocktubeProblem> {
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<ShocktubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/HydroWave/test_hydro_wave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ template <> struct quokka::EOS_Traits<WaveProblem> {
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<WaveProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/ODEIntegration/test_ode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ template <> struct quokka::EOS_Traits<ODETest> {
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 {
Expand Down
1 change: 1 addition & 0 deletions src/PassiveScalar/test_scalars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ template <> struct quokka::EOS_Traits<ScalarProblem> {
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<ScalarProblem> {
Expand Down
7 changes: 0 additions & 7 deletions src/PrimordialChem/test_primordial_chem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +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<PrimordialChemTest> {
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<PrimordialChemTest> {
// cell-centred
static constexpr bool is_hydro_enabled = true;
Expand Down
1 change: 1 addition & 0 deletions src/RadBeam/test_radiation_beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits<BeamProblem> {
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<BeamProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadForce/test_radiation_force.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ template <> struct quokka::EOS_Traits<TubeProblem> {
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<TubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadMarshak/test_radiation_marshak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ template <> struct quokka::EOS_Traits<SuOlsonProblem> {
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<SuOlsonProblem> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ template <> struct quokka::EOS_Traits<SuOlsonProblemCgs> {
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<SuOlsonProblemCgs> {
Expand Down
1 change: 1 addition & 0 deletions src/RadMarshakCGS/test_radiation_marshak_cgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits<SuOlsonProblemCgs> {
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<SuOlsonProblemCgs> {
Expand Down
1 change: 1 addition & 0 deletions src/RadMatterCoupling/test_radiation_matter_coupling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ template <> struct quokka::EOS_Traits<CouplingProblem> {
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<CouplingProblem> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ template <> struct quokka::EOS_Traits<CouplingProblem> {
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<CouplingProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadPulse/test_radiation_pulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ template <> struct quokka::EOS_Traits<PulseProblem> {
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;
psharda marked this conversation as resolved.
Show resolved Hide resolved
};

template <> struct RadSystem_Traits<PulseProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadShadow/test_radiation_shadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ template <> struct quokka::EOS_Traits<ShadowProblem> {
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<ShadowProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadTophat/test_radiation_tophat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ template <> struct quokka::EOS_Traits<TophatProblem> {
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<TophatProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadTube/test_radiation_tube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ template <> struct quokka::EOS_Traits<TubeProblem> {
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<TubeProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadhydroShell/test_radhydro_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ template <> struct quokka::EOS_Traits<ShellProblem> {
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<ShellProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadhydroShock/test_radhydro_shock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ template <> struct quokka::EOS_Traits<ShockProblem> {
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<ShockProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RadhydroShockCGS/test_radhydro_shock_cgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ template <> struct quokka::EOS_Traits<ShockProblem> {
static constexpr double mean_molecular_weight = m_H;
psharda marked this conversation as resolved.
Show resolved Hide resolved
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<ShockProblem> {
Expand Down
14 changes: 14 additions & 0 deletions src/RadhydroSimulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename problem_t> class RadhydroSimulation : public AMRSimulation<problem_t>
{
Expand Down Expand Up @@ -127,13 +129,25 @@ template <typename problem_t> class RadhydroSimulation : public AMRSimulation<pr
defineComponentNames();
// read in runtime parameters
readParmParse();
// initialize Microphysics params
init_extern_parameters();
// initialize Microphysics EOS
amrex::Real small_temp = 1e-10;
amrex::Real small_dens = 1e-100;
eos_init(small_temp, small_dens);
}

explicit RadhydroSimulation(amrex::Vector<amrex::BCRec> &BCs_cc) : AMRSimulation<problem_t>(BCs_cc)
{
defineComponentNames();
// read in runtime parameters
readParmParse();
// initialize Microphysics params
init_extern_parameters();
// initialize Microphysics EOS
amrex::Real small_temp = 1e-10;
amrex::Real small_dens = 1e-100;
eos_init(small_temp, small_dens);
}

[[nodiscard]] static auto getScalarVariableNames() -> std::vector<std::string>;
Expand Down
1 change: 1 addition & 0 deletions src/RayleighTaylor2D/test_hydro2d_rt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits<RTProblem> {
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<RTProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/RayleighTaylor3D/test_hydro3d_rt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ template <> struct quokka::EOS_Traits<RTProblem> {
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<RTProblem> {
Expand Down
1 change: 1 addition & 0 deletions src/ShockCloud/cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ template <> struct quokka::EOS_Traits<ShockCloud> {
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;
psharda marked this conversation as resolved.
Show resolved Hide resolved
};

template <> struct Physics_Traits<ShockCloud> {
Expand Down
1 change: 1 addition & 0 deletions src/SphericalCollapse/spherical_collapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ template <> struct quokka::EOS_Traits<CollapseProblem> {
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<CollapseProblem> {
Expand Down