Skip to content

Use one feed tangent for both phase stability trials - #41

Draft
moyner wants to merge 1 commit into
mainfrom
fix/phase-stability-reference
Draft

moyner wants to merge 1 commit into
mainfrom
fix/phase-stability-reference

Conversation

@moyner

@moyner moyner commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

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:

  • Complete MultiComponentFlash suite passed independently of the Newton prerequisite, and the combined suite also passed.
  • Both synthetic false-stability assertions fail without this fix and pass with it.
  • Existing JutulDarcy implicit derivatives, SIMPLE_COMP integration (3,000 checks), and flash shortcut tests passed with both fixes.
  • Actual RTX 4080 execution of the eight-component phase-dependent stability/reuse path with AD output passed.
  • The captured water-rich case now agrees with a fresh calculation when the separate reuse fix is applied.

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.

This branch has not been deployed

No deployments
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.

1 participant