Merge pull request #407 from akva2/less_deck_usage

changed: lessen deck usage in pvt setup
This commit is contained in:
Bård Skaflestad 2020-02-26 09:48:45 -06:00 committed by GitHub
commit cecce4ddd2
3 changed files with 20 additions and 13 deletions

View File

@ -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())

View File

@ -32,6 +32,11 @@
#include "LiveOilPvt.hpp"
#include "OilPvtThermal.hpp"
#if HAVE_ECL_INPUT
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#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));

View File

@ -31,6 +31,11 @@
#include "ConstantCompressibilityBrinePvt.hpp"
#include "WaterPvtThermal.hpp"
#if HAVE_ECL_INPUT
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#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));