From 3ba77649e53565ea4695b908f14913a3fa0e24bd Mon Sep 17 00:00:00 2001 From: ChongChong He Date: Sun, 27 Oct 2024 21:21:11 +1100 Subject: [PATCH] move boltzmann_constant back to EOS_Traits --- src/QuokkaSimulation.hpp | 2 +- src/hydro/EOS.hpp | 2 +- src/physics_info.hpp | 1 - src/problems/RadhydroShock/test_radhydro_shock.cpp | 2 +- src/radiation/radiation_system.hpp | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/QuokkaSimulation.hpp b/src/QuokkaSimulation.hpp index 3e8018e2e..1061185d2 100644 --- a/src/QuokkaSimulation.hpp +++ b/src/QuokkaSimulation.hpp @@ -334,7 +334,7 @@ template void AMRSimulation::initializeSimulatio simulationMetadata_["unit_temperature"] = "undefined"; // constants - simulationMetadata_["k_B"] = Physics_Traits::boltzmann_constant; + simulationMetadata_["k_B"] = quokka::EOS_Traits::boltzmann_constant; simulationMetadata_["G"] = Physics_Traits::gravitational_constant; if constexpr (Physics_Traits::is_radiation_enabled) { simulationMetadata_["c"] = RadSystem_Traits::c_light; diff --git a/src/hydro/EOS.hpp b/src/hydro/EOS.hpp index b629a2b22..11f522b1b 100644 --- a/src/hydro/EOS.hpp +++ b/src/hydro/EOS.hpp @@ -73,7 +73,7 @@ template class EOS if constexpr (Physics_Traits::unit_system == UnitSystem::CGS) { return C::k_B; } else if constexpr (Physics_Traits::unit_system == UnitSystem::CONSTANTS) { - return Physics_Traits::boltzmann_constant; + return EOS_Traits::boltzmann_constant; } else if constexpr (Physics_Traits::unit_system == UnitSystem::CUSTOM) { // k_B / k_B_bar = u_l^2 * u_m / u_t^2 / u_T return C::k_B / diff --git a/src/physics_info.hpp b/src/physics_info.hpp index 2f880fdb0..c22ed8c98 100644 --- a/src/physics_info.hpp +++ b/src/physics_info.hpp @@ -19,7 +19,6 @@ template 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; diff --git a/src/problems/RadhydroShock/test_radhydro_shock.cpp b/src/problems/RadhydroShock/test_radhydro_shock.cpp index b1b001311..4c8addc6b 100644 --- a/src/problems/RadhydroShock/test_radhydro_shock.cpp +++ b/src/problems/RadhydroShock/test_radhydro_shock.cpp @@ -65,6 +65,7 @@ template <> struct RadSystem_Traits { 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; }; @@ -78,7 +79,6 @@ template <> 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::CONSTANTS; - static constexpr double boltzmann_constant = k_B; static constexpr double gravitational_constant = Ggrav; }; diff --git a/src/radiation/radiation_system.hpp b/src/radiation/radiation_system.hpp index 56fa3f5fd..bf1243520 100644 --- a/src/radiation/radiation_system.hpp +++ b/src/radiation/radiation_system.hpp @@ -261,7 +261,7 @@ template class RadSystem : public HyperbolicSystem::unit_system == UnitSystem::CGS) { return C::k_B; } else if constexpr (Physics_Traits::unit_system == UnitSystem::CONSTANTS) { - return Physics_Traits::boltzmann_constant; + return quokka::EOS_Traits::boltzmann_constant; } else if constexpr (Physics_Traits::unit_system == UnitSystem::CUSTOM) { // k_B / k_B_bar = u_l^2 * u_m / u_t^2 / u_T return C::k_B /