@@ -57,6 +57,8 @@ template<class TypeTag, class MyTypeTag>
5757struct TemperatureMin { using type = UndefinedProperty; };
5858template <class TypeTag , class MyTypeTag >
5959struct MaximumWaterSaturation { using type = UndefinedProperty; };
60+ template <class TypeTag , class MyTypeTag >
61+ struct WaterOnlyThreshold { using type = UndefinedProperty; };
6062template <class TypeTag >
6163struct DpMaxRel <TypeTag, TTag::NewtonMethod>
6264{
@@ -101,6 +103,12 @@ struct MaximumWaterSaturation<TypeTag, TTag::NewtonMethod>
101103 using type = GetPropType<TypeTag, Scalar>;
102104 static constexpr type value = 1.0 ;
103105};
106+ template <class TypeTag >
107+ struct WaterOnlyThreshold <TypeTag, TTag::NewtonMethod>
108+ {
109+ using type = GetPropType<TypeTag, Scalar>;
110+ static constexpr type value = 1.0 ;
111+ };
104112} // namespace Opm::Properties
105113
106114namespace Opm {
@@ -139,6 +147,7 @@ public:
139147 tempMax_ = EWOMS_GET_PARAM (TypeTag, Scalar, TemperatureMax);
140148 tempMin_ = EWOMS_GET_PARAM (TypeTag, Scalar, TemperatureMin);
141149 waterSaturationMax_ = EWOMS_GET_PARAM (TypeTag, Scalar, MaximumWaterSaturation);
150+ waterOnlyThreshold_ = EWOMS_GET_PARAM (TypeTag, Scalar, WaterOnlyThreshold);
142151 }
143152
144153 /* !
@@ -168,6 +177,7 @@ public:
168177 EWOMS_REGISTER_PARAM (TypeTag, Scalar, TemperatureMax, " Maximum absolute temperature" );
169178 EWOMS_REGISTER_PARAM (TypeTag, Scalar, TemperatureMin, " Minimum absolute temperature" );
170179 EWOMS_REGISTER_PARAM (TypeTag, Scalar, MaximumWaterSaturation, " Maximum water saturation" );
180+ EWOMS_REGISTER_PARAM (TypeTag, Scalar, WaterOnlyThreshold, " Cells with water saturation above or equal is considered one-phase water only" );
171181 }
172182
173183 /* !
@@ -458,9 +468,9 @@ protected:
458468 // use a threshold value after a switch to make it harder to switch back
459469 // immediately.
460470 if (wasSwitched_[globalDofIdx])
461- wasSwitched_[globalDofIdx] = nextValue.adaptPrimaryVariables (this ->problem (), globalDofIdx, waterSaturationMax_, priVarOscilationThreshold_);
471+ wasSwitched_[globalDofIdx] = nextValue.adaptPrimaryVariables (this ->problem (), globalDofIdx, waterSaturationMax_, waterOnlyThreshold_, priVarOscilationThreshold_);
462472 else
463- wasSwitched_[globalDofIdx] = nextValue.adaptPrimaryVariables (this ->problem (), globalDofIdx, waterSaturationMax_);
473+ wasSwitched_[globalDofIdx] = nextValue.adaptPrimaryVariables (this ->problem (), globalDofIdx, waterSaturationMax_, waterOnlyThreshold_ );
464474
465475 if (wasSwitched_[globalDofIdx])
466476 ++ numPriVarsSwitched_;
@@ -476,6 +486,8 @@ private:
476486
477487 Scalar priVarOscilationThreshold_;
478488 Scalar waterSaturationMax_;
489+ Scalar waterOnlyThreshold_;
490+
479491 Scalar dpMaxRel_;
480492 Scalar dsMax_;
481493 bool projectSaturations_;
0 commit comments