From c910a5135964468cdf16d3c57aba639625de0ef1 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Sun, 17 Mar 2019 21:03:47 +0100 Subject: [PATCH] Add optional code for well testing --- CMakeLists.txt | 5 +++++ .../eclipse/EclipseState/Schedule/Schedule.hpp | 3 +++ .../eclipse/EclipseState/Schedule/Schedule.cpp | 12 +++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a082cc05a..49c944bf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,11 @@ set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR}) option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON) option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON) option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON) +option(ENABLE_WELL_TEST "Enable testing of well code when building Schedule object" OFF) + +if (ENABLE_WELL_TEST) + add_definitions(-DWELL_TEST) +endif() # Output implies input if(ENABLE_ECL_OUTPUT) diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp index 53f557b22..1bee0e1b6 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp @@ -257,6 +257,9 @@ namespace Opm static double convertInjectionRateToSI(double rawRate, Phase wellPhase, const Opm::UnitSystem &unitSystem); static bool convertEclipseStringToBool(const std::string& eclipseString); +#ifdef CHECK_WELLS + bool checkWells(const ParseContext& parseContext, ErrorGuard& errors) const; +#endif }; } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index e71f9ffc7..d89fdf097 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -104,6 +104,11 @@ namespace Opm { if (Section::hasSCHEDULE(deck)) iterateScheduleSection( parseContext, errors, SCHEDULESection( deck ), grid, eclipseProperties ); + +#ifdef CHECK_WELLS + checkWells(parseContext, errors); +#endif + } @@ -2214,5 +2219,10 @@ namespace Opm { } -} +#ifdef CHECK_WELLS + bool checkWells(const ParseContext& parseContext, ErrorGuard& errors) const { + return true; + } +#endif +}