From 1beaf57b7fb34d44b07a285cab611e2e68bcac11 Mon Sep 17 00:00:00 2001 From: Adam Dempsey Date: Sat, 18 Jan 2025 10:50:01 -0700 Subject: [PATCH] Unit system aware singularity eos --- src/gas/gas.cpp | 6 +++++- src/utils/eos/eos.hpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gas/gas.cpp b/src/gas/gas.cpp index ffbef0de..62ad27e9 100644 --- a/src/gas/gas.cpp +++ b/src/gas/gas.cpp @@ -113,7 +113,11 @@ std::shared_ptr Initialize(ParameterInput *pin, PARTHENON_REQUIRE(mu > 0, "Only positive mean molecular weight allowed!"); cv = constants.GetKBCode() / ((gamma - 1.) * constants.GetAMUCode() * mu); } - EOS eos_host = singularity::IdealGas(gamma - 1., cv); + EOS eos_host = singularity::UnitSystem( + singularity::IdealGas(gamma - 1., cv), + singularity::eos_units_init::LengthTimeUnitsInit(), units.GetTimeCodeToPhysical(), + units.GetMassCodeToPhysical(), units.GetLengthCodeToPhysical(), + units.GetTemperatureCodeToPhysical()); EOS eos_device = eos_host.GetOnDevice(); params.Add("eos_h", eos_host); params.Add("eos_d", eos_device); diff --git a/src/utils/eos/eos.hpp b/src/utils/eos/eos.hpp index 85f5b8e2..d1703fab 100644 --- a/src/utils/eos/eos.hpp +++ b/src/utils/eos/eos.hpp @@ -22,7 +22,7 @@ namespace ArtemisUtils { static constexpr int lambda_max_vals = 1; // Variant containing all EOSs to be used in Artemis. -using EOS = singularity::Variant; +using EOS = singularity::Variant>; } // namespace ArtemisUtils