Skip to content

Accept a COMPVD phase change away from the type-1 gas-oil contact - #7490

Draft
GitPaean wants to merge 5 commits into
OPM:masterfrom
GitPaean:compvd-contact-mismatch
Draft

GitPaean wants to merge 5 commits into
OPM:masterfrom
GitPaean:compvd-contact-mismatch

Conversation

@GitPaean

@GitPaean GitPaean commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

With EQUIL item 10 = 1 the COMPVD rows give the composition versus depth. A two-zone table whose last vapour row and first liquid row do not straddle the gas-oil contact stopped the run. The gas zone now ends at the nearest edge of the gap between those rows, with a warning, and a cell on the last vapour row stays in the gas zone. Type 3 keeps the error, as it uses the contact as reference depth.

When the gas zone reaches the water-oil contact, the water now takes its pressure from the gas column there rather than from the liquid one.

test_compequil covers these cases; the existing equilibration regressions are unchanged. The new regression equil_1d_compvd_water_gascap_contact_mismatch runs the case from OPM/opm-tests#1638 and needs its reference data.

Initialization flow

EQUIL supplies contact depths and reference pressure. COMPVD supplies composition versus depth, with each row marked as vapour or liquid. The following flow applies to a COMPVD table containing both vapour and liquid rows.

flowchart TD
    A["COMPVD contains both vapour and liquid rows"] --> B{"Are all vapour rows<br/>above the liquid rows?"}

    B -->|No| C["Stop: interleaved phase rows"]
    B -->|Yes| D{"Is the EQUIL gas-oil contact<br/>between the last vapour row<br/>and first liquid row?"}

    D -->|Yes| E["Use the EQUIL contact<br/>as the zone boundary"]
    D -->|No| F{"EQUIL initialization type?"}

    F -->|Type 1| G["Move the boundary to the<br/>nearest edge of the row gap<br/>and issue a warning"]
    F -->|Type 3| H["Stop: type 3 requires the<br/>contact as its reference depth"]

    E --> I["Use the selected boundary for<br/>gas and liquid pressure integration"]
    G --> I

    I --> J["Initialize water pressure when needed"]
    J --> K["Assign each cell its zone composition<br/>and nominal phase"]
    K --> L["For type 1, a cell exactly on the<br/>last vapour row remains gas"]
    L --> M["Downstream flash computes<br/>the final hydrocarbon phase split"]
Loading

For example, with the last vapour row at 2049 m and first liquid row at 2051 m, type 1 moves a contact at 2060 m to 2051 m, or 2030 m to 2049 m. Depth increases downward.

Water-pressure anchoring

For a two-zone COMPVD region, when water pressure needs anchoring from the hydrocarbon column, the phase just above the water contact determines which pressure to use.

flowchart TD
    A["Water pressure needs anchoring<br/>from the hydrocarbon column"] --> B{"Does the gas zone reach<br/>the water contact?"}
    B -->|Yes| C["Take gas pressure<br/>at the water contact"]
    B -->|No| D["Take liquid pressure<br/>at the water contact"]
    C --> E["Subtract the specified capillary pressure<br/>and integrate the water column"]
    D --> E
Loading

This prevents a pressure discontinuity when moving the gas/liquid boundary makes gas touch water.

With EQUIL item 10 = 1 the COMPVD rows give the composition versus
depth, so they decide where the gas zone ends. A contact outside the
gap between the last vapour row and the first liquid row now moves to
the nearest edge of that gap with a warning instead of stopping the
run. Type 3 keeps the error, as it uses the contact as reference depth.
@GitPaean
GitPaean force-pushed the compvd-contact-mismatch branch from 4f6e38c to f129390 Compare October 2, 2026 22:40
@GitPaean GitPaean added the manual:enhancement This is an enhancement/improvent that needs to be documented in the manual label Oct 2, 2026
@GitPaean
GitPaean marked this pull request as draft October 2, 2026 22:45
@GitPaean

GitPaean commented Oct 2, 2026 •

Copy link
Copy Markdown
Member Author

jenkins build this opm-tests=1638 failure_report please

https://ci.opm-project.org/job/opm-simulators-PR-builder/10822/

A cell on the contact belongs to the liquid zone, so a contact moved onto
the last vapour row gave that row's depth the liquid composition. With
EQUIL item 10 = 1 the rows decide the phase.
The water took the liquid column's pressure even when the gas zone
reaches the water-oil contact, as it does once the gas-oil contact lies
below it.
Clamp once and compare, so the row gap is defined in one place. Once
the boundary moves it is no longer the EQUIL contact, so the later
messages stop calling it that. The rejection test checks which error
it gets.
@GitPaean

GitPaean commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

jenkins build this opm-tests=1638 failure_report please

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:enhancement This is an enhancement/improvent that needs to be documented in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant