Skip to content

Reservoir coupling: Send more data from slaves to master#6567

Merged
blattms merged 13 commits into
OPM:masterfrom
hakonhagland:slave_send_more
Nov 20, 2025
Merged

Reservoir coupling: Send more data from slaves to master#6567
blattms merged 13 commits into
OPM:masterfrom
hakonhagland:slave_send_more

Conversation

@hakonhagland
Copy link
Copy Markdown
Contributor

Note: Builds on #6535 which should be merged first.

The master needs more data than the currently sent slave group potentials. I.e.

  • surface production rates
  • reservoir voidage rates
  • reinjection rates
  • surface injection rate
  • reservoir injection rate

This is in preparation for #6347 which should be rebased once this is merged.

@hakonhagland hakonhagland marked this pull request as draft October 27, 2025 08:24
@hakonhagland hakonhagland added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Oct 27, 2025
@hakonhagland
Copy link
Copy Markdown
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Copy Markdown
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Copy Markdown
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Copy Markdown
Contributor Author

jenkins build this serial please

@hakonhagland hakonhagland marked this pull request as ready for review October 30, 2025 17:29
The master needs more data than the currently sent slave group
potentials:
 - surface production rates
 - reservoir voidage rates
 - reinjection rates
 - surface injection rate
 - reservoir injection rate
@blattms
Copy link
Copy Markdown
Member

blattms commented Nov 10, 2025

How many types as scalar are we actually supporting?

If it is just a few the we should not move the all definitions to the header files. Instead we should rather keep them in the *.cpp and should explicitly instantiate the template classes for the types needed. This will make this PR smaller and will reduce compile time. (If we miss the instantiation for certain types, it will produce linker errors, though).

Please comment whether you think that this is a good idea and you will do it.

@hakonhagland
Copy link
Copy Markdown
Contributor Author

How many types as scalar are we actually supporting?

@blattms Thanks for the comment. We are supporting the same two types as elsewhere: double and float (conditionally via FLOW_INSTANTIATE_FLOAT).

If it is just a few the we should not move the all definitions to the header files. Instead we should rather keep them in the *.cpp and should explicitly instantiate the template classes for the types needed

I believe the PR already follows the pattern you're suggesting: All template implementations remain in .cpp files with explicit instantiation at the bottom of each file. For example, see:

The header files contain only declarations, not definitions.

Copy link
Copy Markdown
Member

@blattms blattms left a comment

Choose a reason for hiding this comment

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

I think this looks good.

A few comments:
We have introduced another template parameter for a lot of classes. Sometimes it seems this done only to store reference to the master and used only to call functions that might not eve depend on the type of scalar. Maybe we are able to remove some of the introduced template parameter later. Possible ways are

  • to call a method on an object one can use a functor that we store (instead of a reference to an object
  • There could be base classes without a template parameter that provide methods that do not need it
  • One could you double internally and only convert to Scalar when needed. this would cost a bit of storage and make messages bigger, though.

Tnis might be more work than anticipated by me, though. Hence let's do this later.

I would a appreciate a bit more doxygen comments, e.g. describing what the classes arre for and also more complicated methods.

Comment thread opm/simulators/flow/rescoup/ReservoirCoupling.hpp Outdated
Comment thread opm/simulators/flow/rescoup/ReservoirCoupling.hpp Outdated
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingMaster.cpp
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingMasterReportStep.hpp Outdated
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingMasterReportStep.hpp
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingMpiTraits.hpp Outdated
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingSlave.hpp Outdated
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingSlaveReportStep.cpp
Comment thread opm/simulators/flow/rescoup/ReservoirCouplingSlaveReportStep.hpp
Comment thread opm/simulators/wells/rescoup/RescoupSendSlaveGroupData.cpp
@hakonhagland
Copy link
Copy Markdown
Contributor Author

jenkins build this please

@hakonhagland
Copy link
Copy Markdown
Contributor Author

jenkins build this serial please

@hakonhagland
Copy link
Copy Markdown
Contributor Author

@blattms Thanks for the detailed review. I have added 12 commits to address the comments.

Copy link
Copy Markdown
Member

@blattms blattms left a comment

Choose a reason for hiding this comment

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

Thanks a lot for all the changes.
Splitting it into one commit per change made reviewing really easy. Highly appreciated.

Comment thread opm/simulators/wells/rescoup/RescoupSendSlaveGroupData.cpp
@blattms blattms merged commit 81cec28 into OPM:master Nov 20, 2025
2 checks passed
hakonhagland added a commit to hakonhagland/opm-simulators-1 that referenced this pull request Dec 21, 2025
hakonhagland added a commit to hakonhagland/opm-simulators-1 that referenced this pull request Mar 16, 2026
hakonhagland added a commit to hakonhagland/opm-simulators-1 that referenced this pull request Mar 16, 2026
hakonhagland added a commit to hakonhagland/opm-simulators-1 that referenced this pull request Mar 16, 2026
hakonhagland added a commit to hakonhagland/opm-simulators-1 that referenced this pull request Mar 16, 2026
hakonhagland added a commit to hakonhagland/opm-simulators-1 that referenced this pull request Mar 16, 2026
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