diff --git a/opm/models/blackoil/blackoilextbomodules.hh b/opm/models/blackoil/blackoilextbomodules.hh index 0a975fddc..093f8a600 100644 --- a/opm/models/blackoil/blackoilextbomodules.hh +++ b/opm/models/blackoil/blackoilextbomodules.hh @@ -621,7 +621,7 @@ public: if (priVars.primaryVarsMeaningWater() == PrimaryVariables::Sw) { static const Scalar thresholdWaterFilledCell = 1.0 - 1e-6; - Scalar sw = priVars.makeEvaluation(Indices::waterSaturationIdx, timeIdx).value(); + Scalar sw = priVars.makeEvaluation(Indices::waterSwitchIdx, timeIdx).value(); if (sw >= thresholdWaterFilledCell) rs_ = 0.0; // water only, zero rs_ ... } diff --git a/opm/models/blackoil/blackoilindices.hh b/opm/models/blackoil/blackoilindices.hh index d31a6ffa1..e5616b12b 100644 --- a/opm/models/blackoil/blackoilindices.hh +++ b/opm/models/blackoil/blackoilindices.hh @@ -102,7 +102,7 @@ struct BlackOilIndices * Depending on the phases present, this variable is either interpreted as * water saturation or vapporized water in gas phase */ - static const int waterSaturationIdx = PVOffset + 0; + static const int waterSwitchIdx = PVOffset + 0; /*! * \brief Index of the switching variable which determines the pressure diff --git a/opm/models/blackoil/blackoilintensivequantities.hh b/opm/models/blackoil/blackoilintensivequantities.hh index 966e4f689..52c5220d4 100644 --- a/opm/models/blackoil/blackoilintensivequantities.hh +++ b/opm/models/blackoil/blackoilintensivequantities.hh @@ -185,7 +185,7 @@ public: Evaluation Sw = 0.0; if constexpr (waterEnabled) { if (priVars.primaryVarsMeaningWater() == PrimaryVariables::Sw) { - Sw = priVars.makeEvaluation(Indices::waterSaturationIdx, timeIdx); + Sw = priVars.makeEvaluation(Indices::waterSwitchIdx, timeIdx); } else if (priVars.primaryVarsMeaningWater() == PrimaryVariables::W_disabled){ // water is enabled but is not a primary variable i.e. one phase case Sw = 1.0; @@ -298,7 +298,7 @@ public: } if (priVars.primaryVarsMeaningWater() == PrimaryVariables::Rvw) { - const auto& Rvw = priVars.makeEvaluation(Indices::waterSaturationIdx, timeIdx); + const auto& Rvw = priVars.makeEvaluation(Indices::waterSwitchIdx, timeIdx); fluidState_.setRvw(Rvw); } else { if (FluidSystem::enableVaporizedWater()) { // Add Sg > 0? i.e. if only water set rv = 0) diff --git a/opm/models/blackoil/blackoilmodel.hh b/opm/models/blackoil/blackoilmodel.hh index 3cd34394b..81d94cbab 100644 --- a/opm/models/blackoil/blackoilmodel.hh +++ b/opm/models/blackoil/blackoilmodel.hh @@ -342,7 +342,7 @@ public: { std::ostringstream oss; - if (pvIdx == Indices::waterSaturationIdx) + if (pvIdx == Indices::waterSwitchIdx) oss << "saturation_" << FluidSystem::phaseName(FluidSystem::waterPhaseIdx); else if (pvIdx == Indices::pressureSwitchIdx) oss << "pressure_switching"; @@ -396,7 +396,7 @@ public: return 1.0; // saturations are always in the range [0, 1]! - if (int(Indices::waterSaturationIdx) == int(pvIdx)) + if (int(Indices::waterSwitchIdx) == int(pvIdx)) return 1.0; // oil pressures usually are in the range of 100 to 500 bars for typical oil diff --git a/opm/models/blackoil/blackoilnewtonmethod.hh b/opm/models/blackoil/blackoilnewtonmethod.hh index fcdcdba06..e933d270b 100644 --- a/opm/models/blackoil/blackoilnewtonmethod.hh +++ b/opm/models/blackoil/blackoilnewtonmethod.hh @@ -263,7 +263,7 @@ protected: if (currentValue.primaryVarsMeaningWater() == PrimaryVariables::Sw) { - deltaSw = update[Indices::waterSaturationIdx]; + deltaSw = update[Indices::waterSwitchIdx]; deltaSo -= deltaSw; } if (currentValue.primaryVarsMeaningGas() == PrimaryVariables::Sg) @@ -302,13 +302,13 @@ protected: delta = signum(delta)*dpMaxRel_*currentValue[pvIdx]; } // water saturation delta - else if (pvIdx == Indices::waterSaturationIdx) + else if (pvIdx == Indices::waterSwitchIdx) if (currentValue.primaryVarsMeaningWater() == PrimaryVariables::Sw) delta *= satAlpha; else { //Ensure Rvw factor does not become negative - if (delta > currentValue[ Indices::waterSaturationIdx]) - delta = currentValue[ Indices::waterSaturationIdx]; + if (delta > currentValue[ Indices::waterSwitchIdx]) + delta = currentValue[ Indices::waterSwitchIdx]; } else if (pvIdx == Indices::compositionSwitchIdx) { // the switching primary variable for composition is tricky because the diff --git a/opm/models/blackoil/blackoilonephaseindices.hh b/opm/models/blackoil/blackoilonephaseindices.hh index 2d6ab251b..ecdc56a2d 100644 --- a/opm/models/blackoil/blackoilonephaseindices.hh +++ b/opm/models/blackoil/blackoilonephaseindices.hh @@ -92,7 +92,7 @@ struct BlackOilOnePhaseIndices ////////////////////////////// //! The index of the water saturation. For two-phase oil gas models this is disabled. - static const int waterSaturationIdx = -10000; + static const int waterSwitchIdx = -10000; //! Index of the oil pressure in a vector of primary variables static const int pressureSwitchIdx = PVOffset + 0; diff --git a/opm/models/blackoil/blackoilprimaryvariables.hh b/opm/models/blackoil/blackoilprimaryvariables.hh index a15e798ca..608b6a870 100644 --- a/opm/models/blackoil/blackoilprimaryvariables.hh +++ b/opm/models/blackoil/blackoilprimaryvariables.hh @@ -79,7 +79,7 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables enum { numEq = getPropValue() }; // primary variable indices - enum { waterSaturationIdx = Indices::waterSaturationIdx }; + enum { waterSwitchIdx = Indices::waterSwitchIdx }; enum { pressureSwitchIdx = Indices::pressureSwitchIdx }; enum { compositionSwitchIdx = Indices::compositionSwitchIdx }; enum { saltConcentrationIdx = Indices::saltConcentrationIdx }; @@ -406,13 +406,13 @@ public: switch(primaryVarsMeaningWater()) { case Sw: { - (*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx)); + (*this)[waterSwitchIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx)); break; } case Rvw: { const auto& rvw = BlackOil::getRvw_(fluidState, pvtRegionIdx_); - (*this)[waterSaturationIdx] = rvw; + (*this)[waterSwitchIdx] = rvw; break; } case W_disabled: @@ -443,7 +443,7 @@ public: //case Rsw: //{ //const auto& Rsw = BlackOil::getRsw_(fluidState, pvtRegionIdx_); - //(*this)[waterSaturationIdx] = Rsw; + //(*this)[waterSwitchIdx] = Rsw; // break; //} case G_disabled: @@ -486,7 +486,7 @@ public: Scalar saltConcentration = 0.0; const Scalar& T = asImp_().temperature_(); if (primaryVarsMeaningWater() == Sw) - sw = (*this)[waterSaturationIdx]; + sw = (*this)[waterSwitchIdx]; if (primaryVarsMeaningGas() == Sg) sg = (*this)[compositionSwitchIdx]; @@ -518,7 +518,7 @@ public: // make sure water saturations does not exceed 1.0 if constexpr (waterEnabled) - (*this)[Indices::waterSaturationIdx] = 1.0; + (*this)[Indices::waterSwitchIdx] = 1.0; // the hydrocarbon gas saturation is set to 0.0 if constexpr (compositionSwitchEnabled) (*this)[Indices::compositionSwitchIdx] = 0.0; @@ -554,7 +554,7 @@ public: p, saltConcentration); setPrimaryVarsMeaningWater(Rvw); - (*this)[Indices::waterSaturationIdx] = rvwSat; //primary variable becomes Rvw + (*this)[Indices::waterSwitchIdx] = rvwSat; //primary variable becomes Rvw changed = true; break; } @@ -570,7 +570,7 @@ public: // pw, // saltConcentration); // setPrimaryVarsMeaningWater(Rsw); - // (*this)[Indices::waterSaturationIdx] = rswSat; //primary variable becomes Rsw + // (*this)[Indices::waterSwitchIdx] = rswSat; //primary variable becomes Rsw // changed = true; // break; //} @@ -578,7 +578,7 @@ public: } case Rvw: { - const Scalar& rvw = (*this)[waterSaturationIdx]; + const Scalar& rvw = (*this)[waterSwitchIdx]; Scalar p = (*this)[pressureSwitchIdx]; if(primaryVarsMeaningPressure() == Po) { std::array pC = { 0.0 }; @@ -594,7 +594,7 @@ public: if (rvw > rvwSat*(1.0 + eps)) { // water phase appears setPrimaryVarsMeaningWater(Sw); - (*this)[Indices::waterSaturationIdx] = 0.0; // water saturation + (*this)[Indices::waterSwitchIdx] = 0.0; // water saturation changed = true; } break; @@ -748,7 +748,7 @@ public: } Scalar sw = 0.0; if (primaryVarsMeaningWater() == Sw) - sw = (*this)[Indices::waterSaturationIdx]; + sw = (*this)[Indices::waterSwitchIdx]; Scalar sg = 0.0; if (primaryVarsMeaningGas() == Sg) sg = (*this)[Indices::compositionSwitchIdx]; @@ -768,7 +768,7 @@ public: ssol = ssol/st; assert(st>0.5); if (primaryVarsMeaningWater() == Sw) - (*this)[Indices::waterSaturationIdx] = sw; + (*this)[Indices::waterSwitchIdx] = sw; if (primaryVarsMeaningGas() == Sg) (*this)[Indices::compositionSwitchIdx] = sg; if constexpr (enableSolvent) diff --git a/opm/models/blackoil/blackoiltwophaseindices.hh b/opm/models/blackoil/blackoiltwophaseindices.hh index 4405161b6..1f1a513b4 100644 --- a/opm/models/blackoil/blackoiltwophaseindices.hh +++ b/opm/models/blackoil/blackoiltwophaseindices.hh @@ -92,7 +92,7 @@ struct BlackOilTwoPhaseIndices ////////////////////////////// //! The index of the water saturation. For two-phase oil gas models this is disabled. - static const int waterSaturationIdx = waterEnabled ? PVOffset + 0 : -10000; + static const int waterSwitchIdx = waterEnabled ? PVOffset + 0 : -10000; //! Index of the oil pressure in a vector of primary variables static const int pressureSwitchIdx = waterEnabled ? PVOffset + 1 : PVOffset + 0;