|
opm-simulators
|
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. | |
| const Parallel::Communication & | comm () const |
| Get the MPI communicator for intra-slave communication. | |
| MPI_Comm | getSlaveMasterComm () const |
| Get the MPI communicator for slave-master communication. | |
| bool | hasMasterInjectionTarget (const std::string &gname, const Phase phase) const |
| Check if a master-imposed injection target exists for a group and phase. | |
| bool | hasMasterProductionLimits (const std::string &gname) const |
| Check if master-imposed per-rate-type production limits exist for a group. | |
| bool | hasMasterProductionTarget (const std::string &gname) const |
| Check if a master-imposed production target exists for a group. | |
| bool | isFirstSubstepOfSyncTimestep () const |
| Check if this is the first substep within a "sync" timestep. | |
| bool | isLastSubstepOfSyncTimestep () const |
| Check if this is the last substep within a "sync" timestep. | |
| ReservoirCoupling::Logger & | logger () const |
| Get the logger for reservoir coupling operations. | |
| 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. | |
| const MasterProductionLimits & | masterProductionLimits (const std::string &gname) const |
| Get the master-imposed per-rate-type production limits for a group. | |
| std::pair< Scalar, Group::ProductionCMode > | masterProductionTarget (const std::string &gname) const |
| Get the master-imposed production target and control mode for a group. | |
| std::pair< std::size_t, std::size_t > | receiveNumGroupConstraintsFromMaster () const |
| Receive the number of injection and production constraints from master. | |
| void | receiveInjectionGroupTargetsFromMaster (std::size_t num_targets) |
| Receive injection group targets from master and store them locally. | |
| void | receiveProductionGroupConstraintsFromMaster (std::size_t num_targets) |
| Receive production group constraints from master and store them locally. | |
| void | sendProductionDataToMaster (const std::vector< SlaveGroupProductionData > &production_data) const |
| Send production data to the master process. | |
| void | sendInjectionDataToMaster (const std::vector< SlaveGroupInjectionData > &injection_data) const |
| Send injection data to the master process. | |
| void | setFirstSubstepOfSyncTimestep (bool value) |
| Set whether this is the first substep within a "sync" timestep. | |
| void | setLastSubstepOfSyncTimestep (bool value) |
| Set whether this is the last substep within a "sync" timestep. | |
| const std::string & | slaveName () const |
| Get the name of this slave process. | |
| 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. | |
| void | setMasterProductionLimits (const std::string &gname, const MasterProductionLimits &limits) |
| Store master-imposed per-rate-type production limits for a group. | |
| void | setMasterProductionTarget (const std::string &gname, const Scalar target, const Group::ProductionCMode cmode) |
| Store a master-imposed production target for a group. | |
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:
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.
| Scalar | Floating-point type for rate and potential values (typically double or float) |
| Opm::ReservoirCouplingSlaveReportStep< Scalar >::ReservoirCouplingSlaveReportStep | ( | ReservoirCouplingSlave< Scalar > & | slave | ) |
Construct a report step manager for the slave process.
| slave | Reference to the parent ReservoirCouplingSlave object |
|
inline |
Get the MPI communicator for intra-slave communication.
|
inline |
Get the MPI communicator for slave-master communication.
| 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.
| gname | Slave group name |
| phase | Injection phase (e.g., Phase::WATER, Phase::GAS) |
| bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::hasMasterProductionLimits | ( | const std::string & | gname | ) | const |
Check if master-imposed per-rate-type production limits exist for a group.
| gname | Slave group name |
| bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::hasMasterProductionTarget | ( | const std::string & | gname | ) | const |
Check if a master-imposed production target exists for a group.
| gname | Slave group name |
|
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.
|
inline |
Check if this is the last substep within a "sync" timestep.
This flag is used to control reservoir coupling synchronization of summary data sent from the slave to the master process. The slave should send production data to the master at the end of its "sync" timestep, while master is waiting for it in timeStepSucceeded() of the first substep of the sync step.
|
inline |
Get the logger for reservoir coupling operations.
| 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.
| gname | Slave group name |
| phase | Injection phase |
| std::out_of_range | if no target exists for the given group/phase pair |
| const ReservoirCouplingSlaveReportStep< Scalar >::MasterProductionLimits & Opm::ReservoirCouplingSlaveReportStep< Scalar >::masterProductionLimits | ( | const std::string & | gname | ) | const |
Get the master-imposed per-rate-type production limits for a group.
| gname | Slave group name |
| std::out_of_range | if no limits exist for the given group |
| 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.
| gname | Slave group name |
| std::out_of_range | if no target exists for the given group |
| void Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveInjectionGroupTargetsFromMaster | ( | std::size_t | num_targets | ) |
Receive injection group targets from master and store them locally.
| num_targets | Number of injection targets to receive |
| std::pair< std::size_t, std::size_t > Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveNumGroupConstraintsFromMaster | ( | ) | const |
Receive the number of injection and production constraints from master.
| void Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveProductionGroupConstraintsFromMaster | ( | std::size_t | num_targets | ) |
Receive production group constraints from master and store them locally.
| num_targets | Number of production constraints to receive |
| 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.
| injection_data | Vector of injection data for each slave group |
| 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.
| production_data | Vector of production data for each slave group |
|
inline |
Set whether this is the first substep within a "sync" timestep.
| value | true at start of sync timestep, false after first runSubStep_() call |
|
inline |
Set whether this is the last substep within a "sync" timestep.
See isLastSubstepOfSyncTimestep() for details.
| value | true if this is the last substep of a "sync" timestep, false if not |
| 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.
| gname | Slave group name |
| phase | Injection phase |
| target | Target injection rate |
| cmode | Injection control mode dictated by the master |
| void Opm::ReservoirCouplingSlaveReportStep< Scalar >::setMasterProductionLimits | ( | const std::string & | gname, |
| const MasterProductionLimits & | limits ) |
Store master-imposed per-rate-type production limits for a group.
| gname | Slave group name |
| limits | Per-rate-type limits (-1 = no limit for that rate type) |
| 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.
| gname | Slave group name |
| target | Target production rate |
| cmode | Production control mode dictated by the master |
|
inline |
Get the name of this slave process.