In all instances where m_radcool is called
i.e.
RAD_T lambda = (*m_radcool)(Ti, (RAD_T)rhoi, (RAD_T)Zi, (RAD_T)Yi, (RAD_T)aa_av, mui, &iter, false, &nHIi, &nei);
You need to call it with the metalicity-free (or primordial) Y not the true value of Y.
Meaning if the particle data has a value of Yi
you need to calculate:
double y = Yi/Xi;//nHe/nH * (mHe/mH)
double Yp = y/(1.0+y);//Metal-free helium fraction
and use Yp, instead of Yi in the m_radcool call
Also m_radcool now returns mu_e
so instead of doing nemass/rho to get neV = Ne
you can just use mass/mu_e*mh = Ne
Perhaps is the same but avoids worry about density. I think in general though using mi/rho for volume is consistent too
reminder for later that our Cloudy tables now have the ability to measure L instead of using free-free emission approximation only. need to update the map codes to use it
A bug is in the call to the cooling function:
In all instances where m_radcool is called i.e. RAD_T lambda = (*m_radcool)(Ti, (RAD_T)rhoi, (RAD_T)Zi, (RAD_T)Yi, (RAD_T)aa_av, mui, &iter, false, &nHIi, &nei);
You need to call it with the metalicity-free (or primordial) Y not the true value of Y.
Meaning if the particle data has a value of Yi you need to calculate: double y = Yi/Xi;//nHe/nH * (mHe/mH) double Yp = y/(1.0+y);//Metal-free helium fraction and use Yp, instead of Yi in the m_radcool call
Also m_radcool now returns mu_e so instead of doing nemass/rho to get neV = Ne you can just use mass/mu_e*mh = Ne Perhaps is the same but avoids worry about density. I think in general though using mi/rho for volume is consistent too