56 const int pvtRegionIdx,
60 const std::vector<PerforationData>& perf_data);
66 const std::string&
name()
const;
75 const std::vector<int>&
cells()
const {
return well_cells_; }
80 void adaptRatesForVFP(std::vector<double>& rates)
const;
82 const Well& wellEcl()
const;
89 bool isOperableAndSolvable()
const;
90 bool useVfpExplicit ()
const;
91 bool thpLimitViolatedButNotSwitched()
const;
93 void initCompletions();
100 void setRepRadiusPerfLength();
101 void setWsolvent(
const double wsolvent);
102 void setDynamicThpLimit(
const double thp_limit);
103 std::optional<double> getDynamicThpLimit()
const;
110 this->wellStatus_ = Well::Status::STOP;
114 this->wellStatus_ = Well::Status::OPEN;
117 bool wellIsStopped()
const {
118 return this->wellStatus_ == Well::Status::STOP;
121 int currentStep()
const {
122 return this->current_step_;
125 int pvtRegionIdx()
const {
126 return pvtRegionIdx_;
129 const GuideRate* guideRate()
const {
133 int numComponents()
const {
134 return num_components_;
137 int numPhases()
const {
138 return number_of_phases_;
141 int numPerfs()
const {
142 return number_of_perforations_;
145 double refDepth()
const {
149 double gravity()
const {
153 const VFPProperties* vfpProperties()
const {
154 return vfp_properties_;
157 const ParallelWellInfo& parallelWellInfo()
const {
158 return parallel_well_info_;
161 const std::vector<double>& perfDepth()
const {
165 std::vector<double>& perfDepth() {
169 const std::vector<double>& wellIndex()
const {
173 const std::map<int,std::vector<int>>& getCompletions()
const {
177 double getTHPConstraint(
const SummaryState& summaryState)
const;
178 double getALQ(
const WellState& well_state)
const;
179 double wsolvent()
const;
180 double rsRvInj()
const;
183 void initInjMult(
const std::vector<double>& max_inj_mult);
186 void updateInjMult(std::vector<double>& inj_multipliers, DeferredLogger& deferred_logger)
const;
190 double getInjMult(
const int perf,
const double bhp,
const double perf_pres)
const;
193 bool isVFPActive(DeferredLogger& deferred_logger)
const;
195 void reportWellSwitching(
const SingleWellState& ws, DeferredLogger& deferred_logger)
const;
197 bool changedToOpenThisStep()
const {
198 return this->changed_to_open_this_step_;
201 void updateWellTestState(
const SingleWellState& ws,
202 const double& simulationTime,
203 const bool& writeMessageToOPMLog,
204 WellTestState& wellTestState,
205 DeferredLogger& deferred_logger)
const;
207 bool isPressureControlled(
const WellState& well_state)
const;
209 bool stopppedOrZeroRateTarget(
const SummaryState& summary_state,
210 const WellState& well_state)
const;
212 double wellEfficiencyFactor()
const
213 {
return well_efficiency_factor_; }
221 void resetWellOperability();
224 bool getAllowCrossFlow()
const;
226 double wmicrobes_()
const;
227 double wfoam_()
const;
228 double woxygen_()
const;
229 double wpolymer_()
const;
230 double wsalt_()
const;
231 double wurea_()
const;
233 int polymerTable_()
const;
234 int polymerInjTable_()
const;
235 int polymerWaterTable_()
const;
241 computeWellPotentials(std::vector<double>& well_potentials,
244 void checkNegativeWellPotentials(std::vector<double>& well_potentials,
250 bool isOperableAndSolvable()
const {
251 if (!operable_under_only_bhp_limit || !solvable || has_negative_potentials) {
254 return ( (isOperableUnderBHPLimit() || isOperableUnderTHPLimit()) );
258 bool isOperableUnderBHPLimit()
const {
259 return operable_under_only_bhp_limit && obey_thp_limit_under_bhp_limit;
262 bool isOperableUnderTHPLimit()
const {
263 return can_obtain_bhp_with_thp_limit && obey_bhp_limit_with_thp_limit;
266 void resetOperability() {
267 operable_under_only_bhp_limit =
true;
268 obey_thp_limit_under_bhp_limit =
true;
269 can_obtain_bhp_with_thp_limit =
true;
270 obey_bhp_limit_with_thp_limit =
true;
276 bool operable_under_only_bhp_limit =
true;
279 bool obey_thp_limit_under_bhp_limit =
true;
281 bool can_obtain_bhp_with_thp_limit =
true;
283 bool obey_bhp_limit_with_thp_limit =
true;
285 bool solvable =
true;
287 bool has_negative_potentials =
false;
289 mutable bool thp_limit_violated_but_not_switched =
false;
291 bool use_vfpexplicit =
false;
299 const int current_step_;
303 const int pvtRegionIdx_;
305 const int num_components_;
308 int number_of_phases_;
313 const std::vector<PerforationData>* perf_data_;
319 mutable std::vector<double> ipr_a_;
320 mutable std::vector<double> ipr_b_;
323 std::vector<int> well_cells_;
326 std::vector<double> well_index_;
329 int number_of_perforations_;
332 std::vector<double> perf_depth_;
335 std::vector<double> perf_rep_radius_;
338 std::vector<double> perf_length_;
341 std::vector<double> bore_diameters_;
358 std::map<int, std::vector<int>> completions_;
364 std::vector<int> saturation_table_number_;
366 Well::Status wellStatus_;
372 std::optional<double> dynamic_thp_limit_;
375 mutable std::vector<double> inj_multiplier_;
379 std::vector<double> prev_inj_multiplier_;
382 std::vector<double> inj_fc_multiplier_;
384 double well_efficiency_factor_;
388 std::vector< std::string> well_control_log_;
390 bool changed_to_open_this_step_ =
true;