supporting the WELDRAW keyword from the simulator side. - #7346
Open
GitPaean wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds simulator-side WELDRAW support by converting drawdown limits into production-rate constraints.
Changes:
- Computes and applies LIQ/GRAT limits during NUPCOL.
- Persists and reports WELDRAW control state.
- Integrates limits with constraints, networks, and gas-lift optimization.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ParallelSerialization.cpp | Adds WELDRAW serialization dependency. |
| opm/simulators/wells/WellState.cpp | Reports drawdown-limited control. |
| opm/simulators/wells/WellInterfaceGeneric.hpp | Declares control helpers. |
| opm/simulators/wells/WellInterfaceGeneric.cpp | Applies derived rate limits. |
| opm/simulators/wells/WellInterface.hpp | Declares rate calculation. |
| opm/simulators/wells/WellInterface_impl.hpp | Computes and integrates limits. |
| opm/simulators/wells/WellConstraints.cpp | Checks WELDRAW-adjusted controls. |
| opm/simulators/wells/SingleWellState.hpp | Stores WELDRAW state. |
| opm/simulators/wells/SingleWellState.cpp | Supports equality and serialization tests. |
| opm/simulators/wells/GasLiftSingleWellGeneric.cpp | Caps gas-lift well controls. |
| opm/simulators/wells/GasLiftGroupInfo.cpp | Caps gas-lift group contributions. |
| opm/simulators/wells/BlackoilWellModelNetwork_impl.hpp | Applies limits during network solves. |
| opm/simulators/wells/BlackoilWellModel_impl.hpp | Updates limits during NUPCOL. |
| opm/simulators/utils/UnsupportedFlowKeywords.cpp | Removes WELDRAW from unsupported keywords. |
| opm/simulators/utils/PartiallySupportedFlowKeywords.cpp | Defines supported WELDRAW options. |
| opm/simulators/utils/ParallelSerialization.cpp | Includes the WELDRAW type. |
| opm/simulators/flow/FlowGenericVanguard.cpp | Includes WELDRAW for Flow setup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
GitPaean
force-pushed
the
add-weldraw
branch
2 times, most recently
from
August 24, 2026 09:50
507a0a4 to
92ddd51
Compare
GitPaean
marked this pull request as ready for review
August 24, 2026 19:10
akva2
approved these changes
Aug 25, 2026
akva2
left a comment
Member
There was a problem hiding this comment.
Not very informed on the functionality, but the code looks good to me. I'd squash some of the fixup commits though.
GitPaean
marked this pull request as draft
August 25, 2026 08:12
GitPaean
marked this pull request as ready for review
August 25, 2026 08:58
Convert the maximum drawdown into a maximum production rate, Qmax = Dmax * sum(Tw*M/B), reusing the IPR machinery. Qmax is updated during the first NUPCOL iterations of each timestep and imposed as an additional LRAT/GRAT constraint. Only the AVG mode is supported; MAX and use-in-potentials are rejected at deck load. The limit is obtained through a single productionControlsWithWeldraw() accessor, so that constraint checking and target computations cannot get production controls without it. A target phase with no producible mobility leaves the coefficient sum at zero, which would impose a zero rate and silently stop the well; the limit is deactivated with a warning instead.
The drawdown limit is imposed as a maximum rate for its target phase, so a well held back by it is on liquid or gas rate control internally. That is not what the well is under: record which rate control carries the limit, but only while the limit is at least as restrictive as the well's own target for the same phase, and mark the well as drawdown limited when that control is the active one. A well held at a tighter target of its own keeps reporting that target.
GasLiftGroupInfo estimates what a well contributes to its group by taking its potentials and clipping them by its rate targets. The drawdown limit is such a target, so include it: without it the group is told a limited well can deliver more than it will, and lift gas is distributed accordingly. This does not conflict with item 4 of WELDRAW being NO, which keeps the limit out of the potential calculation itself, not out of the targets which are applied to the potentials afterwards. The autochoke network solve iterates the well equations to find the group THP, and passes the production controls to use explicitly. Those controls must carry the drawdown limit, as the ones obtained internally do, or the group THP is found from rates the wells cannot sustain.
Check that the limit introduces a rate target for its phase, that it gives way to a target of the well's own which is tighter, and that it replaces one which is looser, for both a liquid and a gas target phase. PROD1 of the well model test case carries the two target phases across its two report steps. Add regression tests for the three ways the limit has to behave: WELDRAW-01 on a standard well, WELDRAW-01-MSW on a multisegment one, whose connection sum includes crossflowing connections where a standard well's leaves them out, and WELDRAW-02-GAS with the limit on a gas target rather than a liquid one. The cases are derived from WECON-02 and inherit its TUNING, hence --enable-tuning=true, as for wecon_item_14.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the WELDRAW drawdown limit.
The maximum drawdown is converted into a maximum rate for the target phase,
using the IPR coefficients, and imposed as an additional LRAT or GRAT
constraint. Qmax is updated during the first NUPCOL iterations of each
timestep and held fixed afterwards, as the targets of group controlled wells
are. A well held back by the limit reports drawdown control rather than the
rate control which carries it, and the limit is applied in the gas lift and
network calculations as well as in the well constraints.
Only AVG for item 5 and NO for item 4 are supported; other values are
rejected at deck load.
Keyword parsing and restart handling are in OPM/opm-common#5305.
Test cases in OPM/opm-tests#1571.