Skip to content

supporting the WELDRAW keyword from the simulator side. - #7346

Open
GitPaean wants to merge 4 commits into
OPM:masterfrom
GitPaean:add-weldraw
Open

supporting the WELDRAW keyword from the simulator side. #7346
GitPaean wants to merge 4 commits into
OPM:masterfrom
GitPaean:add-weldraw

Conversation

@GitPaean

@GitPaean GitPaean commented Aug 21, 2026

Copy link
Copy Markdown
Member

Implements the WELDRAW drawdown limit.

The maximum drawdown is converted into a maximum rate for the target phase,

Qmax = Dmax * sum_j (Tw_j * M_j / B_j)

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.

@GitPaean GitPaean added the manual:new-feature This is a new feature and should be described in the manual label Aug 21, 2026
@GitPaean
GitPaean requested a balanced review from Copilot August 21, 2026 22:31

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

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.

Comment thread opm/simulators/wells/WellInterface_impl.hpp
Comment thread opm/simulators/wells/WellInterface_impl.hpp
@GitPaean
GitPaean force-pushed the add-weldraw branch 2 times, most recently from 507a0a4 to 92ddd51 Compare August 24, 2026 09:50
@GitPaean
GitPaean marked this pull request as ready for review August 24, 2026 19:10
@GitPaean
GitPaean requested review from akva2 and bska August 24, 2026 19:11

@akva2 akva2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not very informed on the functionality, but the code looks good to me. I'd squash some of the fixup commits though.

Comment thread opm/simulators/wells/WellInterface_impl.hpp Outdated
Comment thread opm/simulators/wells/WellInterfaceGeneric.cpp Outdated
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.
@GitPaean GitPaean changed the title supporting the WELDRAW keyword some the simulator side. supporting the WELDRAW keyword from the simulator side. Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:new-feature This is a new feature and should be described in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants