From b76a809e043fe80799501e640fc918169fbb9a05 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 26 Feb 2020 12:20:45 +0100 Subject: [PATCH] changed: lessen deck usage in pvt setup --- .../blackoilpvt/GasPvtMultiplexer.hpp | 3 +-- .../blackoilpvt/OilPvtMultiplexer.hpp | 16 ++++++++++------ .../blackoilpvt/WaterPvtMultiplexer.hpp | 14 +++++++++----- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp index d2b639817..cbb847999 100644 --- a/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp @@ -128,8 +128,7 @@ public: */ void initFromDeck(const Deck& deck, const EclipseState& eclState) { - const auto& phases = eclState.runspec().phases(); - if (!phases.active(Phase::GAS)) + if (!eclState.runspec().phases().active(Phase::GAS)) return; if (enableThermal && eclState.getSimulationConfig().isThermal()) diff --git a/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp index f700f8fd5..9c71617c4 100644 --- a/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp @@ -32,6 +32,11 @@ #include "LiveOilPvt.hpp" #include "OilPvtThermal.hpp" +#if HAVE_ECL_INPUT +#include +#include +#endif + namespace Opm { #define OPM_OIL_PVT_MULTIPLEXER_CALL(codeToCall) \ switch (approach_) { \ @@ -134,17 +139,16 @@ public: */ void initFromDeck(const Deck& deck, const EclipseState& eclState) { - bool enableOil = deck.hasKeyword("OIL"); - if (!enableOil) + if (!eclState.runspec().phases().active(Phase::OIL)) return; - if (enableThermal && (deck.hasKeyword("THERMAL") || deck.hasKeyword("TEMP"))) + if (enableThermal && eclState.getSimulationConfig().isThermal()) setApproach(ThermalOilPvt); - else if (deck.hasKeyword("PVCDO")) + else if (!eclState.getTableManager().getPvcdoTable().empty()) setApproach(ConstantCompressibilityOilPvt); - else if (deck.hasKeyword("PVDO")) + else if (eclState.getTableManager().hasTables("PVDO")) setApproach(DeadOilPvt); - else if (deck.hasKeyword("PVTO")) + else if (!eclState.getTableManager().getPvtoTables().empty()) setApproach(LiveOilPvt); OPM_OIL_PVT_MULTIPLEXER_CALL(pvtImpl.initFromDeck(deck, eclState)); diff --git a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp index 97680df53..fe247a636 100644 --- a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp @@ -31,6 +31,11 @@ #include "ConstantCompressibilityBrinePvt.hpp" #include "WaterPvtThermal.hpp" +#if HAVE_ECL_INPUT +#include +#include +#endif + #define OPM_WATER_PVT_MULTIPLEXER_CALL(codeToCall) \ switch (approach_) { \ case ConstantCompressibilityWaterPvt: { \ @@ -114,15 +119,14 @@ public: */ void initFromDeck(const Deck& deck, const EclipseState& eclState) { - bool enableWater = deck.hasKeyword("WATER"); - if (!enableWater) + if (!eclState.runspec().phases().active(Phase::WATER)) return; - if (enableThermal && (deck.hasKeyword("THERMAL") || deck.hasKeyword("TEMP"))) + if (enableThermal && eclState.getSimulationConfig().isThermal()) setApproach(ThermalWaterPvt); - else if (deck.hasKeyword("PVTW")) + else if (!eclState.getTableManager().getPvtwTable().empty()) setApproach(ConstantCompressibilityWaterPvt); - else if (enableBrine && deck.hasKeyword("PVTWSALT")) + else if (enableBrine && !eclState.getTableManager().getPvtwSaltTables().empty()) setApproach(ConstantCompressibilityBrinePvt); OPM_WATER_PVT_MULTIPLEXER_CALL(pvtImpl.initFromDeck(deck, eclState));