My Project
Loading...
Searching...
No Matches
MultisegmentWellAssemble.hpp
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{
45 static constexpr int WQTotal = 0;
46 static constexpr bool has_wfrac_variable = Indices::waterEnabled && Indices::oilEnabled;
47 static constexpr bool has_gfrac_variable = Indices::gasEnabled && Indices::numPhases > 1;
48 static constexpr int WFrac = has_wfrac_variable ? 1 : -1000;
49 static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000;
50 static constexpr int SPres = has_wfrac_variable + has_gfrac_variable + 1;
51
52public:
53 static constexpr int numWellEq = Indices::numPhases+1;
54 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,
76
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.
Definition MultisegmentWellAssemble.cpp:343
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.
Definition MultisegmentWellAssemble.cpp:259
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:208
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.
Definition MultisegmentWellAssemble.cpp:392
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.
Definition MultisegmentWellAssemble.cpp:277
void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
Assembles a trivial equation.
Definition MultisegmentWellAssemble.cpp:307
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:367
void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
Assemble accumulation term.
Definition MultisegmentWellAssemble.cpp:325
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:239
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:66
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