StandardWell.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2016 - 2017 IRIS AS.
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22
23#ifndef OPM_STANDARDWELL_HEADER_INCLUDED
24#define OPM_STANDARDWELL_HEADER_INCLUDED
25
34
41
42#include <opm/material/densead/Evaluation.hpp>
43#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
44
46
47#include <dune/common/dynvector.hh>
48#include <dune/common/dynmatrix.hh>
49
50#include <memory>
51#include <optional>
52
53namespace Opm
54{
55
56 template<typename TypeTag>
57 class StandardWell : public WellInterface<TypeTag>
58 , public StandardWellEval<GetPropType<TypeTag, Properties::FluidSystem>,
59 GetPropType<TypeTag, Properties::Indices>>
60 {
61
62 public:
66
67 // TODO: some functions working with AD variables handles only with values (double) without
68 // dealing with derivatives. It can be beneficial to make functions can work with either AD or scalar value.
69 // And also, it can also be beneficial to make these functions hanle different types of AD variables.
70 using typename Base::Simulator;
71 using typename Base::IntensiveQuantities;
72 using typename Base::FluidSystem;
73 using typename Base::MaterialLaw;
74 using typename Base::ModelParameters;
75 using typename Base::Indices;
76 using typename Base::RateConverterType;
77 using typename Base::SparseMatrixAdapter;
78 using typename Base::FluidState;
79 using typename Base::RateVector;
80 using typename Base::WellGroupHelperType;
81
86 using Base::has_foam;
87 using Base::has_brine;
88 using Base::has_energy;
90 using Base::has_micp;
91
94 using typename Base::PressureMatrix;
95
96 // number of the conservation equations
97 static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents;
98 // number of the well control equations
99 static constexpr int numWellControlEq = 1;
100 // number of the well equations that will always be used
101 // based on the solution strategy, there might be other well equations be introduced
103
104 // the index for Bhp in primary variables and also the index of well control equation
105 // they both will be the last one in their respective system.
106 // TODO: we should have indices for the well equations and well primary variables separately
107 static constexpr int Bhp = numStaticWellEq - numWellControlEq;
108
110
111 using typename Base::Scalar;
112
113 using Base::name;
114 using Base::Water;
115 using Base::Oil;
116 using Base::Gas;
117
118 using typename Base::BVector;
119
120 using Eval = typename StdWellEval::Eval;
123
124 using IndexTraits = typename FluidSystem::IndexTraitsType;
126
127 StandardWell(const Well& well,
128 const ParallelWellInfo<Scalar>& pw_info,
129 const int time_step,
130 const ModelParameters& param,
131 const RateConverterType& rate_converter,
132 const int pvtRegionIdx,
133 const int num_conservation_quantities,
134 const int num_phases,
135 const int index_of_well,
136 const std::vector<PerforationData<Scalar>>& perf_data);
137
138 virtual void init(const std::vector<Scalar>& depth_arg,
139 const Scalar gravity_arg,
140 const std::vector<Scalar>& B_avg,
141 const bool changed_to_open_this_step) override;
142
144 virtual ConvergenceReport getWellConvergence(const Simulator& simulator,
145 const WellStateType& well_state,
146 const std::vector<Scalar>& B_avg,
147 DeferredLogger& deferred_logger,
148 const bool relax_tolerance) const override;
149
151 virtual void apply(const BVector& x, BVector& Ax) const override;
153 virtual void apply(BVector& r) const override;
154
158 const BVector& x,
159 WellStateType& well_state,
160 DeferredLogger& deferred_logger) override;
161
163 void computeWellPotentials(const Simulator& simulator,
164 const WellStateType& well_state,
165 const WellGroupHelperType& wgHelper,
166 std::vector<Scalar>& well_potentials,
167 DeferredLogger& deferred_logger) /* const */ override;
168
169 void updatePrimaryVariables(const Simulator& simulator,
170 const WellStateType& well_state,
171 DeferredLogger& deferred_logger) override;
172
173 void solveEqAndUpdateWellState(const Simulator& simulator,
174 WellStateType& well_state,
175 DeferredLogger& deferred_logger) override;
176
177 void calculateExplicitQuantities(const Simulator& simulator,
178 const WellStateType& well_state,
179 DeferredLogger& deferred_logger) override; // should be const?
180
181 void updateProductivityIndex(const Simulator& simulator,
182 const WellProdIndexCalculator<Scalar>& wellPICalc,
183 WellStateType& well_state,
184 DeferredLogger& deferred_logger) const override;
185
186 Scalar connectionDensity(const int globalConnIdx,
187 const int openConnIdx) const override;
188
189 void addWellContributions(SparseMatrixAdapter& mat) const override;
190
192 const BVector& x,
193 const int pressureVarIndex,
194 const bool use_well_weights,
195 const WellStateType& well_state) const override;
196
197 // iterate well equations with the specified control until converged
198 bool iterateWellEqWithControl(const Simulator& simulator,
199 const double dt,
200 const Well::InjectionControls& inj_controls,
201 const Well::ProductionControls& prod_controls,
202 const WellGroupHelperType& wgHelper,
203 WellStateType& well_state,
204 DeferredLogger& deferred_logger) override;
205
206 // iterate well equations including control switching
207 bool iterateWellEqWithSwitching(const Simulator& simulator,
208 const double dt,
209 const Well::InjectionControls& inj_controls,
210 const Well::ProductionControls& prod_controls,
211 const WellGroupHelperType& wgHelper,
212 WellStateType& well_state,
213 DeferredLogger& deferred_logger,
214 const bool fixed_control,
215 const bool fixed_status,
216 const bool solving_with_zero_rate) override;
217
218 /* returns BHP */
220 const WellGroupHelperType& wgHelper,
221 const SummaryState &summary_state,
222 DeferredLogger& deferred_logger,
223 std::vector<Scalar>& potentials,
224 Scalar alq) const;
225
226 void computeWellRatesWithThpAlqProd(const Simulator& ebos_simulator,
227 const WellGroupHelperType& wgHelper,
228 const SummaryState& summary_state,
229 DeferredLogger& deferred_logger,
230 std::vector<Scalar>& potentials,
231 Scalar alq) const;
232
233 std::optional<Scalar>
234 computeBhpAtThpLimitProdWithAlq(const Simulator& ebos_simulator,
235 const WellGroupHelperType& wgHelper,
236 const SummaryState& summary_state,
237 const Scalar alq_value,
238 DeferredLogger& deferred_logger,
239 bool iterate_if_no_solution) const override;
240
241 void updateIPRImplicit(const Simulator& simulator,
242 const WellGroupHelperType& wgHelper,
243 WellStateType& well_state,
244 DeferredLogger& deferred_logger) override;
245
246 void computeWellRatesWithBhp(const Simulator& ebosSimulator,
247 const Scalar& bhp,
248 std::vector<Scalar>& well_flux,
249 DeferredLogger& deferred_logger) const override;
250
251 // NOTE: These cannot be protected since they are used by GasLiftRuntime
253
254 std::vector<Scalar>
255 computeCurrentWellRates(const Simulator& ebosSimulator,
256 DeferredLogger& deferred_logger) const override;
257
258 std::vector<Scalar> getPrimaryVars() const override;
259
260 int setPrimaryVars(typename std::vector<Scalar>::const_iterator it) override;
261
262 protected:
264
265 // updating the well_state based on well solution dwells
266 void updateWellState(const Simulator& simulator,
267 const BVectorWell& dwells,
268 WellStateType& well_state,
269 DeferredLogger& deferred_logger);
270
271 using WellConnectionProps = typename StdWellEval::StdWellConnections::Properties;
272
273 // Compute connection level PVT properties needed to calulate the
274 // pressure difference between well connections.
277 const WellStateType& well_state) const;
278
280 const WellStateType& well_state,
281 const WellConnectionProps& props,
282 DeferredLogger& deferred_logger);
283
284 void computeWellConnectionPressures(const Simulator& simulator,
285 const WellStateType& well_state,
286 DeferredLogger& deferred_logger);
287
288 template<class Value>
289 void computePerfRate(const IntensiveQuantities& intQuants,
290 const std::vector<Value>& mob,
291 const Value& bhp,
292 const std::vector<Value>& Tw,
293 const int perf,
294 const bool allow_cf,
295 std::vector<Value>& cq_s,
296 PerforationRates<Scalar>& perf_rates,
297 DeferredLogger& deferred_logger) const;
298
299 template<class Value>
300 void computePerfRate(const std::vector<Value>& mob,
301 const Value& pressure,
302 const Value& bhp,
303 const Value& rs,
304 const Value& rv,
305 const Value& rvw,
306 const Value& rsw,
307 std::vector<Value>& b_perfcells_dense,
308 const std::vector<Value>& Tw,
309 const int perf,
310 const bool allow_cf,
311 const Value& skin_pressure,
312 const std::vector<Value>& cmix_s,
313 std::vector<Value>& cq_s,
314 PerforationRates<Scalar>& perf_rates,
315 DeferredLogger& deferred_logger) const;
316
317 void computeWellRatesWithBhpIterations(const Simulator& ebosSimulator,
318 const Scalar& bhp,
319 const WellGroupHelperType& wgHelper,
320 std::vector<Scalar>& well_flux,
321 DeferredLogger& deferred_logger) const override;
322
323 std::vector<Scalar>
324 computeWellPotentialWithTHP(const Simulator& ebosSimulator,
325 const WellGroupHelperType& wgHelper,
326 DeferredLogger& deferred_logger,
327 const WellStateType& well_state) const;
328
329 bool computeWellPotentialsImplicit(const Simulator& ebos_simulator,
330 const WellGroupHelperType& wgHelper,
331 std::vector<Scalar>& well_potentials,
332 DeferredLogger& deferred_logger) const;
333
334 // return the density at the perforation[0] of the rank owning this well,
335 // value is cached to minimize the number of broadcasts
336 Scalar getRefDensity() const override;
337
338 // get the transmissibility multiplier for specific perforation
339 template<class Value>
340 void getTransMult(Value& trans_mult,
341 const Simulator& simulator,
342 const int cell_indx) const;
343
344 // get the mobility for specific perforation
345 template<class Value>
346 void getMobility(const Simulator& simulator,
347 const int perf,
348 std::vector<Value>& mob,
349 DeferredLogger& deferred_logger) const;
350
351 void updateWaterMobilityWithPolymer(const Simulator& simulator,
352 const int perf,
353 std::vector<EvalWell>& mob_water,
354 DeferredLogger& deferred_logger) const;
355
356 void updatePrimaryVariablesNewton(const BVectorWell& dwells,
357 const bool stop_or_zero_rate_target,
358 DeferredLogger& deferred_logger);
359
361 const SummaryState& summary_state,
362 DeferredLogger& deferred_logger) const;
363
364 void assembleWellEqWithoutIteration(const Simulator& simulator,
365 const WellGroupHelperType& wgHelper,
366 const double dt,
367 const Well::InjectionControls& inj_controls,
368 const Well::ProductionControls& prod_controls,
369 WellStateType& well_state,
370 DeferredLogger& deferred_logger,
371 const bool solving_with_zero_rate) override;
372
373 void assembleWellEqWithoutIterationImpl(const Simulator& simulator,
374 const WellGroupHelperType& wgHelper,
375 const double dt,
376 const Well::InjectionControls& inj_controls,
377 const Well::ProductionControls& prod_controls,
378 WellStateType& well_state,
379 DeferredLogger& deferred_logger,
380 const bool solving_with_zero_rate);
381
382 void calculateSinglePerf(const Simulator& simulator,
383 const int perf,
384 WellStateType& well_state,
385 std::vector<RateVector>& connectionRates,
386 std::vector<EvalWell>& cq_s,
387 EvalWell& water_flux_s,
388 EvalWell& cq_s_zfrac_effective,
389 DeferredLogger& deferred_logger) const;
390
391 // check whether the well is operable under BHP limit with current reservoir condition
392 void checkOperabilityUnderBHPLimit(const WellStateType& well_state,
393 const Simulator& simulator,
394 DeferredLogger& deferred_logger) override;
395
396 // check whether the well is operable under THP limit with current reservoir condition
397 void checkOperabilityUnderTHPLimit(const Simulator& simulator,
398 const WellStateType& well_state,
399 const WellGroupHelperType& wgHelper,
400 DeferredLogger& deferred_logger) override;
401
402 // updating the inflow based on the current reservoir condition
403 void updateIPR(const Simulator& simulator,
404 DeferredLogger& deferred_logger) const override;
405
406 // for a well, when all drawdown are in the wrong direction, then this well will not
407 // be able to produce/inject .
408 bool allDrawDownWrongDirection(const Simulator& simulator) const;
409
410 // turn on crossflow to avoid singular well equations
411 // when the well is banned from cross-flow and the BHP is not properly initialized,
412 // we turn on crossflow to avoid singular well equations. It can result in wrong-signed
413 // well rates, it can cause problem for THP calculation
414 // TODO: looking for better alternative to avoid wrong-signed well rates
415 bool openCrossFlowAvoidSingularity(const Simulator& simulator) const;
416
417 // calculate the skin pressure based on water velocity, throughput and polymer concentration.
418 // throughput is used to describe the formation damage during water/polymer injection.
419 // calculated skin pressure will be applied to the drawdown during perforation rate calculation
420 // to handle the effect from formation damage.
421 EvalWell pskin(const Scalar throughput,
422 const EvalWell& water_velocity,
423 const EvalWell& poly_inj_conc,
424 DeferredLogger& deferred_logger) const;
425
426 // calculate the skin pressure based on water velocity, throughput during water injection.
427 EvalWell pskinwater(const Scalar throughput,
428 const EvalWell& water_velocity,
429 DeferredLogger& deferred_logger) const;
430
431 // calculate the injecting polymer molecular weight based on the througput and water velocity
432 EvalWell wpolymermw(const Scalar throughput,
433 const EvalWell& water_velocity,
434 DeferredLogger& deferred_logger) const;
435
436 // modify the water rate for polymer injectivity study
437 void handleInjectivityRate(const Simulator& simulator,
438 const int perf,
439 std::vector<EvalWell>& cq_s) const;
440
441 // handle the extra equations for polymer injectivity study
442 void handleInjectivityEquations(const Simulator& simulator,
443 const WellStateType& well_state,
444 const int perf,
445 const EvalWell& water_flux_s,
446 DeferredLogger& deferred_logger);
447
448 void updateWaterThroughput(const double dt,
449 WellStateType& well_state) const override;
450
451 // checking convergence of extra equations, if there are any
452 void checkConvergenceExtraEqs(const std::vector<Scalar>& res,
453 ConvergenceReport& report) const;
454
455 // updating the connectionRates_ related polymer molecular weight
456 void updateConnectionRatePolyMW(const EvalWell& cq_s_poly,
457 const IntensiveQuantities& int_quants,
458 const WellStateType& well_state,
459 const int perf,
460 std::vector<RateVector>& connectionRates,
461 DeferredLogger& deferred_logger) const;
462
463 std::optional<Scalar>
464 computeBhpAtThpLimitProd(const WellStateType& well_state,
465 const Simulator& simulator,
466 const WellGroupHelperType& wgHelper,
467 const SummaryState& summary_state,
468 DeferredLogger& deferred_logger) const;
469
470 std::optional<Scalar>
471 computeBhpAtThpLimitInj(const Simulator& simulator,
472 const WellGroupHelperType& wgHelper,
473 const SummaryState& summary_state,
474 DeferredLogger& deferred_logger) const;
475
476 private:
477 Eval connectionRateEnergy(const std::vector<EvalWell>& cq_s,
478 const IntensiveQuantities& intQuants,
479 DeferredLogger& deferred_logger) const;
480
481 // density of the first perforation, might not be from this rank
482 Scalar cachedRefDensity{0};
483 };
484
485}
486
487#include "StandardWell_impl.hpp"
488
489#endif // OPM_STANDARDWELL_HEADER_INCLUDED
Contains the classes required to extend the black-oil model by bioeffects.
Contains the classes required to extend the black-oil model by brine.
Contains the classes required to extend the black-oil model by solvent component. For details,...
Contains the classes required to extend the black-oil model to include the effects of foam.
Contains the classes required to extend the black-oil model by polymer.
Contains the classes required to extend the black-oil model by solvents.
Contains the high level supplements required to extend the black oil model to include the effects of ...
Definition: blackoilfoammodules.hh:58
Contains the high level supplements required to extend the black oil model by polymer.
Definition: blackoilpolymermodules.hh:64
Definition: ConvergenceReport.hpp:38
Definition: DeferredLogger.hpp:57
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:198
Definition: StandardWellEval.hpp:46
DenseAd::Evaluation< Scalar, Indices::numDerivatives > Eval
Definition: StandardWellEval.hpp:64
typename StandardWellEquations< Scalar, IndexTraits, Indices::numEq >::BVectorWell BVectorWell
Definition: StandardWellEval.hpp:65
Definition: StandardWell.hpp:60
void calculateExplicitQuantities(const Simulator &simulator, const WellStateType &well_state, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:1436
EvalWell wpolymermw(const Scalar throughput, const EvalWell &water_velocity, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:2077
typename StdWellEval::EvalWell EvalWell
Definition: StandardWell.hpp:121
void updateWellStateFromPrimaryVariables(WellStateType &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:805
static constexpr int numStaticWellEq
Definition: StandardWell.hpp:102
bool regularize_
Definition: StandardWell.hpp:263
WellConnectionProps computePropertiesForWellConnectionPressures(const Simulator &simulator, const WellStateType &well_state) const
Definition: StandardWell_impl.hpp:1170
typename StdWellEval::BVectorWell BVectorWell
Definition: StandardWell.hpp:122
std::vector< Scalar > computeWellPotentialWithTHP(const Simulator &ebosSimulator, const WellGroupHelperType &wgHelper, DeferredLogger &deferred_logger, const WellStateType &well_state) const
Definition: StandardWell_impl.hpp:1621
void addWellContributions(SparseMatrixAdapter &mat) const override
Definition: StandardWell_impl.hpp:1974
std::vector< Scalar > getPrimaryVars() const override
Definition: StandardWell_impl.hpp:2642
void addWellPressureEquations(PressureMatrix &mat, const BVector &x, const int pressureVarIndex, const bool use_well_weights, const WellStateType &well_state) const override
Definition: StandardWell_impl.hpp:1982
void computeWellPotentials(const Simulator &simulator, const WellStateType &well_state, const WellGroupHelperType &wgHelper, std::vector< Scalar > &well_potentials, DeferredLogger &deferred_logger) override
computing the well potentials for group control
Definition: StandardWell_impl.hpp:1796
void updateWaterMobilityWithPolymer(const Simulator &simulator, const int perf, std::vector< EvalWell > &mob_water, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:1908
std::vector< Scalar > computeCurrentWellRates(const Simulator &ebosSimulator, DeferredLogger &deferred_logger) const override
Definition: StandardWell_impl.hpp:2604
void calculateSinglePerf(const Simulator &simulator, const int perf, WellStateType &well_state, std::vector< RateVector > &connectionRates, std::vector< EvalWell > &cq_s, EvalWell &water_flux_s, EvalWell &cq_s_zfrac_effective, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:506
bool iterateWellEqWithControl(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const WellGroupHelperType &wgHelper, WellStateType &well_state, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:2410
void updatePrimaryVariablesNewton(const BVectorWell &dwells, const bool stop_or_zero_rate_target, DeferredLogger &deferred_logger)
Definition: StandardWell_impl.hpp:782
bool computeWellPotentialsImplicit(const Simulator &ebos_simulator, const WellGroupHelperType &wgHelper, std::vector< Scalar > &well_potentials, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:1657
void computeWellRatesWithBhpIterations(const Simulator &ebosSimulator, const Scalar &bhp, const WellGroupHelperType &wgHelper, std::vector< Scalar > &well_flux, DeferredLogger &deferred_logger) const override
Definition: StandardWell_impl.hpp:1550
void computeWellConnectionPressures(const Simulator &simulator, const WellStateType &well_state, DeferredLogger &deferred_logger)
Definition: StandardWell_impl.hpp:1396
StandardWell(const Well &well, const ParallelWellInfo< Scalar > &pw_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const std::vector< PerforationData< Scalar > > &perf_data)
Definition: StandardWell_impl.hpp:52
typename StdWellEval::StdWellConnections::Properties WellConnectionProps
Definition: StandardWell.hpp:271
void updateConnectionRatePolyMW(const EvalWell &cq_s_poly, const IntensiveQuantities &int_quants, const WellStateType &well_state, const int perf, std::vector< RateVector > &connectionRates, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:2226
void assembleWellEqWithoutIteration(const Simulator &simulator, const WellGroupHelperType &wgHelper, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellStateType &well_state, DeferredLogger &deferred_logger, const bool solving_with_zero_rate) override
Definition: StandardWell_impl.hpp:341
void computeWellRatesWithBhp(const Simulator &ebosSimulator, const Scalar &bhp, std::vector< Scalar > &well_flux, DeferredLogger &deferred_logger) const override
Definition: StandardWell_impl.hpp:1502
void getMobility(const Simulator &simulator, const int perf, std::vector< Value > &mob, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:704
void getTransMult(Value &trans_mult, const Simulator &simulator, const int cell_indx) const
Definition: StandardWell_impl.hpp:684
void updateIPRImplicit(const Simulator &simulator, const WellGroupHelperType &wgHelper, WellStateType &well_state, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:921
void updateIPR(const Simulator &simulator, DeferredLogger &deferred_logger) const override
Definition: StandardWell_impl.hpp:829
void computeWellConnectionDensitesPressures(const Simulator &simulator, const WellStateType &well_state, const WellConnectionProps &props, DeferredLogger &deferred_logger)
Definition: StandardWell_impl.hpp:1340
std::optional< Scalar > computeBhpAtThpLimitProdWithAlq(const Simulator &ebos_simulator, const WellGroupHelperType &wgHelper, const SummaryState &summary_state, const Scalar alq_value, DeferredLogger &deferred_logger, bool iterate_if_no_solution) const override
Definition: StandardWell_impl.hpp:2285
void updateWellState(const Simulator &simulator, const BVectorWell &dwells, WellStateType &well_state, DeferredLogger &deferred_logger)
Definition: StandardWell_impl.hpp:760
void assembleWellEqWithoutIterationImpl(const Simulator &simulator, const WellGroupHelperType &wgHelper, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellStateType &well_state, DeferredLogger &deferred_logger, const bool solving_with_zero_rate)
Definition: StandardWell_impl.hpp:368
void handleInjectivityEquations(const Simulator &simulator, const WellStateType &well_state, const int perf, const EvalWell &water_flux_s, DeferredLogger &deferred_logger)
Definition: StandardWell_impl.hpp:2160
virtual void apply(const BVector &x, BVector &Ax) const override
Ax = Ax - C D^-1 B x.
Definition: StandardWell_impl.hpp:1450
virtual ConvergenceReport getWellConvergence(const Simulator &simulator, const WellStateType &well_state, const std::vector< Scalar > &B_avg, DeferredLogger &deferred_logger, const bool relax_tolerance) const override
check whether the well equations get converged for this well
Definition: StandardWell_impl.hpp:1221
void checkConvergenceExtraEqs(const std::vector< Scalar > &res, ConvergenceReport &report) const
Definition: StandardWell_impl.hpp:2207
typename StdWellEval::Eval Eval
Definition: StandardWell.hpp:120
bool iterateWellEqWithSwitching(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const WellGroupHelperType &wgHelper, WellStateType &well_state, DeferredLogger &deferred_logger, const bool fixed_control, const bool fixed_status, const bool solving_with_zero_rate) override
Definition: StandardWell_impl.hpp:2473
static constexpr int Bhp
Definition: StandardWell.hpp:107
bool openCrossFlowAvoidSingularity(const Simulator &simulator) const
Definition: StandardWell_impl.hpp:1159
void computeWellRatesWithThpAlqProd(const Simulator &ebos_simulator, const WellGroupHelperType &wgHelper, const SummaryState &summary_state, DeferredLogger &deferred_logger, std::vector< Scalar > &potentials, Scalar alq) const
Definition: StandardWell_impl.hpp:1777
typename FluidSystem::IndexTraitsType IndexTraits
Definition: StandardWell.hpp:124
Scalar computeWellRatesAndBhpWithThpAlqProd(const Simulator &ebos_simulator, const WellGroupHelperType &wgHelper, const SummaryState &summary_state, DeferredLogger &deferred_logger, std::vector< Scalar > &potentials, Scalar alq) const
Definition: StandardWell_impl.hpp:1747
bool allDrawDownWrongDirection(const Simulator &simulator) const
Definition: StandardWell_impl.hpp:1117
EvalWell pskin(const Scalar throughput, const EvalWell &water_velocity, const EvalWell &poly_inj_conc, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:2033
void computePerfRate(const IntensiveQuantities &intQuants, const std::vector< Value > &mob, const Value &bhp, const std::vector< Value > &Tw, const int perf, const bool allow_cf, std::vector< Value > &cq_s, PerforationRates< Scalar > &perf_rates, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:93
static constexpr int numWellConservationEq
Definition: StandardWell.hpp:97
int setPrimaryVars(typename std::vector< Scalar >::const_iterator it) override
Definition: StandardWell_impl.hpp:2659
void updateWaterThroughput(const double dt, WellStateType &well_state) const override
Definition: StandardWell_impl.hpp:2106
void checkOperabilityUnderTHPLimit(const Simulator &simulator, const WellStateType &well_state, const WellGroupHelperType &wgHelper, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:1067
void checkOperabilityUnderBHPLimit(const WellStateType &well_state, const Simulator &simulator, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:998
std::optional< Scalar > computeBhpAtThpLimitInj(const Simulator &simulator, const WellGroupHelperType &wgHelper, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:2372
void recoverWellSolutionAndUpdateWellState(const Simulator &simulator, const BVector &x, WellStateType &well_state, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:1482
EvalWell pskinwater(const Scalar throughput, const EvalWell &water_velocity, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:2002
void solveEqAndUpdateWellState(const Simulator &simulator, WellStateType &well_state, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:1414
void handleInjectivityRate(const Simulator &simulator, const int perf, std::vector< EvalWell > &cq_s) const
Definition: StandardWell_impl.hpp:2137
virtual void init(const std::vector< Scalar > &depth_arg, const Scalar gravity_arg, const std::vector< Scalar > &B_avg, const bool changed_to_open_this_step) override
Definition: StandardWell_impl.hpp:76
void updateProductivityIndex(const Simulator &simulator, const WellProdIndexCalculator< Scalar > &wellPICalc, WellStateType &well_state, DeferredLogger &deferred_logger) const override
Definition: StandardWell_impl.hpp:1265
void updatePrimaryVariables(const Simulator &simulator, const WellStateType &well_state, DeferredLogger &deferred_logger) override
Definition: StandardWell_impl.hpp:1874
std::optional< Scalar > computeBhpAtThpLimitProd(const WellStateType &well_state, const Simulator &simulator, const WellGroupHelperType &wgHelper, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
Definition: StandardWell_impl.hpp:2268
static constexpr int numWellControlEq
Definition: StandardWell.hpp:99
Scalar getRefDensity() const override
Definition: StandardWell_impl.hpp:1897
Scalar connectionDensity(const int globalConnIdx, const int openConnIdx) const override
Definition: StandardWell_impl.hpp:1859
Definition: WellGroupHelper.hpp:59
static constexpr int Oil
Definition: WellInterfaceFluidSystem.hpp:65
static constexpr int Water
Definition: WellInterfaceFluidSystem.hpp:64
static constexpr int Gas
Definition: WellInterfaceFluidSystem.hpp:66
int pvtRegionIdx() const
Definition: WellInterfaceGeneric.hpp:130
const VFPProperties< FluidSystem::Scalar, FluidSystem::IndexTraitsType > * vfp_properties_
Definition: WellInterfaceGeneric.hpp:399
Definition: WellInterface.hpp:77
BlackOilFluidState< Eval, FluidSystem, energyModuleType==EnergyModules::ConstantTemperature,(energyModuleType==EnergyModules::FullyImplicitThermal||energyModuleType==EnergyModules::SequentialImplicitThermal), Indices::compositionSwitchIdx >=0, has_watVapor, has_brine, has_saltPrecip, has_disgas_in_water, Indices::numPhases > FluidState
Definition: WellInterface.hpp:139
static constexpr bool has_brine
Definition: WellInterface.hpp:122
GetPropType< TypeTag, Properties::Simulator > Simulator
Definition: WellInterface.hpp:82
typename WellInterfaceFluidSystem< FluidSystem >::RateConverterType RateConverterType
Definition: WellInterface.hpp:105
const std::vector< RateVector > & connectionRates() const
Definition: WellInterface.hpp:353
Dune::BCRSMatrix< Opm::MatrixBlock< Scalar, 1, 1 > > PressureMatrix
Definition: WellInterface.hpp:98
GetPropType< TypeTag, Properties::IntensiveQuantities > IntensiveQuantities
Definition: WellInterface.hpp:87
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: WellInterface.hpp:83
GetPropType< TypeTag, Properties::MaterialLaw > MaterialLaw
Definition: WellInterface.hpp:88
Dune::BlockVector< VectorBlockType > BVector
Definition: WellInterface.hpp:97
static constexpr bool has_bioeffects
Definition: WellInterface.hpp:126
static constexpr bool has_polymermw
Definition: WellInterface.hpp:120
static constexpr bool has_polymer
Definition: WellInterface.hpp:115
typename Base::ModelParameters ModelParameters
Definition: WellInterface.hpp:111
GetPropType< TypeTag, Properties::FluidSystem > FluidSystem
Definition: WellInterface.hpp:84
static constexpr bool has_solvent
Definition: WellInterface.hpp:113
WellGroupHelper< Scalar, IndexTraits > WellGroupHelperType
Definition: WellInterface.hpp:102
static constexpr bool has_foam
Definition: WellInterface.hpp:121
GetPropType< TypeTag, Properties::RateVector > RateVector
Definition: WellInterface.hpp:90
static constexpr bool has_micp
Definition: WellInterface.hpp:127
static constexpr bool has_energy
Definition: WellInterface.hpp:117
GetPropType< TypeTag, Properties::Indices > Indices
Definition: WellInterface.hpp:86
GetPropType< TypeTag, Properties::SparseMatrixAdapter > SparseMatrixAdapter
Definition: WellInterface.hpp:89
static constexpr bool has_zFraction
Definition: WellInterface.hpp:114
Definition: WellProdIndexCalculator.hpp:37
Definition: WellState.hpp:66
Definition: blackoilbioeffectsmodules.hh:43
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:233
Static data associated with a well perforation.
Definition: PerforationData.hpp:30
Definition: PerforationData.hpp:41