Let reservoir coupling slave UDQs see the production limits in force - #7485
Merged
Merged
Conversation
hakonhagland
marked this pull request as draft
October 2, 2026 04:16
Contributor
Author
|
Putting this in draft mode until OPM/opm-common#5421 has been merged |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
An empty production handshake can leave stale limits that are subsequently reported as current targets.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds effective slave-group production limits so reservoir-coupling UDQs and summary vectors report master-imposed values.
Changes:
- Computes effective GOPRT/GWPRT/GGPRT/GLPRT limits.
- Refreshes target-dependent UDQs during synchronization.
- Passes production limits to the opm-common summary evaluators.
| File | Description |
|---|---|
BlackoilWellModelRescoup.hpp |
Declares production-target handling. |
BlackoilWellModelRescoup_impl.hpp |
Computes, stores, and primes effective limits. |
BlackoilWellModel_impl.hpp |
Invokes the expanded target refresh. |
ReservoirCouplingSlave.hpp |
Stores effective production targets. |
EclWriter.hpp |
Exposes targets to summary evaluation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The master run sends a slave group a production limit for every rate type: the target of its active control mode, and its share of the limits further up the master's group tree. A slave UDQ that refers to GOPRT, GWPRT, GGPRT or GLPRT for such a group nevertheless read the slave deck's own GCONPROD value, usually zero. As for the injection targets, work out per slave group and rate type the limit in force -- the master's, the deck's own, or the smaller of the two, as the group's GRUPSLAV flag says -- at the same two points: after the handshake at the start of a sync step, and after the mid-step receive. Keep it on the slave for the summary writer, which reports it through data::ReservoirCouplingGroupRates::production_targets, and prime the summary state with it before the group and field UDQs are evaluated. The rule is the one GroupStateHelper::getEffectiveProductionLimit_() applies in the control path, except that the deck's own limit only takes part under BOTH when the group has one: that method is only reached for rate types with an own GCONPROD limit, while a limit is reported here for every rate type. refreshSlaveGroupInjectionTargets() becomes refreshSlaveGroupTargets(), since it now refreshes both. RESV is left out: GVPRT does not report a group limit.
hakonhagland
force-pushed
the
slave_prod_targets
branch
from
October 2, 2026 08:58
94c904c to
c271eaa
Compare
hakonhagland
marked this pull request as ready for review
October 2, 2026 08:58
Contributor
Author
|
jenkins build this serial please |
totto82
approved these changes
Oct 2, 2026
totto82
left a comment
Member
There was a problem hiding this comment.
Thanks. The opm-common part is already merged. The code looks correct.
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.

Replaces #7465, as agreed there: instead of stopping a slave whose UDQs use
GOPRTand the other production target vectors for a slave group, report the right number. This is the production counterpart of #7413, which did this forGGIRT/GWIRT.Depends on OPM/opm-common#5421, which adds
data::ReservoirCouplingGroupRates::production_targetsand lets theGOPRT,GWPRT,GGPRTandGLPRTevaluators use it.Report the production limits in force for slave groups (commit 1)
GroupConstraintCalculator::groupProductionConstraints()). A slave UDQ that refers toGOPRT,GWPRT,GGPRTorGLPRTfor such a group nevertheless read the slave deck's ownGCONPRODvalue, usually zero.BlackoilWellModelRescoup::storeSlaveGroupProductionTargets(), next tostoreSlaveGroupInjectionTargets(). It works out the limit in force per slave group and rate type: the master's, the deck's own, or the smaller of the two, as the group'sGRUPSLAVflag says. It then:ReservoirCouplingSlave::effectiveProductionTargets()), so thatEclWriterpasses it to the summary output throughproduction_targets;refreshSlaveGroupInjectionTargets()is renamed torefreshSlaveGroupTargets(), since it now refreshes both.GroupStateHelper::getEffectiveProductionLimit_()applies in the control path, with one difference. There the deck's own limit is only consulted for rate types the group has its ownGCONPRODlimit for. A limit is reported here for every rate type, so underBOTHthe deck's own limit only takes part when the group has one, aseffectiveSlaveGroupInjectionTarget_()does for injection.RESVis left out:GVPRTdoes not report a group limit, but adds up the reservoir volume rate targets of the group's wells.GVPRT,GVIRT, the master'sGVPR/GVIRand gas lift are to be handled in later PRs, as discussed in Stop a reservoir coupling slave whose UDQs use a target vector it cannot report #7465.Testing
Two runs of a three-model coupled case: a master and two slaves, METRIC units, master
GCONPRODwithORATtargets and a gas limit of 6.9E6 on the master groups.SUMMARYasking forGOPRT,GWPRT,GGPRTandGLPRTfor all groups, and a UDQFUOPTC = GOPRTof one slave group:GOPRTequals the master'sGOPRfor its master group at every report step (the field's 9000 split by guide rate). Without this PR it reads the slave deck's own value, which is 0 here, since the slave deck has noGCONPROD;GGPRTadd up to the master's 6.9E6 gas limit;GWPRTandGLPRTstay 0: the master sets no water or liquid limit;GOPRTat all 59 timesteps, including the step where the target changes, so it does not lag a step behind.