|
opm-simulators
|
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 | ProductionGroupConstraints = ReservoirCoupling::ProductionGroupConstraints<Scalar> |
Public Member Functions | |
| ReservoirCouplingMasterReportStep (ReservoirCouplingMaster< Scalar > &master) | |
| Construct a report step manager for the master process. | |
| const Parallel::Communication & | comm () const |
| Get the MPI communicator for master-slave communication. | |
| const std::vector< std::string > & | getMasterGroupNamesForSlave (std::size_t slave_idx) const |
| Get the names of master groups associated with a specific slave. | |
| const std::map< std::string, std::string > & | getMasterGroupToSlaveNameMap () const |
| Get the mapping from master group names to slave names. | |
| std::size_t | getMasterGroupCanonicalIdx (const std::string &slave_name, const std::string &master_group_name) const |
| Get the canonical index for a master group. | |
| MPI_Comm | getSlaveComm (int index) const |
| Get the MPI communicator for a specific slave process. | |
| Scalar | getMasterGroupInjectionSurfaceRate (const std::string &group_name, ReservoirCoupling::Phase phase) const |
| Get the injection surface rate for a master group. | |
| Scalar | getMasterGroupInjectionReservoirRate (const std::string &group_name, ReservoirCoupling::Phase phase) const |
| Get the injection reservoir rate for a master group. | |
| Scalar | getMasterGroupProductionSurfaceRate (const std::string &group_name, ReservoirCoupling::Phase phase) const |
| Get the production surface rate for a master group. | |
| Scalar | getMasterGroupNetworkProductionSurfaceRate (const std::string &group_name, ReservoirCoupling::Phase phase) const |
| Get the network production surface rate for a master group. | |
| Scalar | getMasterGroupProductionReservoirRate (const std::string &group_name, ReservoirCoupling::Phase phase) const |
| Get the production reservoir rate for a master group. | |
| const Potentials & | getSlaveGroupPotentials (const std::string &master_group_name) const |
| Get the production potentials for a slave group. | |
| bool | isFirstSubstepOfSyncTimestep () const |
| Check if this is the first substep within a "sync" timestep. | |
| bool | needsSlaveDataReceive () const |
| Check if the master needs to receive slave data at the next timeStepSucceeded() call. | |
| void | setNeedsSlaveDataReceive (bool value) |
| Set/clear the flag for pending slave data receive. | |
| std::size_t | numSlaveGroups (unsigned int index) const |
| Get the number of slave groups for a specific slave process. | |
| std::size_t | numSlaves () const |
| Get the total number of active slave processes. | |
| ReservoirCoupling::Logger & | logger () const |
| Get the logger for reservoir coupling operations. | |
| void | receiveInjectionDataFromSlaves () |
| Receive injection data from all active slave processes. | |
| void | receiveProductionDataFromSlaves () |
| Receive production data from all active slave processes. | |
| const Schedule & | schedule () const |
| Get the simulation schedule. | |
| void | sendInjectionTargetsToSlave (std::size_t slave_idx, const std::vector< InjectionGroupTarget > &injection_targets) const |
| void | sendNumGroupConstraintsToSlave (std::size_t slave_idx, std::size_t num_injection_targets, std::size_t num_production_constraints) const |
| void | sendProductionConstraintsToSlave (std::size_t slave_idx, const std::vector< ProductionGroupConstraints > &production_constraints) const |
| void | setFirstSubstepOfSyncTimestep (bool value) |
| Set whether this is the first substep within a "sync" timestep. | |
| void | setReportStepIdx (int report_step_idx) |
| Set the current report step index. | |
| bool | slaveIsActivated (int index) const |
| Check if a specific slave process has been activated. | |
| const std::string & | slaveName (int index) const |
| Get the name of a specific slave process. | |
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:
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.
| Scalar | Floating-point type for rate and potential values (typically double or float) |
| Opm::ReservoirCouplingMasterReportStep< Scalar >::ReservoirCouplingMasterReportStep | ( | ReservoirCouplingMaster< Scalar > & | master | ) |
Construct a report step manager for the master process.
| master | Reference to the parent ReservoirCouplingMaster object |
|
inline |
Get the MPI communicator for master-slave communication.
| 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.
| slave_name | Name of the slave process |
| master_group_name | Name of the master group |
| Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupInjectionReservoirRate | ( | const std::string & | group_name, |
| ReservoirCoupling::Phase | phase ) const |
Get the injection reservoir rate for a master group.
| group_name | Name of the master group |
| phase | ReservoirCoupling::Phase enum (Oil, Gas, or Water) |
| Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupInjectionSurfaceRate | ( | const std::string & | group_name, |
| ReservoirCoupling::Phase | phase ) const |
Get the injection surface rate for a master group.
| group_name | Name of the master group |
| phase | ReservoirCoupling::Phase enum (Oil, Gas, or Water) |
|
inline |
Get the names of master groups associated with a specific slave.
| slave_idx | Index of the slave process |
| Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupNetworkProductionSurfaceRate | ( | const std::string & | group_name, |
| ReservoirCoupling::Phase | phase ) const |
Get the network production surface rate for a master group.
This returns the production rate computed with network=true, meaning efficiency factors are 1.0 for groups/wells where GEFAC/WEFAC item 3 = "NO". This is used for network leaf node rate calculations.
| group_name | Name of the master group |
| phase | ReservoirCoupling::Phase enum (Oil, Gas, or Water) |
| 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.
| group_name | Name of the master group |
| phase | ReservoirCoupling::Phase enum (Oil, Gas, or Water) |
| Scalar Opm::ReservoirCouplingMasterReportStep< Scalar >::getMasterGroupProductionSurfaceRate | ( | const std::string & | group_name, |
| ReservoirCoupling::Phase | phase ) const |
Get the production surface rate for a master group.
| group_name | Name of the master group |
| phase | ReservoirCoupling::Phase enum (Oil, Gas, or Water) |
|
inline |
Get the mapping from master group names to slave names.
|
inline |
Get the MPI communicator for a specific slave process.
| index | Index of the slave process |
| const ReservoirCoupling::Potentials< Scalar > & Opm::ReservoirCouplingMasterReportStep< Scalar >::getSlaveGroupPotentials | ( | const std::string & | master_group_name | ) | const |
Get the production potentials for a slave group.
| master_group_name | Name of the master group |
|
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 |
Get the logger for reservoir coupling operations.
|
inline |
Check if the master needs to receive slave data at the next timeStepSucceeded() call.
The slave data is needed for correct summary output.
|
inline |
Get the number of slave groups for a specific slave process.
| index | Index of the slave process |
|
inline |
Get the total number of active slave processes.
| 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.
| 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.
|
inline |
Get the simulation schedule.
|
inline |
Set whether this is the first substep within a "sync" timestep.
| value | true at start of sync timestep, false after first runSubStep_() call |
| void Opm::ReservoirCouplingMasterReportStep< Scalar >::setReportStepIdx | ( | int | report_step_idx | ) |
Set the current report step index.
| report_step_idx | The report step index to set |
This updates the internal state to track which report step is currently being processed.
|
inline |
Check if a specific slave process has been activated.
| index | Index of the slave process |
|
inline |
Get the name of a specific slave process.
| index | Index of the slave process |