blackoilvariableandequationindices.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef OPM_BLACK_OIL_VARIABLE_AND_EQUATION_INDICES_HH
29#define OPM_BLACK_OIL_VARIABLE_AND_EQUATION_INDICES_HH
30
31namespace Opm {
32
38template<unsigned numSolventsV,
39 unsigned numExtbosV,
40 unsigned numPolymersV,
41 unsigned numEnergyV,
42 bool enableSequentialImplicitThermal,
43 bool enableFoam,
44 bool enableBrine,
45 int PVOffset,
46 unsigned numBioCompV>
48{
50 static constexpr int numPhases = 3;
51
53 static constexpr bool oilEnabled = true;
54 static constexpr bool waterEnabled = true;
55 static constexpr bool gasEnabled = true;
56
58 static constexpr bool enableSolvent = numSolventsV > 0;
59
61 static constexpr bool enableExtbo = numExtbosV > 0;
62
64 static constexpr bool enablePolymer = numPolymersV > 0;
65
67 static constexpr bool enableFullyImplicitThermal = numEnergyV > 0;
68
70 static constexpr bool enableMICP = false;
71 static constexpr bool enableBiofilm = false;
72 static constexpr int numBioInWat = 0;
73
75 static constexpr int numSolvents = enableSolvent ? numSolventsV : 0;
76
78 static constexpr int numExtbos = enableExtbo ? numExtbosV : 0;
79
81 static constexpr int numPolymers = enablePolymer ? numPolymersV : 0;
82
84 static constexpr int numEnergy = enableFullyImplicitThermal ? numEnergyV : 0;
85
87 static constexpr int numFoam = enableFoam? 1 : 0;
88
90 static constexpr int numBrine = enableBrine? 1 : 0;
91
93 static constexpr int numEq = numPhases + numSolvents + numExtbos + numPolymers +
95
97 static constexpr int numDerivatives = numEq + enableSequentialImplicitThermal;
98
99
101 // Primary variable indices
103
110 static constexpr int waterSwitchIdx = PVOffset + 0;
111
118 static constexpr int pressureSwitchIdx = PVOffset + 1;
119
128 static constexpr int compositionSwitchIdx = PVOffset + 2;
129
131 static constexpr int solventSaturationIdx =
132 enableSolvent ? PVOffset + numPhases : -1000;
133
135 static constexpr int zFractionIdx =
136 enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
137
139 static constexpr int polymerConcentrationIdx =
140 enablePolymer ? PVOffset + numPhases + numSolvents : -1000;
141
143 static constexpr int polymerMoleWeightIdx =
144 numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000;
145
147 static constexpr int microbialConcentrationIdx = -1000;
148 static constexpr int oxygenConcentrationIdx = -1000;
149 static constexpr int ureaConcentrationIdx = -1000;
150 static constexpr int biofilmVolumeFractionIdx = -1000;
151 static constexpr int calciteVolumeFractionIdx = -1000;
152
154 static constexpr int foamConcentrationIdx =
155 enableFoam ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers : -1000;
156
158 static constexpr int saltConcentrationIdx =
159 enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numFoam : -1000;
160
162 static constexpr int temperatureIdx =
163 (enableSequentialImplicitThermal || enableFullyImplicitThermal) ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numFoam + numBrine : - 1000;
164
165
167 // Equation indices
169
171 static constexpr int conti0EqIdx = PVOffset + 0;
172 // two continuity equations follow
173
175 static constexpr int contiSolventEqIdx =
176 enableSolvent ? PVOffset + numPhases : -1000;
177
179 static constexpr int contiZfracEqIdx =
180 enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
181
183 static constexpr int contiPolymerEqIdx =
184 enablePolymer ? PVOffset + numPhases + numSolvents + numExtbos : -1000;
185
187 static constexpr int contiPolymerMWEqIdx =
188 numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000;
189
191 static constexpr int contiMicrobialEqIdx = -1000;
192 static constexpr int contiOxygenEqIdx = -1000;
193 static constexpr int contiUreaEqIdx = -1000;
194 static constexpr int contiBiofilmEqIdx = -1000;
195 static constexpr int contiCalciteEqIdx = -1000;
196
198 static constexpr int contiFoamEqIdx =
199 enableFoam ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers : -1000;
200
202 static constexpr int contiBrineEqIdx =
203 enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numFoam : -1000;
204
206 static constexpr int contiEnergyEqIdx =
208};
209
210} // namespace Opm
211
212#endif
Definition: blackoilbioeffectsmodules.hh:43
The primary variable and equation indices for the three-phase black-oil model.
Definition: blackoilvariableandequationindices.hh:48
static constexpr bool enableFullyImplicitThermal
Shall energy be conserved?
Definition: blackoilvariableandequationindices.hh:67
static constexpr bool gasEnabled
Definition: blackoilvariableandequationindices.hh:55
static constexpr bool oilEnabled
All phases are enabled.
Definition: blackoilvariableandequationindices.hh:53
static constexpr int biofilmVolumeFractionIdx
Definition: blackoilvariableandequationindices.hh:150
static constexpr int microbialConcentrationIdx
No bioeffects for three phase indices.
Definition: blackoilvariableandequationindices.hh:147
static constexpr int contiPolymerMWEqIdx
Index of the continuity equation for the second polymer component (molecular weight)
Definition: blackoilvariableandequationindices.hh:187
static constexpr int contiCalciteEqIdx
Definition: blackoilvariableandequationindices.hh:195
static constexpr int contiBrineEqIdx
Index of the continuity equation for the salt water component.
Definition: blackoilvariableandequationindices.hh:202
static constexpr int contiUreaEqIdx
Definition: blackoilvariableandequationindices.hh:193
static constexpr bool enableSolvent
Are solvents involved?
Definition: blackoilvariableandequationindices.hh:58
static constexpr int numFoam
Number of foam equations to be considered.
Definition: blackoilvariableandequationindices.hh:87
static constexpr int numPhases
Number of phases active at all times.
Definition: blackoilvariableandequationindices.hh:50
static constexpr int numBioInWat
Definition: blackoilvariableandequationindices.hh:72
static constexpr bool enableMICP
No bioeffects for three phase indices.
Definition: blackoilvariableandequationindices.hh:70
static constexpr bool waterEnabled
Definition: blackoilvariableandequationindices.hh:54
static constexpr int contiOxygenEqIdx
Definition: blackoilvariableandequationindices.hh:192
static constexpr bool enableBiofilm
Definition: blackoilvariableandequationindices.hh:71
static constexpr int contiBiofilmEqIdx
Definition: blackoilvariableandequationindices.hh:194
static constexpr bool enablePolymer
Are polymers involved?
Definition: blackoilvariableandequationindices.hh:64
static constexpr int numEq
The number of equations.
Definition: blackoilvariableandequationindices.hh:93
static constexpr int contiMicrobialEqIdx
No bioeffects for three phase indices.
Definition: blackoilvariableandequationindices.hh:191
static constexpr int foamConcentrationIdx
Index of the primary variable for the foam.
Definition: blackoilvariableandequationindices.hh:154
static constexpr int polymerConcentrationIdx
Index of the primary variable for the first polymer.
Definition: blackoilvariableandequationindices.hh:139
static constexpr int oxygenConcentrationIdx
Definition: blackoilvariableandequationindices.hh:148
static constexpr int waterSwitchIdx
Index of the switching variable which determines the composistion of the water phase.
Definition: blackoilvariableandequationindices.hh:110
static constexpr int numSolvents
Number of solvent components to be considered.
Definition: blackoilvariableandequationindices.hh:75
static constexpr int contiZfracEqIdx
Index of the continuity equation for the first extbo component.
Definition: blackoilvariableandequationindices.hh:179
static constexpr int numEnergy
Number of energy equations to be considered.
Definition: blackoilvariableandequationindices.hh:84
static constexpr int saltConcentrationIdx
Index of the primary variable for the brine.
Definition: blackoilvariableandequationindices.hh:158
static constexpr int contiFoamEqIdx
Index of the continuity equation for the foam component.
Definition: blackoilvariableandequationindices.hh:198
static constexpr int numDerivatives
For seqential implicit approches we evaluate the intensive quantities with a larger number of derivat...
Definition: blackoilvariableandequationindices.hh:97
static constexpr int numPolymers
Number of polymer components to be considered.
Definition: blackoilvariableandequationindices.hh:81
static constexpr int pressureSwitchIdx
Index of the switching variable which determines the pressure.
Definition: blackoilvariableandequationindices.hh:118
static constexpr int conti0EqIdx
Index of the continuity equation of the first phase.
Definition: blackoilvariableandequationindices.hh:171
static constexpr int compositionSwitchIdx
Index of the switching variable which determines the composition of the hydrocarbon phases.
Definition: blackoilvariableandequationindices.hh:128
static constexpr int numExtbos
Number of components to be considered for extbo.
Definition: blackoilvariableandequationindices.hh:78
static constexpr int numBrine
Number of salt equations to be considered.
Definition: blackoilvariableandequationindices.hh:90
static constexpr int contiPolymerEqIdx
Index of the continuity equation for the first polymer component.
Definition: blackoilvariableandequationindices.hh:183
static constexpr int contiEnergyEqIdx
Index of the continuity equation for energy.
Definition: blackoilvariableandequationindices.hh:206
static constexpr int polymerMoleWeightIdx
Index of the primary variable for the second polymer primary variable (molecular weight)
Definition: blackoilvariableandequationindices.hh:143
static constexpr int solventSaturationIdx
Index of the primary variable for the first solvent.
Definition: blackoilvariableandequationindices.hh:131
static constexpr int calciteVolumeFractionIdx
Definition: blackoilvariableandequationindices.hh:151
static constexpr int contiSolventEqIdx
Index of the continuity equation for the first solvent component.
Definition: blackoilvariableandequationindices.hh:175
static constexpr int ureaConcentrationIdx
Definition: blackoilvariableandequationindices.hh:149
static constexpr bool enableExtbo
Is extbo invoked?
Definition: blackoilvariableandequationindices.hh:61
static constexpr int zFractionIdx
Index of the primary variable for the first extbo component.
Definition: blackoilvariableandequationindices.hh:135
static constexpr int temperatureIdx
Index of the primary variable for temperature.
Definition: blackoilvariableandequationindices.hh:162