diff --git a/src/hydro_properties.c b/src/hydro_properties.c index 5540d8c33c6263213b35697cfed2b6b5b07de2b7..f79fd832248fba8fbc55bd9fcec57e645be93159 100644 --- a/src/hydro_properties.c +++ b/src/hydro_properties.c @@ -123,7 +123,7 @@ void hydro_props_init(struct hydro_props *p, /* Compute the minimal energy (Note the temp. read is in internal units) */ double u_min = phys_const->const_boltzmann_k / phys_const->const_proton_mass; - u_min *= p->initial_temperature; + u_min *= p->minimal_temperature; u_min *= hydro_one_over_gamma_minus_one; /* Correct for hydrogen mass fraction */ diff --git a/src/units.c b/src/units.c index 6152d7f42f9a409bea9d057862c04d0ae9fb6a75..04e74bc4d7040ed1bde73184b125eec5d8a7fe97 100644 --- a/src/units.c +++ b/src/units.c @@ -50,6 +50,20 @@ void units_init_cgs(struct unit_system* us) { us->UnitTemperature_in_cgs = 1.; } +/** + * @brief Initialises the unit_system structure with SI system + * + * @param us The unit_system to initialize + */ +void units_init_si(struct unit_system* us) { + + us->UnitMass_in_cgs = 1000.; + us->UnitLength_in_cgs = 100.; + us->UnitTime_in_cgs = 1.; + us->UnitCurrent_in_cgs = 1.; + us->UnitTemperature_in_cgs = 1.; +} + /** * @brief Initialise the unit_system with values for the base units. * diff --git a/src/units.h b/src/units.h index da2c209815b07d1d5597a598ee4a61f3132e39db..08b738c5303db8b40dfbe51799d67da8df3936ce 100644 --- a/src/units.h +++ b/src/units.h @@ -96,6 +96,7 @@ enum unit_conversion_factor { }; void units_init_cgs(struct unit_system*); +void units_init_si(struct unit_system*); void units_init(struct unit_system* us, double U_M_in_cgs, double U_L_in_cgs, double U_t_in_cgs, double U_C_in_cgs, double U_T_in_cgs); void units_init_from_params(struct unit_system*, struct swift_params*,