From de792c72c7f84fa47f463c97b609e8612fa6305b Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 13 Mar 2014 16:33:32 +0100 Subject: [PATCH] initStateFromDeck(): do not accept potentially contradicting ways to set the initial condition i.e. PRESSURE and EQUIL are now considered mutually exclusive... --- opm/core/simulator/initState_impl.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opm/core/simulator/initState_impl.hpp b/opm/core/simulator/initState_impl.hpp index 18372573..89ff8923 100644 --- a/opm/core/simulator/initState_impl.hpp +++ b/opm/core/simulator/initState_impl.hpp @@ -488,6 +488,11 @@ namespace Opm "found " << pu.num_phases << " phases in deck."); } state.init(grid, num_phases); + if (newParserDeck->hasKeyword("EQUIL") && newParserDeck->hasKeyword("PRESSURE")) { + OPM_THROW(std::runtime_error, "initStateFromDeck(): The deck must either specify the initial " + "condition using the PRESSURE _or_ the EQUIL keyword (currently it has both)"); + } + if (newParserDeck->hasKeyword("EQUIL")) { if (num_phases != 2) { OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only two-phase scenarios."); @@ -584,6 +589,10 @@ namespace Opm OPM_THROW(std::runtime_error, "initStateFromDeck(): user specified property object with " << num_phases << " phases, " "found " << pu.num_phases << " phases in deck."); } + if (deck.hasField("EQUIL") && deck.hasField("PRESSURE")) { + OPM_THROW(std::runtime_error, "initStateFromDeck(): The deck must either specify the initial " + "condition using the PRESSURE _or_ the EQUIL keyword (currently it has both)"); + } state.init(grid, num_phases); if (deck.hasField("EQUIL")) { if (num_phases != 2) {