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

View File

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