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

Make FixToAtmosphere fix the electron fraction in atmosphere #6239

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

isaaclegred
Copy link
Contributor

@isaaclegred isaaclegred commented Aug 22, 2024

Proposed changes

Currently we do not perform atmosphere fixing in the hydro evolution after Finite Difference reconstruction, which can result in unphysical values of primitive variables being passed to equation of state calls leading to floating point exceptions.

Additionally, atmosphere fixing currently doesn't fix the electron fraction, which is necessary in simulations using a 3D EoS.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

The reason why these problems are apparently coupled is because in primitive recovery unphysical electron fraction values are limited to the max/min of the EoS. However, in reconstruction the primitives are not the direct output of a con2prim call, and therefore the electron fraction is not generally snapped back to EoS bounds, and this needs to be done explicitly.

@isaaclegred isaaclegred added the in progress Don't review, used for sharing code and getting feedback label Aug 22, 2024
spatial_metric,
eos);
ASSERT(min(rest_mass_density.get()) >= 0.0, "rest mass density should be positive");
ASSERT(min(electron_fraction.get()) >= 0.0, "rest mass density should be positive");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the statement should be "electron fraction should be positive" here.

@isaaclegred isaaclegred removed the in progress Don't review, used for sharing code and getting feedback label Sep 19, 2024
@isaaclegred isaaclegred force-pushed the FixAtmosphereInReconstruction branch from 337796e to 992d9f9 Compare October 18, 2024 02:00
Also add fix_to_atmosphere calls in reconstruction
@isaaclegred isaaclegred force-pushed the FixAtmosphereInReconstruction branch from 992d9f9 to 09c7fe2 Compare October 18, 2024 14:14
@isaaclegred isaaclegred changed the title Make FixToAtmosphere fix the electron fraction in atmosphere, and add… Make FixToAtmosphere fix the electron fraction in atmosphere Nov 4, 2024
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