blackoilindices.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 EWOMS_BLACK_OIL_INDICES_HH
29#define EWOMS_BLACK_OIL_INDICES_HH
30
31namespace Opm {
32
38template <unsigned numSolventsV, unsigned numExtbosV, unsigned numPolymersV, unsigned numEnergyV, bool enableFoam, bool enableBrine, unsigned PVOffset, unsigned numMICPsV>
40{
42 static const int numPhases = 3;
43
45 static const bool oilEnabled = true;
46 static const bool waterEnabled = true;
47 static const bool gasEnabled = true;
48
50 static const bool enableSolvent = numSolventsV > 0;
51
53 static const bool enableExtbo = numExtbosV > 0;
54
56 static const bool enablePolymer = numPolymersV > 0;
57
59 static const bool enableEnergy = numEnergyV > 0;
60
62 static const bool enableMICP = numMICPsV > 0;
63
65 static const int numSolvents = enableSolvent ? numSolventsV : 0;
66
68 static const int numExtbos = enableExtbo ? numExtbosV : 0;
69
71 static const int numPolymers = enablePolymer ? numPolymersV : 0;
72
74 static const int numEnergy = enableEnergy ? numEnergyV : 0;
75
77 static const int numFoam = enableFoam? 1 : 0;
78
80 static const int numBrine = enableBrine? 1 : 0;
81
83 static const int numMICPs = enableMICP ? numMICPsV : 0;
84
87
89 static constexpr unsigned canonicalToActiveComponentIndex(unsigned compIdx)
90 { return compIdx; }
91
92 static constexpr unsigned activeToCanonicalComponentIndex(unsigned compIdx)
93 { return compIdx; }
94
96 // Primary variable indices
98
105 static const int waterSwitchIdx = PVOffset + 0;
106
113 static const int pressureSwitchIdx = PVOffset + 1;
114
123 static const int compositionSwitchIdx = PVOffset + 2;
124
126 static const int solventSaturationIdx =
127 enableSolvent ? PVOffset + numPhases : -1000;
128
130 static const int zFractionIdx =
131 enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
132
134 static const int polymerConcentrationIdx =
135 enablePolymer ? PVOffset + numPhases + numSolvents : -1000;
136
138 static const int polymerMoleWeightIdx =
139 numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000;
140
142 static const int microbialConcentrationIdx =
143 enableMICP ? PVOffset + numPhases + numSolvents : -1000;
144
146 static const int oxygenConcentrationIdx =
147 numMICPs > 1 ? microbialConcentrationIdx + 1 : -1000;
148
150 static const int ureaConcentrationIdx =
151 numMICPs > 2 ? oxygenConcentrationIdx + 1 : -1000;
152
154 static const int biofilmConcentrationIdx =
155 numMICPs > 3 ? ureaConcentrationIdx + 1 : -1000;
156
158 static const int calciteConcentrationIdx =
159 numMICPs > 4 ? biofilmConcentrationIdx + 1 : -1000;
160
162 static const int foamConcentrationIdx =
163 enableFoam ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs : -1000;
164
166 static const int saltConcentrationIdx =
167 enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numExtbos + numPolymers + numMICPs + numFoam : -1000;
168
170 static const int temperatureIdx =
172
173
175 // Equation indices
177
179 static const int conti0EqIdx = PVOffset + 0;
180 // two continuity equations follow
181
183 static const int contiSolventEqIdx =
184 enableSolvent ? PVOffset + numPhases : -1000;
185
187 static const int contiZfracEqIdx =
188 enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
189
191 static const int contiPolymerEqIdx =
192 enablePolymer ? PVOffset + numPhases + numSolvents + numExtbos : -1000;
193
195 static const int contiPolymerMWEqIdx =
196 numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000;
197
199 static const int contiMicrobialEqIdx =
200 enableMICP ? PVOffset + numPhases + numSolvents + numExtbos : -1000;
201
203 static const int contiOxygenEqIdx =
204 numMICPs > 1 ? contiMicrobialEqIdx + 1 : -1000;
205
207 static const int contiUreaEqIdx =
208 numMICPs > 2 ? contiOxygenEqIdx + 1 : -1000;
209
211 static const int contiBiofilmEqIdx =
212 numMICPs > 3 ? contiUreaEqIdx + 1 : -1000;
213
215 static const int contiCalciteEqIdx =
216 numMICPs > 4 ? contiBiofilmEqIdx + 1 : -1000;
217
219 static const int contiFoamEqIdx =
220 enableFoam ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs : -1000;
221
223 static const int contiBrineEqIdx =
224 enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs + numFoam : -1000;
225
226
228 static const int contiEnergyEqIdx =
230};
231
232} // namespace Opm
233
234#endif
Definition: blackoilboundaryratevector.hh:37
The primary variable and equation indices for the black-oil model.
Definition: blackoilindices.hh:40
static const int contiBrineEqIdx
Index of the continuity equation for the salt water component.
Definition: blackoilindices.hh:223
static const int numEnergy
Number of energy equations to be considered.
Definition: blackoilindices.hh:74
static const int numFoam
Number of foam equations to be considered.
Definition: blackoilindices.hh:77
static const int numPolymers
Number of polymer components to be considered.
Definition: blackoilindices.hh:71
static const int contiFoamEqIdx
Index of the continuity equation for the foam component.
Definition: blackoilindices.hh:219
static const int calciteConcentrationIdx
Index of the primary variable for the fifth MICP component.
Definition: blackoilindices.hh:158
static const bool enableExtbo
Is extbo invoked?
Definition: blackoilindices.hh:53
static const int saltConcentrationIdx
Index of the primary variable for the brine.
Definition: blackoilindices.hh:166
static const int polymerConcentrationIdx
Index of the primary variable for the first polymer.
Definition: blackoilindices.hh:134
static const bool oilEnabled
All phases are enabled.
Definition: blackoilindices.hh:45
static const int biofilmConcentrationIdx
Index of the primary variable for the fourth MICP component.
Definition: blackoilindices.hh:154
static const bool enableEnergy
Shall energy be conserved?
Definition: blackoilindices.hh:59
static const int contiCalciteEqIdx
Index of the continuity equation for the fifth MICP component.
Definition: blackoilindices.hh:215
static const int conti0EqIdx
Index of the continuity equation of the first phase.
Definition: blackoilindices.hh:179
static const int zFractionIdx
Index of the primary variable for the first extbo component.
Definition: blackoilindices.hh:130
static const int foamConcentrationIdx
Index of the primary variable for the foam.
Definition: blackoilindices.hh:162
static const bool waterEnabled
Definition: blackoilindices.hh:46
static const int contiZfracEqIdx
Index of the continuity equation for the first extbo component.
Definition: blackoilindices.hh:187
static const bool enablePolymer
Are polymers involved?
Definition: blackoilindices.hh:56
static const int numSolvents
Number of solvent components to be considered.
Definition: blackoilindices.hh:65
static const int numExtbos
Number of components to be considered for extbo.
Definition: blackoilindices.hh:68
static const int compositionSwitchIdx
Index of the switching variable which determines the composition of the hydrocarbon phases.
Definition: blackoilindices.hh:123
static const bool gasEnabled
Definition: blackoilindices.hh:47
static const int contiSolventEqIdx
Index of the continuity equation for the first solvent component.
Definition: blackoilindices.hh:183
static const int numBrine
Number of salt equations to be considered.
Definition: blackoilindices.hh:80
static const int numEq
The number of equations.
Definition: blackoilindices.hh:86
static const int temperatureIdx
Index of the primary variable for temperature.
Definition: blackoilindices.hh:170
static const int waterSwitchIdx
Index of the switching variable which determines the composistion of the water phase.
Definition: blackoilindices.hh:105
static constexpr unsigned activeToCanonicalComponentIndex(unsigned compIdx)
Definition: blackoilindices.hh:92
static const bool enableMICP
Is MICP involved?
Definition: blackoilindices.hh:62
static const int oxygenConcentrationIdx
Index of the primary variable for the second MICP component.
Definition: blackoilindices.hh:146
static const int ureaConcentrationIdx
Index of the primary variable for the third MICP component.
Definition: blackoilindices.hh:150
static const int contiPolymerEqIdx
Index of the continuity equation for the first polymer component.
Definition: blackoilindices.hh:191
static const int microbialConcentrationIdx
Index of the primary variable for the first MICP component.
Definition: blackoilindices.hh:142
static const int numPhases
Number of phases active at all times.
Definition: blackoilindices.hh:42
static const int pressureSwitchIdx
Index of the switching variable which determines the pressure.
Definition: blackoilindices.hh:113
static const int solventSaturationIdx
Index of the primary variable for the first solvent.
Definition: blackoilindices.hh:126
static const int numMICPs
Number of MICP components to be considered.
Definition: blackoilindices.hh:83
static const bool enableSolvent
Are solvents involved?
Definition: blackoilindices.hh:50
static const int polymerMoleWeightIdx
Index of the primary variable for the second polymer primary variable (molecular weight)
Definition: blackoilindices.hh:138
static const int contiEnergyEqIdx
Index of the continuity equation for energy.
Definition: blackoilindices.hh:228
static const int contiUreaEqIdx
Index of the continuity equation for the third MICP component.
Definition: blackoilindices.hh:207
static const int contiBiofilmEqIdx
Index of the continuity equation for the fourth MICP component.
Definition: blackoilindices.hh:211
static const int contiMicrobialEqIdx
Index of the continuity equation for the first MICP component.
Definition: blackoilindices.hh:199
static const int contiPolymerMWEqIdx
Index of the continuity equation for the second polymer component (molecular weight)
Definition: blackoilindices.hh:195
static constexpr unsigned canonicalToActiveComponentIndex(unsigned compIdx)
returns the index of "active" component
Definition: blackoilindices.hh:89
static const int contiOxygenEqIdx
Index of the continuity equation for the second MICP component.
Definition: blackoilindices.hh:203