Skip to content

compositional equilibration with ZMFVD - #7306

Draft
GitPaean wants to merge 11 commits into
OPM:masterfrom
GitPaean:comp_equil_july_6th
Draft

compositional equilibration with ZMFVD#7306
GitPaean wants to merge 11 commits into
OPM:masterfrom
GitPaean:comp_equil_july_6th

Conversation

@GitPaean

Copy link
Copy Markdown
Member

It depends on OPM/opm-common#5283

@GitPaean GitPaean added the manual:enhancement This is an enhancement/improvent that needs to be documented in the manual label Aug 10, 2026
@GitPaean GitPaean changed the title compositional equilibration compositional equilibration with ZMFVD Aug 10, 2026
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-common=5283 please

@GitPaean
GitPaean requested a balanced review from Copilot August 10, 2026 13:24
Copilot stopped reviewing on behalf of GitPaean due to an error August 10, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds compositional hydrostatic equilibration support (EQUIL + ZMFVD) and aligns compositional restart/output behavior with expected Eclipse-style arrays, while also improving parallel correctness for data exchange and residual metrics.

Changes:

  • Add shared hydrostatic ODE integrator + pressure function, and implement compositional equilibration (InitStateEquilComp).
  • Extend distributed field-property handling to support multi-values-per-cell double keywords (e.g., ZMF).
  • Improve compositional restart/output (renamed arrays, new POIL/PGAS/PSAT/VMF) and fix parallel solution syncing / residual evaluation.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
opm/simulators/utils/UnsupportedFlowKeywords.cpp Removes ZMFVD from the “unsupported” list.
opm/simulators/utils/PropsDataHandle.hpp Supports multi-valued double fields per cell during broadcast/packing/unpacking.
opm/simulators/utils/PartiallySupportedFlowKeywords.cpp Tightens allowed EQUIL item 10/11 values for compositional initialization.
opm/simulators/flow/equil/PressureFunction.hpp Introduces reusable RK4 IVP integrator + depth→pressure function.
opm/simulators/flow/equil/InitStateEquil_impl.hpp Removes local integrator/pressure-function implementations now moved to shared header.
opm/simulators/flow/equil/InitStateEquilComp.hpp Adds compositional equilibration implementation based on EQUIL + ZMFVD (+ RTEMPVD).
opm/simulators/flow/equil/InitStateEquil.hpp Switches black-oil equilibration to shared PressureFunction implementation.
opm/simulators/flow/OutputCompositionalModule.hpp Adds compositional restart alignment (renames) + new outputs (phase pressures, PSAT, VMF).
opm/simulators/flow/NonlinearSystemCompositional_impl.hpp Adds updateSolution with overlap sync; residual metrics now ignore ghost cells.
opm/simulators/flow/NonlinearSystemCompositional.hpp Declares updateSolution().
opm/simulators/flow/FlowProblemComp.hpp Enables compositional equilibration; fixes parallel transmissibility export approach.
opm/simulators/flow/CompositionalContainer.hpp Adds buffers/APIs for POIL/PGAS/PSAT/VMF and allocation checks.
opm/simulators/flow/CompositionalContainer.cpp Allocates and writes new restart arrays; fixes moleFractions_ allocation check.
CMakeLists_files.cmake Installs new public headers for compositional equilibration and PressureFunction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread opm/simulators/flow/FlowProblemComp.hpp
Comment thread opm/simulators/flow/CompositionalContainer.cpp
Comment thread opm/simulators/flow/equil/PressureFunction.hpp
Comment thread opm/simulators/flow/OutputCompositionalModule.hpp Outdated
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-common=5283 failure_report please

@GitPaean
GitPaean force-pushed the comp_equil_july_6th branch from 0cb16eb to f06fea8 Compare August 10, 2026 15:17
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-common=5283 failure_report please

@GitPaean
GitPaean force-pushed the comp_equil_july_6th branch from f06fea8 to 53bf2f2 Compare August 11, 2026 08:54
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-common=5283 failure_report please

@GitPaean
GitPaean force-pushed the comp_equil_july_6th branch from 53bf2f2 to 98e5a87 Compare August 12, 2026 11:53
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-common=5283 please

@GitPaean
GitPaean force-pushed the comp_equil_july_6th branch from 98e5a87 to d0e7ce4 Compare August 18, 2026 21:23
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this opm-common=5283 please

@GitPaean
GitPaean force-pushed the comp_equil_july_6th branch 2 times, most recently from d1f4b11 to 4b581c0 Compare August 22, 2026 21:48
@GitPaean
GitPaean requested a balanced review from Copilot August 22, 2026 21:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Suppressed comments (1)

opm/simulators/flow/equil/InitStateEquilComp.hpp:420

  • For a datum depth different from the contact, pDatum below is nevertheless used directly as the pressure at reg.zgoc. The warning therefore silently shifts the entire hydrostatic pressure profile instead of honoring the EQUIL datum. Either reject this input or integrate the datum pressure to the contact before constructing the two pressure functions.
        if (std::abs(record.datumDepth() - reg.zgoc) > 0.0) {
            OpmLog::warning(fmt::format("Equilibration region {}: the datum depth {} m "
                                        "must be at the gas-oil contact when EQUIL "
                                        "item 10 is 3; using the contact depth {} m.",
                                        regionIdx + 1, record.datumDepth(), reg.zgoc));

Comment thread opm/simulators/utils/PropsDataHandle.hpp
Comment on lines +372 to +374
const Scalar datum = record.datumDepth();
const auto phaseIdx = (datum < reg.zgoc)
? FluidSystem::gasPhaseIdx : FluidSystem::oilPhaseIdx;
Comment thread opm/simulators/flow/equil/InitStateEquilComp.hpp
The linear solver leaves the rows of ghost cells untouched, so their
primary variables must be fetched from the owning processes before the
intensive quantities are recomputed. A virtual postSolutionUpdate hook
between the two steps of the base updateSolution carries the sync, so
the sequence itself stays in one place.
The scatter resized the distributed data to hold every value of a
multi-valued keyword such as ZMF, but left the keyword information at
one value per cell, so numValuePerCell(), numCells() and compress()
read the distributed field as a scalar one.
Type 1 integrates the whole column with the single EOS root chosen from
the datum side of the contact. With the contact inside the region that
root can be the wrong one of a three-root cubic on the far side, but
the warning only covered a depth-invariant ZMFVD; a varying one was
initialized in silence. A genuinely two-phase column needs item 10 = 3,
which splits the integration at the contact.
Cover the supported EQUIL envelope on the verified 1D column: a
continuous liquid with the composition following ZMFVD (item 10 = 1), a
gas cap over a liquid leg with the contact pressure at the saturation
pressure of the contact liquid (item 10 = 3), two independently
equilibrated EQLNUM regions, and the error on a missing ZMFVD. The
pressures are anchored to the reference-simulator values the
implementation was verified against.
EQUIL_1D_ZMFVD initializes a continuous liquid column (EQUIL item 10
defaulted) and EQUIL_1D_ZMFVD_OIL a gas cap over a liquid leg with the
contact pressure at the saturation pressure (item 10 = 3), covering the
supported envelope of the compositional equilibration end to end.
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.

2 participants