problems with evaluating phycon.EnergyExcitation and EnergyIonization
There are many problems with evaluating phycon.EnergyExcitation and EnergyIonization. First of all there appear to be bugs. Many of the loops evaluating phycon.EnergyExcitation are as follows
( loop over lower states )
( loop over upper states )
energy += Hi->Pop*transition_energy;
However they should be
( loop over quantumstates )
energy += Pop*level_energy;
In the code evaluating phycon.EnergyIonization we should look closely at the variable kadvec, it looks like the second time it is evaluated, the code should actually be:
kadvec = kadvec && dynamics.lgISO[ipISO];
to get proper interaction between the commands NO ADVECTION METALS and NO ADVECTION H-LIKE
The second problem is that the comments claim that these quantities are needed to get the energy balance in an advection flow, however they are only used in printouts, nowhere else.
The third problem is the question when they should be evaluated. Comments suggest they should only be needed in advection flows, however they are e.g. evaluated in a constant density model like h2_pdr_leiden_f1.in. Is that appropriate? We should also look at how often they should be evaluated as frequent evaluation over all energy levels could be costly.
The fourth problem is that phycon.EnergyBinding is not implemented at all at the moment.
All this code is currently disabled in pressure_total.cpp, mole_h2.cpp, and atom_feii.cpp.