I've being working with one of the 'mini' snapshots for TNG100, and found that NeutralHydrogenAbundance was not a data field for the mini snaps. I just wanted to ask if there was any method or work-around to compute neutral hydrogen abundance with the data supplied in the mini snaps?
Yes, this field was removed from mini snapshots since it can be, in theory, reconstructed from the other available fields, following Rahmati+13. I post some code which may be a useful starting point:
def neutral_fraction(nH, sP, temp=1e4, redshift=None):
""" The neutral fraction from Rahmati+ (2012) Eqn. A8. """
# recombination rate from Rahmati+ (2012) Eqn. A3, also Hui & Gnedin (1997). [cm^3 / s] """
lamb = 315614.0/temp
alpha_A = 1.269e-13*lamb**1.503 / (1+(lamb/0.522)**0.47)**1.923
# photoionization rate
if redshift is None:
redshift = sP.redshift
_, gamma_UVB_z = uvbPhotoionAtten(np.log10(nH), np.log10(temp), redshift)
# A6 from Theuns 98
LambdaT = 1.17e-10*temp**0.5*np.exp(-157809.0/temp)/(1+np.sqrt(temp/1e5))
A = alpha_A + LambdaT
B = 2*alpha_A + gamma_UVB_z/nH + LambdaT
return (B - np.sqrt(B**2-4*A*alpha_A))/(2*A)
Thank you! One question about the code you sent - what is the function uvbPhotoionAtten? Is that also from the Rahmati paper?
Yes gamma_UVB_z is the value of the hydrogen photoionization rate, at the redshift of interest. Table 2 of Rahmati+ (should use FG09 to be most consistent with TNG).