adapt to rename of waterSaturationIdx -> waterSwitchIdx

This commit is contained in:
Tor Harald Sandve
2022-11-25 09:30:05 +01:00
parent 2d70d08fdc
commit de09a3eb3c
8 changed files with 24 additions and 24 deletions

View File

@@ -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_ ...
}

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -79,7 +79,7 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
// 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_<FluidSystem, FluidState, Scalar>(fluidState, pvtRegionIdx_);
(*this)[waterSaturationIdx] = rvw;
(*this)[waterSwitchIdx] = rvw;
break;
}
case W_disabled:
@@ -443,7 +443,7 @@ public:
//case Rsw:
//{
//const auto& Rsw = BlackOil::getRsw_<FluidSystem, FluidState, Scalar>(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<Scalar, numPhases> 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)

View File

@@ -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;