Loading...
Searching...
No Matches
blackoilonephaseindices.hh
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef EWOMS_BLACK_OIL_ONE_PHASE_INDICES_HH
#define EWOMS_BLACK_OIL_ONE_PHASE_INDICES_HH
#include <cassert>
#include <opm/common/utility/ConstexprAssert.hpp>
namespace Opm {
template<unsigned numSolventsV,
unsigned numExtbosV,
unsigned numPolymersV,
unsigned numEnergyV,
bool enableFoam,
bool enableBrine,
unsigned PVOffset,
unsigned canonicalCompIdx,
unsigned numBioCompV>
struct BlackOilOnePhaseIndices
{
static constexpr bool oilEnabled = canonicalCompIdx == 0;
static constexpr bool waterEnabled = canonicalCompIdx == 1;
static constexpr bool gasEnabled = canonicalCompIdx == 2;
static constexpr bool enableSolvent = numSolventsV > 0;
static constexpr bool enableExtbo = numExtbosV > 0;
static constexpr bool enablePolymer = numPolymersV > 0;
static constexpr bool enableEnergy = numEnergyV > 0;
static constexpr bool enableMICP = numBioCompV == 5;
static constexpr bool enableBiofilm = false;
static constexpr int numSolvents = enableSolvent ? numSolventsV : 0;
static constexpr int numExtbos = enableExtbo ? numExtbosV : 0;
static constexpr int numPolymers = enablePolymer ? numPolymersV : 0;
static constexpr int numEnergy = enableEnergy ? numEnergyV : 0;
static constexpr int numFoam = enableFoam? 1 : 0;
static constexpr int numBrine = enableBrine? 1 : 0;
static constexpr int numPhases = 1;
static constexpr int numMICPs = enableMICP ? numBioCompV : 0;
static constexpr int numBioInWat = enableMICP ? 3 : 0;
static constexpr int numEq = numPhases + numSolvents + numExtbos + numPolymers +
numEnergy + numFoam + numBrine + numMICPs;
// Primary variable indices
static constexpr int waterSwitchIdx = -10000;
static constexpr int pressureSwitchIdx = PVOffset + 0;
static constexpr int compositionSwitchIdx = -10000;
static constexpr int solventSaturationIdx =
enableSolvent ? PVOffset + numPhases : -1000;
static constexpr int zFractionIdx =
enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int polymerConcentrationIdx =
enablePolymer ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int polymerMoleWeightIdx =
numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000;
static constexpr int microbialConcentrationIdx =
enableMICP ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int oxygenConcentrationIdx =
numMICPs > 1 ? microbialConcentrationIdx + 1 : -1000;
static constexpr int ureaConcentrationIdx =
numMICPs > 2 ? oxygenConcentrationIdx + 1 : -1000;
static constexpr int biofilmVolumeFractionIdx =
numMICPs > 3 ? ureaConcentrationIdx + 1 : -1000;
static constexpr int calciteVolumeFractionIdx =
numMICPs > 4 ? biofilmVolumeFractionIdx + 1 : -1000;
static constexpr int foamConcentrationIdx =
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers + numMICPs : -1000;
static constexpr int saltConcentrationIdx =
enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs + numFoam : -1000;
static constexpr int temperatureIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs + numFoam + numBrine: - 1000;
// Equation indices
static constexpr int conti0EqIdx = PVOffset + 0;
static constexpr int contiSolventEqIdx =
enableSolvent ? PVOffset + numPhases : -1000;
static constexpr int contiZfracEqIdx =
enableExtbo ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int contiPolymerEqIdx =
enablePolymer ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int contiPolymerMWEqIdx =
numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000;
static constexpr int contiMicrobialEqIdx =
enableMICP ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int contiOxygenEqIdx =
numMICPs > 1 ? contiMicrobialEqIdx + 1 : -1000;
static constexpr int contiUreaEqIdx =
numMICPs > 2 ? contiOxygenEqIdx + 1 : -1000;
static constexpr int contiBiofilmEqIdx =
numMICPs > 3 ? contiUreaEqIdx + 1 : -1000;
static constexpr int contiCalciteEqIdx =
numMICPs > 4 ? contiBiofilmEqIdx + 1 : -1000;
static constexpr int contiFoamEqIdx =
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers + numMICPs : -1000;
static constexpr int contiBrineEqIdx =
enableBrine ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs + numFoam : -1000;
static constexpr int contiEnergyEqIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numMICPs + numFoam + numBrine: -1000;
};
} // namespace Opm
#endif
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::BlackOilOnePhaseIndices
The primary variable and equation indices for the black-oil model.
Definition blackoilonephaseindices.hh:52
Opm::BlackOilOnePhaseIndices::numBioInWat
static constexpr int numBioInWat
Number of biocomponents in the water phase.
Definition blackoilonephaseindices.hh:101
Opm::BlackOilOnePhaseIndices::numBrine
static constexpr int numBrine
Number of salt equations to be considered.
Definition blackoilonephaseindices.hh:92
Opm::BlackOilOnePhaseIndices::ureaConcentrationIdx
static constexpr int ureaConcentrationIdx
Index of the primary variable for the third MICP component.
Definition blackoilonephaseindices.hh:162
Opm::BlackOilOnePhaseIndices::contiUreaEqIdx
static constexpr int contiUreaEqIdx
Index of the continuity equation for the third MICP component.
Definition blackoilonephaseindices.hh:217
Opm::BlackOilOnePhaseIndices::contiEnergyEqIdx
static constexpr int contiEnergyEqIdx
Index of the continuity equation for energy.
Definition blackoilonephaseindices.hh:237
Opm::BlackOilOnePhaseIndices::numPolymers
static constexpr int numPolymers
Number of polymer components to be considered.
Definition blackoilonephaseindices.hh:83
Opm::BlackOilOnePhaseIndices::foamConcentrationIdx
static constexpr int foamConcentrationIdx
Index of the primary variable for the foam.
Definition blackoilonephaseindices.hh:174
Opm::BlackOilOnePhaseIndices::numEq
static constexpr int numEq
The number of equations.
Definition blackoilonephaseindices.hh:104
Opm::BlackOilOnePhaseIndices::polymerConcentrationIdx
static constexpr int polymerConcentrationIdx
Index of the primary variable for the first polymer.
Definition blackoilonephaseindices.hh:146
Opm::BlackOilOnePhaseIndices::contiCalciteEqIdx
static constexpr int contiCalciteEqIdx
Index of the continuity equation for the fifth MICP component.
Definition blackoilonephaseindices.hh:225
Opm::BlackOilOnePhaseIndices::numPhases
static constexpr int numPhases
The number of fluid phases.
Definition blackoilonephaseindices.hh:95
Opm::BlackOilOnePhaseIndices::enableSolvent
static constexpr bool enableSolvent
Are solvents involved?
Definition blackoilonephaseindices.hh:59
Opm::BlackOilOnePhaseIndices::contiZfracEqIdx
static constexpr int contiZfracEqIdx
Index of the continuity equation for the first extbo component.
Definition blackoilonephaseindices.hh:197
Opm::BlackOilOnePhaseIndices::enablePolymer
static constexpr bool enablePolymer
Are polymers involved?
Definition blackoilonephaseindices.hh:65
Opm::BlackOilOnePhaseIndices::enableExtbo
static constexpr bool enableExtbo
Is extbo invoked?
Definition blackoilonephaseindices.hh:62
Opm::BlackOilOnePhaseIndices::pressureSwitchIdx
static constexpr int pressureSwitchIdx
Index of the switching variable which determines the pressure.
Definition blackoilonephaseindices.hh:127
Opm::BlackOilOnePhaseIndices::waterSwitchIdx
static constexpr int waterSwitchIdx
Index of the switching variable which determines the composistion of the water phase.
Definition blackoilonephaseindices.hh:119
Opm::BlackOilOnePhaseIndices::compositionSwitchIdx
static constexpr int compositionSwitchIdx
Index of the switching variable which determines the composition of the hydrocarbon phases.
Definition blackoilonephaseindices.hh:135
Opm::BlackOilOnePhaseIndices::conti0EqIdx
static constexpr int conti0EqIdx
Index of the continuity equation of the first (and only) phase.
Definition blackoilonephaseindices.hh:190
Opm::BlackOilOnePhaseIndices::enableEnergy
static constexpr bool enableEnergy
Shall energy be conserved?
Definition blackoilonephaseindices.hh:68
Opm::BlackOilOnePhaseIndices::contiPolymerEqIdx
static constexpr int contiPolymerEqIdx
Index of the continuity equation for the first polymer component.
Definition blackoilonephaseindices.hh:201
Opm::BlackOilOnePhaseIndices::numSolvents
static constexpr int numSolvents
Number of solvent components to be considered.
Definition blackoilonephaseindices.hh:77
Opm::BlackOilOnePhaseIndices::microbialConcentrationIdx
static constexpr int microbialConcentrationIdx
Index of the primary variable for the first MICP component.
Definition blackoilonephaseindices.hh:154
Opm::BlackOilOnePhaseIndices::contiFoamEqIdx
static constexpr int contiFoamEqIdx
Index of the continuity equation for the foam component.
Definition blackoilonephaseindices.hh:229
Opm::BlackOilOnePhaseIndices::contiBiofilmEqIdx
static constexpr int contiBiofilmEqIdx
Index of the continuity equation for the fourth MICP component.
Definition blackoilonephaseindices.hh:221
Opm::BlackOilOnePhaseIndices::temperatureIdx
static constexpr int temperatureIdx
Index of the primary variable for temperature.
Definition blackoilonephaseindices.hh:182
Opm::BlackOilOnePhaseIndices::calciteVolumeFractionIdx
static constexpr int calciteVolumeFractionIdx
Index of the primary variable for the fifth MICP component.
Definition blackoilonephaseindices.hh:170
Opm::BlackOilOnePhaseIndices::contiMicrobialEqIdx
static constexpr int contiMicrobialEqIdx
Index of the continuity equation for the first MICP component.
Definition blackoilonephaseindices.hh:209
Opm::BlackOilOnePhaseIndices::numMICPs
static constexpr int numMICPs
Number of MICP components to be considered.
Definition blackoilonephaseindices.hh:98
Opm::BlackOilOnePhaseIndices::numFoam
static constexpr int numFoam
Number of foam equations to be considered.
Definition blackoilonephaseindices.hh:89
Opm::BlackOilOnePhaseIndices::zFractionIdx
static constexpr int zFractionIdx
Index of the primary variable for the first extbo component.
Definition blackoilonephaseindices.hh:142
Opm::BlackOilOnePhaseIndices::solventSaturationIdx
static constexpr int solventSaturationIdx
Index of the primary variable for the first solvent.
Definition blackoilonephaseindices.hh:138
Opm::BlackOilOnePhaseIndices::enableMICP
static constexpr bool enableMICP
Is MICP involved? (microbes, oxygen, urea, biofilm, and calcite).
Definition blackoilonephaseindices.hh:71
Opm::BlackOilOnePhaseIndices::oilEnabled
static constexpr bool oilEnabled
Is phase enabled or not.
Definition blackoilonephaseindices.hh:54
Opm::BlackOilOnePhaseIndices::oxygenConcentrationIdx
static constexpr int oxygenConcentrationIdx
Index of the primary variable for the second MICP component.
Definition blackoilonephaseindices.hh:158
Opm::BlackOilOnePhaseIndices::enableBiofilm
static constexpr bool enableBiofilm
Biofilm effects on co2/h2store only for two phase indices.
Definition blackoilonephaseindices.hh:74
Opm::BlackOilOnePhaseIndices::contiPolymerMWEqIdx
static constexpr int contiPolymerMWEqIdx
Index of the continuity equation for the second polymer component (molecular weight).
Definition blackoilonephaseindices.hh:205
Opm::BlackOilOnePhaseIndices::polymerMoleWeightIdx
static constexpr int polymerMoleWeightIdx
Index of the primary variable for the second polymer primary variable (molecular weight).
Definition blackoilonephaseindices.hh:150
Opm::BlackOilOnePhaseIndices::biofilmVolumeFractionIdx
static constexpr int biofilmVolumeFractionIdx
Index of the primary variable for the fourth MICP component.
Definition blackoilonephaseindices.hh:166
Opm::BlackOilOnePhaseIndices::contiOxygenEqIdx
static constexpr int contiOxygenEqIdx
Index of the continuity equation for the second MICP component.
Definition blackoilonephaseindices.hh:213
Opm::BlackOilOnePhaseIndices::saltConcentrationIdx
static constexpr int saltConcentrationIdx
Index of the primary variable for the salt.
Definition blackoilonephaseindices.hh:178
Opm::BlackOilOnePhaseIndices::contiBrineEqIdx
static constexpr int contiBrineEqIdx
Index of the continuity equation for the salt component.
Definition blackoilonephaseindices.hh:233
Opm::BlackOilOnePhaseIndices::contiSolventEqIdx
static constexpr int contiSolventEqIdx
Index of the continuity equation for the first solvent component.
Definition blackoilonephaseindices.hh:193
Opm::BlackOilOnePhaseIndices::numEnergy
static constexpr int numEnergy
Number of energy equations to be considered.
Definition blackoilonephaseindices.hh:86
Opm::BlackOilOnePhaseIndices::numExtbos
static constexpr int numExtbos
Number of components to be considered for extbo.
Definition blackoilonephaseindices.hh:80