22#ifndef OPM_MULTISEGMENTWELL_HEADER_INCLUDED
23#define OPM_MULTISEGMENTWELL_HEADER_INCLUDED
25#include <opm/simulators/wells/WellInterface.hpp>
26#include <opm/simulators/wells/MultisegmentWellEval.hpp>
32 template<
typename TypeTag>
35 GetPropType<TypeTag, Properties::Indices>>
43 using typename Base::IntensiveQuantities;
45 using typename Base::ModelParameters;
48 using typename Base::RateConverterType;
49 using typename Base::SparseMatrixAdapter;
52 using Base::has_solvent;
53 using Base::has_polymer;
73 const ModelParameters& param,
75 const int pvtRegionIdx,
84 const std::vector<Scalar>&
B_avg,
87 void initPrimaryVariablesEvaluation()
override;
98 const std::vector<Scalar>&
B_avg,
103 void apply(
const BVector& x, BVector&
Ax)
const override;
105 void apply(BVector&
r)
const override;
117 std::vector<Scalar>& well_potentials,
120 void updatePrimaryVariables(
const Simulator& simulator,
124 void solveEqAndUpdateWellState(
const Simulator& simulator,
128 void calculateExplicitQuantities(
const Simulator& simulator,
132 void updateIPRImplicit(
const Simulator& simulator,
136 void updateProductivityIndex(
const Simulator& simulator,
144 void addWellContributions(SparseMatrixAdapter& jacobian)
const override;
146 void addWellPressureEquations(PressureMatrix& mat,
148 const int pressureVarIndex,
156 std::optional<Scalar>
157 computeBhpAtThpLimitProdWithAlq(
const Simulator& simulator,
162 std::vector<Scalar> getPrimaryVars()
const override;
164 int setPrimaryVars(
typename std::vector<Scalar>::const_iterator it)
override;
171 std::vector<std::vector<Scalar> > segment_fluid_initial_;
173 mutable int debug_cost_counter_ = 0;
176 void updateWellState(
const Simulator& simulator,
177 const BVectorWell&
dwells,
183 void computeInitialSegmentFluids(
const Simulator& simulator);
186 void computePerfCellPressDiffs(
const Simulator& simulator);
188 template<
class Value>
189 void computePerfRate(
const IntensiveQuantities&
int_quants,
191 const std::vector<Scalar>&
Tw,
196 std::vector<Value>&
cq_s,
201 template<
class Value>
207 const std::vector<Scalar>&
Tw,
212 const std::vector<Value>&
cmix_s,
213 std::vector<Value>&
cq_s,
220 void computeSegmentFluidProperties(
const Simulator& simulator,
224 template<
class Value>
225 void getMobility(
const Simulator& simulator,
227 std::vector<Value>&
mob,
230 void computeWellRatesAtBhpLimit(
const Simulator& simulator,
234 void computeWellRatesWithBhp(
const Simulator& simulator,
239 void computeWellRatesWithBhpIterations(
const Simulator& simulator,
246 const Simulator& simulator,
249 bool computeWellPotentialsImplicit(
const Simulator& simulator,
250 std::vector<Scalar>& well_potentials,
253 Scalar getRefDensity()
const override;
255 bool iterateWellEqWithControl(
const Simulator& simulator,
263 bool iterateWellEqWithSwitching(
const Simulator& simulator,
273 void assembleWellEqWithoutIteration(
const Simulator& simulator,
283 EvalWell getSegmentSurfaceVolume(
const Simulator& simulator,
const int seg_idx)
const;
290 bool openCrossFlowAvoidSingularity(
const Simulator& simulator)
const;
294 bool allDrawDownWrongDirection(
const Simulator& simulator)
const;
296 std::optional<Scalar>
302 std::optional<Scalar>
307 Scalar maxPerfPress(
const Simulator& simulator)
const;
315 void checkOperabilityUnderTHPLimit(
const Simulator&
ebos_simulator,
326#ifndef OPM_MULTISEGMENTWELL_IMPL_HEADER_INCLUDED
327#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:38
Definition MultisegmentWellEval.hpp:46
Definition MultisegmentWell.hpp:36
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 MultisegmentWell_impl.hpp:283
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 MultisegmentWell_impl.hpp:201
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:2181
void apply(const BVector &x, BVector &Ax) const override
Ax = Ax - C D^-1 B x.
Definition MultisegmentWell_impl.hpp:227
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 MultisegmentWell_impl.hpp:262
void updateWellStateWithTarget(const Simulator &simulator, const GroupState< Scalar > &group_state, WellState< Scalar > &well_state, DeferredLogger &deferred_logger) const override
updating the well state based the current control mode
Definition MultisegmentWell_impl.hpp:180
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:186
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
Static data associated with a well perforation.
Definition PerforationData.hpp:30
Definition PerforationData.hpp:41
Definition BlackoilPhases.hpp:46