collisionsal ionization/3b recombination sink/sources to ground state of isosequences fails to produce LTE at high densities
The sources and sinks due to collisional ionization and three body recombination in the He iso-sequence are wrongly delivered to all excited states through a partition function. The reactions that matter are:
He(nl) + e <-> He+(1s) + 2e
where nl is any resolved state. However cloudy is delivering these populations to:
He(nl) + e -> He+(n'l') + 2e
through the partition function. The inverse reaction is duplicated for every n'l' (no partition function) :
He+(n'l') +2e -> He(nl) + e
The code that allows that possible is:
if (0)
{
creation[0] += source;
for( level=0; level < numlevels_local; level++ )
{
z[level][level] += sink;
}
}
else
{
// Try Boltzmann weighting to capture LTE limit correctly
t_iso_sp* sp = &iso_sp[ipISO][nelem];
double partfun=0.0;
for ( level = 0; level < numlevels_local; level++ )
{
partfun += sp->st[level].Boltzmann()*sp->st[level].g();
}
source /= partfun;
for( level=0; level < numlevels_local; level++ )
{
creation[level] += source*
sp->st[level].Boltzmann()*sp->st[level].g();
z[level][level] += sink;
}
}
If the physics were correct, the first branch of the if clause should be allowed. However the current configuration produces correct LTE limits while the correct physics fails in producing that. This is seen in the wrong departure coefficients of He+ in the tsuite simulation limit_lte_he1_ste.in and in the modified attached sim limit_lte_he1_coll_t50k.in. It is possible that a bug in ionization-recombination balance produces this problem.