23#ifndef OPM_MULTISEGMENTWELL_ASSEMBLE_HEADER_INCLUDED
24#define OPM_MULTISEGMENTWELL_ASSEMBLE_HEADER_INCLUDED
26#include <opm/input/eclipse/Schedule/Well/Well.hpp>
27#include <opm/material/densead/Evaluation.hpp>
33template<
class Scalar>
class GroupState;
34template<
class Scalar,
int numWellEq,
int numEq>
class MultisegmentWellEquations;
35template<
class Flu
idSystem,
class Indices>
class MultisegmentWellPrimaryVariables;
38template<
class Flu
idSystem,
class Indices>
class WellInterfaceIndices;
39template<
class Scalar>
class WellState;
42template<
class Flu
idSystem,
class Indices>
45 static constexpr bool has_water = (Indices::waterSwitchIdx >= 0);
46 static constexpr bool has_gas = (Indices::compositionSwitchIdx >= 0);
47 static constexpr bool has_oil = (Indices::numPhases - has_gas - has_water) > 0;
52 static constexpr bool has_wfrac_variable = has_water && Indices::numPhases > 1;
53 static constexpr bool has_gfrac_variable = has_gas && has_oil;
55 static constexpr int WQTotal = 0;
56 static constexpr int WFrac = has_wfrac_variable ? 1 : -1000;
57 static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000;
58 static constexpr int SPres = has_wfrac_variable + has_gfrac_variable + 1;
61 static constexpr int numWellEq = Indices::numPhases+1;
62 using Scalar =
typename FluidSystem::Scalar;
65 using EvalWell = DenseAd::Evaluation<Scalar, numWellEq+Indices::numEq>;
90 Equations&
eqns1)
const;
96 Equations&
eqns1)
const;
102 Equations&
eqns1)
const;
111 bool wfrac = has_wfrac_variable,
112 bool gfrac = has_gfrac_variable)
const;
117 Equations&
eqns)
const;
123 Equations&
eqns1)
const;
130 Equations&
eqns1)
const;
138 Equations&
eqns)
const;
145 Equations&
eqns)
const;
Definition DeferredLogger.hpp:57
Definition GroupState.hpp:38
Class handling assemble of the equation system for MultisegmentWell.
Definition MultisegmentWellAssemble.hpp:44
void assembleOutflowTerm(const int seg, const int seg_upwind, const int comp_idx, const EvalWell &segment_rate, Equations &eqns1) const
Assemble outflow term.
Definition MultisegmentWellAssemble.cpp:313
void assemblePerforationEq(const int seg, const int cell_idx, const int comp_idx, const EvalWell &cq_s_effective, Equations &eqns) const
Assemble equation for a perforation.
Definition MultisegmentWellAssemble.cpp:354
MultisegmentWellAssemble(const WellInterfaceIndices< FluidSystem, Indices > &well)
Constructor initializes reference to well.
Definition MultisegmentWellAssemble.hpp:68
void assemblePressureEqExtraDerivatives(const int seg, const int seg_upwind, const EvalWell &extra_derivatives, Equations &eqns1) const
Assemble additional derivatives due to reverse flow.
Definition MultisegmentWellAssemble.cpp:244
void assembleAccelerationTerm(const int seg_target, const int seg, const int seg_upwing, const EvalWell &accelerationTerm, Equations &eqns1) const
Assemble piece of the acceleration term.
Definition MultisegmentWellAssemble.cpp:204
void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
Assembles a trivial equation.
Definition MultisegmentWellAssemble.cpp:288
void assembleInflowTerm(const int seg, const int inlet, const int inlet_upwind, const int comp_idx, const EvalWell &inlet_rate, Equations &eqns) const
Assemble inflow term.
Definition MultisegmentWellAssemble.cpp:333
void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
Assemble accumulation term.
Definition MultisegmentWellAssemble.cpp:299
void assembleHydroPressureLoss(const int seg, const int seg_density, const EvalWell &hydro_pressure_drop_seg, Equations &eqns1) const
Assemble hydraulic pressure term.
Definition MultisegmentWellAssemble.cpp:229
void assemblePressureEq(const int seg, const int seg_upwind, const int outlet_segment_index, const EvalWell &pressure_equation, const EvalWell &outlet_pressure, Equations &eqns, bool wfrac=has_wfrac_variable, bool gfrac=has_gfrac_variable) const
Assemble pressure terms.
Definition MultisegmentWellAssemble.cpp:259
void assembleControlEq(const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const Scalar rho, const PrimaryVariables &primary_variables, Equations &eqns, const bool stopped_or_zero_target, DeferredLogger &deferred_logger) const
Assemble control equation.
Definition MultisegmentWellAssemble.cpp:87
Definition MultisegmentWellPrimaryVariables.hpp:45
Definition WellInterfaceIndices.hpp:34
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