|
opm-simulators
|
Public Types | |
| using | MessageTag = ReservoirCoupling::MessageTag |
| using | Seconds = ReservoirCoupling::Seconds |
| using | Potentials = ReservoirCoupling::Potentials< Scalar > |
| using | SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData< Scalar > |
| using | InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget< Scalar > |
| using | MasterGroupNodePressure = ReservoirCoupling::MasterGroupNodePressure< Scalar > |
| using | ProductionGroupConstraints = ReservoirCoupling::ProductionGroupConstraints< Scalar > |
Public Member Functions | |
| ReservoirCouplingMaster (const Parallel::Communication &comm, const Schedule &schedule, int argc, char **argv) | |
| bool | activated () |
| void | addSlaveCommunicator (MPI_Comm comm) |
| void | addSlaveName (const std::string &name) |
| void | addSlaveActivationDate (double date) |
| void | addSlaveStartDate (std::time_t date) |
| void | clearDeferredLogger () |
| int | effectiveGCW (const std::string &group_name) const |
| Effective group-controlled-wells (GCW) count for a master group, used by guide-rate distribution independently of the group's production control mode. More... | |
| void | setEffectiveGCW (const std::string &group_name, int value) |
| void | resetEffectiveGCW () |
| Clear all effective-GCW entries. More... | |
| double | getActivationDate () const |
| int | getArgc () const |
| char * | getArgv (int index) const |
| char ** | getArgv () const |
| const Parallel::Communication & | getComm () const |
| const std::vector< std::string > & | getMasterGroupNamesForSlave (std::size_t slave_idx) const |
| Get the master group names associated with a slave reservoir by index. More... | |
| std::size_t | getMasterGroupCanonicalIdx (const std::string &slave_name, const std::string &master_group_name) const |
| Get the canonical index of the master group for a given slave name and master group name. More... | |
| Scalar | getMasterGroupRate (const std::string &group_name, ReservoirCoupling::Phase phase, ReservoirCoupling::RateKind kind) const |
| std::map< std::string, std::string > & | getMasterGroupToSlaveNameMap () |
| double | getSimulationStartDate () const |
| double | getSlaveActivationDate (int index) const |
| const double * | getSlaveActivationDates () const |
| MPI_Comm | getSlaveComm (int index) const |
| std::map< std::string, std::vector< std::string > > & | getSlaveNameToMasterGroupsMap () |
| const Potentials & | getSlaveGroupPotentials (const std::string &master_group_name) |
| int | getSlaveIdx (const std::string &slave_name) const |
| const std::string & | getSlaveName (int index) const |
| double | getSlaveStartDate (int index) const |
| const double * | getSlaveStartDates () |
| void | initStartOfReportStep (int report_step_idx) |
| void | initTimeStepping () |
| bool | isFirstSubstepOfSyncTimestep () const |
| bool | isMasterGroup (const std::string &group_name) const |
| bool | needsSlaveDataReceive () const |
| Check if the master needs to receive production data from the slaves. More... | |
| void | setNeedsSlaveDataReceive (bool value) |
| Set whether the master needs to receive production data from the slaves. More... | |
| ReservoirCoupling::Logger & | logger () |
| ReservoirCoupling::Logger & | logger () const |
| void | maybeActivate (int report_step) |
| void | maybeReceiveActivationHandshakeFromSlaves (double current_time) |
| double | maybeChopSubStep (double suggested_timestep, double current_time) const |
| void | maybeSpawnSlaveProcesses (int report_step) |
| std::size_t | numSlaveGroups (unsigned int index) |
| std::size_t | numSlaves () const |
| std::size_t | numSlavesStarted () const |
| std::size_t | numActivatedSlaves () const |
| void | rebuildSlaveIdxToMasterGroupsVector () |
| void | receiveNextReportDateFromSlaves () |
| void | receiveProductionDataFromSlaves () |
| void | receiveInjectionDataFromSlaves () |
| void | resizeNextReportDates (int size) |
| void | resizeSlaveActivationDates (int size) |
| void | resizeSlaveStartDates (int size) |
| const Schedule & | schedule () const |
| void | sendNextTimeStepToSlaves (double next_time_step) |
| void | sendCoupledNetworkActiveStatusToSlave (std::size_t slave_idx, bool active) const |
| Send a single boolean to a slave telling it whether the master will iterate the cross-rescoup network exchange this sync timestep. More... | |
| void | sendInjectionTargetsToSlave (std::size_t slave_idx, const std::vector< InjectionGroupTarget > &injection_targets) const |
| void | sendMasterGroupNodePressuresToSlave (std::size_t slave_idx, const std::vector< MasterGroupNodePressure > &pressures) const |
| Send master-computed network-leaf node pressures to a slave. | |
| void | sendNumGroupConstraintsToSlave (std::size_t slave_idx, std::size_t num_injection_targets, std::size_t num_production_constraints) const |
| void | sendNumMasterGroupNodePressuresToSlave (std::size_t slave_idx, std::size_t num_pressures, bool is_final) const |
Send the count of master-computed network-leaf node pressures plus the master's is_final flag for this sync-step iteration. More... | |
| void | sendProductionConstraintsToSlave (std::size_t slave_idx, const std::vector< ProductionGroupConstraints > &production_constraints) const |
| void | setDeferredLogger (DeferredLogger *deferred_logger) |
| void | setFirstSubstepOfSyncTimestep (bool value) |
| data::ReservoirCouplingGroupRates | collectGroupRatesForSummary () const |
| Collect production/injection rates for all master groups. More... | |
| void | setSlaveActivationDate (int index, double date) |
| void | setSlaveNextReportTimeOffset (int index, double offset) |
| void | setSlaveStartDate (int index, std::time_t date) |
| bool | slaveIsActivated (int index) const |
| bool | syncAtReportSteps () const |
| Whether the master syncs with slaves at slave report-step boundaries (true) or at every master actual time step (false, default CLI flag value). More... | |
| void | updateMasterGroupNameOrderMap (const std::string &slave_name, const std::map< std::string, std::size_t > &master_group_map) |
| void | sendDontTerminateSignalToSlaves () |
| Send "don't terminate" signal (value=0) to all active slaves. More... | |
| void | sendTerminateAndDisconnect () |
| Send terminate signal to all active slaves and disconnect intercommunicators. More... | |
| data::ReservoirCouplingGroupRates Opm::ReservoirCouplingMaster< Scalar >::collectGroupRatesForSummary | ( | ) | const |
Collect production/injection rates for all master groups.
Returns a ReservoirCouplingGroupRates struct that can be passed through DynamicSimulatorState to Summary::eval().
|
inline |
Effective group-controlled-wells (GCW) count for a master group, used by guide-rate distribution independently of the group's production control mode.
Set by RescoupConstraintsCalculator during master-group constraint calculation. A participating master group (GCONPROD item 8 RESPOND_TO_PARENT = YES) defaults to 1 so it is counted in the parent's guide-rate sum even while on individual control; it is set to 0 when capped at its slave's potential or when its slave is inactive. See GroupStateHelper::updateGroupControlledWellsRecursive_ for the reader.
| std::size_t Opm::ReservoirCouplingMaster< Scalar >::getMasterGroupCanonicalIdx | ( | const std::string & | slave_name, |
| const std::string & | master_group_name | ||
| ) | const |
Get the canonical index of the master group for a given slave name and master group name.
The index is used to map slave group data sent from the slaves, like potentials to the corresponding master group.
| slave_name | The name of the slave reservoir. |
| master_group_name | The name of the master group. |
| const std::vector< std::string > & Opm::ReservoirCouplingMaster< Scalar >::getMasterGroupNamesForSlave | ( | std::size_t | slave_idx | ) | const |
Get the master group names associated with a slave reservoir by index.
This method retrieves the list of master group names that are associated with a specific slave reservoir identified by its index.
| slave_idx | The zero-based index of the slave reservoir (must be < numSlaves()) |
| std::runtime_error | if slave_idx is out of bounds |
| bool Opm::ReservoirCouplingMaster< Scalar >::needsSlaveDataReceive | ( | ) | const |
Check if the master needs to receive production data from the slaves.
This flag is used to control reservoir coupling synchronization of summary data sent from the slaves to the master process. The master blocks in timeStepSucceeded() until all slaves have sent their production data.
|
inline |
Clear all effective-GCW entries.
Call at the start of each master-group constraint calculation before any entries are set, so stale caps from a previous sync step do not leak in.
| void Opm::ReservoirCouplingMaster< Scalar >::sendCoupledNetworkActiveStatusToSlave | ( | std::size_t | slave_idx, |
| bool | active | ||
| ) | const |
Send a single boolean to a slave telling it whether the master will iterate the cross-rescoup network exchange this sync timestep.
| void Opm::ReservoirCouplingMaster< Scalar >::sendDontTerminateSignalToSlaves | ( | ) |
Send "don't terminate" signal (value=0) to all active slaves.
This method is called at the start of each iteration in the master's substep loop, before receiving the next report date from slaves. The slave waits for this signal at the start of each iteration - if it receives 0, it continues; if it receives 1 (from sendTerminateAndDisconnect()), it terminates.
| void Opm::ReservoirCouplingMaster< Scalar >::sendNumMasterGroupNodePressuresToSlave | ( | std::size_t | slave_idx, |
| std::size_t | num_pressures, | ||
| bool | is_final | ||
| ) | const |
Send the count of master-computed network-leaf node pressures plus the master's is_final flag for this sync-step iteration.
| void Opm::ReservoirCouplingMaster< Scalar >::sendTerminateAndDisconnect | ( | ) |
Send terminate signal to all active slaves and disconnect intercommunicators.
This method must be called at the end of the simulation to cleanly shut down the MPI intercommunicators created by MPI_Comm_spawn(). 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::ReservoirCouplingMaster< Scalar >::setNeedsSlaveDataReceive | ( | bool | value | ) |
Set whether the master needs to receive production data from the slaves.
See needsSlaveDataReceive() for details.
| value | true if the master needs to receive production data from the slaves, false if not |
|
inline |
Whether the master syncs with slaves at slave report-step boundaries (true) or at every master actual time step (false, default CLI flag value).
Set from the –rescoup-sync-at-report-steps CLI flag in the constructor. See Parameters::RescoupSyncAtReportSteps.