-
Notifications
You must be signed in to change notification settings - Fork 191
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 protection against negative pressure in HybridEos
#6221
Conversation
Uh oh, tests are unhappy :( |
@nilsdeppe updated PR, everything should be fixed now. Let me know if the split into two commits was unorthodox and whether a separate PR would be more appropriate. |
@@ -311,12 +311,18 @@ class EquationOfState<IsRelativistic, 1> : public PUP::able { | |||
/// The lower bound of the specific internal energy that is valid for this EOS | |||
/// at the given rest mass density \f$\rho\f$ | |||
virtual double specific_internal_energy_lower_bound( | |||
double rest_mass_density) const = 0; | |||
double rest_mass_density) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might break @jyoo1042 's simulations with a 1d EOS. I believe for primitive recovery we need the thermal part effectively unrestricted and trying to restrict it caused the simulations to fail. Isn't what you would like for the 2d EOS to have a density-dependent bound, not the 1d EOS? For a 1d EOS the thermal part doesn't mattr
aa5787e
to
0d4ff63
Compare
@nilsdeppe PR updated to reflect our last discussion. For posterity's sake, we had agreed that the 1D specific internal energy bounds should lose their density dependence entirely, and that |
Proposed changes
Floating point issues can lead to negative pressures in
HybridEos
. This quick PR puts a safeguard against this.Edit: delving into fixing the unit-tests has revealed another related issue, so I've split the PR into two commits. For the first commit, the
specific_internal_energy_lower_bound
andspecific_internal_energy_upper_bound
functions in 1D EoSs are supposed to provide these bounds as a function of rest mass density. Since in the case of a 1D EoS the internal energy is not a free parameter when density is known, these bounds can only be the exact specific internal energy returned by the 1D EoS.The second commit deals with the original floating point problem with
HybridEos
.Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments