Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more robust checks on NLTE population solver and safer treatment when NLTE solver fails #159

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

fionntancallan
Copy link
Member

Add more robust checks on the populations in the NLTE solver and safer treatment of what populations should be used instead if the NLTE solution is not sensible (e.g. convert to LTE). In particular:

-Previously when the NLTE population was negative for a level it was directly replaced with the LTE level population. This resulted in cases where the negative excited population was replaced with a value much greater than the NLTE ground pop resulting in extremely large partition function values which in some cases then overflowed the float limit. Additionally, negative NLTE ground populations were just replaced with the LTE value. However, if the ground population is negative this means the entire solution for that ion is unlikely to be sensible. If the NLTE ground population is negative now therefore revert to using LTE populations for the element.
-There were previously no checks on population inversions so have also added checks such that if the solver predicts a large population inversion the level populations of the element are set to their LTE values - large population inversions can also lead to partition function values which overflow the float limit causing the code to fail.

This pull request provides a temporary solution to problems that can occur when the NLTE solver does not produce a temporary solution. The plan is to add functionality in the future so that when the NLTE solver fails to a produce a sensible solution for an individual ion that specific ion can be set to LTE with the NLTE solver called again for the element with that ion excluded.

@fionntancallan fionntancallan force-pushed the Add_more_robust_checks_on_NLTE_population_solver branch from 19f849a to d27cc61 Compare November 22, 2024 14:32
@fionntancallan
Copy link
Member Author

@lukeshingles I think I've missed something with the syntax of find_uppermost_ion when trying to make it accessible outside of ltepop.cc, any ideas?

@lukeshingles
Copy link
Member

@lukeshingles I think I've missed something with the syntax of find_uppermost_ion when trying to make it accessible outside of ltepop.cc, any ideas?

Definitions in the anonymous namespace block are not accessible outside the translation unit (*.cc file). You'll need to move it down past

} // anonymous namespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants