Skip to content

Start the flow_comp flash from each cell's previous two-phase result - #7732

Draft
GitPaean wants to merge 3 commits into
OPM:masterfrom
GitPaean:flowcomp-flash-warmstart
Draft

GitPaean wants to merge 3 commits into
OPM:masterfrom
GitPaean:flowcomp-flash-warmstart

Conversation

@GitPaean

@GitPaean GitPaean commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

On top of #7730 and #7724, which it needs: only the last commit is new here.

The flash of every cell restarted from Wilson K-values in every Newton iteration and ran a stability test. The flash model enables thermodynamic hints by default, but the cache refresh marked each entry stale before looking up its hint, so none was ever found. With the cache now updated in place, a cell whose previous flash was two-phase starts from that result's K-values and liquid fraction, which skips the stability test. Single-phase results are not used, since the stability test would start from K-values that can be trivial; the flash's existing fallback to Wilson estimates covers a warm start that fails. --enable-thermodynamic-hints=false keeps the cold start.

Results move at the flash tolerance: within 1e-6 on most compositional test decks and up to 1e-5 relative on the mobile-water well cases, inside the regression and serial/parallel test tolerances. Newton iterations are unchanged on all but one deck, which takes one more. On a 40x40x5 three-component case the property update takes 20% less time and the whole run 17% less.

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Nov 23, 2026
A new local residual for the PT-flash model computes the same
transmissibility-based flux as the element-context assembly. The TPFA
linearizer assembles total rates rather than rates per unit volume, so
flow_comp no longer uses a volumetric residual, and the convergence
check divides by the cell volume to keep its tolerances.

Compositional runs never read boundary conditions, so a deck with BCCON
used to run with no-flow boundaries. Such decks are now rejected.
flow_comp now refreshes the cached intensive quantities cell by cell. The
well model no longer loops over all cells every iteration, since the
cache is already up to date when the wells read it.
@GitPaean
GitPaean force-pushed the flowcomp-flash-warmstart branch from 0e90535 to 08965ad Compare November 23, 2026 14:35
The flash restarted from Wilson K-values in every Newton iteration, with a
stability test in every cell. A cell whose previous result was two-phase
now starts from its K-values and liquid fraction, which skips the
stability test. --enable-thermodynamic-hints=false keeps the cold start.

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

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant