Coronal equilibrium problem for certain setups
Closed this issue · 1 comments
When running examples/ionequil/generate.py
(master branch, debugging cmake mode) a "Floating-point error" is raised. This seems to originate in the method SimulationGenerator::EvaluateIonEquilibrium
, where the ADAS coefficients are calculated with nfree = 0
for some reason.
If I switch place on the two addIon
methods in the the example script (so that the neon is added first, which is supposed to initialise in equilibrium), this error is not raised at all. Instead, the simulation output has both deuterium charge states set to zero.
However, when specifying both ion species to be initialised in coronal equilibrium, the simulation runs as expected.
The problem seems to be due to some incorrect indexing in both in the equation initialiser in src/Settings/Equations/ions.cpp
that lead to a miscalculation of nfree
, and in src/Settings/IonEquilibrium.cpp
where it essentially is assumed that the equilibrium species are always added first.
I pushed a possible fix to this to #322 and made a pull request! :D