get rid of deck usage setting up three phase options

This commit is contained in:
Arne Morten Kvarving 2020-03-09 10:10:32 +01:00
parent e0a43d7973
commit 8d07bef17c

View File

@ -129,7 +129,7 @@ public:
readGlobalEpsOptions_(deck, eclState); readGlobalEpsOptions_(deck, eclState);
readGlobalHysteresisOptions_(eclState); readGlobalHysteresisOptions_(eclState);
readGlobalThreePhaseOptions_(deck); readGlobalThreePhaseOptions_(eclState.runspec());
// read the end point scaling configuration. this needs to be done only once per // read the end point scaling configuration. this needs to be done only once per
// deck. // deck.
@ -687,11 +687,11 @@ private:
hysteresisConfig_->initFromState(state.runspec()); hysteresisConfig_->initFromState(state.runspec());
} }
void readGlobalThreePhaseOptions_(const Opm::Deck& deck) void readGlobalThreePhaseOptions_(const Opm::Runspec& runspec)
{ {
bool gasEnabled = deck.hasKeyword("GAS"); bool gasEnabled = runspec.phases().active(Phase::GAS);
bool oilEnabled = deck.hasKeyword("OIL"); bool oilEnabled = runspec.phases().active(Phase::OIL);
bool waterEnabled = deck.hasKeyword("WATER"); bool waterEnabled = runspec.phases().active(Phase::WATER);
int numEnabled = int numEnabled =
(gasEnabled?1:0) (gasEnabled?1:0)
@ -715,9 +715,9 @@ private:
assert(numEnabled == 3); assert(numEnabled == 3);
threePhaseApproach_ = EclMultiplexerApproach::EclDefaultApproach; threePhaseApproach_ = EclMultiplexerApproach::EclDefaultApproach;
if (deck.hasKeyword("STONE") || deck.hasKeyword("STONE2")) if (runspec.stoneType() == Runspec::StoneType::STONE2)
threePhaseApproach_ = EclMultiplexerApproach::EclStone2Approach; threePhaseApproach_ = EclMultiplexerApproach::EclStone2Approach;
else if (deck.hasKeyword("STONE1")) else if (runspec.stoneType() == Runspec::StoneType::STONE1)
threePhaseApproach_ = EclMultiplexerApproach::EclStone1Approach; threePhaseApproach_ = EclMultiplexerApproach::EclStone1Approach;
} }
} }