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.
| EQUIL::Comp::InitialStateComputer<FluidSystem> initialState( | ||
| eclState, | ||
| getEosType(), | ||
| vanguard.cellCenterDepths(), | ||
| eqlnum, | ||
| vanguard.gridView().comm(), | ||
| this->gravity()[dimWorld - 1], | ||
| this->numPressurePointsEquil()); |
| entries.emplace_back("POIL", UnitSystem::measure::pressure, oilPressure_); | ||
| entries.emplace_back("PGAS", UnitSystem::measure::pressure, gasPressure_); | ||
| entries.emplace_back("PSAT", UnitSystem::measure::pressure, saturationPressure_); | ||
| entries.emplace_back("VMF", UnitSystem::measure::identity, vaporFraction_); |
| Scalar operator()(const Scalar x) const | ||
| { | ||
| // Dense output (O(h**3)) according to Shampine | ||
| // (Hermite interpolation) | ||
| const Scalar h = stepsize(); | ||
| int i = (x - span_[0]) / h; | ||
|
|
||
| // Crude handling of evaluation point outside "span_": the interval is | ||
| // clamped to the table, and "t" with it, so that a depth beyond either | ||
| // end returns the value at that end instead of a cubic extrapolation. | ||
| if (i < 0) { i = 0; } | ||
| if (N_ <= i) { i = N_ - 1; } |
| // A cell where both phases are present is at its saturation pressure; | ||
| // elsewhere the bubble- (dew-) point pressure of the total composition. | ||
| Entry{[&compC = this->compC_, eosType = this->eosType_](const ExtractContext& ectx) | ||
| { | ||
| const auto& fs = ectx.fs; | ||
| const Scalar sOil = getValue(fs.saturation(oilPhaseIdx)); | ||
| const Scalar sGas = getValue(fs.saturation(gasPhaseIdx)); | ||
|
|
||
| Scalar psat = 0.0; | ||
| if (sOil > 0.0 && sGas > 0.0) { | ||
| psat = getValue(fs.pressure(oilPhaseIdx)); | ||
| } | ||
| else { | ||
| using SatP = SaturationPressure<Scalar, FluidSystem>; | ||
| typename SatP::CompVec z; | ||
| typename SatP::CompVec incipient; | ||
| for (int c = 0; c < numComponents; ++c) { | ||
| z[c] = getValue(fs.moleFraction(c)); | ||
| } | ||
| const Scalar temp = getValue(fs.temperature(oilPhaseIdx)); | ||
| const bool converged = (sGas <= 0.0) | ||
| ? SatP::bubblePressure(z, temp, eosType, psat, incipient) | ||
| : SatP::dewPressure(z, temp, eosType, psat, incipient); | ||
| if (!converged) { | ||
| psat = 0.0; | ||
| } | ||
| } | ||
| compC.assignSaturationPressure(ectx.globalDofIdx, psat); |
|
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 |
It depends on OPM/opm-common#5283