60 const int pvtRegionIdx,
70 const std::string&
name()
const;
79 const std::vector<int>&
cells()
const {
return well_cells_; }
84 void adaptRatesForVFP(std::vector<Scalar>& rates)
const;
86 const Well& wellEcl()
const;
94 bool isOperableAndSolvable()
const;
95 bool useVfpExplicit ()
const;
96 bool thpLimitViolatedButNotSwitched()
const;
98 void initCompletions();
106 void setRepRadiusPerfLength();
107 void setWsolvent(
const Scalar wsolvent);
108 void setDynamicThpLimit(
const Scalar
thp_limit);
109 std::optional<Scalar> getDynamicThpLimit()
const;
110 void setDynamicThpLimit(
const std::optional<Scalar>
thp_limit);
116 void stopWell() { this->wellStatus_ = Well::Status::STOP; }
117 void openWell() { this->wellStatus_ = Well::Status::OPEN; }
119 bool wellIsStopped()
const {
return this->wellStatus_ == Well::Status::STOP; }
121 int currentStep()
const {
return this->current_step_; }
123 int pvtRegionIdx()
const {
return pvtRegionIdx_; }
125 const GuideRate* guideRate()
const {
return guide_rate_; }
127 int numComponents()
const {
return num_components_; }
129 int numPhases()
const {
return number_of_phases_; }
131 int numPerfs()
const {
return number_of_perforations_; }
133 Scalar refDepth()
const {
return ref_depth_; }
135 Scalar gravity()
const {
return gravity_; }
141 const std::vector<Scalar>& perfDepth()
const {
return perf_depth_; }
143 std::vector<Scalar>& perfDepth() {
return perf_depth_; }
145 const std::vector<Scalar>& wellIndex()
const {
return well_index_; }
147 const std::map<int,std::vector<int>>& getCompletions()
const {
return completions_; }
149 Scalar getTHPConstraint(
const SummaryState& summaryState)
const;
151 Scalar wsolvent()
const;
152 Scalar rsRvInj()
const;
155 void initInjMult(
const std::vector<Scalar>&
max_inj_mult);
163 Scalar getInjMult(
const int perf,
const Scalar bhp,
const Scalar
perf_pres, DeferredLogger&
dlogger)
const;
171 bool changedToOpenThisStep()
const {
return this->changed_to_open_this_step_; }
182 Scalar wellEfficiencyFactor()
const {
return well_efficiency_factor_; }
190 void resetWellOperability();
193 bool getAllowCrossFlow()
const;
195 Scalar wmicrobes_()
const;
196 Scalar wfoam_()
const;
197 Scalar woxygen_()
const;
198 Scalar wpolymer_()
const;
199 Scalar wsalt_()
const;
200 Scalar wurea_()
const;
202 int polymerTable_()
const;
203 int polymerInjTable_()
const;
204 int polymerWaterTable_()
const;
212 computeWellPotentials(std::vector<Scalar>& well_potentials,
215 void checkNegativeWellPotentials(std::vector<Scalar>& well_potentials,
224 void resetDampening() {
225 std::fill(this->inj_multiplier_damp_factor_.begin(),
this->inj_multiplier_damp_factor_.end(), 1.0);
231 bool isOperableAndSolvable()
const
233 if (!operable_under_only_bhp_limit || !solvable || has_negative_potentials) {
236 return ( (isOperableUnderBHPLimit() || isOperableUnderTHPLimit()) );
240 bool isOperableUnderBHPLimit()
const
242 return operable_under_only_bhp_limit && obey_thp_limit_under_bhp_limit;
245 bool isOperableUnderTHPLimit()
const
247 return can_obtain_bhp_with_thp_limit && obey_bhp_limit_with_thp_limit;
250 void resetOperability()
252 operable_under_only_bhp_limit =
true;
253 obey_thp_limit_under_bhp_limit =
true;
254 can_obtain_bhp_with_thp_limit =
true;
255 obey_bhp_limit_with_thp_limit =
true;
261 bool operable_under_only_bhp_limit =
true;
264 bool obey_thp_limit_under_bhp_limit =
true;
266 bool can_obtain_bhp_with_thp_limit =
true;
268 bool obey_bhp_limit_with_thp_limit =
true;
270 bool solvable =
true;
272 bool has_negative_potentials =
false;
274 mutable bool thp_limit_violated_but_not_switched =
false;
276 bool use_vfpexplicit =
false;
284 const int current_step_;
289 const int pvtRegionIdx_;
291 const int num_components_;
294 int number_of_phases_;
299 const std::vector<PerforationData<Scalar>>* perf_data_;
305 mutable std::vector<Scalar> ipr_a_;
306 mutable std::vector<Scalar> ipr_b_;
309 std::vector<int> well_cells_;
312 std::vector<Scalar> well_index_;
315 int number_of_perforations_;
318 std::vector<Scalar> perf_depth_;
321 std::vector<Scalar> perf_rep_radius_;
324 std::vector<Scalar> perf_length_;
327 std::vector<Scalar> bore_diameters_;
344 std::map<int, std::vector<int>> completions_;
350 std::vector<int> saturation_table_number_;
352 Well::Status wellStatus_;
358 std::optional<Scalar> dynamic_thp_limit_;
361 mutable std::vector<Scalar> inj_multiplier_;
365 std::vector<Scalar> prev_inj_multiplier_;
368 mutable std::vector<Scalar> inj_multiplier_previter_;
370 mutable std::vector<Scalar> inj_multiplier_damp_factor_;
373 std::vector<Scalar> inj_fc_multiplier_;
375 Scalar well_efficiency_factor_;
379 std::vector<std::string> well_control_log_;
381 bool changed_to_open_this_step_ =
true;