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

Turn off flux correction if it would cause X < 0 or X > 1 #2123

Merged
merged 2 commits into from
Apr 24, 2022

Conversation

maxpkatz
Copy link
Member

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

  • test suite needs to be run on this PR
  • this PR will change answers in the test suite to more than roundoff level
  • all newly-added functions have docstrings as per the coding conventions
  • the CHANGES file has been updated, if appropriate
  • if appropriate, this change is described in the docs

@zingale
Copy link
Member

zingale commented Apr 24, 2022

@zingale zingale merged commit de349f6 into AMReX-Astro:development Apr 24, 2022
@maxpkatz maxpkatz deleted the avoid_invalid_X_in_reflux branch April 24, 2022 14:39
@zingale zingale mentioned this pull request Apr 24, 2022
5 tasks
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.

None yet

2 participants