Skip to content
Snippets Groups Projects
Commit 708023e4 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Clarify the newly added reduced Hubble constant in CGS.

parent 1950ef68
No related branches found
No related tags found
No related merge requests found
...@@ -106,11 +106,6 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params, ...@@ -106,11 +106,6 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
internal_const->const_earth_mass = internal_const->const_earth_mass =
const_earth_mass_cgs / const_earth_mass_cgs /
units_general_cgs_conversion_factor(us, dimension_mass); units_general_cgs_conversion_factor(us, dimension_mass);
/* Calculate the reduced hubble constant prefactor */
const float dimension_hubble[5] = {0, 0, -1, 0, 0}; /* [s^-1] */
internal_const->const_reduced_hubble =
const_reduced_hubble_cgs /
units_general_cgs_conversion_factor(us, dimension_hubble);
const float dimension_time[5] = {0, 0, 1, 0, 0}; /* [s] */ const float dimension_time[5] = {0, 0, 1, 0, 0}; /* [s] */
internal_const->const_year = internal_const->const_year =
...@@ -136,6 +131,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params, ...@@ -136,6 +131,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
internal_const->const_primordial_He_fraction = internal_const->const_primordial_He_fraction =
const_primordial_He_fraction_cgs / const_primordial_He_fraction_cgs /
units_general_cgs_conversion_factor(us, dimension_Yp); units_general_cgs_conversion_factor(us, dimension_Yp);
const float dimension_reduced_hubble[5] = {0, 0, -1, 0, 0}; /* [s^-1] */
internal_const->const_reduced_hubble =
const_reduced_hubble_cgs /
units_general_cgs_conversion_factor(us, dimension_reduced_hubble);
} }
/** /**
......
...@@ -97,7 +97,7 @@ struct phys_const { ...@@ -97,7 +97,7 @@ struct phys_const {
/*! Primordial Helium fraction */ /*! Primordial Helium fraction */
double const_primordial_He_fraction; double const_primordial_He_fraction;
/*! Unit factor of the reduced hubble constant */ /*! Reduced hubble constant units (i.e. H_0 / h) */
double const_reduced_hubble; double const_reduced_hubble;
}; };
......
...@@ -98,7 +98,8 @@ const double const_T_CMB_0_cgs = 2.7255; ...@@ -98,7 +98,8 @@ const double const_T_CMB_0_cgs = 2.7255;
/*! Primordial Helium fraction [-] */ /*! Primordial Helium fraction [-] */
const double const_primordial_He_fraction_cgs = 0.245; const double const_primordial_He_fraction_cgs = 0.245;
/*! km/s/Mpc to cgs conversion 100 * 1e5 / 3.08567781E24 */ /*! Reduced Hubble constant units (i.e. H_0 / h == 100 km / s / Mpc in CGS)
const double const_reduced_hubble_cgs = 3.240779e-18; * [s^-1] */
const double const_reduced_hubble_cgs = 3.2407792894458e-18;
#endif /* SWIFT_PHYSICAL_CONSTANTS_CGS_H */ #endif /* SWIFT_PHYSICAL_CONSTANTS_CGS_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment