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

[PureFluid] Use pressure criteria to decide phase #839

Merged
merged 1 commit into from Apr 5, 2020

Conversation

bryanwweber
Copy link
Member

@bryanwweber bryanwweber commented Apr 3, 2020

Use the pressure compared with the saturation pressure to decide gas or
liquid phase, rather than temperature. This change is required because
for some substances, the saturation temperature for low values of the
pressure was outside the limits of the equation of state, resulting
in convergence errors in the saturation solver.

Since phaseOfMatter can throw, we need to translate exceptions in
the Cython interface as well.

Add tests to prevent regression with cases identifed in #786.
Fixes #786.

Checklist

  • There is a clear use-case for this code change
  • The commit message has a short title & references relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • The pull request is ready for review

Use the pressure compared with the saturation pressure to decide gas or
liquid phase, rather than temperature. This change is required because
for some substances, the saturation temperature for low values of the
pressure was outside the limits of the equation of state, resulting
in convergence errors in the saturation solver.

Since phaseOfMatter can throw, we need to translate exceptions in
the Cython interface as well.

Add tests to prevent regression with cases identifed in Cantera#786.
Fixes Cantera#786.
@codecov
Copy link

codecov bot commented Apr 3, 2020

Codecov Report

Merging #839 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #839      +/-   ##
==========================================
- Coverage   71.45%   71.44%   -0.01%     
==========================================
  Files         372      372              
  Lines       43522    43522              
==========================================
- Hits        31098    31096       -2     
- Misses      12424    12426       +2     
Impacted Files Coverage Δ
src/thermo/PureFluidPhase.cpp 58.79% <100.00%> (-0.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a9f637...f4c3dc8. Read the comment docs.

@bryanwweber bryanwweber requested a review from speth April 5, 2020 15:35
@speth speth merged commit 29437ef into Cantera:master Apr 5, 2020
@bryanwweber bryanwweber deleted the fix-786 branch January 30, 2021 02:26
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.

Exceptions raised by PureFluidPhase::phaseOfMatter
2 participants