Compositional equilibration with EQUIL and ZMFVD - #7306
Conversation
|
jenkins build this opm-common=5283 please |
There was a problem hiding this comment.
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.
|
jenkins build this opm-common=5283 failure_report please |
0cb16eb to
f06fea8
Compare
|
jenkins build this opm-common=5283 failure_report please |
f06fea8 to
53bf2f2
Compare
|
jenkins build this opm-common=5283 failure_report please |
53bf2f2 to
98e5a87
Compare
|
jenkins build this opm-common=5283 please |
98e5a87 to
d0e7ce4
Compare
|
jenkins build this opm-common=5283 please |
d1f4b11 to
4b581c0
Compare
There was a problem hiding this comment.
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,
pDatumbelow is nevertheless used directly as the pressure atreg.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));
a15704f to
6606a88
Compare
83a3afa to
9cc88f6
Compare
9cc88f6 to
8c5eea9
Compare
EQUIL_1D_ZMFVD uses type-1 initialization and integrates pressure with the liquid EOS root. Flashing the resulting total composition produces gas in the methane-rich upper cells, and the short initial time steps begin resolving its segregation. EQUIL_1D_ZMFVD_OIL initializes a gas cap over a liquid leg with the contact at the liquid bubble-point pressure.
EQLNUM is given on the unrefined input grid while the equilibration works on the leaf grid. Copying the array straight across left refined cells at region 1 and the coarse cells with input-ordered values in leaf-ordered slots. Use the same LookUpData mapping the black-oil initializer uses; it reduces to the identity without local refinement.
A gas-oil contact inside an EQUIL type-1 region requires COMPVD or ZMFVD variation across the contact for proper phase labeling. Only warn when the supported ZMFVD input has no such variation.
Document that type 3 uses the gas-oil contact as the reference depth. Rename the local pressure values to distinguish the user input from the pressure applied at the contact, and explain that item 11 retains the numeric input even when it is not the saturation pressure.
Include <utility> directly for std::move instead of relying on a transitive include.
Describe the numerical expectations directly and use a generic input-state parameter name.
Clamp ZMFVD and RTEMPVD/TEMPVD evaluations in hydrostatic integration, contact saturation-pressure calculations, and cell assignment. Test equivalent padded tables and contacts outside both ends of the input ranges.
Require EQUIL item 6 to be zero because the downstream flash uses a single pressure for all phases. Cover positive and negative values for initialization types 1 and 3 and report the offending region.
Reject nonzero EQUIL item 9 values instead of silently applying cell-centre initialization. Test explicit zero and positive and negative subdivision requests for both supported initialization types.
Report pressures through the unit helpers instead of a bare 1e5, name the repeated depth-table and tolerance constants, and compare compositions with std::ranges::equal. Output is unchanged.
|
I consider the implementation is clean and ready for review now. With some consideration, I think it is okay to get ZMFVD PR in first. Then COMPVD equilibration (#7373), which should be a much smaller PR. So far the implementation is straightforward. It might be challenged with more testing cases, especially the field case testing. More development in the line will be very likely. |
|
jenkins build this failure_report please |
|
jenkins build this update_data failure_report please https://ci.opm-project.org/job/opm-simulators-PR-builder/10643/ |
|
jenkins build this opm-tests=1607 please |
Reason: PR OPM/opm-simulators#7306 opm-common = 562cf6c6edfb3c0836dcd540ea8582e313b8ee8a opm-grid = ed27fd832c1da18f4e0177f2d88e5197c3da23f0 opm-simulators = d2f0e6717fa3af86d447e25dd3485f7401a78d4f ### Changed Tests ### * equil_1d_zmfvd * equil_1d_zmfvd_oil
Automatic Reference Data Update for PR OPM/opm-simulators#7306
bska
left a comment
There was a problem hiding this comment.
Nice!
The new reference solutions have been installed on the CI system so I'll merge this into master.
Add hydrostatic compositional initialization from
EQUILandZMFVD, usingRTEMPVDwhen present andRTEMPotherwise.ZMFVDas total composition, integrates pressure with the EOS root selected at the datum side of the gas-oil contact, and leaves the phase split to the subsequent flash.ZMFVDas the liquid composition below the contact and uses its equilibrium vapour above it. The contact pressure is adjusted to the bubble point when requested;EQUILitem 11 can preserve the supplied pressure.EQLNUMregions are equilibrated independently. Region values are mapped to the leaf grid for local refinement, and invalid rank-local values are propagated collectively in parallel runs.Type 2,
COMPVD, and water zones are not supported. The RK4 integrator and pressure function are moved to a shared header and reused by both initialization paths.Unit and regression tests cover types 1 and 3, item 11, multiple
EQLNUMregions, constant and gradedRTEMPVD, missingZMFVD, local-refinement mapping, and synchronized invalid-EQLNUMfailures.Depends on OPM/opm-common#5349 for defaulted
EQUILitem 11 (merged already). Parallelflow_compruns also require #7387.