grackle-project / grackle

The Grackle chemistry and cooling library for astrophysical simulations and models.
Other
26 stars 50 forks source link

Allow a variable HydrogenFractionByMass #234

Open brittonsmith opened 2 months ago

brittonsmith commented 2 months ago

Grackle currently does not allow the H/He ratio to change and instead resets everything according to the HydrogenFractionByMass parameter inside make_consistent_g (in solve_rate_cool_g.F). I propose to change this to recording the H/He ratio prior to integration and then resetting to this afterward.

Separately, @mabruzzo's comment in PR #215 has reminded me to check whether the documentation and usage of the HydrogenFractionByMass parameter are consistent, specifically that it is used as the mass fraction of H in the primordial gas and not the total gas density.