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/input/eclipse/Schedule/Well/Well.hpp>
33
34#include <ctime>
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
208 const double& simulationTime,
209 const bool& writeMessageToOPMLog,
210 const bool during_well_test,
211 const bool zero_group_target,
212 WellTestState& wellTestState,
213 const UnitSystem& unit_system,
214 const std::time_t start_time,
215 DeferredLogger& deferred_logger,
216 std::string* closure_reason = nullptr) const;
217
218 bool isPressureControlled(const WellStateType& well_state) const;
219
224 static void applyWeldrawRateLimit(const Well& well_ecl,
225 const std::optional<Scalar>& weldraw_max_rate,
226 Well::ProductionControls& controls);
227
233 Well::ProductionControls
234 productionControlsWithWeldraw(const SummaryState& summary_state,
236
238
240 void updateFilterCakeMultipliers(const std::vector<Scalar>& inj_fc_multiplier)
241 {
242 inj_fc_multiplier_ = inj_fc_multiplier;
243 }
244
246
247 virtual std::vector<Scalar> getPrimaryVars() const
248 {
249 return {};
250 }
251
252 virtual int setPrimaryVars(typename std::vector<Scalar>::const_iterator)
253 {
254 return 0;
255 }
256
257 virtual Scalar connectionDensity(const int globalConnIdx,
258 const int openConnIdx) const = 0;
259
263 virtual Scalar totalReservoirVoidageRate(const std::vector<Scalar>& surface_rates) const = 0;
264
265 void addPerforations(const std::vector<RuntimePerforation>& perfs);
266
272 void addFracturePerforations(const std::vector<RuntimePerforation>& perfs);
273
276 const std::vector<WellIndexFracture>& wellIndexFracture() const
277 { return well_index_fracture_; }
278
284 {
285 double solve_time{0.0};
287 double assemble_time{0.0};
288 double linear_solve_time{0.0};
289 unsigned int iterations{0};
290 unsigned int potential_iterations{0};
291 };
292
293 const WellSolveStats& solveStats() const { return *solve_stats_; }
295
296protected:
302 {
303 public:
304 WellSolveScope(const WellInterfaceGeneric& well, const int& iterations)
305 : well_(well), iterations_(iterations)
306 {
307 well_.in_well_solve_ = true;
308 timer_.start();
309 }
311 {
312 well_.in_well_solve_ = false;
313 auto& stats = *well_.solve_stats_;
314 if (well_.computing_well_potentials_) {
315 stats.potential_solve_time += timer_.stop();
316 stats.potential_iterations += iterations_;
317 } else {
318 stats.solve_time += timer_.stop();
319 stats.iterations += iterations_;
320 }
321 }
322 private:
323 const WellInterfaceGeneric& well_;
324 const int& iterations_;
325 Dune::Timer timer_{};
326 };
327
331 {
332 public:
333 SolvePartTimer(const WellInterfaceGeneric& well, double& target)
334 : well_(well), target_(target)
335 {
336 timer_.start();
337 }
339 {
340 if (well_.in_well_solve_) {
341 target_ += timer_.stop();
342 }
343 }
344 private:
345 const WellInterfaceGeneric& well_;
346 double& target_;
347 Dune::Timer timer_{};
348 };
349
352 {
353 public:
355 : well_(well), previous_(well.computing_well_potentials_)
356 {
357 well_.computing_well_potentials_ = true;
358 }
360 {
361 well_.computing_well_potentials_ = previous_;
362 }
363 private:
364 const WellInterfaceGeneric& well_;
365 bool previous_;
366 };
367
368 WellSolveScope solveScope(const int& iterations) const
369 { return WellSolveScope(*this, iterations); }
370
372 { return SolvePartTimer(*this, solve_stats_->assemble_time); }
373
375 { return SolvePartTimer(*this, solve_stats_->linear_solve_time); }
376
378 { return PotentialCalculationScope(*this); }
379
380 bool getAllowCrossFlow() const;
381
382 Scalar wmicrobes_() const;
383 Scalar wfoam_() const;
384 Scalar woxygen_() const;
385 Scalar wpolymer_() const;
386 Scalar wsalt_() const;
387 Scalar wurea_() const;
388
389 int polymerTable_() const;
390 int polymerInjTable_() const;
392
393 bool wellUnderZeroRateTargetIndividual(const SummaryState& summary_state,
394 const WellState<Scalar, IndexTraits>& well_state) const;
395
397
398 std::pair<bool,bool>
399 computeWellPotentials(std::vector<Scalar>& well_potentials,
400 const WellStateType& well_state);
401
402 void checkNegativeWellPotentials(std::vector<Scalar>& well_potentials,
403 const bool checkOperability,
404 DeferredLogger& deferred_logger);
405
406 // Remove all other controls than THP and BHP
407 void onlyKeepBHPandTHPcontrols(const SummaryState& summary_state,
408 WellStateType& well_state,
409 Well::InjectionControls& inj_controls,
410 Well::ProductionControls& prod_controls) const;
411
413 {
414 std::ranges::fill(this->inj_multiplier_damp_factor_, 1.0);
415 }
416
418 const std::vector<Scalar>& scaled_well_fractions,
419 DeferredLogger& deferred_logger) const;
420
421 // definition of the struct OperabilityStatus
423 {
425 {
427 return false;
428 }
429
431 }
432
434 {
436 }
437
439 {
441 }
442
444 {
449 }
450
451 // whether the well can be operated under bhp limit
452 // without considering other limits.
453 // if it is false, then the well is not operable for sure.
455 // if the well can be operated under bhp limit, will it obey(not violate)
456 // the thp limit when operated under bhp limit
458 // whether the well operate under the thp limit only
460 // whether the well obey bhp limit when operated under thp limit
462 // the well is solveable
463 bool solvable = true;
464 // the well have non positive potentials
466 //thp limit violated but not switched
468
469 bool use_vfpexplicit = false;
470 };
471
473
475
477 const int current_step_;
479
480 // The pvt region of the well. We assume
481 // We assume a well to not penetrate more than one pvt region.
482 const int pvtRegionIdx_;
483
484 // TODO: with energy conservation joins, we probably should change this to be num_mass_conservation_quantities_
485 // or something like that. Energy term calculate somehow differently from the mass term
487
488 // number of phases
490
491 // the index of well in Wells struct
493
495
496 const std::vector<PerforationData<Scalar>>* perf_data_;
497
498 // the vectors used to describe the inflow performance relationship (IPR)
499 // Q = IPR_A - BHP * IPR_B
500 // TODO: it minght need to go to WellInterface, let us implement it in StandardWell first
501 // it is only updated and used for producers for now
502 mutable std::vector<Scalar> ipr_a_;
503 mutable std::vector<Scalar> ipr_b_;
504
505 // cell index for each well perforation
506 std::vector<int> well_cells_;
507
508 // well index for each perforation
509 std::vector<Scalar> well_index_;
510
511 // fracture contribution to the well index per perforation; empty when no
512 // fracture model has registered contributions (see addFracturePerforations)
513 std::vector<WellIndexFracture> well_index_fracture_;
514
515 // number of the perforations for this well on this process
517
518 // depth for each perforation
519 std::vector<Scalar> perf_depth_;
520
521 // representative radius of the perforations, used in shear calculation
522 std::vector<Scalar> perf_rep_radius_;
523
524 // length of the perforations, use in shear calculation
525 std::vector<Scalar> perf_length_;
526
527 // well bore diameter
528 std::vector<Scalar> bore_diameters_;
529
530 /*
531 * completions_ contains the mapping from completion id to connection indices
532 * {
533 * 2 : [ConnectionIndex, ConnectionIndex],
534 * 1 : [ConnectionIndex, ConnectionIndex, ConnectionIndex],
535 * 5 : [ConnectionIndex],
536 * 7 : [ConnectionIndex]
537 * ...
538 * }
539 * The integer IDs correspond to the COMPLETION id given by the COMPLUMP keyword.
540 * When there is no COMPLUMP keyword used, a default completion number will be assigned
541 * based on the order of the declaration of the connections.
542 * Since the connections not OPEN is not included in the Wells, so they will not be considered
543 * in this mapping relation.
544 */
545 std::map<int, std::vector<int>> completions_;
546
547 // reference depth for the BHP
549
550 // saturation table nubmer for each well perforation
551 std::vector<int> saturation_table_number_;
552
553 Well::Status wellStatus_;
554
555 Scalar gravity_;
556 Scalar wsolvent_;
557 std::optional<Scalar> dynamic_thp_limit_;
558
559 // recording the multiplier calculate from the keyword WINJMULT during the time step
560 mutable std::vector<Scalar> inj_multiplier_;
561
562 // the injection multiplier from the previous running, it is mostly used for CIRR mode
563 // which intends to keep the fracturing open
564 std::vector<Scalar> prev_inj_multiplier_;
565
566 // WINJMULT multipliers for previous iteration (used for oscillation detection)
567 mutable std::vector<Scalar> inj_multiplier_previter_;
568 // WINJMULT dampening factors (used in case of oscillations)
569 mutable std::vector<Scalar> inj_multiplier_damp_factor_;
570
571 // the multiplier due to injection filtration cake
572 std::vector<Scalar> inj_fc_multiplier_;
573
576 const GuideRate* guide_rate_;
577
578 std::vector<std::string> well_control_log_;
579
581
582 // statistics for standalone well solves; shared so that well copies used
583 // during e.g. potential calculations contribute to the same statistics
584 std::shared_ptr<WellSolveStats> solve_stats_ = std::make_shared<WellSolveStats>();
585 // true while a well potential calculation is in progress
586 mutable bool computing_well_potentials_ = false;
587 // true while a standalone well solve is in progress
588 mutable bool in_well_solve_ = false;
589};
590
591}
592
593#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:352
~PotentialCalculationScope()
Definition: WellInterfaceGeneric.hpp:359
PotentialCalculationScope(const WellInterfaceGeneric &well)
Definition: WellInterfaceGeneric.hpp:354
Definition: WellInterfaceGeneric.hpp:331
SolvePartTimer(const WellInterfaceGeneric &well, double &target)
Definition: WellInterfaceGeneric.hpp:333
~SolvePartTimer()
Definition: WellInterfaceGeneric.hpp:338
Definition: WellInterfaceGeneric.hpp:302
WellSolveScope(const WellInterfaceGeneric &well, const int &iterations)
Definition: WellInterfaceGeneric.hpp:304
~WellSolveScope()
Definition: WellInterfaceGeneric.hpp:310
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:486
bool isVFPActive(DeferredLogger &deferred_logger) const
const WellSolveStats & solveStats() const
Definition: WellInterfaceGeneric.hpp:293
void openWell()
Definition: WellInterfaceGeneric.hpp:129
std::vector< int > saturation_table_number_
Definition: WellInterfaceGeneric.hpp:551
bool isOperableAndSolvable() const
void addFracturePerforations(const std::vector< RuntimePerforation > &perfs)
std::vector< int > well_cells_
Definition: WellInterfaceGeneric.hpp:506
void updatePerforatedCell(std::vector< bool > &is_cell_perforated)
int index_of_well_
Definition: WellInterfaceGeneric.hpp:492
std::optional< Scalar > dynamic_thp_limit_
Definition: WellInterfaceGeneric.hpp:557
std::vector< Scalar > perf_depth_
Definition: WellInterfaceGeneric.hpp:519
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:564
Well::Status wellStatus()
Definition: WellInterfaceGeneric.hpp:130
int polymerWaterTable_() const
int number_of_phases_
Definition: WellInterfaceGeneric.hpp:489
void setWsolvent(const Scalar wsolvent)
std::vector< Scalar > & perfDepth()
Definition: WellInterfaceGeneric.hpp:156
const PhaseUsageInfo< IndexTraits > & phase_usage_
Definition: WellInterfaceGeneric.hpp:494
Scalar wpolymer_() const
bool in_well_solve_
Definition: WellInterfaceGeneric.hpp:588
const int current_step_
Definition: WellInterfaceGeneric.hpp:477
std::vector< Scalar > ipr_a_
Definition: WellInterfaceGeneric.hpp:502
Well well_ecl_
Definition: WellInterfaceGeneric.hpp:474
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:476
Scalar wmicrobes_() const
const PhaseUsageInfo< IndexTraits > & phaseUsage() const
void resetSolveStats() const
Definition: WellInterfaceGeneric.hpp:294
std::vector< Scalar > ipr_b_
Definition: WellInterfaceGeneric.hpp:503
const int pvtRegionIdx_
Definition: WellInterfaceGeneric.hpp:482
std::vector< Scalar > inj_multiplier_damp_factor_
Definition: WellInterfaceGeneric.hpp:569
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:576
OperabilityStatus operability_status_
Definition: WellInterfaceGeneric.hpp:472
bool wellUnderZeroRateTargetIndividual(const SummaryState &summary_state, const WellState< Scalar, IndexTraits > &well_state) const
Well::Status wellStatus_
Definition: WellInterfaceGeneric.hpp:553
int numLocalPerfs() const
Definition: WellInterfaceGeneric.hpp:144
Scalar getTHPConstraint(const SummaryState &summaryState) const
bool isPressureControlled(const WellStateType &well_state) const
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 std::time_t start_time, DeferredLogger &deferred_logger, std::string *closure_reason=nullptr) 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:240
Scalar well_efficiency_factor_
Definition: WellInterfaceGeneric.hpp:574
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:567
std::vector< Scalar > inj_fc_multiplier_
Definition: WellInterfaceGeneric.hpp:572
const std::vector< WellIndexFracture > & wellIndexFracture() const
Definition: WellInterfaceGeneric.hpp:276
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:368
const std::vector< PerforationData< Scalar > > * perf_data_
Definition: WellInterfaceGeneric.hpp:496
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:584
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:237
SolvePartTimer solveLinearSolveTimer() const
Definition: WellInterfaceGeneric.hpp:374
Well::ProductionControls productionControlsWithWeldraw(const SummaryState &summary_state, const SingleWellState< Scalar, IndexTraits > &ws) const
std::vector< std::string > well_control_log_
Definition: WellInterfaceGeneric.hpp:578
void resetDampening()
Definition: WellInterfaceGeneric.hpp:412
int indexOfWell() const
Index of well in the wells struct and wellState.
std::vector< WellIndexFracture > well_index_fracture_
Definition: WellInterfaceGeneric.hpp:513
virtual std::vector< Scalar > getPrimaryVars() const
Definition: WellInterfaceGeneric.hpp:247
const std::vector< PerforationData< Scalar > > & perforationData() const
Get the perforations of the well.
std::vector< Scalar > perf_length_
Definition: WellInterfaceGeneric.hpp:525
const std::vector< int > & cells() const
Well cells.
Definition: WellInterfaceGeneric.hpp:91
int number_of_local_perforations_
Definition: WellInterfaceGeneric.hpp:516
std::vector< Scalar > well_index_
Definition: WellInterfaceGeneric.hpp:509
virtual int setPrimaryVars(typename std::vector< Scalar >::const_iterator)
Definition: WellInterfaceGeneric.hpp:252
void setVFPProperties(const VFPProperties< Scalar, IndexTraits > *vfp_properties_arg)
const std::string & name() const
Well name.
const ModelParameters & param_
Definition: WellInterfaceGeneric.hpp:478
std::pair< bool, bool > computeWellPotentials(std::vector< Scalar > &well_potentials, const WellStateType &well_state)
bool computing_well_potentials_
Definition: WellInterfaceGeneric.hpp:586
SolvePartTimer solveAssembleTimer() const
Definition: WellInterfaceGeneric.hpp:371
bool changed_to_open_this_step_
Definition: WellInterfaceGeneric.hpp:580
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:377
const VFPProperties< Scalar, IndexTraits > * vfp_properties_
Definition: WellInterfaceGeneric.hpp:575
virtual ~WellInterfaceGeneric()=default
void initInjMult(const std::vector< Scalar > &max_inj_mult)
Scalar wsolvent_
Definition: WellInterfaceGeneric.hpp:556
std::map< int, std::vector< int > > completions_
Definition: WellInterfaceGeneric.hpp:545
void setDynamicThpLimit(const std::optional< Scalar > thp_limit)
std::vector< Scalar > perf_rep_radius_
Definition: WellInterfaceGeneric.hpp:522
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:555
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:528
bool wellIsStopped() const
Definition: WellInterfaceGeneric.hpp:132
Scalar ref_depth_
Definition: WellInterfaceGeneric.hpp:548
bool thpLimitViolatedButNotSwitched() const
bool getAllowCrossFlow() const
std::vector< Scalar > inj_multiplier_
Definition: WellInterfaceGeneric.hpp:560
int currentStep() const
Definition: WellInterfaceGeneric.hpp:134
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:207
Static data associated with a well perforation.
Definition: PerforationData.hpp:30
Definition: WellInterfaceGeneric.hpp:423
void resetOperability()
Definition: WellInterfaceGeneric.hpp:443
bool thp_limit_violated_but_not_switched
Definition: WellInterfaceGeneric.hpp:467
bool can_obtain_bhp_with_thp_limit
Definition: WellInterfaceGeneric.hpp:459
bool has_negative_potentials
Definition: WellInterfaceGeneric.hpp:465
bool isOperableUnderTHPLimit() const
Definition: WellInterfaceGeneric.hpp:438
bool obey_bhp_limit_with_thp_limit
Definition: WellInterfaceGeneric.hpp:461
bool solvable
Definition: WellInterfaceGeneric.hpp:463
bool operable_under_only_bhp_limit
Definition: WellInterfaceGeneric.hpp:454
bool use_vfpexplicit
Definition: WellInterfaceGeneric.hpp:469
bool isOperableUnderBHPLimit() const
Definition: WellInterfaceGeneric.hpp:433
bool obey_thp_limit_under_bhp_limit
Definition: WellInterfaceGeneric.hpp:457
bool isOperableAndSolvable() const
Definition: WellInterfaceGeneric.hpp:424
Definition: WellInterfaceGeneric.hpp:284
unsigned int iterations
well iterations in normal solves
Definition: WellInterfaceGeneric.hpp:289
double potential_solve_time
time used by well potential solves
Definition: WellInterfaceGeneric.hpp:286
double assemble_time
assembly time in the well solves
Definition: WellInterfaceGeneric.hpp:287
double solve_time
time used by normal well solves
Definition: WellInterfaceGeneric.hpp:285
double linear_solve_time
linear solve time in the well solves
Definition: WellInterfaceGeneric.hpp:288
unsigned int potential_iterations
well iterations in potential solves
Definition: WellInterfaceGeneric.hpp:290