58 GetPropType<TypeTag, Properties::Indices>,
59 GetPropType<TypeTag, Properties::Scalar>>
77 using typename Base::RateConverterType;
82 using Base::has_solvent;
83 using Base::has_zFraction;
84 using Base::has_polymer;
85 using Base::has_polymermw;
87 using Base::has_brine;
88 using Base::has_energy;
97 static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents;
99 static constexpr int numWellControlEq = 1;
102 static constexpr int numStaticWellEq = numWellConservationEq + numWellControlEq;
107 static constexpr int Bhp = numStaticWellEq - numWellControlEq;
109 using StdWellEval::WQTotal;
121 using Eval =
typename StdWellEval::Eval;
122 using EvalWell =
typename StdWellEval::EvalWell;
123 using BVectorWell =
typename StdWellEval::BVectorWell;
130 const int pvtRegionIdx,
132 const int num_phases,
134 const std::vector<PerforationData>& perf_data);
140 const std::vector< Scalar >&
B_avg,
144 void initPrimaryVariablesEvaluation()
override;
148 const std::vector<double>&
B_avg,
153 virtual void apply(
const BVector& x, BVector&
Ax)
const override;
155 virtual void apply(BVector&
r)
const override;
167 std::vector<double>& well_potentials,
178 virtual void calculateExplicitQuantities(
const Simulator& ebosSimulator,
182 virtual void updateProductivityIndex(
const Simulator& ebosSimulator,
187 virtual void addWellContributions(SparseMatrixAdapter& mat)
const override;
189 virtual void addWellPressureEquations(PressureMatrix& mat,
191 const int pressureVarIndex,
193 const WellState& well_state)
const override;
196 bool iterateWellEqWithControl(
const Simulator& ebosSimulator,
207 return this->param_.matrix_add_well_contributions_;
211 double computeWellRatesAndBhpWithThpAlqProd(
const Simulator &
ebos_simulator,
217 void computeWellRatesWithThpAlqProd(
224 std::optional<double> computeBhpAtThpLimitProdWithAlq(
230 virtual void computeWellRatesWithBhp(
231 const Simulator& ebosSimulator,
237 using Base::phaseUsage;
238 using Base::vfp_properties_;
243 void computeConnLevelProdInd(
const FluidState&
fs,
244 const std::function<
double(
const double)>&
connPICalc,
245 const std::vector<EvalWell>&
mobility,
248 void computeConnLevelInjInd(
const typename StandardWell<TypeTag>::FluidState&
fs,
250 const std::function<
double(
const double)>&
connIICalc,
251 const std::vector<EvalWell>&
mobility,
261 const BVectorWell&
dwells,
267 void computePropertiesForWellConnectionPressures(
const Simulator& ebosSimulator,
269 std::vector<double>&
b_perf,
276 void computeWellConnectionDensitesPressures(
const Simulator& ebosSimulator,
278 const std::vector<double>&
b_perf,
286 void computeWellConnectionPressures(
const Simulator& ebosSimulator,
290 void computePerfRateEval(
const IntensiveQuantities&
intQuants,
291 const std::vector<EvalWell>&
mob,
296 std::vector<EvalWell>&
cq_s,
303 void computePerfRateScalar(
const IntensiveQuantities&
intQuants,
304 const std::vector<Scalar>&
mob,
309 std::vector<Scalar>&
cq_s,
312 template<
class Value>
313 void computePerfRate(
const std::vector<Value>&
mob,
314 const Value& pressure,
324 const Value& skin_pressure,
325 const std::vector<Value>&
cmix_s,
326 std::vector<Value>&
cq_s,
333 void computeWellRatesWithBhpIterations(
const Simulator& ebosSimulator,
338 std::vector<double> computeWellPotentialWithTHP(
339 const Simulator& ebosSimulator,
343 bool updateWellStateWithTHPTargetProd(
const Simulator&
ebos_simulator,
347 virtual double getRefDensity()
const override;
350 void getMobilityEval(
const Simulator& ebosSimulator,
352 std::vector<EvalWell>&
mob,
356 void getMobilityScalar(
const Simulator& ebosSimulator,
358 std::vector<Scalar>&
mob,
362 void updateWaterMobilityWithPolymer(
const Simulator&
ebos_simulator,
367 void updatePrimaryVariablesNewton(
const BVectorWell&
dwells,
375 virtual void assembleWellEqWithoutIteration(
const Simulator& ebosSimulator,
383 void assembleWellEqWithoutIterationImpl(
const Simulator& ebosSimulator,
391 void calculateSinglePerf(
const Simulator& ebosSimulator,
394 std::vector<RateVector>& connectionRates,
395 std::vector<EvalWell>&
cq_s,
411 bool allDrawDownWrongDirection(
const Simulator&
ebos_simulator)
const;
414 bool canProduceInjectWithCurrentBhp(
const Simulator&
ebos_simulator,
423 bool openCrossFlowAvoidSingularity(
const Simulator&
ebos_simulator)
const;
430 const EvalWell& water_velocity,
436 const EvalWell& water_velocity,
441 const EvalWell& water_velocity,
445 void handleInjectivityRate(
const Simulator& ebosSimulator,
447 std::vector<EvalWell>&
cq_s)
const;
450 void handleInjectivityEquations(
const Simulator& ebosSimulator,
456 virtual void updateWaterThroughput(
const double dt,
WellState& well_state)
const override;
459 void checkConvergenceExtraEqs(
const std::vector<double>&
res,
463 void updateConnectionRatePolyMW(
const EvalWell&
cq_s_poly,
467 std::vector<RateVector>& connectionRates,
471 std::optional<double> computeBhpAtThpLimitProd(
const WellState& well_state,
476 std::optional<double> computeBhpAtThpLimitInj(
const Simulator&
ebos_simulator,
void recoverWellSolutionAndUpdateWellState(const SummaryState &summary_state, const BVector &x, WellState &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:1659
virtual ConvergenceReport getWellConvergence(const WellState &well_state, const std::vector< double > &B_avg, DeferredLogger &deferred_logger, const bool relax_tolerance=false) const override
check whether the well equations get converged for this well
Definition StandardWell_impl.hpp:1407
virtual void computeWellPotentials(const Simulator &ebosSimulator, const WellState &well_state, std::vector< double > &well_potentials, DeferredLogger &deferred_logger) override
computing the well potentials for group control
Definition StandardWell_impl.hpp:1885