Loading...
Searching...
No Matches
blackoiltwophaseindices.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_TWO_PHASE_INDICES_HH
#define EWOMS_BLACK_OIL_TWO_PHASE_INDICES_HH
#include <opm/common/utility/ConstexprAssert.hpp>
#include <cassert>
namespace Opm {
template<unsigned numSolventsV,
unsigned numExtbosV,
unsigned numPolymersV,
unsigned numEnergyV,
bool enableFoam,
bool enableBrine,
unsigned PVOffset,
unsigned disabledCanonicalCompIdx,
unsigned numBioCompV>
struct BlackOilTwoPhaseIndices
{
static constexpr bool oilEnabled = disabledCanonicalCompIdx != 0;
static constexpr bool waterEnabled = disabledCanonicalCompIdx != 1;
static constexpr bool gasEnabled = disabledCanonicalCompIdx != 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 = false;
static constexpr bool enableBiofilm = numBioCompV > 0;
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 numBioComp = enableBiofilm ? numBioCompV : 0;
static constexpr int numBioInWat = enableBiofilm ? 1 : 0;
static constexpr int numPhases = 2;
static constexpr int numEq = numPhases + numSolvents + numExtbos + numPolymers +
numEnergy + numFoam + numBrine + numBioComp;
// Primary variable indices
static constexpr int waterSwitchIdx = waterEnabled ? PVOffset + 0 : -10000;
static constexpr int pressureSwitchIdx = waterEnabled ? PVOffset + 1 : PVOffset + 0;
static constexpr int compositionSwitchIdx = (gasEnabled && oilEnabled) ? PVOffset + 1 : -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 =
enableBiofilm ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int biofilmVolumeFractionIdx =
enableBiofilm ? PVOffset + numPhases + numSolvents + 1 : -1000;
static constexpr int oxygenConcentrationIdx = -1000;
static constexpr int ureaConcentrationIdx = -1000;
static constexpr int calciteVolumeFractionIdx = -1000;
static constexpr int foamConcentrationIdx =
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers + numBioComp : -1000;
static constexpr int saltConcentrationIdx =
enableBrine ? PVOffset + numPhases + numSolvents + numPolymers + numBioComp + numFoam : -1000;
static constexpr int temperatureIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numBioComp + numFoam + numBrine : - 1000;
// Equation indices
static constexpr int conti0EqIdx = PVOffset + 0;
// one continuity equation follows
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 =
enableBiofilm ? PVOffset + numPhases + numSolvents : -1000;
static constexpr int contiBiofilmEqIdx =
enableBiofilm ? PVOffset + numPhases + numSolvents + 1 : -1000;
static constexpr int contiOxygenEqIdx = -1000;
static constexpr int contiUreaEqIdx = -1000;
static constexpr int contiCalciteEqIdx = -1000;
static constexpr int contiFoamEqIdx =
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers + numBioComp : -1000;
static constexpr int contiBrineEqIdx =
enableBrine ? PVOffset + numPhases + numSolvents + numPolymers + numBioComp + numFoam : -1000;
static constexpr int contiEnergyEqIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numExtbos + numPolymers + numBioComp + numFoam + numBrine: -1000;
};
} // namespace Opm
#endif
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::BlackOilTwoPhaseIndices
The primary variable and equation indices for the black-oil model.
Definition blackoiltwophaseindices.hh:52
Opm::BlackOilTwoPhaseIndices::numEnergy
static constexpr int numEnergy
Number of energy equations to be considered.
Definition blackoiltwophaseindices.hh:86
Opm::BlackOilTwoPhaseIndices::solventSaturationIdx
static constexpr int solventSaturationIdx
Index of the primary variable for the first solvent.
Definition blackoiltwophaseindices.hh:138
Opm::BlackOilTwoPhaseIndices::contiOxygenEqIdx
static constexpr int contiOxygenEqIdx
MICP only available for one phase indices.
Definition blackoiltwophaseindices.hh:211
Opm::BlackOilTwoPhaseIndices::enableSolvent
static constexpr bool enableSolvent
Are solvents involved?
Definition blackoiltwophaseindices.hh:59
Opm::BlackOilTwoPhaseIndices::temperatureIdx
static constexpr int temperatureIdx
Index of the primary variable for temperature.
Definition blackoiltwophaseindices.hh:175
Opm::BlackOilTwoPhaseIndices::enableBiofilm
static constexpr bool enableBiofilm
Are biofilms involved?
Definition blackoiltwophaseindices.hh:74
Opm::BlackOilTwoPhaseIndices::numPhases
static constexpr int numPhases
The number of fluid phases.
Definition blackoiltwophaseindices.hh:101
Opm::BlackOilTwoPhaseIndices::contiBiofilmEqIdx
static constexpr int contiBiofilmEqIdx
Index of the continuity equation for the biofilm component.
Definition blackoiltwophaseindices.hh:207
Opm::BlackOilTwoPhaseIndices::contiEnergyEqIdx
static constexpr int contiEnergyEqIdx
Index of the continuity equation for energy.
Definition blackoiltwophaseindices.hh:224
Opm::BlackOilTwoPhaseIndices::contiPolymerEqIdx
static constexpr int contiPolymerEqIdx
Index of the continuity equation for the first polymer component.
Definition blackoiltwophaseindices.hh:195
Opm::BlackOilTwoPhaseIndices::numBrine
static constexpr int numBrine
Number of salt equations to be considered.
Definition blackoiltwophaseindices.hh:92
Opm::BlackOilTwoPhaseIndices::foamConcentrationIdx
static constexpr int foamConcentrationIdx
Index of the primary variable for the foam.
Definition blackoiltwophaseindices.hh:167
Opm::BlackOilTwoPhaseIndices::enableEnergy
static constexpr bool enableEnergy
Shall energy be conserved?
Definition blackoiltwophaseindices.hh:68
Opm::BlackOilTwoPhaseIndices::oilEnabled
static constexpr bool oilEnabled
Is phase enabled or not.
Definition blackoiltwophaseindices.hh:54
Opm::BlackOilTwoPhaseIndices::oxygenConcentrationIdx
static constexpr int oxygenConcentrationIdx
MICP only available for one phase indices.
Definition blackoiltwophaseindices.hh:162
Opm::BlackOilTwoPhaseIndices::numSolvents
static constexpr int numSolvents
Number of solvent components to be considered.
Definition blackoiltwophaseindices.hh:77
Opm::BlackOilTwoPhaseIndices::contiSolventEqIdx
static constexpr int contiSolventEqIdx
Index of the continuity equation for the first solvent component.
Definition blackoiltwophaseindices.hh:187
Opm::BlackOilTwoPhaseIndices::contiMicrobialEqIdx
static constexpr int contiMicrobialEqIdx
Index of the continuity equation for the first microbial component.
Definition blackoiltwophaseindices.hh:203
Opm::BlackOilTwoPhaseIndices::numEq
static constexpr int numEq
The number of equations.
Definition blackoiltwophaseindices.hh:104
Opm::BlackOilTwoPhaseIndices::contiBrineEqIdx
static constexpr int contiBrineEqIdx
Index of the continuity equation for the salt component.
Definition blackoiltwophaseindices.hh:220
Opm::BlackOilTwoPhaseIndices::saltConcentrationIdx
static constexpr int saltConcentrationIdx
Index of the primary variable for the salt.
Definition blackoiltwophaseindices.hh:171
Opm::BlackOilTwoPhaseIndices::polymerConcentrationIdx
static constexpr int polymerConcentrationIdx
Index of the primary variable for the first polymer.
Definition blackoiltwophaseindices.hh:146
Opm::BlackOilTwoPhaseIndices::enableMICP
static constexpr bool enableMICP
MICP only available for one phase indices.
Definition blackoiltwophaseindices.hh:71
Opm::BlackOilTwoPhaseIndices::numExtbos
static constexpr int numExtbos
Number of components to be considered for extbo.
Definition blackoiltwophaseindices.hh:80
Opm::BlackOilTwoPhaseIndices::numBioComp
static constexpr int numBioComp
Number of biofilm equations to be considered.
Definition blackoiltwophaseindices.hh:95
Opm::BlackOilTwoPhaseIndices::polymerMoleWeightIdx
static constexpr int polymerMoleWeightIdx
Index of the primary variable for the second polymer primary variable (molecular weight).
Definition blackoiltwophaseindices.hh:150
Opm::BlackOilTwoPhaseIndices::numPolymers
static constexpr int numPolymers
Number of polymer components to be considered.
Definition blackoiltwophaseindices.hh:83
Opm::BlackOilTwoPhaseIndices::contiZfracEqIdx
static constexpr int contiZfracEqIdx
Index of the continuity equation for the first extbo component.
Definition blackoiltwophaseindices.hh:191
Opm::BlackOilTwoPhaseIndices::contiPolymerMWEqIdx
static constexpr int contiPolymerMWEqIdx
Index of the continuity equation for the second polymer component (molecular weight).
Definition blackoiltwophaseindices.hh:199
Opm::BlackOilTwoPhaseIndices::conti0EqIdx
static constexpr int conti0EqIdx
Index of the continuity equation of the first phase.
Definition blackoiltwophaseindices.hh:183
Opm::BlackOilTwoPhaseIndices::numBioInWat
static constexpr int numBioInWat
Number of biocomponents in the water phase.
Definition blackoiltwophaseindices.hh:98
Opm::BlackOilTwoPhaseIndices::contiFoamEqIdx
static constexpr int contiFoamEqIdx
Index of the continuity equation for the foam component.
Definition blackoiltwophaseindices.hh:216
Opm::BlackOilTwoPhaseIndices::pressureSwitchIdx
static constexpr int pressureSwitchIdx
Index of the switching variable which determines the pressure.
Definition blackoiltwophaseindices.hh:127
Opm::BlackOilTwoPhaseIndices::biofilmVolumeFractionIdx
static constexpr int biofilmVolumeFractionIdx
Index of the primary variable for the biofilm component.
Definition blackoiltwophaseindices.hh:158
Opm::BlackOilTwoPhaseIndices::numFoam
static constexpr int numFoam
Number of foam equations to be considered.
Definition blackoiltwophaseindices.hh:89
Opm::BlackOilTwoPhaseIndices::enableExtbo
static constexpr bool enableExtbo
Is extbo invoked?
Definition blackoiltwophaseindices.hh:62
Opm::BlackOilTwoPhaseIndices::microbialConcentrationIdx
static constexpr int microbialConcentrationIdx
Index of the primary variable for the first microbial component.
Definition blackoiltwophaseindices.hh:154
Opm::BlackOilTwoPhaseIndices::zFractionIdx
static constexpr int zFractionIdx
Index of the primary variable for the first extbo component.
Definition blackoiltwophaseindices.hh:142
Opm::BlackOilTwoPhaseIndices::enablePolymer
static constexpr bool enablePolymer
Are polymers involved?
Definition blackoiltwophaseindices.hh:65
Opm::BlackOilTwoPhaseIndices::waterSwitchIdx
static constexpr int waterSwitchIdx
Index of the switching variable which determines the composistion of the water phase.
Definition blackoiltwophaseindices.hh:119
Opm::BlackOilTwoPhaseIndices::compositionSwitchIdx
static constexpr int compositionSwitchIdx
Index of the switching variable which determines the composition of the hydrocarbon phases.
Definition blackoiltwophaseindices.hh:135