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;
47 using typename Base::ModelParameters;
50 using typename Base::RateConverterType;
51 using typename Base::SparseMatrixAdapter;
54 using Base::has_solvent;
55 using Base::has_polymer;
75 const ModelParameters& param,
77 const int pvtRegionIdx,
86 const std::vector<Scalar>&
B_avg,
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,
163 std::vector<Scalar> getPrimaryVars()
const override;
165 int setPrimaryVars(
typename std::vector<Scalar>::const_iterator it)
override;
172 std::vector<std::vector<Scalar> > segment_fluid_initial_;
174 mutable int debug_cost_counter_ = 0;
177 void updateWellState(
const Simulator& simulator,
178 const BVectorWell&
dwells,
184 void computeInitialSegmentFluids(
const Simulator& simulator);
187 void computePerfCellPressDiffs(
const Simulator& simulator);
189 template<
class Value>
190 void computePerfRate(
const IntensiveQuantities&
int_quants,
192 const std::vector<Scalar>&
Tw,
197 std::vector<Value>&
cq_s,
202 template<
class Value>
208 const std::vector<Scalar>&
Tw,
213 const std::vector<Value>&
cmix_s,
214 std::vector<Value>&
cq_s,
221 void computeSegmentFluidProperties(
const Simulator& simulator,
225 template<
class Value>
226 void getMobility(
const Simulator& simulator,
228 std::vector<Value>&
mob,
231 void computeWellRatesAtBhpLimit(
const Simulator& simulator,
235 void computeWellRatesWithBhp(
const Simulator& simulator,
240 void computeWellRatesWithBhpIterations(
const Simulator& simulator,
247 const Simulator& simulator,
250 bool computeWellPotentialsImplicit(
const Simulator& simulator,
252 std::vector<Scalar>& well_potentials,
255 Scalar getRefDensity()
const override;
257 bool iterateWellEqWithControl(
const Simulator& simulator,
265 bool iterateWellEqWithSwitching(
const Simulator& simulator,
275 void assembleWellEqWithoutIteration(
const Simulator& simulator,
285 EvalWell getSegmentSurfaceVolume(
const Simulator& simulator,
const int seg_idx)
const;
292 bool openCrossFlowAvoidSingularity(
const Simulator& simulator)
const;
296 bool allDrawDownWrongDirection(
const Simulator& simulator)
const;
298 std::optional<Scalar>
304 std::optional<Scalar>
309 Scalar maxPerfPress(
const Simulator& simulator)
const;
317 void checkOperabilityUnderTHPLimit(
const Simulator&
ebos_simulator,
328#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:43
Definition MultisegmentWellEval.hpp:47
Definition MultisegmentWell.hpp:38
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:272
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:190
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:2176
void apply(const BVector &x, BVector &Ax) const override
Ax = Ax - C D^-1 B x.
Definition MultisegmentWell_impl.hpp:216
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:251
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:169
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:195
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
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 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