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 
31 namespace Ewoms {
32 
38 template <unsigned numSolventsV, unsigned numPolymersV, unsigned PVOffset>
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 int numSolvents = numSolventsV;
51 
53  static const int numPolymers = numPolymersV;
54 
56  static const int numEq = numPhases + numSolvents + numPolymers;
57 
59  static constexpr unsigned canonicalToActiveComponentIndex(unsigned compIdx)
60  { return compIdx; }
61 
63  // Primary variable indices
65 
67  static const int waterSaturationIdx = PVOffset + 0;
68 
70  static const int pressureSwitchIdx = PVOffset + 1;
71 
80  static const int compositionSwitchIdx = PVOffset + 2;
81 
84 
87 
88  // numSolvents-1 primary variables follow
89 
91  // Equation indices
93 
95  static const int conti0EqIdx = PVOffset + 0;
96  // two continuity equations follow
97 
99  static const int contiSolventEqIdx = PVOffset + numPhases - 1 + numSolvents;
100 
103  // numSolvents-1 continuity equations follow
104 };
105 
106 } // namespace Ewoms
107 
108 #endif
static constexpr unsigned canonicalToActiveComponentIndex(unsigned compIdx)
returns the index of "active" component
Definition: blackoilindices.hh:59
static const int conti0EqIdx
Index of the continuity equation of the first phase.
Definition: blackoilindices.hh:95
Definition: baseauxiliarymodule.hh:37
static const int polymerConcentrationIdx
Index of the primary variable for the first polymer.
Definition: blackoilindices.hh:86
static const int numSolvents
Number of solvent components considered.
Definition: blackoilindices.hh:50
static const int compositionSwitchIdx
Index of the switching variable which determines the composition of the hydrocarbon phases...
Definition: blackoilindices.hh:80
static const int numPolymers
Number of polymer components considered.
Definition: blackoilindices.hh:53
static const bool oilEnabled
All phases are enabled.
Definition: blackoilindices.hh:45
static const int numPhases
Number of phases active at all times.
Definition: blackoilindices.hh:42
static const int contiPolymerEqIdx
Index of the continuity equation for the first polymer component.
Definition: blackoilindices.hh:102
static const int pressureSwitchIdx
Index of the oil pressure in a vector of primary variables.
Definition: blackoilindices.hh:70
The primary variable and equation indices for the black-oil model.
Definition: blackoilindices.hh:39
static const int waterSaturationIdx
The index of the water saturation.
Definition: blackoilindices.hh:67
static const int solventSaturationIdx
Index of the primary variable for the first solvent.
Definition: blackoilindices.hh:83
static const int contiSolventEqIdx
Index of the continuity equation for the first solvent component.
Definition: blackoilindices.hh:99
static const int numEq
The number of equations.
Definition: blackoilindices.hh:56