23#ifndef OPM_STANDARDWELL_HEADER_INCLUDED
24#define OPM_STANDARDWELL_HEADER_INCLUDED
26#include <opm/simulators/timestepping/ConvergenceReport.hpp>
28#include <opm/simulators/wells/RatioCalculator.hpp>
29#include <opm/simulators/wells/VFPInjProperties.hpp>
30#include <opm/simulators/wells/VFPProdProperties.hpp>
31#include <opm/simulators/wells/WellInterface.hpp>
32#include <opm/simulators/wells/WellProdIndexCalculator.hpp>
33#include <opm/simulators/wells/ParallelWellInfo.hpp>
42#include <opm/material/densead/Evaluation.hpp>
43#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
45#include <opm/simulators/wells/StandardWellEval.hpp>
47#include <dune/common/dynvector.hh>
48#include <dune/common/dynmatrix.hh>
56 template<
typename TypeTag>
59 GetPropType<TypeTag, Properties::Indices>>
71 using typename Base::IntensiveQuantities;
74 using typename Base::ModelParameters;
76 using typename Base::RateConverterType;
77 using typename Base::SparseMatrixAdapter;
81 using Base::has_solvent;
82 using Base::has_zFraction;
83 using Base::has_polymer;
84 using Base::has_polymermw;
86 using Base::has_brine;
87 using Base::has_energy;
96 static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents;
98 static constexpr int numWellControlEq = 1;
101 static constexpr int numStaticWellEq = numWellConservationEq + numWellControlEq;
106 static constexpr int Bhp = numStaticWellEq - numWellControlEq;
108 using StdWellEval::WQTotal;
119 using Eval =
typename StdWellEval::Eval;
120 using EvalWell =
typename StdWellEval::EvalWell;
121 using BVectorWell =
typename StdWellEval::BVectorWell;
126 const ModelParameters& param,
128 const int pvtRegionIdx,
130 const int num_phases,
137 const std::vector<Scalar>&
B_avg,
143 const std::vector<Scalar>&
B_avg,
148 virtual void apply(
const BVector& x, BVector&
Ax)
const override;
150 virtual void apply(BVector&
r)
const override;
162 std::vector<Scalar>& well_potentials,
165 void updatePrimaryVariables(
const Simulator& simulator,
169 void solveEqAndUpdateWellState(
const Simulator& simulator,
173 void calculateExplicitQuantities(
const Simulator& simulator,
177 void updateProductivityIndex(
const Simulator& simulator,
185 void addWellContributions(SparseMatrixAdapter& mat)
const override;
187 void addWellPressureEquations(PressureMatrix& mat,
189 const int pressureVarIndex,
194 bool iterateWellEqWithControl(
const Simulator& simulator,
203 bool iterateWellEqWithSwitching(
const Simulator& simulator,
232 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,
327 std::vector<Scalar>& well_potentials,
330 Scalar getRefDensity()
const override;
333 template<
class Value>
334 void getMobility(
const Simulator& simulator,
336 std::vector<Value>&
mob,
339 void updateWaterMobilityWithPolymer(
const Simulator& simulator,
344 void updatePrimaryVariablesNewton(
const BVectorWell&
dwells,
352 void assembleWellEqWithoutIteration(
const Simulator& simulator,
360 void assembleWellEqWithoutIterationImpl(
const Simulator& simulator,
368 void calculateSinglePerf(
const Simulator& simulator,
371 std::vector<RateVector>& connectionRates,
372 std::vector<EvalWell>&
cq_s,
383 void checkOperabilityUnderTHPLimit(
const Simulator& simulator,
388 void updateIPR(
const Simulator& simulator,
393 bool allDrawDownWrongDirection(
const Simulator& simulator)
const;
396 bool canProduceInjectWithCurrentBhp(
const Simulator& simulator,
405 bool openCrossFlowAvoidSingularity(
const Simulator& simulator)
const;
412 const EvalWell& water_velocity,
418 const EvalWell& water_velocity,
423 const EvalWell& water_velocity,
427 void handleInjectivityRate(
const Simulator& simulator,
429 std::vector<EvalWell>&
cq_s)
const;
432 void handleInjectivityEquations(
const Simulator& simulator,
438 void updateWaterThroughput(
const double dt,
442 void checkConvergenceExtraEqs(
const std::vector<Scalar>&
res,
446 void updateConnectionRatePolyMW(
const EvalWell&
cq_s_poly,
450 std::vector<RateVector>& connectionRates,
453 std::optional<Scalar>
459 std::optional<Scalar>
460 computeBhpAtThpLimitInj(
const Simulator& simulator,
465 Eval connectionRateEnergy(
const Scalar maxOilSaturation,
466 const std::vector<EvalWell>&
cq_s,
467 const IntensiveQuantities& intQuants,
473#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:43
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:195
Manages the initializing and running of time dependent problems.
Definition simulator.hh:97
Definition StandardWellEval.hpp:46
Definition StandardWell.hpp:60
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:1746
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:2505
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:1456
bool jacobianContainsWellContributions() const override
Wether the Jacobian will also have well contributions in it.
Definition StandardWell.hpp:214
virtual void apply(const BVector &x, BVector &Ax) const override
Ax = Ax - C D^-1 B x.
Definition StandardWell_impl.hpp:1424
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:1200
const std::string & name() const
Well name.
Definition WellInterfaceGeneric.cpp:164
Definition WellInterface.hpp:77
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:66
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:280
Static data associated with a well perforation.
Definition PerforationData.hpp:30
Definition PerforationData.hpp:41
Definition BlackoilPhases.hpp:46