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

[thermo] Improve solveCubic exception handling #1819

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Nov 27, 2024

Changes proposed in this pull request

If applicable, fill in the issue number this pull request is fixing

Band-aid for #1699

The example from #1699 now fails with:

CanteraError:
*******************************************************************************
CanteraError thrown by MixtureFugacityTP::solveCubic:
root failed to converge for T = 250.45022511255627, p = 30717382.242601085 with V = -8038.658839830863
*******************************************************************************

which allows for improved exception handling (rather than checking for invalid densities).

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 73.25%. Comparing base (1b48991) to head (a8dde95).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/thermo/MixtureFugacityTP.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1819   +/-   ##
=======================================
  Coverage   73.24%   73.25%           
=======================================
  Files         383      383           
  Lines       54625    54624    -1     
  Branches     9103     9103           
=======================================
+ Hits        40012    40015    +3     
+ Misses      11606    11603    -3     
+ Partials     3007     3006    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @ischoegl!

@speth speth merged commit f9ac078 into Cantera:main Nov 29, 2024
58 of 59 checks passed
@ischoegl ischoegl deleted the cubic-root-exception branch November 29, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants