Turn off flux correction if it would cause X < 0 or X > 1 #2123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR summary
The reflux currently zeros out any flux corrections that would cause a negative or small density. A check is added to this that also turns off flux corrections if they would cause X > 1 or X < 0 (within some tolerance). Since it is possible that multiple flux corrections at the same zone center could conspire together to cause this, the only general way to do this is to loop over zone centers and consider all adjacent fluxes simultaneously, so this code is switched to a zone center loop instead of a zone face loop (and the same logic is now applied to the density check, which should also make it more accurate).
PR motivation
This should address #2096.
PR checklist
CHANGES
file has been updated, if appropriate