From b9509cdf78663a5d1a9e254540adefa07fc06050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 10 Oct 2019 16:08:04 +0200 Subject: [PATCH] Add or fix foam-related indices for one- and two-phase cases. --- .../blackoil/blackoilonephaseindices.hh | 21 ++++++++++++++----- .../blackoil/blackoiltwophaseindices.hh | 6 +++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/opm/models/blackoil/blackoilonephaseindices.hh b/opm/models/blackoil/blackoilonephaseindices.hh index d857f0d3d..5cc866507 100644 --- a/opm/models/blackoil/blackoilonephaseindices.hh +++ b/opm/models/blackoil/blackoilonephaseindices.hh @@ -26,7 +26,7 @@ * \copydoc Ewoms::BlackOilTwoPhaseIndices */ #ifndef EWOMS_BLACK_OIL_ONE_PHASE_INDICES_HH -#define EWOMS_BLACK_OIL_ONe_PHASE_INDICES_HH +#define EWOMS_BLACK_OIL_ONE_PHASE_INDICES_HH #include @@ -37,7 +37,7 @@ namespace Ewoms { * * \brief The primary variable and equation indices for the black-oil model. */ -template +template struct BlackOilOnePhaseIndices { //! Is phase enabled or not @@ -63,11 +63,14 @@ struct BlackOilOnePhaseIndices //! Number of energy equations to be considered static const int numEnergy = enableEnergy ? numEnergyV : 0; + //! Number of foam equations to be considered + static const int numFoam = enableFoam? 1 : 0; + //! The number of fluid phases static const int numPhases = 1; //! The number of equations - static const int numEq = numPhases + numSolvents + numPolymers + numEnergy; + static const int numEq = numPhases + numSolvents + numPolymers + numEnergy + numFoam; ////////////////////////////// // Primary variable indices @@ -99,9 +102,13 @@ struct BlackOilOnePhaseIndices static const int polymerMoleWeightIdx = numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000; + //! Index of the primary variable for the foam + static const int foamConcentrationIdx = + enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000; + //! Index of the primary variable for temperature static const int temperatureIdx = - enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers : - 1000; + enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam: - 1000; ////////////////////// // Equation indices @@ -142,9 +149,13 @@ struct BlackOilOnePhaseIndices static const int contiPolymerMWEqIdx = numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000; + //! Index of the continuity equation for the foam component + static const int contiFoamEqIdx = + enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000; + //! Index of the continuity equation for energy static const int contiEnergyEqIdx = - enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers : -1000; + enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000; }; } // namespace Ewoms diff --git a/opm/models/blackoil/blackoiltwophaseindices.hh b/opm/models/blackoil/blackoiltwophaseindices.hh index 129517a58..0346c6c88 100644 --- a/opm/models/blackoil/blackoiltwophaseindices.hh +++ b/opm/models/blackoil/blackoiltwophaseindices.hh @@ -104,7 +104,7 @@ struct BlackOilTwoPhaseIndices //! Index of the primary variable for the foam static const int foamConcentrationIdx = - enableFoam ? polymerMoleWeightIdx + 1 : -1000; + enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000; //! Index of the primary variable for temperature static const int temperatureIdx = @@ -167,9 +167,9 @@ struct BlackOilTwoPhaseIndices static const int contiPolymerMWEqIdx = numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000; - //! Index of the continuity equation for the foam component + //! Index of the continuity equation for the foam component static const int contiFoamEqIdx = - enableFoam ? contiPolymerMWEqIdx + 1 : -1000; + enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000; //! Index of the continuity equation for energy static const int contiEnergyEqIdx =