WellInterfaceGeneric.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2017 IRIS
5 Copyright 2019 Norce
6
7 This file is part of the Open Porous Media project (OPM).
8
9 OPM is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OPM is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OPM. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23
24#ifndef OPM_WELLINTERFACE_GENERIC_HEADER_INCLUDED
25#define OPM_WELLINTERFACE_GENERIC_HEADER_INCLUDED
26
27#include <dune/common/timer.hh>
28
29#include <opm/common/utility/TimeService.hpp>
30#include <opm/input/eclipse/Schedule/Well/Well.hpp>
34
35#include <map>
36#include <memory>
37#include <optional>
38#include <string>
39#include <vector>
40
41namespace Opm
42{
43
44class DeferredLogger;
45class GuideRate;
46class UnitSystem;
47template<class Scalar> class ParallelWellInfo;
48template<class Scalar> struct PerforationData;
49class SummaryState;
50template<typename Scalar, typename IndexTraits> class VFPProperties;
51class WellTestState;
52template<typename Scalar, typename IndexTraits> class WellState;
53template<typename Scalar, typename IndexTraits> class SingleWellState;
54class Group;
55class Schedule;
56template<typename IndexTraits> class PhaseUsageInfo;
57
58template<typename Scalar, typename IndexTraits>
60public:
62
64
65 WellInterfaceGeneric(const Well& well,
66 const ParallelWellInfo<Scalar>& parallel_well_info,
67 const int time_step,
68 const ModelParameters& param,
69 const int pvtRegionIdx,
70 const int num_conservation_quantities,
71 const int num_phases,
72 const int index_of_well,
73 const PhaseUsageInfo<IndexTraits>& phase_usage,
74 const std::vector<PerforationData<Scalar>>& perf_data);
75
76 virtual ~WellInterfaceGeneric() = default;
77
79 const std::vector<PerforationData<Scalar>>& perforationData() const;
80
82 const std::string& name() const;
83
85 bool isInjector() const;
86
88 bool isProducer() const;
89
91 const std::vector<int>& cells() const { return well_cells_; }
92
94 int indexOfWell() const;
95
96 void adaptRatesForVFP(std::vector<Scalar>& rates) const;
97
98 const Well& wellEcl() const;
99 Well& wellEcl();
101
104
105 // whether the well is operable
107 bool useVfpExplicit () const;
109
111 void closeCompletions(const WellTestState& wellTestState);
112
115 const WellStateType& prev_well_state) const;
116 void setGuideRate(const GuideRate* guide_rate_arg);
117 void setWellEfficiencyFactor(const Scalar efficiency_factor);
119 void setWsolvent(const Scalar wsolvent);
120 void setDynamicThpLimit(const Scalar thp_limit);
121 std::optional<Scalar> getDynamicThpLimit() const;
122 void setDynamicThpLimit(const std::optional<Scalar> thp_limit);
123 void updatePerforatedCell(std::vector<bool>& is_cell_perforated);
124
126 bool wellHasTHPConstraints(const SummaryState& summaryState) const;
127
128 void stopWell() { this->wellStatus_ = Well::Status::STOP; }
129 void openWell() { this->wellStatus_ = Well::Status::OPEN; }
130 Well::Status wellStatus() { return this->wellStatus_;}
131
132 bool wellIsStopped() const { return this->wellStatus_ == Well::Status::STOP; }
133
134 int currentStep() const { return this->current_step_; }
135
136 int pvtRegionIdx() const { return pvtRegionIdx_; }
137
138 const GuideRate* guideRate() const { return guide_rate_; }
139
141
142 int numPhases() const { return number_of_phases_; }
143
145
146 Scalar refDepth() const { return ref_depth_; }
147
148 Scalar gravity() const { return gravity_; }
149
151
153
154 const std::vector<Scalar>& perfDepth() const { return perf_depth_; }
155
156 std::vector<Scalar>& perfDepth() { return perf_depth_; }
157
158 const std::vector<Scalar>& wellIndex() const { return well_index_; }
159
164 std::vector<Scalar>& wellIndex() { return well_index_; }
165
166 const std::map<int,std::vector<int>>& getCompletions() const { return completions_; }
167
168 Scalar getTHPConstraint(const SummaryState& summaryState) const;
169 Scalar getALQ(const WellStateType& well_state) const;
170 Scalar wsolvent() const;
171 Scalar rsRvInj() const;
172
173 // at the beginning of the time step, we check what inj_multiplier from the previous running
174 void initInjMult(const std::vector<Scalar>& max_inj_mult);
175
176 // update the InjMult information at the end of the time step, so it can be used for later.
177 void updateInjMult(std::vector<Scalar>& inj_multipliers,
178 DeferredLogger& deferred_logger) const;
179
180 // Note:: for multisegment wells, bhp is actually segment pressure in practice based on observation
181 // it might change in the future
182 Scalar getInjMult(const int local_perf_index, const Scalar bhp, const Scalar perf_pres, DeferredLogger& dlogger) const;
183
184 // whether a well is specified with a non-zero and valid VFP table number
185 bool isVFPActive(DeferredLogger& deferred_logger) const;
186
188 DeferredLogger& deferred_logger) const;
189
191
194 void setLogAllControlSwitches(const bool value) { this->log_all_control_switches_ = value; }
195
212 const double& simulationTime,
213 const bool& writeMessageToOPMLog,
214 const bool during_well_test,
215 const bool zero_group_target,
216 WellTestState& wellTestState,
217 const UnitSystem& unit_system,
218 const time_point start_time,
219 DeferredLogger& deferred_logger,
220 std::string* closure_reason = nullptr) const;
221
222 bool isPressureControlled(const WellStateType& well_state) const;
223
228 static void applyWeldrawRateLimit(const Well& well_ecl,
229 const std::optional<Scalar>& weldraw_max_rate,
230 Well::ProductionControls& controls);
231
237 Well::ProductionControls
238 productionControlsWithWeldraw(const SummaryState& summary_state,
240
242
244 void updateFilterCakeMultipliers(const std::vector<Scalar>& inj_fc_multiplier)
245 {
246 inj_fc_multiplier_ = inj_fc_multiplier;
247 }
248
250
251 virtual std::vector<Scalar> getPrimaryVars() const
252 {
253 return {};
254 }
255
256 virtual int setPrimaryVars(typename std::vector<Scalar>::const_iterator)
257 {
258 return 0;
259 }
260
261 virtual Scalar connectionDensity(const int globalConnIdx,
262 const int openConnIdx) const = 0;
263
267 virtual Scalar totalReservoirVoidageRate(const std::vector<Scalar>& surface_rates) const = 0;
268
269 void addPerforations(const std::vector<RuntimePerforation>& perfs);
270
276 void addFracturePerforations(const std::vector<RuntimePerforation>& perfs);
277
280 const std::vector<WellIndexFracture>& wellIndexFracture() const
281 { return well_index_fracture_; }
282
288 {
289 double solve_time{0.0};
291 double assemble_time{0.0};
292 double linear_solve_time{0.0};
293 unsigned int iterations{0};
294 unsigned int potential_iterations{0};
295 };
296
297 const WellSolveStats& solveStats() const { return *solve_stats_; }
299
300protected:
306 {
307 public:
308 WellSolveScope(const WellInterfaceGeneric& well, const int& iterations)
309 : well_(well), iterations_(iterations)
310 {
311 well_.in_well_solve_ = true;
312 timer_.start();
313 }
315 {
316 well_.in_well_solve_ = false;
317 auto& stats = *well_.solve_stats_;
318 if (well_.computing_well_potentials_) {
319 stats.potential_solve_time += timer_.stop();
320 stats.potential_iterations += iterations_;
321 } else {
322 stats.solve_time += timer_.stop();
323 stats.iterations += iterations_;
324 }
325 }
326 private:
327 const WellInterfaceGeneric& well_;
328 const int& iterations_;
329 Dune::Timer timer_{};
330 };
331
335 {
336 public:
337 SolvePartTimer(const WellInterfaceGeneric& well, double& target)
338 : well_(well), target_(target)
339 {
340 timer_.start();
341 }
343 {
344 if (well_.in_well_solve_) {
345 target_ += timer_.stop();
346 }
347 }
348 private:
349 const WellInterfaceGeneric& well_;
350 double& target_;
351 Dune::Timer timer_{};
352 };
353
356 {
357 public:
359 : well_(well), previous_(well.computing_well_potentials_)
360 {
361 well_.computing_well_potentials_ = true;
362 }
364 {
365 well_.computing_well_potentials_ = previous_;
366 }
367 private:
368 const WellInterfaceGeneric& well_;
369 bool previous_;
370 };
371
372 WellSolveScope solveScope(const int& iterations) const
373 { return WellSolveScope(*this, iterations); }
374
376 { return SolvePartTimer(*this, solve_stats_->assemble_time); }
377
379 { return SolvePartTimer(*this, solve_stats_->linear_solve_time); }
380
382 { return PotentialCalculationScope(*this); }
383
384 bool getAllowCrossFlow() const;
385
386 Scalar wmicrobes_() const;
387 Scalar wfoam_() const;
388 Scalar woxygen_() const;
389 Scalar wpolymer_() const;
390 Scalar wsalt_() const;
391 Scalar wurea_() const;
392
393 int polymerTable_() const;
394 int polymerInjTable_() const;
396
397 bool wellUnderZeroRateTargetIndividual(const SummaryState& summary_state,
398 const WellState<Scalar, IndexTraits>& well_state) const;
399
401
402 std::pair<bool,bool>
403 computeWellPotentials(std::vector<Scalar>& well_potentials,
404 const WellStateType& well_state);
405
406 void checkNegativeWellPotentials(std::vector<Scalar>& well_potentials,
407 const bool checkOperability,
408 DeferredLogger& deferred_logger);
409
410 // Remove all other controls than THP and BHP
411 void onlyKeepBHPandTHPcontrols(const SummaryState& summary_state,
412 WellStateType& well_state,
413 Well::InjectionControls& inj_controls,
414 Well::ProductionControls& prod_controls) const;
415
417 {
418 std::ranges::fill(this->inj_multiplier_damp_factor_, 1.0);
419 }
420
422 const std::vector<Scalar>& scaled_well_fractions,
423 DeferredLogger& deferred_logger) const;
424
425 // definition of the struct OperabilityStatus
427 {
429 {
431 return false;
432 }
433
435 }
436
438 {
440 }
441
443 {
445 }
446
448 {
453 }
454
455 // whether the well can be operated under bhp limit
456 // without considering other limits.
457 // if it is false, then the well is not operable for sure.
459 // if the well can be operated under bhp limit, will it obey(not violate)
460 // the thp limit when operated under bhp limit
462 // whether the well operate under the thp limit only
464 // whether the well obey bhp limit when operated under thp limit
466 // the well is solveable
467 bool solvable = true;
468 // the well have non positive potentials
470 //thp limit violated but not switched
472
473 bool use_vfpexplicit = false;
474 };
475
477
479
481 const int current_step_;
483
484 // The pvt region of the well. We assume
485 // We assume a well to not penetrate more than one pvt region.
486 const int pvtRegionIdx_;
487
488 // TODO: with energy conservation joins, we probably should change this to be num_mass_conservation_quantities_
489 // or something like that. Energy term calculate somehow differently from the mass term
491
492 // number of phases
494
495 // the index of well in Wells struct
497
499
500 const std::vector<PerforationData<Scalar>>* perf_data_;
501
502 // the vectors used to describe the inflow performance relationship (IPR)
503 // Q = IPR_A - BHP * IPR_B
504 // TODO: it minght need to go to WellInterface, let us implement it in StandardWell first
505 // it is only updated and used for producers for now
506 mutable std::vector<Scalar> ipr_a_;
507 mutable std::vector<Scalar> ipr_b_;
508
509 // cell index for each well perforation
510 std::vector<int> well_cells_;
511
512 // well index for each perforation
513 std::vector<Scalar> well_index_;
514
515 // fracture contribution to the well index per perforation; empty when no
516 // fracture model has registered contributions (see addFracturePerforations)
517 std::vector<WellIndexFracture> well_index_fracture_;
518
519 // number of the perforations for this well on this process
521
522 // depth for each perforation
523 std::vector<Scalar> perf_depth_;
524
525 // representative radius of the perforations, used in shear calculation
526 std::vector<Scalar> perf_rep_radius_;
527
528 // length of the perforations, use in shear calculation
529 std::vector<Scalar> perf_length_;
530
531 // well bore diameter
532 std::vector<Scalar> bore_diameters_;
533
534 /*
535 * completions_ contains the mapping from completion id to connection indices
536 * {
537 * 2 : [ConnectionIndex, ConnectionIndex],
538 * 1 : [ConnectionIndex, ConnectionIndex, ConnectionIndex],
539 * 5 : [ConnectionIndex],
540 * 7 : [ConnectionIndex]
541 * ...
542 * }
543 * The integer IDs correspond to the COMPLETION id given by the COMPLUMP keyword.
544 * When there is no COMPLUMP keyword used, a default completion number will be assigned
545 * based on the order of the declaration of the connections.
546 * Since the connections not OPEN is not included in the Wells, so they will not be considered
547 * in this mapping relation.
548 */
549 std::map<int, std::vector<int>> completions_;
550
551 // reference depth for the BHP
553
554 // saturation table nubmer for each well perforation
555 std::vector<int> saturation_table_number_;
556
557 Well::Status wellStatus_;
558
559 Scalar gravity_;
560 Scalar wsolvent_;
561 std::optional<Scalar> dynamic_thp_limit_;
562
563 // recording the multiplier calculate from the keyword WINJMULT during the time step
564 mutable std::vector<Scalar> inj_multiplier_;
565
566 // the injection multiplier from the previous running, it is mostly used for CIRR mode
567 // which intends to keep the fracturing open
568 std::vector<Scalar> prev_inj_multiplier_;
569
570 // WINJMULT multipliers for previous iteration (used for oscillation detection)
571 mutable std::vector<Scalar> inj_multiplier_previter_;
572 // WINJMULT dampening factors (used in case of oscillations)
573 mutable std::vector<Scalar> inj_multiplier_damp_factor_;
574
575 // the multiplier due to injection filtration cake
576 std::vector<Scalar> inj_fc_multiplier_;
577
580 const GuideRate* guide_rate_;
581
582 std::vector<std::string> well_control_log_;
583
584 // Count every control switch of the well towards max_number_of_well_switches_,
585 // also before NUPCOL iterations. Set for a reservoir coupling slave's wells while
586 // the master exchanges network pressures with the slave, see
587 // BlackoilWellModelRescoup::receiveMasterGroupNodePressuresFromMaster().
589
591
592 // statistics for standalone well solves; shared so that well copies used
593 // during e.g. potential calculations contribute to the same statistics
594 std::shared_ptr<WellSolveStats> solve_stats_ = std::make_shared<WellSolveStats>();
595 // true while a well potential calculation is in progress
596 mutable bool computing_well_potentials_ = false;
597 // true while a standalone well solve is in progress
598 mutable bool in_well_solve_ = false;
599};
600
601}
602
603#endif // OPM_WELLINTERFACE_GENERIC_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:217
Definition: GasLiftGroupInfo.hpp:38
Definition: SingleWellState.hpp:44
Definition: VFPProperties.hpp:40
RAII helper marking that a well potential calculation is in progress.
Definition: WellInterfaceGeneric.hpp:356
~PotentialCalculationScope()
Definition: WellInterfaceGeneric.hpp:363
PotentialCalculationScope(const WellInterfaceGeneric &well)
Definition: WellInterfaceGeneric.hpp:358
Definition: WellInterfaceGeneric.hpp:335
SolvePartTimer(const WellInterfaceGeneric &well, double &target)
Definition: WellInterfaceGeneric.hpp:337
~SolvePartTimer()
Definition: WellInterfaceGeneric.hpp:342
Definition: WellInterfaceGeneric.hpp:306
WellSolveScope(const WellInterfaceGeneric &well, const int &iterations)
Definition: WellInterfaceGeneric.hpp:308
~WellSolveScope()
Definition: WellInterfaceGeneric.hpp:314
Definition: WellInterfaceGeneric.hpp:59
int pvtRegionIdx() const
Definition: WellInterfaceGeneric.hpp:136
WellInterfaceGeneric(const Well &well, const ParallelWellInfo< Scalar > &parallel_well_info, const int time_step, const ModelParameters &param, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const PhaseUsageInfo< IndexTraits > &phase_usage, const std::vector< PerforationData< Scalar > > &perf_data)
void updateGroupTargetFallbackFlag(WellState< Scalar, IndexTraits > &well_state, const std::vector< Scalar > &scaled_well_fractions, DeferredLogger &deferred_logger) const
const std::map< int, std::vector< int > > & getCompletions() const
Definition: WellInterfaceGeneric.hpp:166
const int num_conservation_quantities_
Definition: WellInterfaceGeneric.hpp:490
bool isVFPActive(DeferredLogger &deferred_logger) const
const WellSolveStats & solveStats() const
Definition: WellInterfaceGeneric.hpp:297
void openWell()
Definition: WellInterfaceGeneric.hpp:129
std::vector< int > saturation_table_number_
Definition: WellInterfaceGeneric.hpp:555
bool isOperableAndSolvable() const
void addFracturePerforations(const std::vector< RuntimePerforation > &perfs)
std::vector< int > well_cells_
Definition: WellInterfaceGeneric.hpp:510
void updatePerforatedCell(std::vector< bool > &is_cell_perforated)
int index_of_well_
Definition: WellInterfaceGeneric.hpp:496
std::optional< Scalar > dynamic_thp_limit_
Definition: WellInterfaceGeneric.hpp:561
std::vector< Scalar > perf_depth_
Definition: WellInterfaceGeneric.hpp:523
int numPhases() const
Definition: WellInterfaceGeneric.hpp:142
virtual Scalar totalReservoirVoidageRate(const std::vector< Scalar > &surface_rates) const =0
The total reservoir voidage rate for the given surface phase rates (or potentials),...
Scalar gravity() const
Definition: WellInterfaceGeneric.hpp:148
const GuideRate * guideRate() const
Definition: WellInterfaceGeneric.hpp:138
std::vector< Scalar > prev_inj_multiplier_
Definition: WellInterfaceGeneric.hpp:568
Well::Status wellStatus()
Definition: WellInterfaceGeneric.hpp:130
int polymerWaterTable_() const
int number_of_phases_
Definition: WellInterfaceGeneric.hpp:493
void setWsolvent(const Scalar wsolvent)
std::vector< Scalar > & perfDepth()
Definition: WellInterfaceGeneric.hpp:156
const PhaseUsageInfo< IndexTraits > & phase_usage_
Definition: WellInterfaceGeneric.hpp:498
Scalar wpolymer_() const
bool in_well_solve_
Definition: WellInterfaceGeneric.hpp:598
void updateWellTestState(const SingleWellState< Scalar, IndexTraits > &ws, const double &simulationTime, const bool &writeMessageToOPMLog, const bool during_well_test, const bool zero_group_target, WellTestState &wellTestState, const UnitSystem &unit_system, const time_point start_time, DeferredLogger &deferred_logger, std::string *closure_reason=nullptr) const
const int current_step_
Definition: WellInterfaceGeneric.hpp:481
std::vector< Scalar > ipr_a_
Definition: WellInterfaceGeneric.hpp:506
Well well_ecl_
Definition: WellInterfaceGeneric.hpp:478
const std::vector< Scalar > & perfDepth() const
Definition: WellInterfaceGeneric.hpp:154
bool wellUnderGroupControl(const SingleWellState< Scalar, IndexTraits > &ws) const
const Well & wellEcl() const
const ParallelWellInfo< Scalar > & parallel_well_info_
Definition: WellInterfaceGeneric.hpp:480
Scalar wmicrobes_() const
const PhaseUsageInfo< IndexTraits > & phaseUsage() const
void resetSolveStats() const
Definition: WellInterfaceGeneric.hpp:298
std::vector< Scalar > ipr_b_
Definition: WellInterfaceGeneric.hpp:507
const int pvtRegionIdx_
Definition: WellInterfaceGeneric.hpp:486
std::vector< Scalar > inj_multiplier_damp_factor_
Definition: WellInterfaceGeneric.hpp:573
bool underPredictionMode() const
Returns true if the well is currently in prediction mode (i.e. not history mode).
const GuideRate * guide_rate_
Definition: WellInterfaceGeneric.hpp:580
OperabilityStatus operability_status_
Definition: WellInterfaceGeneric.hpp:476
bool wellUnderZeroRateTargetIndividual(const SummaryState &summary_state, const WellState< Scalar, IndexTraits > &well_state) const
Well::Status wellStatus_
Definition: WellInterfaceGeneric.hpp:557
int numLocalPerfs() const
Definition: WellInterfaceGeneric.hpp:144
Scalar getTHPConstraint(const SummaryState &summaryState) const
bool isPressureControlled(const WellStateType &well_state) const
void setDynamicThpLimit(const Scalar thp_limit)
void updateInjMult(std::vector< Scalar > &inj_multipliers, DeferredLogger &deferred_logger) const
void updateFilterCakeMultipliers(const std::vector< Scalar > &inj_fc_multiplier)
Update filter cake multipliers.
Definition: WellInterfaceGeneric.hpp:244
Scalar well_efficiency_factor_
Definition: WellInterfaceGeneric.hpp:578
void closeCompletions(const WellTestState &wellTestState)
bool isProducer() const
True if the well is a producer.
void checkNegativeWellPotentials(std::vector< Scalar > &well_potentials, const bool checkOperability, DeferredLogger &deferred_logger)
void setPrevSurfaceRates(WellStateType &well_state, const WellStateType &prev_well_state) const
void addPerforations(const std::vector< RuntimePerforation > &perfs)
std::vector< Scalar > inj_multiplier_previter_
Definition: WellInterfaceGeneric.hpp:571
std::vector< Scalar > inj_fc_multiplier_
Definition: WellInterfaceGeneric.hpp:576
const std::vector< WellIndexFracture > & wellIndexFracture() const
Definition: WellInterfaceGeneric.hpp:280
virtual Scalar connectionDensity(const int globalConnIdx, const int openConnIdx) const =0
Scalar getInjMult(const int local_perf_index, const Scalar bhp, const Scalar perf_pres, DeferredLogger &dlogger) const
void adaptRatesForVFP(std::vector< Scalar > &rates) const
void onlyKeepBHPandTHPcontrols(const SummaryState &summary_state, WellStateType &well_state, Well::InjectionControls &inj_controls, Well::ProductionControls &prod_controls) const
bool changedToOpenThisStep() const
Definition: WellInterfaceGeneric.hpp:190
void setGuideRate(const GuideRate *guide_rate_arg)
WellSolveScope solveScope(const int &iterations) const
Definition: WellInterfaceGeneric.hpp:372
const std::vector< PerforationData< Scalar > > * perf_data_
Definition: WellInterfaceGeneric.hpp:500
bool isInjector() const
True if the well is an injector.
int numConservationQuantities() const
Definition: WellInterfaceGeneric.hpp:140
std::shared_ptr< WellSolveStats > solve_stats_
Definition: WellInterfaceGeneric.hpp:594
const VFPProperties< Scalar, IndexTraits > * vfpProperties() const
Definition: WellInterfaceGeneric.hpp:150
Scalar refDepth() const
Definition: WellInterfaceGeneric.hpp:146
std::vector< Scalar > & wellIndex()
Mutable per-perforation well indices (connection transmissibility factors). Adjoint hook: the dJ/dper...
Definition: WellInterfaceGeneric.hpp:164
Scalar getALQ(const WellStateType &well_state) const
void stopWell()
Definition: WellInterfaceGeneric.hpp:128
Scalar wellEfficiencyFactor() const
Definition: WellInterfaceGeneric.hpp:241
SolvePartTimer solveLinearSolveTimer() const
Definition: WellInterfaceGeneric.hpp:378
Well::ProductionControls productionControlsWithWeldraw(const SummaryState &summary_state, const SingleWellState< Scalar, IndexTraits > &ws) const
std::vector< std::string > well_control_log_
Definition: WellInterfaceGeneric.hpp:582
void resetDampening()
Definition: WellInterfaceGeneric.hpp:416
int indexOfWell() const
Index of well in the wells struct and wellState.
std::vector< WellIndexFracture > well_index_fracture_
Definition: WellInterfaceGeneric.hpp:517
virtual std::vector< Scalar > getPrimaryVars() const
Definition: WellInterfaceGeneric.hpp:251
const std::vector< PerforationData< Scalar > > & perforationData() const
Get the perforations of the well.
std::vector< Scalar > perf_length_
Definition: WellInterfaceGeneric.hpp:529
const std::vector< int > & cells() const
Well cells.
Definition: WellInterfaceGeneric.hpp:91
int number_of_local_perforations_
Definition: WellInterfaceGeneric.hpp:520
std::vector< Scalar > well_index_
Definition: WellInterfaceGeneric.hpp:513
virtual int setPrimaryVars(typename std::vector< Scalar >::const_iterator)
Definition: WellInterfaceGeneric.hpp:256
void setVFPProperties(const VFPProperties< Scalar, IndexTraits > *vfp_properties_arg)
const std::string & name() const
Well name.
const ModelParameters & param_
Definition: WellInterfaceGeneric.hpp:482
std::pair< bool, bool > computeWellPotentials(std::vector< Scalar > &well_potentials, const WellStateType &well_state)
bool log_all_control_switches_
Definition: WellInterfaceGeneric.hpp:588
bool computing_well_potentials_
Definition: WellInterfaceGeneric.hpp:596
SolvePartTimer solveAssembleTimer() const
Definition: WellInterfaceGeneric.hpp:375
bool changed_to_open_this_step_
Definition: WellInterfaceGeneric.hpp:590
static void applyWeldrawRateLimit(const Well &well_ecl, const std::optional< Scalar > &weldraw_max_rate, Well::ProductionControls &controls)
void setWellEfficiencyFactor(const Scalar efficiency_factor)
PotentialCalculationScope potentialCalculationScope() const
Definition: WellInterfaceGeneric.hpp:381
const VFPProperties< Scalar, IndexTraits > * vfp_properties_
Definition: WellInterfaceGeneric.hpp:579
virtual ~WellInterfaceGeneric()=default
void initInjMult(const std::vector< Scalar > &max_inj_mult)
Scalar wsolvent_
Definition: WellInterfaceGeneric.hpp:560
std::map< int, std::vector< int > > completions_
Definition: WellInterfaceGeneric.hpp:549
void setDynamicThpLimit(const std::optional< Scalar > thp_limit)
std::vector< Scalar > perf_rep_radius_
Definition: WellInterfaceGeneric.hpp:526
void reportWellSwitching(const SingleWellState< Scalar, IndexTraits > &ws, DeferredLogger &deferred_logger) const
std::optional< Scalar > getDynamicThpLimit() const
const std::vector< Scalar > & wellIndex() const
Definition: WellInterfaceGeneric.hpp:158
Scalar gravity_
Definition: WellInterfaceGeneric.hpp:559
bool wellHasTHPConstraints(const SummaryState &summaryState) const
Returns true if the well has one or more THP limits/constraints.
std::vector< Scalar > bore_diameters_
Definition: WellInterfaceGeneric.hpp:532
bool wellIsStopped() const
Definition: WellInterfaceGeneric.hpp:132
Scalar ref_depth_
Definition: WellInterfaceGeneric.hpp:552
bool thpLimitViolatedButNotSwitched() const
bool getAllowCrossFlow() const
std::vector< Scalar > inj_multiplier_
Definition: WellInterfaceGeneric.hpp:564
int currentStep() const
Definition: WellInterfaceGeneric.hpp:134
void setLogAllControlSwitches(const bool value)
Definition: WellInterfaceGeneric.hpp:194
const ParallelWellInfo< Scalar > & parallelWellInfo() const
Definition: WellInterfaceGeneric.hpp:152
Definition: WellState.hpp:68
Definition: blackoilbioeffectsmodules.hh:45
Solver parameters for the NonlinearSystemBlackOilReservoir.
Definition: BlackoilModelParameters.hpp:208
Static data associated with a well perforation.
Definition: PerforationData.hpp:30
Definition: WellInterfaceGeneric.hpp:427
void resetOperability()
Definition: WellInterfaceGeneric.hpp:447
bool thp_limit_violated_but_not_switched
Definition: WellInterfaceGeneric.hpp:471
bool can_obtain_bhp_with_thp_limit
Definition: WellInterfaceGeneric.hpp:463
bool has_negative_potentials
Definition: WellInterfaceGeneric.hpp:469
bool isOperableUnderTHPLimit() const
Definition: WellInterfaceGeneric.hpp:442
bool obey_bhp_limit_with_thp_limit
Definition: WellInterfaceGeneric.hpp:465
bool solvable
Definition: WellInterfaceGeneric.hpp:467
bool operable_under_only_bhp_limit
Definition: WellInterfaceGeneric.hpp:458
bool use_vfpexplicit
Definition: WellInterfaceGeneric.hpp:473
bool isOperableUnderBHPLimit() const
Definition: WellInterfaceGeneric.hpp:437
bool obey_thp_limit_under_bhp_limit
Definition: WellInterfaceGeneric.hpp:461
bool isOperableAndSolvable() const
Definition: WellInterfaceGeneric.hpp:428
Definition: WellInterfaceGeneric.hpp:288
unsigned int iterations
well iterations in normal solves
Definition: WellInterfaceGeneric.hpp:293
double potential_solve_time
time used by well potential solves
Definition: WellInterfaceGeneric.hpp:290
double assemble_time
assembly time in the well solves
Definition: WellInterfaceGeneric.hpp:291
double solve_time
time used by normal well solves
Definition: WellInterfaceGeneric.hpp:289
double linear_solve_time
linear solve time in the well solves
Definition: WellInterfaceGeneric.hpp:292
unsigned int potential_iterations
well iterations in potential solves
Definition: WellInterfaceGeneric.hpp:294