-
Notifications
You must be signed in to change notification settings - Fork 114
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
Only compute psat when needed #4515
base: master
Are you sure you want to change the base?
Conversation
jenkins build this please |
@svenn-t Can you review this? |
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.
Looks good to me, just a small comment.
if (model1) { | ||
// Computing the vapor pressure is not trivial and is also not defined for T > criticalTemperature | ||
Evaluation psat = CO2::vaporPressure(temperature); | ||
model1 = model1 && pg > psat; |
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.
This can be written model1 = pg > psat
since model1
is always true
inside this if-clause.
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.
thanks. updated.
jenkins build this please |
This prevents the erroneous std::power call with negative base for the default value of ACTCO2S. |
Here is the relevant part of the stack trace when running ACTCO2S being 1 or 2 with this PR and my PR that throws:
|
Note In Spycher Pruess 2010 they say 31C which is inconsistent with the critical temperature (30.95C) we use in OPM. For consistancy we change to critical temperature.