61 const int pvtRegionIdx,
71 const std::string&
name()
const;
80 const std::vector<int>&
cells()
const {
return well_cells_; }
85 void adaptRatesForVFP(std::vector<Scalar>& rates)
const;
87 const Well& wellEcl()
const;
95 bool isOperableAndSolvable()
const;
96 bool useVfpExplicit ()
const;
97 bool thpLimitViolatedButNotSwitched()
const;
99 void initCompletions();
107 void setRepRadiusPerfLength();
108 void setWsolvent(
const Scalar wsolvent);
109 void setDynamicThpLimit(
const Scalar
thp_limit);
110 std::optional<Scalar> getDynamicThpLimit()
const;
111 void setDynamicThpLimit(
const std::optional<Scalar>
thp_limit);
117 void stopWell() { this->wellStatus_ = Well::Status::STOP; }
118 void openWell() { this->wellStatus_ = Well::Status::OPEN; }
120 bool wellIsStopped()
const {
return this->wellStatus_ == Well::Status::STOP; }
122 int currentStep()
const {
return this->current_step_; }
124 int pvtRegionIdx()
const {
return pvtRegionIdx_; }
126 const GuideRate* guideRate()
const {
return guide_rate_; }
128 int numComponents()
const {
return num_components_; }
130 int numPhases()
const {
return number_of_phases_; }
132 int numPerfs()
const {
return number_of_local_perforations_; }
134 Scalar refDepth()
const {
return ref_depth_; }
136 Scalar gravity()
const {
return gravity_; }
142 const std::vector<Scalar>& perfDepth()
const {
return perf_depth_; }
144 std::vector<Scalar>& perfDepth() {
return perf_depth_; }
146 const std::vector<Scalar>& wellIndex()
const {
return well_index_; }
148 const std::map<int,std::vector<int>>& getCompletions()
const {
return completions_; }
150 Scalar getTHPConstraint(
const SummaryState& summaryState)
const;
152 Scalar wsolvent()
const;
153 Scalar rsRvInj()
const;
156 void initInjMult(
const std::vector<Scalar>&
max_inj_mult);
172 bool changedToOpenThisStep()
const {
return this->changed_to_open_this_step_; }
183 Scalar wellEfficiencyFactor()
const {
return well_efficiency_factor_; }
191 void resetWellOperability();
193 virtual std::vector<Scalar> getPrimaryVars()
const
198 virtual int setPrimaryVars(
typename std::vector<Scalar>::const_iterator)
206 void addPerforations(
const std::vector<RuntimePerforation>&
perfs);
209 bool getAllowCrossFlow()
const;
211 Scalar wmicrobes_()
const;
212 Scalar wfoam_()
const;
213 Scalar woxygen_()
const;
214 Scalar wpolymer_()
const;
215 Scalar wsalt_()
const;
216 Scalar wurea_()
const;
218 int polymerTable_()
const;
219 int polymerInjTable_()
const;
220 int polymerWaterTable_()
const;
228 computeWellPotentials(std::vector<Scalar>& well_potentials,
231 void checkNegativeWellPotentials(std::vector<Scalar>& well_potentials,
240 void resetDampening() {
241 std::fill(this->inj_multiplier_damp_factor_.begin(),
this->inj_multiplier_damp_factor_.end(), 1.0);
247 bool isOperableAndSolvable()
const
249 if (!operable_under_only_bhp_limit || !solvable || has_negative_potentials) {
252 return ( (isOperableUnderBHPLimit() || isOperableUnderTHPLimit()) );
256 bool isOperableUnderBHPLimit()
const
258 return operable_under_only_bhp_limit && obey_thp_limit_under_bhp_limit;
261 bool isOperableUnderTHPLimit()
const
263 return can_obtain_bhp_with_thp_limit && obey_bhp_limit_with_thp_limit;
266 void resetOperability()
268 operable_under_only_bhp_limit =
true;
269 obey_thp_limit_under_bhp_limit =
true;
270 can_obtain_bhp_with_thp_limit =
true;
271 obey_bhp_limit_with_thp_limit =
true;
277 bool operable_under_only_bhp_limit =
true;
280 bool obey_thp_limit_under_bhp_limit =
true;
282 bool can_obtain_bhp_with_thp_limit =
true;
284 bool obey_bhp_limit_with_thp_limit =
true;
286 bool solvable =
true;
288 bool has_negative_potentials =
false;
290 mutable bool thp_limit_violated_but_not_switched =
false;
292 bool use_vfpexplicit =
false;
300 const int current_step_;
305 const int pvtRegionIdx_;
307 const int num_components_;
310 int number_of_phases_;
315 const std::vector<PerforationData<Scalar>>* perf_data_;
321 mutable std::vector<Scalar> ipr_a_;
322 mutable std::vector<Scalar> ipr_b_;
325 std::vector<int> well_cells_;
328 std::vector<Scalar> well_index_;
331 int number_of_local_perforations_;
334 std::vector<Scalar> perf_depth_;
337 std::vector<Scalar> perf_rep_radius_;
340 std::vector<Scalar> perf_length_;
343 std::vector<Scalar> bore_diameters_;
360 std::map<int, std::vector<int>> completions_;
366 std::vector<int> saturation_table_number_;
368 Well::Status wellStatus_;
374 std::optional<Scalar> dynamic_thp_limit_;
377 mutable std::vector<Scalar> inj_multiplier_;
381 std::vector<Scalar> prev_inj_multiplier_;
384 mutable std::vector<Scalar> inj_multiplier_previter_;
386 mutable std::vector<Scalar> inj_multiplier_damp_factor_;
389 std::vector<Scalar> inj_fc_multiplier_;
391 Scalar well_efficiency_factor_;
395 std::vector<std::string> well_control_log_;
397 bool changed_to_open_this_step_ =
true;