MultisegmentWellAssemble.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2016 - 2017 IRIS AS.
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22
23#ifndef OPM_MULTISEGMENTWELL_ASSEMBLE_HEADER_INCLUDED
24#define OPM_MULTISEGMENTWELL_ASSEMBLE_HEADER_INCLUDED
25
26#include <opm/input/eclipse/Schedule/Well/Well.hpp>
27#include <opm/material/densead/Evaluation.hpp>
28
29namespace Opm
30{
31
32class DeferredLogger;
33template<class Scalar> class GroupState;
34template<class Scalar, int numWellEq, int numEq> class MultisegmentWellEquations;
35template<class FluidSystem, class Indices> class MultisegmentWellPrimaryVariables;
36class Schedule;
37class SummaryState;
38template<class FluidSystem, class Indices> class WellInterfaceIndices;
39template<class Scalar> class WellState;
40
42template<class FluidSystem, class Indices>
44{
46 static constexpr int WQTotal = PrimaryVariables::WQTotal;
47 static constexpr bool has_wfrac_variable = PrimaryVariables::has_wfrac_variable;
48 static constexpr bool has_gfrac_variable = PrimaryVariables::has_gfrac_variable;
49 static constexpr int WFrac = PrimaryVariables::WFrac;
50 static constexpr int GFrac = PrimaryVariables::GFrac;
51 static constexpr int SPres = PrimaryVariables::SPres;
52
53public:
54 static constexpr int numWellEq = Indices::numPhases+1;
55 using Scalar = typename FluidSystem::Scalar;
57 using EvalWell = DenseAd::Evaluation<Scalar, numWellEq+Indices::numEq>;
58
61 : well_(well)
62 {}
63
65 void assembleControlEq(const WellState<Scalar>& well_state,
66 const GroupState<Scalar>& group_state,
67 const Schedule& schedule,
68 const SummaryState& summaryState,
69 const Well::InjectionControls& inj_controls,
70 const Well::ProductionControls& prod_controls,
71 const Scalar rho,
72 const PrimaryVariables& primary_variables,
73 Equations& eqns,
74 const bool stopped_or_zero_target,
75 DeferredLogger& deferred_logger) const;
76
78 void assembleAccelerationTerm(const int seg_target,
79 const int seg,
80 const int seg_upwing,
81 const EvalWell& accelerationTerm,
82 Equations& eqns1) const;
83
85 void assembleHydroPressureLoss(const int seg,
86 const int seg_density,
87 const EvalWell& hydro_pressure_drop_seg,
88 Equations& eqns1) const;
89
92 const int seg_upwind,
93 const EvalWell& extra_derivatives,
94 Equations& eqns1) const;
95
97 void assemblePressureEq(const int seg,
98 const int seg_upwind,
99 const int outlet_segment_index,
100 const EvalWell& pressure_equation,
101 const EvalWell& outlet_pressure,
102 Equations& eqns) const;
103
105 void assembleTrivialEq(const int seg,
106 const Scalar value,
107 Equations& eqns) const;
108
110 void assembleAccumulationTerm(const int seg,
111 const int comp_idx,
112 const EvalWell& accumulation_term,
113 Equations& eqns1) const;
114
116 void assembleOutflowTerm(const int seg,
117 const int seg_upwind,
118 const int comp_idx,
119 const EvalWell& segment_rate,
120 Equations& eqns1) const;
121
123 void assembleInflowTerm(const int seg,
124 const int inlet,
125 const int inlet_upwind,
126 const int comp_idx,
127 const EvalWell& inlet_rate,
128 Equations& eqns) const;
129
131 void assemblePerforationEq(const int seg,
132 const int local_perf_index,
133 const int comp_idx,
134 const EvalWell& cq_s_effective,
135 Equations& eqns) const;
136
137private:
139};
140
141}
142
143#endif // OPM_STANDARDWELL_ASSEMBLE_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: GroupState.hpp:43
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.
typename FluidSystem::Scalar Scalar
Definition: MultisegmentWellAssemble.hpp:55
MultisegmentWellAssemble(const WellInterfaceIndices< FluidSystem, Indices > &well)
Constructor initializes reference to well.
Definition: MultisegmentWellAssemble.hpp:60
void assemblePressureEqExtraDerivatives(const int seg, const int seg_upwind, const EvalWell &extra_derivatives, Equations &eqns1) const
Assemble additional derivatives due to reverse flow.
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.
void assemblePerforationEq(const int seg, const int local_perf_index, const int comp_idx, const EvalWell &cq_s_effective, Equations &eqns) const
Assemble equation for a perforation.
void assemblePressureEq(const int seg, const int seg_upwind, const int outlet_segment_index, const EvalWell &pressure_equation, const EvalWell &outlet_pressure, Equations &eqns) const
Assemble pressure terms.
void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
Assembles a trivial equation.
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.
void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
Assemble accumulation term.
DenseAd::Evaluation< Scalar, numWellEq+Indices::numEq > EvalWell
Definition: MultisegmentWellAssemble.hpp:57
void assembleHydroPressureLoss(const int seg, const int seg_density, const EvalWell &hydro_pressure_drop_seg, Equations &eqns1) const
Assemble hydraulic pressure term.
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.
static constexpr int numWellEq
Definition: MultisegmentWellAssemble.hpp:54
Definition: MultisegmentWellPrimaryVariables.hpp:45
static constexpr int WFrac
Definition: MultisegmentWellPrimaryVariables.hpp:64
static constexpr bool has_gfrac_variable
Definition: MultisegmentWellPrimaryVariables.hpp:61
static constexpr bool has_wfrac_variable
Definition: MultisegmentWellPrimaryVariables.hpp:60
static constexpr int SPres
Definition: MultisegmentWellPrimaryVariables.hpp:66
static constexpr int GFrac
Definition: MultisegmentWellPrimaryVariables.hpp:65
static constexpr int WQTotal
Definition: MultisegmentWellPrimaryVariables.hpp:63
Definition: WellInterfaceIndices.hpp:34
Definition: WellState.hpp:65
Definition: blackoilboundaryratevector.hh:39