Opm::ReservoirCouplingMasterReportStep< Scalar > Class Template Reference

Manages master-side reservoir coupling operations for a single report step. More...

#include <ReservoirCouplingMasterReportStep.hpp>

Public Types

using MessageTag = ReservoirCoupling::MessageTag
 
using Potentials = ReservoirCoupling::Potentials< Scalar >
 
using SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData< Scalar >
 
using SlaveGroupInjectionData = ReservoirCoupling::SlaveGroupInjectionData< Scalar >
 
using InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget< Scalar >
 
using ProductionGroupTarget = ReservoirCoupling::ProductionGroupTarget< Scalar >
 

Public Member Functions

 ReservoirCouplingMasterReportStep (ReservoirCouplingMaster< Scalar > &master)
 Construct a report step manager for the master process. More...
 
const Parallel::Communicationcomm () const
 Get the MPI communicator for master-slave communication. More...
 
const std::vector< std::string > & getMasterGroupNamesForSlave (std::size_t slave_idx) const
 Get the names of master groups associated with a specific slave. More...
 
const std::map< std::string, std::string > & getMasterGroupToSlaveNameMap () const
 Get the mapping from master group names to slave names. More...
 
std::size_t getMasterGroupCanonicalIdx (const std::string &slave_name, const std::string &master_group_name) const
 Get the canonical index for a master group. More...
 
MPI_Comm getSlaveComm (int index) const
 Get the MPI communicator for a specific slave process. More...
 
Scalar getMasterGroupInjectionSurfaceRate (const std::string &group_name, ReservoirCoupling::Phase phase) const
 Get the injection surface rate for a master group. More...
 
Scalar getMasterGroupInjectionReservoirRate (const std::string &group_name, ReservoirCoupling::Phase phase) const
 Get the injection reservoir rate for a master group. More...
 
Scalar getMasterGroupProductionSurfaceRate (const std::string &group_name, ReservoirCoupling::Phase phase) const
 Get the production surface rate for a master group. More...
 
Scalar getMasterGroupProductionReservoirRate (const std::string &group_name, ReservoirCoupling::Phase phase) const
 Get the production reservoir rate for a master group. More...
 
const PotentialsgetSlaveGroupPotentials (const std::string &master_group_name) const
 Get the production potentials for a slave group. More...
 
std::size_t numSlaveGroups (unsigned int index) const
 Get the number of slave groups for a specific slave process. More...
 
std::size_t numSlaves () const
 Get the total number of active slave processes. More...
 
ReservoirCoupling::Loggerlogger () const
 Get the logger for reservoir coupling operations. More...
 
void receiveInjectionDataFromSlaves ()
 Receive injection data from all active slave processes. More...
 
void receiveProductionDataFromSlaves ()
 Receive production data from all active slave processes. More...
 
const Schedule & schedule () const
 Get the simulation schedule. More...
 
void sendInjectionTargetsToSlave (std::size_t slave_idx, const std::vector< InjectionGroupTarget > &injection_targets) const
 
void sendNumGroupTargetsToSlave (std::size_t slave_idx, std::size_t num_injection_targets, std::size_t num_production_targets) const
 
void sendProductionTargetsToSlave (std::size_t slave_idx, const std::vector< ProductionGroupTarget > &production_targets) const
 
void setReportStepIdx (int report_step_idx)
 Set the current report step index. More...
 
bool slaveIsActivated (int index) const
 Check if a specific slave process has been activated. More...
 
const std::string & slaveName (int index) const
 Get the name of a specific slave process. More...
 

Detailed Description

template<class Scalar>
class Opm::ReservoirCouplingMasterReportStep< Scalar >

Manages master-side reservoir coupling operations for a single report step.

This class encapsulates the master process's communication and coordination with slave processes during a single report step in reservoir coupling simulations. It handles:

  • Receiving production and injection data from slave processes via MPI
  • Sending group control information and constraints to slaves
  • Managing slave group potentials and production/injection data
  • Coordinating the exchange of information between master and slave groups

The class serves as a helper to ReservoirCouplingMaster, separating the report-step-specific logic from the overall coupling lifecycle management. This separation improves code organization and makes the coupling logic easier to understand and maintain.

Template Parameters
ScalarFloating-point type for rate and potential values (typically double or float)
Note
This class holds references to the parent ReservoirCouplingMaster object and should only be used within the scope of that object's lifetime
See also
ReservoirCouplingMaster

Member Typedef Documentation

◆ InjectionGroupTarget

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget<Scalar>

◆ MessageTag

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::MessageTag = ReservoirCoupling::MessageTag

◆ Potentials

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::Potentials = ReservoirCoupling::Potentials<Scalar>

◆ ProductionGroupTarget

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::ProductionGroupTarget = ReservoirCoupling::ProductionGroupTarget<Scalar>

◆ SlaveGroupInjectionData

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::SlaveGroupInjectionData = ReservoirCoupling::SlaveGroupInjectionData<Scalar>

◆ SlaveGroupProductionData

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData<Scalar>

Constructor & Destructor Documentation

◆ ReservoirCouplingMasterReportStep()

template<class Scalar >
Opm::ReservoirCouplingMasterReportStep< Scalar >::ReservoirCouplingMasterReportStep ( ReservoirCouplingMaster< Scalar > &  master)

Construct a report step manager for the master process.

Parameters
masterReference to the parent ReservoirCouplingMaster object

Member Function Documentation

◆ comm()

template<class Scalar >
const Parallel::Communication & Opm::ReservoirCouplingMasterReportStep< Scalar >::comm ( ) const
inline

Get the MPI communicator for master-slave communication.

Returns
Reference to the parallel communication object

◆ getMasterGroupCanonicalIdx()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupCanonicalIdx ( const std::string &  slave_name,
const std::string &  master_group_name 
) const

Get the canonical index for a master group.

Parameters
slave_nameName of the slave process
master_group_nameName of the master group
Returns
Canonical index for the specified master group in the context of the slave

◆ getMasterGroupInjectionReservoirRate()

template<class Scalar >
Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupInjectionReservoirRate ( const std::string &  group_name,
ReservoirCoupling::Phase  phase 
) const

Get the injection reservoir rate for a master group.

Parameters
group_nameName of the master group
phaseReservoirCoupling::Phase enum (Oil, Gas, or Water)
Returns
Injection reservoir rate for the specified phase

◆ getMasterGroupInjectionSurfaceRate()

template<class Scalar >
Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupInjectionSurfaceRate ( const std::string &  group_name,
ReservoirCoupling::Phase  phase 
) const

Get the injection surface rate for a master group.

Parameters
group_nameName of the master group
phaseReservoirCoupling::Phase enum (Oil, Gas, or Water)
Returns
Injection surface rate for the specified phase

◆ getMasterGroupNamesForSlave()

template<class Scalar >
const std::vector< std::string > & Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupNamesForSlave ( std::size_t  slave_idx) const
inline

Get the names of master groups associated with a specific slave.

Parameters
slave_idxIndex of the slave process
Returns
Vector of master group names that this slave is connected to

◆ getMasterGroupProductionReservoirRate()

template<class Scalar >
Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupProductionReservoirRate ( const std::string &  group_name,
ReservoirCoupling::Phase  phase 
) const

Get the production reservoir rate for a master group.

This returns the production rate at reservoir conditions, computed using the slave's PVT properties. This is needed when the master's parent group has RESV control mode, so the conversion uses slave's formation volume factors rather than master's.

Parameters
group_nameName of the master group
phaseReservoirCoupling::Phase enum (Oil, Gas, or Water)
Returns
Production reservoir rate for the specified phase

◆ getMasterGroupProductionSurfaceRate()

template<class Scalar >
Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupProductionSurfaceRate ( const std::string &  group_name,
ReservoirCoupling::Phase  phase 
) const

Get the production surface rate for a master group.

Parameters
group_nameName of the master group
phaseReservoirCoupling::Phase enum (Oil, Gas, or Water)
Returns
Production surface rate for the specified phase

◆ getMasterGroupToSlaveNameMap()

template<class Scalar >
const std::map< std::string, std::string > & Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupToSlaveNameMap ( ) const
inline

Get the mapping from master group names to slave names.

Returns
Map from master group name to the corresponding slave name

◆ getSlaveComm()

template<class Scalar >
MPI_Comm Opm::ReservoirCouplingMasterReportStep< Scalar >::getSlaveComm ( int  index) const
inline

Get the MPI communicator for a specific slave process.

Parameters
indexIndex of the slave process
Returns
MPI communicator handle for communication with the specified slave

◆ getSlaveGroupPotentials()

template<class Scalar >
const Potentials & Opm::ReservoirCouplingMasterReportStep< Scalar >::getSlaveGroupPotentials ( const std::string &  master_group_name) const

Get the production potentials for a slave group.

Parameters
master_group_nameName of the master group
Returns
Reference to the potentials data for the specified group

◆ logger()

template<class Scalar >
ReservoirCoupling::Logger & Opm::ReservoirCouplingMasterReportStep< Scalar >::logger ( ) const
inline

Get the logger for reservoir coupling operations.

Returns
Reference to the logger object for this coupling session

◆ numSlaveGroups()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMasterReportStep< Scalar >::numSlaveGroups ( unsigned int  index) const
inline

Get the number of slave groups for a specific slave process.

Parameters
indexIndex of the slave process
Returns
Number of groups managed by the specified slave

◆ numSlaves()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMasterReportStep< Scalar >::numSlaves ( ) const
inline

Get the total number of active slave processes.

Returns
Number of slaves that have been started

◆ receiveInjectionDataFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::receiveInjectionDataFromSlaves ( )

Receive injection data from all active slave processes.

This method receives injection rates and related data from each slave process via MPI communication. The data is organized by slave groups and stored in slave_group_injection_data_ for use in group control calculations.

Note
This is a blocking operation that waits for all slaves to send data
Must be called after slaves have computed and sent their injection data

◆ receiveProductionDataFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::receiveProductionDataFromSlaves ( )

Receive production data from all active slave processes.

This method receives production rates, potentials, and related data from each slave process via MPI communication. The data is organized by slave groups and stored in slave_group_production_data_ for use in group control calculations.

Note
This is a blocking operation that waits for all slaves to send data
Must be called after slaves have computed and sent their production data

◆ schedule()

template<class Scalar >
const Schedule & Opm::ReservoirCouplingMasterReportStep< Scalar >::schedule ( ) const
inline

Get the simulation schedule.

Returns
Reference to the Schedule object containing well and group definitions

◆ sendInjectionTargetsToSlave()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::sendInjectionTargetsToSlave ( std::size_t  slave_idx,
const std::vector< InjectionGroupTarget > &  injection_targets 
) const

◆ sendNumGroupTargetsToSlave()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::sendNumGroupTargetsToSlave ( std::size_t  slave_idx,
std::size_t  num_injection_targets,
std::size_t  num_production_targets 
) const

◆ sendProductionTargetsToSlave()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::sendProductionTargetsToSlave ( std::size_t  slave_idx,
const std::vector< ProductionGroupTarget > &  production_targets 
) const

◆ setReportStepIdx()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::setReportStepIdx ( int  report_step_idx)

Set the current report step index.

Parameters
report_step_idxThe report step index to set

This updates the internal state to track which report step is currently being processed.

◆ slaveIsActivated()

template<class Scalar >
bool Opm::ReservoirCouplingMasterReportStep< Scalar >::slaveIsActivated ( int  index) const
inline

Check if a specific slave process has been activated.

Parameters
indexIndex of the slave process
Returns
true if the slave is activated, false otherwise

◆ slaveName()

template<class Scalar >
const std::string & Opm::ReservoirCouplingMasterReportStep< Scalar >::slaveName ( int  index) const
inline

Get the name of a specific slave process.

Parameters
indexIndex of the slave process
Returns
Reference to the name string for the specified slave

The documentation for this class was generated from the following file: