Skip to content

Reservoir coupling: Apply master group targets on slave Schedule#6983

Merged
totto82 merged 2 commits intoOPM:masterfrom
hakonhagland:sg_constraint_fix2
Apr 16, 2026
Merged

Reservoir coupling: Apply master group targets on slave Schedule#6983
totto82 merged 2 commits intoOPM:masterfrom
hakonhagland:sg_constraint_fix2

Conversation

@hakonhagland
Copy link
Copy Markdown
Contributor

Builds on #6979. Depends on companion OPM/opm-common#5109

  • Add updateSlaveGroupTargetsInSchedule() to ReservoirCouplingSlaveReportStep and ReservoirCouplingSlave: after receiving constraints from the master, updates the slave's Schedule with synthetic GCONPROD/GCONINJE entries for both production and injection targets
  • Call from BlackoilWellModel::beginTimeStep() on the first substep of each sync timestep, after receiving master constraints and updating control modes

Background

In reservoir coupling, slave groups may not have GCONPROD or GCONINJE in the slave deck, rather the master provides targets at runtime. The existing constraint enforcement code has isProductionGroup() / isInjectionGroup() gates at multiple locations that skip groups without deck-level group controls:

  • checkGroupHigherConstraints (BlackoilWellModelGeneric.cpp)
  • getWellGroupTargetProducer / getWellGroupTargetInjector (GroupStateHelper.cpp)
  • updateGroupIndividualControl (BlackoilWellModelConstraints.cpp)

Without synthetic group properties, slave wells run at their individual WCONPROD/WCONINJE limits unconstrained by the master's group target.

Companion PR

@hakonhagland hakonhagland added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Apr 13, 2026
@hakonhagland hakonhagland marked this pull request as draft April 13, 2026 06:19
@hakonhagland
Copy link
Copy Markdown
Contributor Author

Putting this in draft mode until #6979 has been merged

After receiving constraints from the master, the slave
updates its Schedule with synthetic GCONPROD/GCONINJE entries
so the existing constraint enforcement mechanisms recognize
the groups and apply the master's targets.  Without this,
slave groups without deck-level GCONPROD/GCONINJE would be
skipped by isProductionGroup()/isInjectionGroup() gates in
checkGroupHigherConstraints, getWellGroupTargetProducer, etc.

Requires the companion opm-common PR that adds
Schedule::updateSlaveGroupProductionTarget() and
Schedule::updateSlaveGroupInjectionTarget().
@hakonhagland hakonhagland marked this pull request as ready for review April 14, 2026 12:20
Replace updateSlaveGroupTargetsInSchedule() (which created
synthetic GCONPROD/GCONINJE) with markSlaveGroupsInSchedule()
which sets lightweight boolean flags on slave groups.

The flags make isProductionGroup()/isInjectionGroup() return
true so the existing constraint enforcement gates pass.  The
actual target values are still provided by the master via
hasMasterProductionTarget()/hasMasterInjectionTarget().

Requires the companion opm-common commit that adds the flag
mechanism to Group and Schedule.
@totto82 totto82 merged commit 8442daf into OPM:master Apr 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants