Skip to content

Commit

Permalink
Merge pull request OPM#93 from bska/show-unscaled-if-eps-missing
Browse files Browse the repository at this point in the history
Don't Calculate Scaled Curves if EPS Data Unavailable
  • Loading branch information
atgeirr authored Apr 23, 2019
2 parents 37911f6 + 7edfbd6 commit e8b4d58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions opm/utility/ECLSaturationFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,8 @@ class Opm::ECLSaturationFunc::Impl
std::unique_ptr<Gas::SatFunction> gas_{nullptr};
std::unique_ptr<Water::SatFunction> wat_{nullptr};

bool haveEPSData_{false};

std::unique_ptr<EPSEvaluator> eps_{nullptr};

std::unique_ptr<const ECLUnits::UnitSystem> usys_output_{nullptr};
Expand Down Expand Up @@ -1616,10 +1618,9 @@ Opm::ECLSaturationFunc::Impl::init(const ECLGraph& G,
// Activate saturation function scaling if present in result set.
const auto& lh = init.keywordData<bool>(LOGIHEAD_KW);

const auto haveEPS = static_cast<bool>(
lh[LOGIHEAD_ENDPOINT_SCALING_INDEX]);
this->haveEPSData_ = lh[LOGIHEAD_ENDPOINT_SCALING_INDEX];

if (haveEPS) {
if (this->haveEPSData_) {
const auto use3PtScaling = static_cast<bool>(
lh[LOGIHEAD_ALT_ENDPOINT_SCALING_INDEX]);

Expand Down Expand Up @@ -2466,7 +2467,7 @@ max2PSatSum(const RawCurve& fi,

if (fi.subsys == RawCurve::SubSystem::OilGas) {
// Max 2p Saturation sum = 1 - SWL
if (enableHorizontalEPS(scaling)) {
if (this->haveEPSData_ && enableHorizontalEPS(scaling)) {
if (this->eps_ != nullptr) {
smin = this->eps_->scaledConnateWater(cell);
}
Expand All @@ -2486,7 +2487,7 @@ max2PSatSum(const RawCurve& fi,
}
else {
// Max 2p Saturation sum = 1 - SGL (almost always = 1)
if (enableHorizontalEPS(scaling)) {
if (this->haveEPSData_ && enableHorizontalEPS(scaling)) {
if (this->eps_ != nullptr) {
smin = this->eps_->scaledConnateGas(cell);
}
Expand Down

0 comments on commit e8b4d58

Please sign in to comment.