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 MultisegmentWellPrimaryVariables;
38template<
class Flu
idSystem,
class Indices>
class WellInterfaceIndices;
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>;
75 const Schedule& schedule,
76 const SummaryState& summaryState,
77 const Well::InjectionControls& inj_controls,
78 const Well::ProductionControls& prod_controls,
80 const PrimaryVariables& primary_variables,
88 const EvalWell& accelerationTerm,
89 Equations& eqns1)
const;
93 const int seg_density,
94 const EvalWell& hydro_pressure_drop_seg,
95 Equations& eqns1)
const;
100 const EvalWell& extra_derivatives,
101 Equations& eqns1)
const;
105 const int seg_upwind,
106 const int outlet_segment_index,
107 const EvalWell& pressure_equation,
108 const EvalWell& outlet_pressure,
110 bool wfrac = has_wfrac_variable,
111 bool gfrac = has_gfrac_variable)
const;
116 Equations& eqns)
const;
121 const EvalWell& accumulation_term,
122 Equations& eqns1)
const;
126 const int seg_upwind,
128 const EvalWell& segment_rate,
129 Equations& eqns1)
const;
134 const int inlet_upwind,
136 const EvalWell& inlet_rate,
137 Equations& eqns)
const;
143 const EvalWell& cq_s_effective,
144 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:311
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:352
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:242
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:202
void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
Assembles a trivial equation.
Definition MultisegmentWellAssemble.cpp:286
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:331
void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
Assemble accumulation term.
Definition MultisegmentWellAssemble.cpp:297
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:227
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:257
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
Definition MultisegmentWellPrimaryVariables.hpp:45
Definition WellInterfaceIndices.hpp:35
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:61
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27