|
opm-simulators
|
Public Types | |
| using | MessageTag = ReservoirCoupling::MessageTag |
| using | Potentials = ReservoirCoupling::Potentials< Scalar > |
| using | SlaveGroupInjectionData = ReservoirCoupling::SlaveGroupInjectionData< Scalar > |
| using | SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData< Scalar > |
| using | InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget< Scalar > |
| using | MasterGroupNodePressure = ReservoirCoupling::MasterGroupNodePressure< Scalar > |
| using | MasterProductionLimits = typename ReservoirCoupling::MasterProductionLimits< Scalar > |
| using | ProductionGroupConstraints = ReservoirCoupling::ProductionGroupConstraints< Scalar > |
Public Member Functions | |
| ReservoirCouplingSlave (const Parallel::Communication &comm, const Schedule &schedule, const SimulatorTimer &timer) | |
| bool | activated () const |
| void | clearDeferredLogger () |
| const Parallel::Communication & | getComm () const |
| MPI_Comm | getMasterComm () const |
| const std::string & | getSlaveName () const |
| const std::map< std::string, std::string > & | getSlaveToMasterGroupNameMap () const |
| bool | hasMasterGroupNodePressure (const std::string &gname) const |
| Check if a master-computed network-leaf node pressure exists for a master group. 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... | |
| void | initTimeStepping () |
| bool | isFirstSubstepOfSyncTimestep () const |
| bool | isLastSubstepOfSyncTimestep () const |
| Check if this is the last substep within a "sync" timestep. More... | |
| bool | isSlaveGroup (const std::string &group_name) const |
| bool | lastReceivedMasterGroupNodePressuresIsFinal () const |
Whether the most recent master-group-node-pressures receive carried the is_final flag. More... | |
| bool | connectedToMasterCoupledNetwork () const |
| Whether this slave is connected to the master's cross-rescoup network this sync step. More... | |
| ReservoirCoupling::Logger & | logger () |
| ReservoirCoupling::Logger & | logger () const |
| Scalar | masterGroupNodePressure (const std::string &gname) const |
| Get the master-computed network-leaf node pressure for a master group. More... | |
| const std::map< std::string, Scalar > & | masterGroupNodePressures () const |
| Get the full map of master-computed network-leaf node pressures. 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 MasterProductionLimits & | masterProductionLimits (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... | |
| void | maybeActivate (int report_step) |
| std::size_t | numSlaveGroups () const |
| void | receiveCoupledNetworkActiveStatusFromMaster () |
| Receive the master's single-bool flag for the current sync timestep and mirror it into the slave's local is_final state. More... | |
| double | receiveNextTimeStepFromMaster () |
| std::pair< std::size_t, std::size_t > | receiveNumGroupConstraintsFromMaster () const |
| void | receiveInjectionGroupTargetsFromMaster (std::size_t num_targets) |
| Receive injection group targets from master and store them locally. More... | |
| void | receiveMasterGroupNodePressuresFromMaster (std::size_t num_pressures) |
| Receive master-computed network-leaf node pressures from master. More... | |
| std::pair< std::size_t, bool > | receiveNumMasterGroupNodePressuresFromMaster () |
| Receive the master-group-node-pressures header from master. More... | |
| void | receiveProductionGroupConstraintsFromMaster (std::size_t num_targets) |
| Receive production group constraints from master and store them locally. More... | |
| void | sendAndReceiveInitialData () |
| void | sendInjectionDataToMaster (const std::vector< SlaveGroupInjectionData > &injection_data) const |
| void | sendNextReportDateToMasterProcess () const |
| void | sendProductionDataToMaster (const std::vector< SlaveGroupProductionData > &production_data) const |
| void | setDeferredLogger (DeferredLogger *deferred_logger) |
| void | setFirstSubstepOfSyncTimestep (bool value) |
| void | setLastSubstepOfSyncTimestep (bool value) |
| Set whether this is the last substep within a "sync" timestep. More... | |
| void | markSlaveGroupsInSchedule (Schedule &schedule, int report_step_idx) |
| Mark slave groups in the Schedule as production/injection groups. More... | |
| const std::string & | slaveGroupIdxToGroupName (std::size_t group_idx) const |
| bool | terminated () const |
| bool | maybeReceiveTerminateSignalFromMaster () |
| Blocking receive for terminate/continue signal from master. More... | |
| void | receiveTerminateAndDisconnect () |
| Receive terminate signal from master and disconnect the intercommunicator. More... | |
| bool Opm::ReservoirCouplingSlave< Scalar >::connectedToMasterCoupledNetwork | ( | ) | const |
Whether this slave is connected to the master's cross-rescoup network this sync step.
Delegates to ReservoirCouplingSlaveReportStep.
| bool Opm::ReservoirCouplingSlave< Scalar >::hasMasterGroupNodePressure | ( | const std::string & | gname | ) | const |
Check if a master-computed network-leaf node pressure exists for a master group.
Delegates to ReservoirCouplingSlaveReportStep
| bool Opm::ReservoirCouplingSlave< Scalar >::hasMasterInjectionTarget | ( | const std::string & | gname, |
| const Phase | phase | ||
| ) | const |
Check if a master-imposed injection target exists for a group and phase.
Delegates to ReservoirCouplingSlaveReportStep
| bool Opm::ReservoirCouplingSlave< Scalar >::hasMasterProductionLimits | ( | const std::string & | gname | ) | const |
Check if master-imposed per-rate-type production limits exist for a group.
Delegates to ReservoirCouplingSlaveReportStep
| bool Opm::ReservoirCouplingSlave< Scalar >::hasMasterProductionTarget | ( | const std::string & | gname | ) | const |
Check if a master-imposed production target exists for a group.
Delegates to ReservoirCouplingSlaveReportStep
| bool Opm::ReservoirCouplingSlave< Scalar >::isLastSubstepOfSyncTimestep | ( | ) | const |
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.
| bool Opm::ReservoirCouplingSlave< Scalar >::lastReceivedMasterGroupNodePressuresIsFinal | ( | ) | const |
Whether the most recent master-group-node-pressures receive carried the is_final flag.
Delegates to ReservoirCouplingSlaveReportStep.
| void Opm::ReservoirCouplingSlave< Scalar >::markSlaveGroupsInSchedule | ( | Schedule & | schedule, |
| int | report_step_idx | ||
| ) |
Mark slave groups in the Schedule as production/injection groups.
Delegates to ReservoirCouplingSlaveReportStep.
| Scalar Opm::ReservoirCouplingSlave< Scalar >::masterGroupNodePressure | ( | const std::string & | gname | ) | const |
Get the master-computed network-leaf node pressure for a master group.
Delegates to ReservoirCouplingSlaveReportStep
| const std::map< std::string, Scalar > & Opm::ReservoirCouplingSlave< Scalar >::masterGroupNodePressures | ( | ) | const |
Get the full map of master-computed network-leaf node pressures.
Delegates to ReservoirCouplingSlaveReportStep
| std::pair< Scalar, Group::InjectionCMode > Opm::ReservoirCouplingSlave< Scalar >::masterInjectionTarget | ( | const std::string & | gname, |
| const Phase | phase | ||
| ) | const |
Get the master-imposed injection target and control mode for a group and phase.
Delegates to ReservoirCouplingSlaveReportStep
| const ReservoirCouplingSlave< Scalar >::MasterProductionLimits & Opm::ReservoirCouplingSlave< Scalar >::masterProductionLimits | ( | const std::string & | gname | ) | const |
Get the master-imposed per-rate-type production limits for a group.
Delegates to ReservoirCouplingSlaveReportStep
| std::pair< Scalar, Group::ProductionCMode > Opm::ReservoirCouplingSlave< Scalar >::masterProductionTarget | ( | const std::string & | gname | ) | const |
Get the master-imposed production target and control mode for a group.
Delegates to ReservoirCouplingSlaveReportStep
| bool Opm::ReservoirCouplingSlave< Scalar >::maybeReceiveTerminateSignalFromMaster | ( | ) |
Blocking receive for terminate/continue signal from master.
This method is called at the start of each timestep iteration in the slave's substep loop. Master sends 0 (continue) or 1 (terminate) at each iteration. If terminate signal (value != 0) is received, disconnects the intercommunicator, sets the terminated flag, and returns true.
| void Opm::ReservoirCouplingSlave< Scalar >::receiveCoupledNetworkActiveStatusFromMaster | ( | ) |
Receive the master's single-bool flag for the current sync timestep and mirror it into the slave's local is_final state.
Delegates to ReservoirCouplingSlaveReportStep. Side effect: updates last_received_master_group_node_pressures_is_final_; query it via lastReceivedMasterGroupNodePressuresIsFinal().
| void Opm::ReservoirCouplingSlave< Scalar >::receiveInjectionGroupTargetsFromMaster | ( | std::size_t | num_targets | ) |
Receive injection group targets from master and store them locally.
Delegates to ReservoirCouplingSlaveReportStep
| void Opm::ReservoirCouplingSlave< Scalar >::receiveMasterGroupNodePressuresFromMaster | ( | std::size_t | num_pressures | ) |
Receive master-computed network-leaf node pressures from master.
Delegates to ReservoirCouplingSlaveReportStep
| std::pair< std::size_t, bool > Opm::ReservoirCouplingSlave< Scalar >::receiveNumMasterGroupNodePressuresFromMaster | ( | ) |
Receive the master-group-node-pressures header from master.
Delegates to ReservoirCouplingSlaveReportStep. Returns (num_pressures, is_final).
| void Opm::ReservoirCouplingSlave< Scalar >::receiveProductionGroupConstraintsFromMaster | ( | std::size_t | num_targets | ) |
Receive production group constraints from master and store them locally.
Delegates to ReservoirCouplingSlaveReportStep
| void Opm::ReservoirCouplingSlave< Scalar >::receiveTerminateAndDisconnect | ( | ) |
Receive terminate signal from master and disconnect the intercommunicator.
This method must be called at the end of the simulation to cleanly shut down the MPI intercommunicator created when the slave was spawned. It performs two steps:
Both master and slaves must call their respective disconnect methods for MPI_Comm_disconnect() to complete - it is a collective operation.
| void Opm::ReservoirCouplingSlave< Scalar >::setLastSubstepOfSyncTimestep | ( | bool | value | ) |
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 |