Avoid negative PCW for mixed-wet Pc curves

This commit is contained in:
Vegard Kippe 2023-10-18 12:57:38 +02:00
parent 2d33b520f1
commit d2b69158bd

View File

@ -178,8 +178,8 @@ applySwatinit(unsigned elemIdx,
Scalar pcowAtSw = pc[oilPhaseIdx] - pc[waterPhaseIdx]; Scalar pcowAtSw = pc[oilPhaseIdx] - pc[waterPhaseIdx];
constexpr const Scalar pcowAtSwThreshold = 1.0; //Pascal constexpr const Scalar pcowAtSwThreshold = 1.0; //Pascal
// avoid divison by very small number // avoid divison by very small number and avoid negative PCW at connate Sw
if (std::abs(pcowAtSw) > pcowAtSwThreshold) { if (pcowAtSw > pcowAtSwThreshold) {
// Scale max. capillary pressure to honor SWATINIT value // Scale max. capillary pressure to honor SWATINIT value
Scalar newMaxPcow = elemScaledEpsInfo.maxPcow * (pcow/pcowAtSw); Scalar newMaxPcow = elemScaledEpsInfo.maxPcow * (pcow/pcowAtSw);
@ -206,6 +206,8 @@ applySwatinit(unsigned elemIdx,
*oilWaterEclEpsConfig_, *oilWaterEclEpsConfig_,
EclTwoPhaseSystemType::OilWater); EclTwoPhaseSystemType::OilWater);
} }
// Find Sw from unscaled curve if PCW at connate Sw would be negative (i.e., do no respect SWATINIT in this case)
if (pcowAtSw < 0.0) newSwatInit = true;
} }
return {Sw, newSwatInit}; return {Sw, newSwatInit};