Repository navigation
Conversation
This was referenced Oct 23, 2026
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.
With phase-dependent EOS coefficients, the liquid and vapor stability trials previously used different feed fugacities. Both trials could converge to their own trivial point and report a single phase even when a cross-phase tangent-plane distance was negative. The mutable stability test also treated an iteration-limit failure as trivial stability.
Choose the homogeneous feed with the lower Gibbs energy and compare both trial phases with that one fixed tangent plane. Apply the same reference in the mutable and immutable paths. An unfinished mutable trial now reports instability instead of authorizing a single-phase result.
The tests use a synthetic water/methane/ethane model with explicit coefficients, independently calculate a negative tangent-plane distance, and reproduce false stability in both paths before the fix. They do not depend on the hydrogen correlation or reservoir deck. Another test checks that an unfinished mutable trial is not marked trivial.
Validation on Julia 1.13.1:
Unresolved benchmark validation: adding this stability correction to the reuse prototype does not complete the supplied HighH2 CPU benchmark. The coarse grid stalls at report step 65; the full grid stops in its first report step with either Float32 or Float64 linear solves. A control with reuse disabled and Float64 linear solves also stops in the first report step. The Newton/reuse changes alone complete all 305 steps on both grids. These failures are recorded explicitly; this draft is not ready to merge on the strength of a full benchmark pass.
The H2 coefficients and correlations are unchanged. Newton support (#40) and simulator reuse are separate PRs.