Commit 574d1b2f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added the case-B recombination constant to the list of physical constants used in the code.

parent 5b36ab99
......@@ -140,6 +140,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
internal_const->const_reduced_hubble =
const_reduced_hubble_cgs /
units_general_cgs_conversion_factor(us, dimension_reduced_hubble);
const float dimension_alphaB[5] = {0, 3, -1, 0, 0}; /* [cm^3 s^-1] */
internal_const->const_caseb_recomb =
const_caseb_recomb_cgs /
units_general_cgs_conversion_factor(us, dimension_alphaB);
}
/**
......@@ -217,6 +222,7 @@ void phys_const_print_snapshot(hid_t h_file, const struct phys_const *p) {
io_write_attribute_d(h_grp_cgs, "primordial_He_fraction",
const_primordial_He_fraction_cgs);
io_write_attribute_d(h_grp_cgs, "reduced_hubble", const_reduced_hubble_cgs);
io_write_attribute_d(h_grp_cgs, "caseb_recomb", const_caseb_recomb_cgs);
H5Gclose(h_grp_cgs);
......@@ -250,6 +256,7 @@ void phys_const_print_snapshot(hid_t h_file, const struct phys_const *p) {
io_write_attribute_d(h_grp_int, "primordial_He_fraction",
p->const_primordial_He_fraction);
io_write_attribute_d(h_grp_int, "reduced_hubble", p->const_reduced_hubble);
io_write_attribute_d(h_grp_int, "caseb_recomb", p->const_caseb_recomb);
H5Gclose(h_grp_int);
......
......@@ -99,6 +99,9 @@ struct phys_const {
/*! Reduced hubble constant units (i.e. H_0 / h) */
double const_reduced_hubble;
/*! Case B recombination coefficient for hydrogen at 10^4 K */
double const_caseb_recomb;
};
void phys_const_init(const struct unit_system* us, struct swift_params* params,
......
......@@ -38,6 +38,9 @@
* http://pdg.lbl.gov/2017/reviews/rpp2017-rev-astrophysical-constants.pdf
*
* The primordial Helium fraction is the value obtained by WMAP7.
*
* The case B recombination coefficient is taken from
* Pequignot, Petitjean & Boisson, 1991, A&A, 251, 680
*/
#ifdef SWIFT_USE_GADGET2_PHYSICAL_CONSTANTS
......@@ -131,4 +134,7 @@ const double const_primordial_He_fraction_cgs = 0.248;
* [s^-1] */
const double const_reduced_hubble_cgs = 3.2407792894458e-18;
/*! Case B recombination coefficient for hydrogen at 10^4 K [cm^3 s^-1] */
const double const_caseb_recomb_cgs = 2.6e-13;
#endif /* SWIFT_PHYSICAL_CONSTANTS_CGS_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment