20#ifndef OPM_BLACKOILWELLMODEL_RESCOUP_HEADER_INCLUDED
21#define OPM_BLACKOILWELLMODEL_RESCOUP_HEADER_INCLUDED
25#ifdef RESERVOIR_COUPLING_ENABLED
36 template<
class TypeTag>
class BlackoilWellModel;
37 template<
class Scalar,
class IndexTraits>
class GroupStateHelper;
38 template<
class Scalar,
class IndexTraits>
class WellState;
39 template<
class Scalar>
class ReservoirCouplingMaster;
40 template<
class Scalar>
class ReservoirCouplingSlave;
56template<
typename TypeTag>
57class BlackoilWellModelRescoup {
58 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
59 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
60 using IndexTraits =
typename FluidSystem::IndexTraitsType;
61 using Simulator = GetPropType<TypeTag, Properties::Simulator>;
62 using ModelParameters = BlackoilModelParameters<Scalar>;
66 explicit BlackoilWellModelRescoup(BlackoilWellModel<TypeTag>& well_model);
70 bool isReservoirCouplingMaster()
const {
return well_model_.isReservoirCouplingMaster(); }
71 bool isReservoirCouplingSlave()
const {
return well_model_.isReservoirCouplingSlave(); }
73 ReservoirCouplingMaster<Scalar>& reservoirCouplingMaster()
74 {
return well_model_.reservoirCouplingMaster(); }
75 const ReservoirCouplingMaster<Scalar>& reservoirCouplingMaster()
const
76 {
return well_model_.reservoirCouplingMaster(); }
78 ReservoirCouplingSlave<Scalar>& reservoirCouplingSlave()
79 {
return well_model_.reservoirCouplingSlave(); }
80 const ReservoirCouplingSlave<Scalar>& reservoirCouplingSlave()
const
81 {
return well_model_.reservoirCouplingSlave(); }
85 GroupStateHelper<Scalar, IndexTraits>& groupStateHelper()
86 {
return well_model_.groupStateHelper(); }
87 const GroupStateHelper<Scalar, IndexTraits>& groupStateHelper()
const
88 {
return well_model_.groupStateHelper(); }
90 WellState<Scalar, IndexTraits>& wellState()
91 {
return well_model_.wellState(); }
92 const WellState<Scalar, IndexTraits>& wellState()
const
93 {
return well_model_.wellState(); }
95 const Schedule& schedule()
const {
return well_model_.schedule(); }
97 std::vector<WellInterfacePtr>& wellContainer()
98 {
return well_model_.wellContainer(); }
108 bool lastSentMasterGroupNodePressuresIsFinal()
const
109 {
return last_sent_master_group_node_pressures_is_final_; }
120 bool masterNetworkHasMasterGroupLeaves()
const;
127 bool masterIsInCoupledNetworkIteration()
const;
136 void receiveCoupledNetworkActiveStatus();
144 void receiveGroupConstraintsFromMaster();
149 void receiveMasterGroupNodePressuresFromMaster();
158 void receiveSlaveGroupData();
166 void rescoupSyncSummaryData();
178 void sendCoupledNetworkActiveStatus();
187 void sendMasterGroupConstraintsToSlaves();
197 void sendMasterGroupNodePressuresToSlaves(
bool is_final);
209 void maybeExchangeNetworkSubIterationWithSlaves();
222 void maybeExchangeNetworkOuterIterationWithSlaves(
bool more_network_update);
230 void sendSlaveGroupDataToMaster();
234 std::optional<ReservoirCoupling::ScopedLoggerGuard> setupScopedLogger(DeferredLogger& local_logger);
243 bool masterNetworkHasMasterGroupLeavesForSlave_(std::size_t slave_idx)
const;
245 BlackoilWellModel<TypeTag>& well_model_;
246 BlackoilWellModelNetwork<TypeTag>& network_;
247 Simulator& simulator_;
248 const ModelParameters& param_;
251 bool last_sent_master_group_node_pressures_is_final_{
true};
Defines a type tags and some fundamental properties all models.
std::unique_ptr< WellInterface< TypeTag > > WellInterfacePtr
Definition: BlackoilWellModel.hpp:189
Definition: blackoilbioeffectsmodules.hh:45