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>
34template<
class Scalar,
int numWellEq,
int numEq>
class MultisegmentWellEquations;
35template<
class Flu
idSystem,
class Indices,
class Scalar>
class MultisegmentWellPrimaryVariables;
38template<
class Flu
idSystem,
class Indices,
class Scalar>
class WellInterfaceIndices;
42template<
class Flu
idSystem,
class Indices,
class Scalar>
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;
64 using EvalWell = DenseAd::Evaluation<Scalar, numWellEq+Indices::numEq>;
74 const Schedule& schedule,
75 const SummaryState& summaryState,
76 const Well::InjectionControls& inj_controls,
77 const Well::ProductionControls& prod_controls,
79 const PrimaryVariables& primary_variables,
87 const EvalWell& accelerationPressureLoss,
88 Equations& eqns)
const;
93 const int outlet_segment_index,
94 const EvalWell& pressure_equation,
95 const EvalWell& outlet_pressure,
97 bool wfrac = has_wfrac_variable,
98 bool gfrac = has_gfrac_variable)
const;
103 Equations& eqns)
const;
108 const EvalWell& accumulation_term,
109 Equations& eqns1)
const;
113 const int seg_upwind,
115 const EvalWell& segment_rate,
116 Equations& eqns1)
const;
121 const int inlet_upwind,
123 const EvalWell& inlet_rate,
124 Equations& eqns)
const;
130 const EvalWell& cq_s_effective,
131 Equations& eqns)
const;
Definition: DeferredLogger.hpp:57
Definition: GroupState.hpp:34
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:275
MultisegmentWellAssemble(const WellInterfaceIndices< FluidSystem, Indices, Scalar > &well)
Constructor initializes reference to well.
Definition: MultisegmentWellAssemble.hpp:67
void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
Assembles a trivial equation.
Definition: MultisegmentWellAssemble.cpp:250
void assembleControlEq(const WellState &well_state, const GroupState &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const double rho, const PrimaryVariables &primary_variables, Equations &eqns, DeferredLogger &deferred_logger) const
Assemble control equation.
Definition: MultisegmentWellAssemble.cpp:86
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:316
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:221
void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
Assemble accumulation term.
Definition: MultisegmentWellAssemble.cpp:261
void assemblePressureLoss(const int seg, const int seg_upwind, const EvalWell &accelerationPressureLoss, Equations &eqns) const
Assemble pressure loss term.
Definition: MultisegmentWellAssemble.cpp:202
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:295
Definition: MultisegmentWellPrimaryVariables.hpp:42
Definition: WellInterfaceIndices.hpp:33
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: WellState.hpp:60
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27