23#ifndef OPM_STANDARDWELL_HEADER_INCLUDED
24#define OPM_STANDARDWELL_HEADER_INCLUDED
26#include <opm/simulators/timestepping/ConvergenceReport.hpp>
28#include <opm/simulators/wells/VFPInjProperties.hpp>
29#include <opm/simulators/wells/VFPProdProperties.hpp>
30#include <opm/simulators/wells/WellInterface.hpp>
31#include <opm/simulators/wells/WellProdIndexCalculator.hpp>
32#include <opm/simulators/wells/ParallelWellInfo.hpp>
41#include <opm/material/densead/Evaluation.hpp>
42#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
44#include <opm/simulators/wells/StandardWellEval.hpp>
46#include <dune/common/dynvector.hh>
47#include <dune/common/dynmatrix.hh>
55 template<
typename TypeTag>
58 GetPropType<TypeTag, Properties::Indices>>
70 using typename Base::IntensiveQuantities;
73 using typename Base::ModelParameters;
75 using typename Base::RateConverterType;
76 using typename Base::SparseMatrixAdapter;
80 using Base::has_solvent;
81 using Base::has_zFraction;
82 using Base::has_polymer;
83 using Base::has_polymermw;
85 using Base::has_brine;
86 using Base::has_energy;
95 static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents;
97 static constexpr int numWellControlEq = 1;
100 static constexpr int numStaticWellEq = numWellConservationEq + numWellControlEq;
105 static constexpr int Bhp = numStaticWellEq - numWellControlEq;
107 using StdWellEval::WQTotal;
118 using Eval =
typename StdWellEval::Eval;
119 using EvalWell =
typename StdWellEval::EvalWell;
120 using BVectorWell =
typename StdWellEval::BVectorWell;
125 const ModelParameters& param,
127 const int pvtRegionIdx,
129 const int num_phases,
136 const std::vector<Scalar>&
B_avg,
139 void initPrimaryVariablesEvaluation()
override;
144 const std::vector<Scalar>&
B_avg,
149 virtual void apply(
const BVector& x, BVector&
Ax)
const override;
151 virtual void apply(BVector&
r)
const override;
163 std::vector<Scalar>& well_potentials,
166 void updatePrimaryVariables(
const Simulator& simulator,
170 void solveEqAndUpdateWellState(
const Simulator& simulator,
174 void calculateExplicitQuantities(
const Simulator& simulator,
178 void updateProductivityIndex(
const Simulator& simulator,
186 void addWellContributions(SparseMatrixAdapter& mat)
const override;
188 void addWellPressureEquations(PressureMatrix& mat,
190 const int pressureVarIndex,
195 bool iterateWellEqWithControl(
const Simulator& simulator,
204 bool iterateWellEqWithSwitching(
const Simulator& simulator,
233 std::optional<Scalar>
239 void updateIPRImplicit(
const Simulator& simulator,
249 using Base::phaseUsage;
250 using Base::vfp_properties_;
256 std::vector<Scalar> getPrimaryVars()
const override;
258 int setPrimaryVars(
typename std::vector<Scalar>::const_iterator it)
override;
264 void updateWellState(
const Simulator& simulator,
265 const BVectorWell&
dwells,
269 using WellConnectionProps =
typename StdWellEval::StdWellConnections::Properties;
274 computePropertiesForWellConnectionPressures(
const Simulator& simulator,
277 void computeWellConnectionDensitesPressures(
const Simulator& simulator,
279 const WellConnectionProps&
props,
282 void computeWellConnectionPressures(
const Simulator& simulator,
286 template<
class Value>
287 void computePerfRate(
const IntensiveQuantities&
intQuants,
288 const std::vector<Value>&
mob,
290 const std::vector<Scalar>&
Tw,
293 std::vector<Value>&
cq_s,
297 template<
class Value>
298 void computePerfRate(
const std::vector<Value>&
mob,
299 const Value& pressure,
306 const std::vector<Scalar>&
Tw,
309 const Value& skin_pressure,
310 const std::vector<Value>&
cmix_s,
311 std::vector<Value>&
cq_s,
326 std::vector<Scalar>& well_potentials,
329 Scalar getRefDensity()
const override;
332 template<
class Value>
333 void getMobility(
const Simulator& simulator,
335 std::vector<Value>&
mob,
338 void updateWaterMobilityWithPolymer(
const Simulator& simulator,
343 void updatePrimaryVariablesNewton(
const BVectorWell&
dwells,
351 void assembleWellEqWithoutIteration(
const Simulator& simulator,
359 void assembleWellEqWithoutIterationImpl(
const Simulator& simulator,
367 void calculateSinglePerf(
const Simulator& simulator,
370 std::vector<RateVector>& connectionRates,
371 std::vector<EvalWell>&
cq_s,
382 void checkOperabilityUnderTHPLimit(
const Simulator& simulator,
387 void updateIPR(
const Simulator& simulator,
392 bool allDrawDownWrongDirection(
const Simulator& simulator)
const;
395 bool canProduceInjectWithCurrentBhp(
const Simulator& simulator,
404 bool openCrossFlowAvoidSingularity(
const Simulator& simulator)
const;
411 const EvalWell& water_velocity,
417 const EvalWell& water_velocity,
422 const EvalWell& water_velocity,
426 void handleInjectivityRate(
const Simulator& simulator,
428 std::vector<EvalWell>&
cq_s)
const;
431 void handleInjectivityEquations(
const Simulator& simulator,
437 void updateWaterThroughput(
const double dt,
441 void checkConvergenceExtraEqs(
const std::vector<Scalar>&
res,
445 void updateConnectionRatePolyMW(
const EvalWell&
cq_s_poly,
449 std::vector<RateVector>& connectionRates,
452 std::optional<Scalar>
458 std::optional<Scalar>
459 computeBhpAtThpLimitInj(
const Simulator& simulator,
464 Eval connectionRateEnergy(
const Scalar maxOilSaturation,
465 const std::vector<EvalWell>&
cq_s,
469 template<
class Value>
470 void gasOilPerfRateInj(
const std::vector<Value>&
cq_s,
474 const Value& pressure,
478 template<
class Value>
479 void gasOilPerfRateProd(std::vector<Value>&
cq_s,
483 const Value& rvw)
const;
485 template<
class Value>
486 void gasWaterPerfRateProd(std::vector<Value>&
cq_s,
489 const Value& rsw)
const;
491 template<
class Value>
492 void gasWaterPerfRateInj(
const std::vector<Value>&
cq_s,
496 const Value& pressure,
499 template<
class Value>
503 const Value& pressure,
504 const std::vector<Value>&
cmix_s,
508 template<
class Value>
512 const Value& pressure,
513 const std::vector<Value>&
cmix_s,
520#ifndef OPM_STANDARDWELL_IMPL_HEADER_INCLUDED
521#include "StandardWell_impl.hpp"
Facility for converting component rates at surface conditions to phase (voidage) rates at reservoir c...
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.
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 MICP.
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 by brine.
Definition blackoilbrinemodules.hh:50
Contains the high level supplements required to extend the black oil model to include the effects of ...
Definition blackoilfoammodules.hh:60
Contains the high level supplements required to extend the black oil model by polymer.
Definition blackoilpolymermodules.hh:54
Represents the convergence status of the whole simulator, to make it possible to query and store the ...
Definition ConvergenceReport.hpp:38
Definition DeferredLogger.hpp:57
Definition GroupState.hpp:38
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:186
Manages the initializing and running of time dependent problems.
Definition simulator.hh:92
Definition StandardWellEval.hpp:47
Definition StandardWell.hpp:59
void computeWellPotentials(const Simulator &simulator, const WellState< Scalar > &well_state, std::vector< Scalar > &well_potentials, DeferredLogger &deferred_logger) override
computing the well potentials for group control
Definition StandardWell_impl.hpp:1740
std::vector< Scalar > computeCurrentWellRates(const Simulator &ebosSimulator, DeferredLogger &deferred_logger) const override
Compute well rates based on current reservoir conditions and well variables.
Definition StandardWell_impl.hpp:2493
void recoverWellSolutionAndUpdateWellState(const Simulator &simulator, const BVector &x, WellState< Scalar > &well_state, DeferredLogger &deferred_logger) override
using the solution x to recover the solution xw for wells and applying xw to update Well State
Definition StandardWell_impl.hpp:1449
bool jacobianContainsWellContributions() const override
Wether the Jacobian will also have well contributions in it.
Definition StandardWell.hpp:215
virtual void apply(const BVector &x, BVector &Ax) const override
Ax = Ax - C D^-1 B x.
Definition StandardWell_impl.hpp:1417
virtual ConvergenceReport getWellConvergence(const Simulator &simulator, const WellState< Scalar > &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:1192
const std::string & name() const
Well name.
Definition WellInterfaceGeneric.cpp:157
Definition WellInterface.hpp:71
Collect per-connection static information to enable calculating connection-level or well-level produc...
Definition WellProdIndexCalculator.hpp:37
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:62
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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:235
bool matrix_add_well_contributions_
Whether to add influences of wells between cells to the matrix and preconditioner matrix.
Definition BlackoilModelParameters.hpp:265
Static data associated with a well perforation.
Definition PerforationData.hpp:30
Definition PerforationData.hpp:41
Definition BlackoilPhases.hpp:46