Skip to content

Commit

Permalink
Unit system aware singularity eos
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdempsey90 committed Jan 18, 2025
1 parent 861a489 commit 1beaf57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/gas/gas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ std::shared_ptr<StateDescriptor> 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>(
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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/eos/eos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<singularity::IdealGas>;
using EOS = singularity::Variant<singularity::UnitSystem<singularity::IdealGas>>;

} // namespace ArtemisUtils

Expand Down

0 comments on commit 1beaf57

Please sign in to comment.