Closed astroshrey closed 3 years ago
Thanks, Shreyas! I will run some tests and merge the changes. FYI: I verified today that changing how the mean molecular weight is calculated does not significantly affect the H ion fraction profile, so I think that indeed the key on solving that is with your exact solutions.
The current version of the code uses the approximation in Equation (9) of Oklopcic & Hirata (2018), where the photoionization rate Phi_prime is approximated as the photoionization rate at null optical depth Phi multiplied by exp(-tau_0). While this approximation works well in the optically thin outer part of the outflow, I have found that it can overestimate the photoionization rate by a factor of several near the ionization front. Therefore I have written an exact version of the photoionization calculation which can be accessed in the top-level "ion_fraction" function by setting the argument "exact_phi = True". I have left it as False by default so it does not change code behavior, but the default could be updated in the future.