53class GuideRateHandler {
56#ifdef RESERVOIR_COUPLING_ENABLED
66 class GuideRateDumper {
69 GuideRateHandler<Scalar, IndexTraits> &parent,
const int report_step_idx,
const double sim_time
72 DeferredLogger &deferredLogger() {
return this->parent_.deferredLogger(); }
78 void dumpGuideRatesRecursive_(
const Group& group,
int level);
79 void getGroupGuideRatesInjection_(
81 const data::GroupGuideRates& group_guide_rate,
82 std::vector<std::string>& msg_items
84 void getGroupGuideRatesProduction_(
86 const data::GroupGuideRates& group_guide_rate,
87 std::vector<std::string>& msg_items
95 void printGroupGuideRates_(
const Group& group,
int level);
98 void printWellGuideRates_(
const Well& well,
int level);
100 GuideRateHandler<Scalar, IndexTraits> &parent_;
101 const int report_step_idx_;
102 const double sim_time_;
104 const Schedule& schedule_;
105 const Parallel::Communication& comm_;
106 std::unordered_map<std::string, data::GuideRateValue> well_guide_rates_;
107 std::unordered_map<std::string, data::GroupGuideRates> group_guide_rates_;
117 class UpdateGuideRates {
120 GuideRateHandler<Scalar, IndexTraits> &parent,
121 const int report_step_idx,
122 const double sim_time,
128#ifdef RESERVOIR_COUPLING_ENABLED
129 bool isReservoirCouplingMaster()
const {
return this->parent_.isReservoirCouplingMaster(); }
131 return this->parent_.reservoirCouplingMaster();
134 const Parallel::Communication &comm()
const {
return this->parent_.comm_; }
135 DeferredLogger &deferredLogger() {
return this->parent_.deferredLogger(); }
136 GuideRate &guideRate() {
return this->parent_.guide_rate_; }
138 const SummaryState &summaryState()
const {
return this->parent_.summary_state_; }
139 const Schedule &schedule()
const {
return this->parent_.schedule_; }
146#ifdef RESERVOIR_COUPLING_ENABLED
147 bool isMasterGroup_(
const Group& group);
149 void updateGuideRatesForInjectionGroups_(
const Group& group);
156 void updateGuideRatesForProductionGroups_(
const Group& group, std::vector<Scalar>& pot);
157 void updateGuideRatesForWells_();
158#ifdef RESERVOIR_COUPLING_ENABLED
159 void updateProductionGroupPotentialFromSlaveGroup_(
160 const Group& group, std::vector<Scalar>& pot);
162 void updateProductionGroupPotentialFromSubGroups(
163 const Group& group, std::vector<Scalar>& pot);
165 GuideRateHandler<Scalar, IndexTraits> &parent_;
166 const int report_step_idx_;
167 const double sim_time_;
170 const int num_phases_;
171 const UnitSystem& unit_system_;
176 const Schedule& schedule,
177 const SummaryState& summary_state,
178 const Parallel::Communication& comm
181#ifdef RESERVOIR_COUPLING_ENABLED
182 bool isReservoirCouplingMaster()
const {
183 return this->reservoir_coupling_master_ !=
nullptr;
185 bool isReservoirCouplingSlave()
const {
186 return this->reservoir_coupling_slave_ !=
nullptr;
188 void receiveMasterGroupPotentialsFromSlaves();
189 ReservoirCouplingMaster& reservoirCouplingMaster() {
return *(this->reservoir_coupling_master_); }
190 ReservoirCouplingSlave& reservoirCouplingSlave() {
return *(this->reservoir_coupling_slave_); }
191 void sendSlaveGroupPotentialsToMaster(
const GroupState<Scalar>& group_state);
192 void setReservoirCouplingMaster(ReservoirCouplingMaster *reservoir_coupling_master) {
193 this->reservoir_coupling_master_ = reservoir_coupling_master;
195 void setReservoirCouplingSlave(ReservoirCouplingSlave *reservoir_coupling_slave) {
196 this->reservoir_coupling_slave_ = reservoir_coupling_slave;
199 DeferredLogger& deferredLogger();
209 const Parallel::Communication& getComm()
const {
return comm_; }
210 void setLogger(DeferredLogger *deferred_logger);
211 const Schedule& schedule()
const {
return schedule_; }
221 const double sim_time,
222 const WellState<Scalar, IndexTraits>& well_state,
223 GroupState<Scalar>& group_state);
225 const BlackoilWellModelGeneric<Scalar, IndexTraits>& wellModel()
const {
return well_model_; }
227 void debugDumpGuideRatesRecursive_(
const Group& group)
const;
228 BlackoilWellModelGeneric<Scalar, IndexTraits>& well_model_;
229 const Schedule& schedule_;
230 const SummaryState& summary_state_;
231 const Parallel::Communication& comm_;
232 GuideRate& guide_rate_;
233 DeferredLogger *deferred_logger_ =
nullptr;
234#ifdef RESERVOIR_COUPLING_ENABLED
235 ReservoirCouplingMaster *reservoir_coupling_master_ =
nullptr;
236 ReservoirCouplingSlave *reservoir_coupling_slave_ =
nullptr;
void debugDumpGuideRates(const int report_step_idx, const double sim_time)
Dumps guide rate information to the logger in a readable format.
Definition GuideRateHandler.cpp:101
void updateGuideRates(const int report_step_idx, const double sim_time, const WellState< Scalar, IndexTraits > &well_state, GroupState< Scalar > &group_state)
Updates guide rates for the current simulation step.
Definition GuideRateHandler.cpp:172