Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
623 stars 349 forks source link

[thermo] Improve solveCubic exception handling #1819

Open ischoegl opened 18 hours ago

ischoegl commented 18 hours ago

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

codecov[bot] commented 17 hours ago

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).

Files with missing lines Patch % Lines
src/thermo/MixtureFugacityTP.cpp 0.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.