From 7bf635ef59f8089051ec3ac0ce9a7e49868d015e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 6 Feb 2019 17:08:26 +0100 Subject: [PATCH] Parse Context: Add Keys for Items 1-4 of WELLDIMS This commit introduces Parse Context keys that govern the parser's behaviour in the case of a simulation run using dynamic sizes that happen to exceed the maximum sizes declared in the RUNSPEC keyword WELLDIMS. The default action for these keys is DELAYED_EXIT1, which reflects the fact that it is impossible to create ECLIPSE-compatible restart files if the run exceeds those maximum sizes. --- opm/parser/eclipse/Parser/ParseContext.hpp | 15 +++++++++++++++ src/opm/parser/eclipse/Parser/ParseContext.cpp | 12 ++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/opm/parser/eclipse/Parser/ParseContext.hpp b/opm/parser/eclipse/Parser/ParseContext.hpp index dc1838c73..e403b3dd9 100644 --- a/opm/parser/eclipse/Parser/ParseContext.hpp +++ b/opm/parser/eclipse/Parser/ParseContext.hpp @@ -194,6 +194,21 @@ namespace Opm { */ const static std::string PARSE_MISSING_INCLUDE; + /// Dynamic number of wells exceeds maximum declared in + /// RUNSPEC keyword WELLDIMS (item 1). + const static std::string RUNSPEC_NUMWELLS_TOO_LARGE; + + /// Dynamic number of connections per well exceeds maximum + /// declared in RUNSPEC keyword WELLDIMS (item 2). + const static std::string RUNSPEC_CONNS_PER_WELL_TOO_LARGE; + + /// Dynamic number of groups exceeds maximum number declared in + /// RUNSPEC keyword WELLDIMS (item 3). + const static std::string RUNSPEC_NUMGROUPS_TOO_LARGE; + + /// Dynamic group size exceeds maximum number declared in + /// RUNSPEC keyword WELLDIMS (item 4). + const static std::string RUNSPEC_GROUPSIZE_TOO_LARGE; /* Should we allow keywords of length more than eight characters? If the diff --git a/src/opm/parser/eclipse/Parser/ParseContext.cpp b/src/opm/parser/eclipse/Parser/ParseContext.cpp index b788f0b08..a39f2ff11 100644 --- a/src/opm/parser/eclipse/Parser/ParseContext.cpp +++ b/src/opm/parser/eclipse/Parser/ParseContext.cpp @@ -79,6 +79,11 @@ namespace Opm { addKey(PARSE_MISSING_INCLUDE, InputError::EXIT1); addKey(PARSE_LONG_KEYWORD, InputError::WARN); + this->addKey(RUNSPEC_NUMWELLS_TOO_LARGE, InputError::DELAYED_EXIT1); + this->addKey(RUNSPEC_CONNS_PER_WELL_TOO_LARGE, InputError::DELAYED_EXIT1); + this->addKey(RUNSPEC_NUMGROUPS_TOO_LARGE, InputError::DELAYED_EXIT1); + this->addKey(RUNSPEC_GROUPSIZE_TOO_LARGE, InputError::DELAYED_EXIT1); + addKey(UNSUPPORTED_SCHEDULE_GEO_MODIFIER, InputError::THROW_EXCEPTION); addKey(UNSUPPORTED_COMPORD_TYPE, InputError::THROW_EXCEPTION); addKey(UNSUPPORTED_INITIAL_THPRES, InputError::THROW_EXCEPTION); @@ -301,6 +306,11 @@ namespace Opm { const std::string ParseContext::PARSE_MISSING_INCLUDE = "PARSE_MISSING_INCLUDE"; const std::string ParseContext::PARSE_LONG_KEYWORD = "PARSE_LONG_KEYWORD"; + const std::string ParseContext::RUNSPEC_NUMWELLS_TOO_LARGE = "RUNSPEC_NUMWELLS_TOO_LARGE"; + const std::string ParseContext::RUNSPEC_CONNS_PER_WELL_TOO_LARGE = "RUNSPEC_CONNS_PER_WELL_TOO_LARGE"; + const std::string ParseContext::RUNSPEC_NUMGROUPS_TOO_LARGE = "RUNSPEC_NUMGROUPS_TOO_LARGE"; + const std::string ParseContext::RUNSPEC_GROUPSIZE_TOO_LARGE = "RUNSPEC_GROUPSIZE_TOO_LARGE"; + const std::string ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER = "UNSUPPORTED_SCHEDULE_GEO_MODIFIER"; const std::string ParseContext::UNSUPPORTED_COMPORD_TYPE = "UNSUPPORTED_COMPORD_TYPE"; const std::string ParseContext::UNSUPPORTED_INITIAL_THPRES = "UNSUPPORTED_INITIAL_THPRES"; @@ -321,5 +331,3 @@ namespace Opm { const std::string ParseContext::SIMULATOR_KEYWORD_NOT_SUPPORTED = "SIMULATOR_KEYWORD_NOT_SUPPORTED"; const std::string ParseContext::SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED = "SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED"; } - -