Merge pull request #407 from akva2/less_deck_usage
changed: lessen deck usage in pvt setup
This commit is contained in:
commit
cecce4ddd2
@ -128,8 +128,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
const auto& phases = eclState.runspec().phases();
|
if (!eclState.runspec().phases().active(Phase::GAS))
|
||||||
if (!phases.active(Phase::GAS))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (enableThermal && eclState.getSimulationConfig().isThermal())
|
if (enableThermal && eclState.getSimulationConfig().isThermal())
|
||||||
|
@ -32,6 +32,11 @@
|
|||||||
#include "LiveOilPvt.hpp"
|
#include "LiveOilPvt.hpp"
|
||||||
#include "OilPvtThermal.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 {
|
namespace Opm {
|
||||||
#define OPM_OIL_PVT_MULTIPLEXER_CALL(codeToCall) \
|
#define OPM_OIL_PVT_MULTIPLEXER_CALL(codeToCall) \
|
||||||
switch (approach_) { \
|
switch (approach_) { \
|
||||||
@ -134,17 +139,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
bool enableOil = deck.hasKeyword("OIL");
|
if (!eclState.runspec().phases().active(Phase::OIL))
|
||||||
if (!enableOil)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (enableThermal && (deck.hasKeyword("THERMAL") || deck.hasKeyword("TEMP")))
|
if (enableThermal && eclState.getSimulationConfig().isThermal())
|
||||||
setApproach(ThermalOilPvt);
|
setApproach(ThermalOilPvt);
|
||||||
else if (deck.hasKeyword("PVCDO"))
|
else if (!eclState.getTableManager().getPvcdoTable().empty())
|
||||||
setApproach(ConstantCompressibilityOilPvt);
|
setApproach(ConstantCompressibilityOilPvt);
|
||||||
else if (deck.hasKeyword("PVDO"))
|
else if (eclState.getTableManager().hasTables("PVDO"))
|
||||||
setApproach(DeadOilPvt);
|
setApproach(DeadOilPvt);
|
||||||
else if (deck.hasKeyword("PVTO"))
|
else if (!eclState.getTableManager().getPvtoTables().empty())
|
||||||
setApproach(LiveOilPvt);
|
setApproach(LiveOilPvt);
|
||||||
|
|
||||||
OPM_OIL_PVT_MULTIPLEXER_CALL(pvtImpl.initFromDeck(deck, eclState));
|
OPM_OIL_PVT_MULTIPLEXER_CALL(pvtImpl.initFromDeck(deck, eclState));
|
||||||
|
@ -31,6 +31,11 @@
|
|||||||
#include "ConstantCompressibilityBrinePvt.hpp"
|
#include "ConstantCompressibilityBrinePvt.hpp"
|
||||||
#include "WaterPvtThermal.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) \
|
#define OPM_WATER_PVT_MULTIPLEXER_CALL(codeToCall) \
|
||||||
switch (approach_) { \
|
switch (approach_) { \
|
||||||
case ConstantCompressibilityWaterPvt: { \
|
case ConstantCompressibilityWaterPvt: { \
|
||||||
@ -114,15 +119,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
bool enableWater = deck.hasKeyword("WATER");
|
if (!eclState.runspec().phases().active(Phase::WATER))
|
||||||
if (!enableWater)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (enableThermal && (deck.hasKeyword("THERMAL") || deck.hasKeyword("TEMP")))
|
if (enableThermal && eclState.getSimulationConfig().isThermal())
|
||||||
setApproach(ThermalWaterPvt);
|
setApproach(ThermalWaterPvt);
|
||||||
else if (deck.hasKeyword("PVTW"))
|
else if (!eclState.getTableManager().getPvtwTable().empty())
|
||||||
setApproach(ConstantCompressibilityWaterPvt);
|
setApproach(ConstantCompressibilityWaterPvt);
|
||||||
else if (enableBrine && deck.hasKeyword("PVTWSALT"))
|
else if (enableBrine && !eclState.getTableManager().getPvtwSaltTables().empty())
|
||||||
setApproach(ConstantCompressibilityBrinePvt);
|
setApproach(ConstantCompressibilityBrinePvt);
|
||||||
|
|
||||||
OPM_WATER_PVT_MULTIPLEXER_CALL(pvtImpl.initFromDeck(deck, eclState));
|
OPM_WATER_PVT_MULTIPLEXER_CALL(pvtImpl.initFromDeck(deck, eclState));
|
||||||
|
Loading…
Reference in New Issue
Block a user