22#ifndef OPM_MULTISEGMENTWELL_HEADER_INCLUDED
23#define OPM_MULTISEGMENTWELL_HEADER_INCLUDED
27#include <opm/simulators/wells/WellInterface.hpp>
28#include <opm/simulators/wells/MultisegmentWellEval.hpp>
34 template<
typename TypeTag>
37 GetPropType<TypeTag, Properties::Indices>>
45 using typename Base::IntensiveQuantities;
48 using typename Base::ModelParameters;
51 using typename Base::RateConverterType;
52 using typename Base::SparseMatrixAdapter;
56 using Base::has_solvent;
57 using Base::has_polymer;
73 using FSInfo = std::tuple<Scalar,typename std::decay<decltype(std::declval<decltype(std::declval<const Simulator&>().model().intensiveQuantities(0, 0).fluidState())>().saltConcentration())>::type,
int>;
78 const ModelParameters& param,
80 const int pvtRegionIdx,
86 void init(
const std::vector<Scalar>&
depth_arg,
88 const std::vector<Scalar>&
B_avg,
103 const std::vector<Scalar>&
B_avg,
108 void apply(
const BVector& x, BVector&
Ax)
const override;
110 void apply(BVector&
r)
const override;
122 std::vector<Scalar>& well_potentials,
125 void updatePrimaryVariables(
const Simulator& simulator,
129 void solveEqAndUpdateWellState(
const Simulator& simulator,
133 void calculateExplicitQuantities(
const Simulator& simulator,
137 void updateIPRImplicit(
const Simulator& simulator,
141 void updateProductivityIndex(
const Simulator& simulator,
149 void addWellContributions(SparseMatrixAdapter& jacobian)
const override;
151 void addWellPressureEquations(PressureMatrix& mat,
153 const int pressureVarIndex,
161 std::optional<Scalar>
162 computeBhpAtThpLimitProdWithAlq(
const Simulator& simulator,
168 std::vector<Scalar> getPrimaryVars()
const override;
170 int setPrimaryVars(
typename std::vector<Scalar>::const_iterator it)
override;
177 std::vector<std::vector<Scalar> > segment_fluid_initial_;
179 mutable int debug_cost_counter_ = 0;
182 void updateWellState(
const Simulator& simulator,
183 const BVectorWell&
dwells,
189 void computeInitialSegmentFluids(
const Simulator& simulator);
192 void computePerfCellPressDiffs(
const Simulator& simulator);
194 template<
class Value>
195 void computePerfRate(
const IntensiveQuantities&
int_quants,
197 const std::vector<Scalar>&
Tw,
202 std::vector<Value>&
cq_s,
207 template<
class Value>
213 const std::vector<Scalar>&
Tw,
218 const std::vector<Value>&
cmix_s,
219 std::vector<Value>&
cq_s,
226 void computeSegmentFluidProperties(
const Simulator& simulator,
230 template<
class Value>
231 void getMobility(
const Simulator& simulator,
233 std::vector<Value>&
mob,
236 void computeWellRatesAtBhpLimit(
const Simulator& simulator,
240 void computeWellRatesWithBhp(
const Simulator& simulator,
245 void computeWellRatesWithBhpIterations(
const Simulator& simulator,
252 const Simulator& simulator,
255 bool computeWellPotentialsImplicit(
const Simulator& simulator,
257 std::vector<Scalar>& well_potentials,
260 Scalar getRefDensity()
const override;
262 bool iterateWellEqWithControl(
const Simulator& simulator,
270 bool iterateWellEqWithSwitching(
const Simulator& simulator,
280 void assembleWellEqWithoutIteration(
const Simulator& simulator,
288 void updateWaterThroughput(
const double dt,
WellStateType& well_state)
const override;
290 EvalWell getSegmentSurfaceVolume(
const Simulator& simulator,
const int seg_idx)
const;
297 bool openCrossFlowAvoidSingularity(
const Simulator& simulator)
const;
301 bool allDrawDownWrongDirection(
const Simulator& simulator)
const;
303 std::optional<Scalar>
309 std::optional<Scalar>
314 Scalar maxPerfPress(
const Simulator& simulator)
const;
317 void checkOperabilityUnderBHPLimit(
const WellStateType& well_state,
322 void checkOperabilityUnderTHPLimit(
const Simulator&
ebos_simulator,
330 FSInfo getFirstPerforationFluidStateInfo(
const Simulator& simulator)
const;
335#include "MultisegmentWell_impl.hpp"
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:41
Definition MultisegmentWellEval.hpp:48
Definition MultisegmentWell.hpp:38
std::vector< Scalar > computeCurrentWellRates(const Simulator &simulator, DeferredLogger &deferred_logger) const override
Compute well rates based on current reservoir conditions and well variables.
Definition MultisegmentWell_impl.hpp:2214
void apply(const BVector &x, BVector &Ax) const override
Ax = Ax - C D^-1 B x.
Definition MultisegmentWell_impl.hpp:230
void scaleSegmentRatesAndPressure(WellStateType &well_state) const override
updating the segment pressure and rates based the current bhp and well rates
Definition MultisegmentWell_impl.hpp:173
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 MultisegmentWell_impl.hpp:204
void computeWellPotentials(const Simulator &simulator, const WellStateType &well_state, std::vector< Scalar > &well_potentials, DeferredLogger &deferred_logger) override
computing the well potentials for group control
Definition MultisegmentWell_impl.hpp:297
void recoverWellSolutionAndUpdateWellState(const Simulator &simulator, const BVector &x, WellStateType &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 MultisegmentWell_impl.hpp:265
void updateWellStateWithTarget(const Simulator &simulator, const GroupState< Scalar > &group_state, WellStateType &well_state, DeferredLogger &deferred_logger) const override
updating the well state based the current control mode
Definition MultisegmentWell_impl.hpp:184
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:198
Definition WellInterface.hpp:76
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
Defines the common properties required by the porous medium multi-phase models.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
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