Repository navigation
Use a temperature guess and report failures in iterative enthalpy inversions - #2983
Open
joshkellyjak wants to merge 2 commits into
Open
joshkellyjak wants to merge 2 commits into
joshkellyjak wants to merge 2 commits into
Conversation
…lace cout warnings and set temperature to most recent correct state. Density failed points are now reported in NONPYHSICAL_POINTS
joshkellyjak
added this pull request to stack #2984
October 15, 2026 16:25
bigfooted
reviewed
Oct 16, 2026
bigfooted
reviewed
Oct 16, 2026
bigfooted
reviewed
Oct 16, 2026
bigfooted
reviewed
Oct 16, 2026
bigfooted
reviewed
Oct 16, 2026
bigfooted
reviewed
Oct 16, 2026
| the enthalpy increases with temperature, so a step below the minimum taken from the minimum itself means | ||
| the solution is below it, stop and report failure. ---*/ | ||
| if (temperature + delta < Temperature_Min) { | ||
| if (temperature == Temperature_Min) break; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Fluid models that solve for the temperature from the enthalpy iteratively currently start every solve from a fixed temperature and give the caller no way to tell that it failed.
CIncIdealGasPolynomialstarts at 300 K and only prints a per-point warning when it fails.This PR adds
CFluidModel::SolveTDState_h(h, Y, T_guess), which takes the starting temperature as an argument and returns whether a valid state was found. The default implementation forwards toSetTDState_hand returnstrue, so models that compute the temperature directly are unchanged.CIncIdealGasPolynomialinow uses the guess (falling back to the non-dimensional reference temperature) and returns failure instead of printing per-point warnings. The incompressible call sites (SetPrimVarmain and fallback paths,ComputeConsistentExtrapolation,RecomputeDensity_time_n) now pass the previous temperature and handle failure explicitly.Related Work
Replaces the
SetTemperatureGuess/GetTemperatureIterationFailedpair proposed in #2713 (Cantera fluid model), which can implementSolveTDState_hinstead. Also prepares for a temperature-dependent cp inFLUID_MIXTURE(see the TODO inCFluidScalar::SetTDState_h).PR Checklist
pre-commit run --allto format old commits.