compositional equilibration with 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));
| const Scalar datum = record.datumDepth(); | ||
| const auto phaseIdx = (datum < reg.zgoc) | ||
| ? FluidSystem::gasPhaseIdx : FluidSystem::oilPhaseIdx; |
a15704f to
6606a88
Compare
83a3afa to
9cc88f6
Compare
9cc88f6 to
8c5eea9
Compare
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.
It depends on OPM/opm-common#5283