fix to avoid reading gaswater parameters if oil is present

This commit is contained in:
Paul Egberts 2021-03-11 16:06:52 +01:00
parent 809c1d3f1b
commit 249983c52a
2 changed files with 14 additions and 10 deletions

View File

@ -241,9 +241,7 @@ public:
this->enableKrwScaling_ = hasKR("W") || this->enableThreePointKrwScaling();
this->enablePcScaling_ = hasPC("W") || fp.has_double("SWATINIT");
}
else {
assert(twoPhaseSystemType == EclGasOilSystem);
else if (twoPhaseSystemType == EclGasOilSystem) {
this->setEnableThreePointKrwScaling(hasKR("ORG"));
this->setEnableThreePointKrnScaling(hasKR("GR"));
@ -251,6 +249,10 @@ public:
this->enableKrwScaling_ = hasKR("O") || this->enableThreePointKrwScaling();
this->enablePcScaling_ = hasPC("G");
}
else {
assert(twoPhaseSystemType == EclGasWaterSystem);
//TODO enable endpoint scaling for gaswater system
}
if (enablePcScaling_ && enableLeverettScaling_) {
throw std::runtime_error {

View File

@ -367,7 +367,7 @@ public:
EclOilWaterSystem);
}
if (hasGas && hasWater) {
if (hasGas && hasWater && !hasOil) {
auto gasWaterDrainParams = std::make_shared<GasWaterEpsTwoPhaseParams>();
gasWaterDrainParams->setConfig(gasWaterConfig);
gasWaterDrainParams->setUnscaledPoints(gasWaterUnscaledPointsVector_[satRegionIdx]);
@ -410,7 +410,7 @@ public:
EclGasOilSystem);
}
if (hasGas && hasWater) {
if (hasGas && hasWater && !hasOil) {
auto gasWaterImbParamsHyst = std::make_shared<GasWaterEpsTwoPhaseParams>();
gasWaterImbParamsHyst->setConfig(gasWaterConfig);
gasWaterImbParamsHyst->setUnscaledPoints(gasWaterUnscaledPointsVector_[imbRegionIdx]);
@ -430,7 +430,7 @@ public:
if (hasOil && hasWater)
oilWaterParams[elemIdx]->finalize();
if (hasGas && hasWater)
if (hasGas && hasWater && !hasOil)
gasWaterParams[elemIdx]->finalize();
}
@ -952,8 +952,9 @@ private:
const Opm::EclipseState& eclState,
unsigned satRegionIdx)
{
if (!hasGas || !hasWater)
// we don't read anything if either the gas or the water phase is not active
//if (!hasGas || !hasWater)
if (hasOil)
// we don't read anything if oil is present
return;
dest[satRegionIdx] = std::make_shared<GasWaterEffectiveTwoPhaseParams>();
@ -1029,8 +1030,9 @@ private:
const Opm::EclipseState& /* eclState */,
unsigned satRegionIdx)
{
if (!hasGas || !hasWater)
// we don't read anything if either the water or the oil phase is not active
//if (!hasGas || !hasWater)
if (hasOil)
// we don't read anything if oil phase is active
return;
dest[satRegionIdx] = std::make_shared<EclEpsScalingPoints<Scalar> >();