Skip to content

Commit

Permalink
move boltzmann_constant back to EOS_Traits
Browse files Browse the repository at this point in the history
  • Loading branch information
chongchonghe committed Oct 27, 2024
1 parent 25d6c44 commit 3ba7764
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/QuokkaSimulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ template <typename problem_t> void AMRSimulation<problem_t>::initializeSimulatio
simulationMetadata_["unit_temperature"] = "undefined";

// constants
simulationMetadata_["k_B"] = Physics_Traits<problem_t>::boltzmann_constant;
simulationMetadata_["k_B"] = quokka::EOS_Traits<problem_t>::boltzmann_constant;
simulationMetadata_["G"] = Physics_Traits<problem_t>::gravitational_constant;
if constexpr (Physics_Traits<problem_t>::is_radiation_enabled) {
simulationMetadata_["c"] = RadSystem_Traits<problem_t>::c_light;
Expand Down
2 changes: 1 addition & 1 deletion src/hydro/EOS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ template <typename problem_t> class EOS
if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CGS) {
return C::k_B;
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CONSTANTS) {
return Physics_Traits<problem_t>::boltzmann_constant;
return EOS_Traits<problem_t>::boltzmann_constant;
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CUSTOM) {
// k_B / k_B_bar = u_l^2 * u_m / u_t^2 / u_T
return C::k_B /
Expand Down
1 change: 0 additions & 1 deletion src/physics_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ template <typename problem_t> struct Physics_Traits {
static constexpr bool is_mhd_enabled = false;
static constexpr int nGroups = 1; // number of radiation groups
static constexpr UnitSystem unit_system = UnitSystem::CGS;
static constexpr double boltzmann_constant = C::k_B; // Hydro, EOS
static constexpr double gravitational_constant = C::Gconst; // gravity
static constexpr double unit_length = 1.0;
static constexpr double unit_mass = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion src/problems/RadhydroShock/test_radhydro_shock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ template <> struct RadSystem_Traits<ShockProblem> {

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;
};

Expand All @@ -78,7 +79,6 @@ template <> struct Physics_Traits<ShockProblem> {
static constexpr bool is_mhd_enabled = false;
static constexpr int nGroups = 1; // number of radiation groups
static constexpr UnitSystem unit_system = UnitSystem::CONSTANTS;
static constexpr double boltzmann_constant = k_B;
static constexpr double gravitational_constant = Ggrav;
};

Expand Down
2 changes: 1 addition & 1 deletion src/radiation/radiation_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ template <typename problem_t> class RadSystem : public HyperbolicSystem<problem_
if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CGS) {
return C::k_B;
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CONSTANTS) {
return Physics_Traits<problem_t>::boltzmann_constant;
return quokka::EOS_Traits<problem_t>::boltzmann_constant;
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CUSTOM) {
// k_B / k_B_bar = u_l^2 * u_m / u_t^2 / u_T
return C::k_B /
Expand Down

0 comments on commit 3ba7764

Please sign in to comment.