Opm::ReservoirCouplingSlaveReportStep< Scalar > Class Template Reference

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

#include <ReservoirCouplingSlaveReportStep.hpp>

Public Types

using InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget< Scalar >
 
using ProductionGroupConstraints = ReservoirCoupling::ProductionGroupConstraints< Scalar >
 
using MessageTag = ReservoirCoupling::MessageTag
 
using MasterProductionLimits = ReservoirCoupling::MasterProductionLimits< Scalar >
 
using SlaveGroupInjectionData = ReservoirCoupling::SlaveGroupInjectionData< Scalar >
 
using SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData< Scalar >
 

Public Member Functions

 ReservoirCouplingSlaveReportStep (ReservoirCouplingSlave< Scalar > &slave)
 Construct a report step manager for the slave process. More...
 
const Parallel::Communicationcomm () const
 Get the MPI communicator for intra-slave communication. More...
 
MPI_Comm getSlaveMasterComm () const
 Get the MPI communicator for slave-master communication. More...
 
bool hasMasterInjectionTarget (const std::string &gname, const Phase phase) const
 Check if a master-imposed injection target exists for a group and phase. More...
 
bool hasMasterProductionLimits (const std::string &gname) const
 Check if master-imposed per-rate-type production limits exist for a group. More...
 
bool hasMasterProductionTarget (const std::string &gname) const
 Check if a master-imposed production target exists for a group. More...
 
bool isFirstSubstepOfSyncTimestep () const
 Check if this is the first substep within a "sync" timestep. More...
 
ReservoirCoupling::Loggerlogger () const
 Get the logger for reservoir coupling operations. More...
 
std::pair< Scalar, Group::InjectionCMode > masterInjectionTarget (const std::string &gname, const Phase phase) const
 Get the master-imposed injection target and control mode for a group and phase. More...
 
const MasterProductionLimitsmasterProductionLimits (const std::string &gname) const
 Get the master-imposed per-rate-type production limits for a group. More...
 
std::pair< Scalar, Group::ProductionCMode > masterProductionTarget (const std::string &gname) const
 Get the master-imposed production target and control mode for a group. More...
 
std::pair< std::size_t, std::size_t > receiveNumGroupConstraintsFromMaster () const
 Receive the number of injection and production constraints from master. More...
 
void receiveInjectionGroupTargetsFromMaster (std::size_t num_targets)
 Receive injection group targets from master and store them locally. More...
 
void receiveProductionGroupConstraintsFromMaster (std::size_t num_targets)
 Receive production group constraints from master and store them locally. More...
 
void sendProductionDataToMaster (const std::vector< SlaveGroupProductionData > &production_data) const
 Send production data to the master process. More...
 
void sendInjectionDataToMaster (const std::vector< SlaveGroupInjectionData > &injection_data) const
 Send injection data to the master process. More...
 
void setFirstSubstepOfSyncTimestep (bool value)
 Set whether this is the first substep within a "sync" timestep. More...
 
const std::string & slaveName () const
 Get the name of this slave process. More...
 
void setMasterInjectionTarget (const std::string &gname, const Phase phase, const Scalar target, const Group::InjectionCMode cmode)
 Store a master-imposed injection target for a group and phase. More...
 
void setMasterProductionLimits (const std::string &gname, const MasterProductionLimits &limits)
 Store master-imposed per-rate-type production limits for a group. More...
 
void setMasterProductionTarget (const std::string &gname, const Scalar target, const Group::ProductionCMode cmode)
 Store a master-imposed production target for a group. More...
 

Detailed Description

template<class Scalar>
class Opm::ReservoirCouplingSlaveReportStep< Scalar >

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

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

  • Sending production data (rates, potentials) to the master process via MPI
  • Sending injection data (rates) to the master process via MPI
  • Coordinating data exchange between slave and master processes

The class serves as a helper to ReservoirCouplingSlave, separating the report-step-specific communication 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 a reference to the parent ReservoirCouplingSlave object and should only be used within the scope of that object's lifetime
See also
ReservoirCouplingSlave

Member Typedef Documentation

◆ InjectionGroupTarget

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

◆ MasterProductionLimits

template<class Scalar >
using Opm::ReservoirCouplingSlaveReportStep< Scalar >::MasterProductionLimits = ReservoirCoupling::MasterProductionLimits<Scalar>

◆ MessageTag

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

◆ ProductionGroupConstraints

template<class Scalar >
using Opm::ReservoirCouplingSlaveReportStep< Scalar >::ProductionGroupConstraints = ReservoirCoupling::ProductionGroupConstraints<Scalar>

◆ SlaveGroupInjectionData

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

◆ SlaveGroupProductionData

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

Constructor & Destructor Documentation

◆ ReservoirCouplingSlaveReportStep()

template<class Scalar >
Opm::ReservoirCouplingSlaveReportStep< Scalar >::ReservoirCouplingSlaveReportStep ( ReservoirCouplingSlave< Scalar > &  slave)

Construct a report step manager for the slave process.

Parameters
slaveReference to the parent ReservoirCouplingSlave object

Member Function Documentation

◆ comm()

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

Get the MPI communicator for intra-slave communication.

Returns
Reference to the parallel communication object

◆ getSlaveMasterComm()

template<class Scalar >
MPI_Comm Opm::ReservoirCouplingSlaveReportStep< Scalar >::getSlaveMasterComm ( ) const
inline

Get the MPI communicator for slave-master communication.

Returns
MPI communicator handle for communication with the master process

◆ hasMasterInjectionTarget()

template<class Scalar >
bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::hasMasterInjectionTarget ( const std::string &  gname,
const Phase  phase 
) const

Check if a master-imposed injection target exists for a group and phase.

Parameters
gnameSlave group name
phaseInjection phase (e.g., Phase::WATER, Phase::GAS)
Returns
true if the master sent an injection target for this group/phase pair

◆ hasMasterProductionLimits()

template<class Scalar >
bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::hasMasterProductionLimits ( const std::string &  gname) const

Check if master-imposed per-rate-type production limits exist for a group.

Parameters
gnameSlave group name
Returns
true if the master sent per-rate-type limits for this group

◆ hasMasterProductionTarget()

template<class Scalar >
bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::hasMasterProductionTarget ( const std::string &  gname) const

Check if a master-imposed production target exists for a group.

Parameters
gnameSlave group name
Returns
true if the master sent a production target for this group

◆ isFirstSubstepOfSyncTimestep()

template<class Scalar >
bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::isFirstSubstepOfSyncTimestep ( ) const
inline

Check if this is the first substep within a "sync" timestep.

This flag is used to control reservoir coupling synchronization. Master-slave data exchange should only happen at the start of each "sync" timestep, not on internal substeps or at retries after convergence chops.

Returns
true if this is the first substep of a "sync" timestep, false if not

◆ logger()

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

Get the logger for reservoir coupling operations.

Returns
Reference to the logger object for this coupling session

◆ masterInjectionTarget()

template<class Scalar >
std::pair< Scalar, Group::InjectionCMode > Opm::ReservoirCouplingSlaveReportStep< Scalar >::masterInjectionTarget ( const std::string &  gname,
const Phase  phase 
) const

Get the master-imposed injection target and control mode for a group and phase.

Parameters
gnameSlave group name
phaseInjection phase
Returns
Pair of (target rate, control mode)
Exceptions
std::out_of_rangeif no target exists for the given group/phase pair

◆ masterProductionLimits()

template<class Scalar >
const MasterProductionLimits & Opm::ReservoirCouplingSlaveReportStep< Scalar >::masterProductionLimits ( const std::string &  gname) const

Get the master-imposed per-rate-type production limits for a group.

Parameters
gnameSlave group name
Returns
Reference to the limits struct (-1 = no limit for that rate type)
Exceptions
std::out_of_rangeif no limits exist for the given group

◆ masterProductionTarget()

template<class Scalar >
std::pair< Scalar, Group::ProductionCMode > Opm::ReservoirCouplingSlaveReportStep< Scalar >::masterProductionTarget ( const std::string &  gname) const

Get the master-imposed production target and control mode for a group.

Parameters
gnameSlave group name
Returns
Pair of (target rate, control mode)
Exceptions
std::out_of_rangeif no target exists for the given group

◆ receiveInjectionGroupTargetsFromMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveInjectionGroupTargetsFromMaster ( std::size_t  num_targets)

Receive injection group targets from master and store them locally.

Parameters
num_targetsNumber of injection targets to receive

◆ receiveNumGroupConstraintsFromMaster()

template<class Scalar >
std::pair< std::size_t, std::size_t > Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveNumGroupConstraintsFromMaster ( ) const

Receive the number of injection and production constraints from master.

Returns
Pair of (num_injection_targets, num_production_constraints)

◆ receiveProductionGroupConstraintsFromMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveProductionGroupConstraintsFromMaster ( std::size_t  num_targets)

Receive production group constraints from master and store them locally.

Parameters
num_targetsNumber of production constraints to receive

◆ sendInjectionDataToMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::sendInjectionDataToMaster ( const std::vector< SlaveGroupInjectionData > &  injection_data) const

Send injection data to the master process.

This method sends injection rates and related data for all slave groups to the master process via MPI communication. The data is used by the master for group control calculations and coordination.

Parameters
injection_dataVector of injection data for each slave group
Note
This is a blocking operation that waits for the master to receive the data
Must be called before the master attempts to receive injection data

◆ sendProductionDataToMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::sendProductionDataToMaster ( const std::vector< SlaveGroupProductionData > &  production_data) const

Send production data to the master process.

This method sends production rates, potentials, and related data for all slave groups to the master process via MPI communication. The data is used by the master for group control calculations and coordination.

Parameters
production_dataVector of production data for each slave group
Note
This is a blocking operation that waits for the master to receive the data
Must be called before the master attempts to receive production data

◆ setFirstSubstepOfSyncTimestep()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::setFirstSubstepOfSyncTimestep ( bool  value)
inline

Set whether this is the first substep within a "sync" timestep.

Parameters
valuetrue at start of sync timestep, false after first runSubStep_() call

◆ setMasterInjectionTarget()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::setMasterInjectionTarget ( const std::string &  gname,
const Phase  phase,
const Scalar  target,
const Group::InjectionCMode  cmode 
)

Store a master-imposed injection target for a group and phase.

Parameters
gnameSlave group name
phaseInjection phase
targetTarget injection rate
cmodeInjection control mode dictated by the master

◆ setMasterProductionLimits()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::setMasterProductionLimits ( const std::string &  gname,
const MasterProductionLimits limits 
)

Store master-imposed per-rate-type production limits for a group.

Parameters
gnameSlave group name
limitsPer-rate-type limits (-1 = no limit for that rate type)

◆ setMasterProductionTarget()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::setMasterProductionTarget ( const std::string &  gname,
const Scalar  target,
const Group::ProductionCMode  cmode 
)

Store a master-imposed production target for a group.

Parameters
gnameSlave group name
targetTarget production rate
cmodeProduction control mode dictated by the master

◆ slaveName()

template<class Scalar >
const std::string & Opm::ReservoirCouplingSlaveReportStep< Scalar >::slaveName ( ) const
inline

Get the name of this slave process.

Returns
Reference to the name string for this slave

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