Skip to content

Send the slave group quantities the master's summary needs - #7488

Open
totto82 wants to merge 1 commit into
OPM:masterfrom
totto82:rc_summary_output
Open

totto82 wants to merge 1 commit into
OPM:masterfrom
totto82:rc_summary_output

Conversation

@totto82

@totto82 totto82 commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

The master's summary for its master groups (and their ancestors and FIELD) did not add up to the slaves' summaries:

  • Lift gas, potentials, history rates and the numbers of flowing wells were 0. Let the slave sum these over the wells below each slave group, as its group summary vectors are summed, and send them with the production and injection data. The master passes them to the summary in collectGroupRatesForSummary().
  • The rates sent at the end of a sync step, which the master uses for its summary and for its own substeps until the next sync step, were the slave's group rates of the NUPCOL well state. That state is frozen after the first NUPCOL Newton iterations, so after a longer step the rates differed from the converged well rates. NUPCOL stabilises the Newton iterations of a step; at the end of the sync step there is nothing left to stabilise. Recompute the slave's group rates from the converged well state before that send (new BlackoilWellModelGeneric::updateGroupRatesFromWellState()). The data sent at the start of a sync step is computed in the first Newton iteration, where the NUPCOL well state is the current one, and the data sent in the network iterations within the step keeps the NUPCOL behaviour.

Requires the corresponding opm-common change
OPM/opm-common#5424

The master's summary for its master groups (and their ancestors and
FIELD) did not add up to the slaves' summaries:

- Lift gas, potentials, history rates and the numbers of flowing wells
  were 0.  Let the slave sum these over the wells below each slave
  group, as its group summary vectors are summed, and send them with
  the production and injection data.  The master passes them to the
  summary in collectGroupRatesForSummary().
- The rates sent at the end of a sync step, which the master uses for
  its summary and for its own substeps until the next sync step, were
  the slave's group rates of the NUPCOL well state.  That state is
  frozen after the first NUPCOL Newton iterations, so after a longer
  step the rates differed from the converged well rates.  NUPCOL
  stabilises the Newton iterations of a step; at the end of the sync
  step there is nothing left to stabilise.  Recompute the slave's group
  rates from the converged well state before that send (new
  BlackoilWellModelGeneric::updateGroupRatesFromWellState()).  The data
  sent at the start of a sync step is computed in the first Newton
  iteration, where the NUPCOL well state is the current one, and the
  data sent in the network iterations within the step keeps the NUPCOL
  behaviour.

Requires the corresponding opm-common change
(data::ReservoirCouplingGroupRates).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@totto82

totto82 commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

Probably still not the complete list, but at least it syncs all rates we have in opm-tests/rescoup

@totto82 totto82 added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Oct 2, 2026
@totto82
totto82 requested a balanced review from Copilot October 2, 2026 12:52

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.

Copilot review overview

🟡 Changes recommended

Prediction-mode injection history incorrectly reports scheduled targets instead of simulated rates.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Extends reservoir-coupling communication so master summaries include slave-group quantities and converged rates.

Changes:

  • Collects and communicates potentials, history rates, lift gas, and flowing-well counts.
  • Recomputes group rates from converged well states.
  • Supplies expanded data to master summary evaluation.
File Description
RescoupSendSlaveGroupData.hpp Declares summary-data collection helpers.
RescoupSendSlaveGroupData.cpp Collects slave well-summary quantities.
BlackoilWellModelRescoup_impl.hpp Refreshes rates before the final send.
BlackoilWellModelGeneric.hpp Exposes converged-rate recomputation.
BlackoilWellModelGeneric.cpp Implements reusable group-rate updates.
ReservoirCouplingMpiTraits.hpp Extends MPI payload definitions.
ReservoirCouplingMasterReportStep.cpp Transfers received quantities into summaries.
ReservoirCoupling.hpp Expands slave-group data structures.

💡 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/rescoup/RescoupSendSlaveGroupData.cpp
@totto82
totto82 requested a review from hakonhagland October 2, 2026 14:03
@totto82
totto82 marked this pull request as ready for review October 2, 2026 14:03

This branch has not been deployed

No deployments
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