From 249983c52a8a8c5cdbfff4aee04b6c0dfee2515d Mon Sep 17 00:00:00 2001 From: Paul Egberts Date: Thu, 11 Mar 2021 16:06:52 +0100 Subject: [PATCH] fix to avoid reading gaswater parameters if oil is present --- .../fluidmatrixinteractions/EclEpsConfig.hpp | 8 +++++--- .../EclMaterialLawManager.hpp | 16 +++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/opm/material/fluidmatrixinteractions/EclEpsConfig.hpp b/opm/material/fluidmatrixinteractions/EclEpsConfig.hpp index 54f96d3cc..31a1037c7 100644 --- a/opm/material/fluidmatrixinteractions/EclEpsConfig.hpp +++ b/opm/material/fluidmatrixinteractions/EclEpsConfig.hpp @@ -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 { diff --git a/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp b/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp index 66753571e..a716b08ca 100644 --- a/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp +++ b/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp @@ -367,7 +367,7 @@ public: EclOilWaterSystem); } - if (hasGas && hasWater) { + if (hasGas && hasWater && !hasOil) { auto gasWaterDrainParams = std::make_shared(); 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(); 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(); @@ -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 >();