opm-simulators
Loading...
Searching...
No Matches
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 enableFoam,
43 bool enableBrine,
44 int PVOffset,
45 unsigned numBioCompV>
47{
49 static constexpr int numPhases = 3;
50
52 static constexpr bool oilEnabled = true;
53 static constexpr bool waterEnabled = true;
54 static constexpr bool gasEnabled = true;
55
57 static constexpr bool enableSolvent = numSolventsV > 0;
58
60 static constexpr bool enableExtbo = numExtbosV > 0;
61
63 static constexpr bool enablePolymer = numPolymersV > 0;
64
66 static constexpr bool enableFullyImplicitThermal = numEnergyV > 0;
67
69 static constexpr bool enableMICP = false;
70 static constexpr bool enableBiofilm = false;
71 static constexpr int numBioInWat = 0;
72
74 static constexpr int numSolvents = enableSolvent ? numSolventsV : 0;
75
77 static constexpr int numExtbos = enableExtbo ? numExtbosV : 0;
78
80 static constexpr int numPolymers = enablePolymer ? numPolymersV : 0;
81
83 static constexpr int numEnergy = enableFullyImplicitThermal ? numEnergyV : 0;
84
86 static constexpr int numFoam = enableFoam? 1 : 0;
87
89 static constexpr int numBrine = enableBrine? 1 : 0;
90
92 static constexpr int numEq = numPhases + numSolvents + numExtbos + numPolymers +
94
96 static constexpr int numDerivatives = numEq;
97
98
100 // Primary variable indices
102
109 static constexpr int waterSwitchIdx = PVOffset + 0;
110
117 static constexpr int pressureSwitchIdx = PVOffset + 1;
118
127 static constexpr int compositionSwitchIdx = PVOffset + 2;
128
130 static constexpr int solventSaturationIdx =
131 enableSolvent ? PVOffset + numPhases : -1000;
132
134 static constexpr int zFractionIdx =
135 enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
136
138 static constexpr int polymerConcentrationIdx =
139 enablePolymer ? PVOffset + numPhases + numSolvents : -1000;
140
142 static constexpr int polymerMoleWeightIdx =
143 numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000;
144
146 static constexpr int microbialConcentrationIdx = -1000;
147 static constexpr int oxygenConcentrationIdx = -1000;
148 static constexpr int ureaConcentrationIdx = -1000;
149 static constexpr int biofilmVolumeFractionIdx = -1000;
150 static constexpr int calciteVolumeFractionIdx = -1000;
151
153 static constexpr int foamConcentrationIdx =
154 enableFoam ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers : -1000;
155
157 static constexpr int saltConcentrationIdx =
158 enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numFoam : -1000;
159
161 static constexpr int temperatureIdx =
163
164
166 // Equation indices
168
170 static constexpr int conti0EqIdx = PVOffset + 0;
171 // two continuity equations follow
172
174 static constexpr int contiSolventEqIdx =
175 enableSolvent ? PVOffset + numPhases : -1000;
176
178 static constexpr int contiZfracEqIdx =
179 enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
180
182 static constexpr int contiPolymerEqIdx =
183 enablePolymer ? PVOffset + numPhases + numSolvents + numExtbos : -1000;
184
186 static constexpr int contiPolymerMWEqIdx =
187 numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000;
188
190 static constexpr int contiMicrobialEqIdx = -1000;
191 static constexpr int contiOxygenEqIdx = -1000;
192 static constexpr int contiUreaEqIdx = -1000;
193 static constexpr int contiBiofilmEqIdx = -1000;
194 static constexpr int contiCalciteEqIdx = -1000;
195
197 static constexpr int contiFoamEqIdx =
198 enableFoam ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers : -1000;
199
201 static constexpr int contiBrineEqIdx =
202 enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numFoam : -1000;
203
205 static constexpr int contiEnergyEqIdx =
207};
208
209} // namespace Opm
210
211#endif
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
The primary variable and equation indices for the three-phase black-oil model.
Definition blackoilvariableandequationindices.hh:47