From 0f707b74980032c73a5fa189aaf99bcf08e74b09 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Wed, 29 Jan 2014 15:55:02 +0100 Subject: [PATCH] Keeping track of well OPEN|SHUT|STOP status from WCONxxxx keywords. --- .../EclipseState/Schedule/Schedule.cpp | 10 +++++++-- .../ScheduleCreateFromDeck.cpp | 17 ++++++++++++++- .../SCHEDULE/SCHEDULE_WELLS2 | 21 +++++++++++++++---- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 01e662ff7..0907a7eeb 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -167,7 +167,9 @@ namespace Opm { double orat = record->getItem("ORAT")->getSIDouble(0); double wrat = record->getItem("WRAT")->getSIDouble(0); double grat = record->getItem("GRAT")->getSIDouble(0); - + WellCommon::StatusEnum status = WellCommon::StatusFromString( record->getItem("STATUS")->getString(0)); + + well->setStatus( currentStep , status ); well->setOilRate(currentStep, orat); well->setWaterRate(currentStep, wrat); well->setGasRate(currentStep, grat); @@ -193,7 +195,9 @@ namespace Opm { double BHPLimit = record->getItem("BHP_TARGET")->getSIDouble(0); double THPLimit = record->getItem("THP_TARGET")->getSIDouble(0); WellInjector::ControlModeEnum controlMode = WellInjector::ControlModeFromString( record->getItem("CMODE")->getString(0)); - + WellCommon::StatusEnum status = WellCommon::StatusFromString( record->getItem("STATUS")->getString(0)); + + well->setStatus( currentStep , status ); well->setSurfaceInjectionRate( currentStep , surfaceInjectionRate ); well->setReservoirInjectionRate( currentStep , reservoirInjectionRate ); well->setBHPLimit(currentStep, BHPLimit); @@ -209,7 +213,9 @@ namespace Opm { const std::string& wellName = record->getItem("WELL")->getString(0); WellPtr well = getWell(wellName); double injectionRate = record->getItem("RATE")->getSIDouble(0); + WellCommon::StatusEnum status = WellCommon::StatusFromString( record->getItem("STATUS")->getString(0)); + well->setStatus( currentStep , status ); well->setSurfaceInjectionRate( currentStep , injectionRate ); well->setInPredictionMode(currentStep, false ); } diff --git a/opm/parser/eclipse/IntegrationTests/ScheduleCreateFromDeck.cpp b/opm/parser/eclipse/IntegrationTests/ScheduleCreateFromDeck.cpp index db591656f..0fcd5301b 100644 --- a/opm/parser/eclipse/IntegrationTests/ScheduleCreateFromDeck.cpp +++ b/opm/parser/eclipse/IntegrationTests/ScheduleCreateFromDeck.cpp @@ -69,6 +69,19 @@ BOOST_AUTO_TEST_CASE(WellTesting) { BOOST_CHECK(sched->hasWell("W_2")); BOOST_CHECK(sched->hasWell("W_3")); + { + WellPtr well2 = sched->getWell("W_2"); + + BOOST_CHECK_EQUAL( WellCommon::SHUT , well2->getStatus(3)); + } + + + { + WellPtr well3 = sched->getWell("W_3"); + + BOOST_CHECK_EQUAL( WellCommon::AUTO , well3->getStatus(3)); + } + { WellPtr well1 = sched->getWell("W_1"); @@ -109,10 +122,12 @@ BOOST_AUTO_TEST_CASE(WellTesting) { BOOST_CHECK_CLOSE(123.00 * Metric::Pressure , well1->getBHPLimit(10) , 0.001); BOOST_CHECK_CLOSE(678.00 * Metric::Pressure , well1->getTHPLimit(10) , 0.001); - BOOST_CHECK_CLOSE(5000/Metric::Time , well1->getSurfaceInjectionRate(12) , 0.001); + BOOST_CHECK_CLOSE(5000/Metric::Time , well1->getSurfaceInjectionRate(11) , 0.001); BOOST_CHECK_EQUAL( WellInjector::RESV , well1->getInjectorControlMode( 9 )); BOOST_CHECK_EQUAL( WellInjector::RATE , well1->getInjectorControlMode( 11 )); + BOOST_CHECK_EQUAL( WellCommon::OPEN , well1->getStatus( 11 )); + BOOST_CHECK_EQUAL( WellCommon::SHUT , well1->getStatus( 12 )); } } diff --git a/testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2 b/testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2 index c7442e03f..08c75a5ad 100644 --- a/testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2 +++ b/testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2 @@ -37,13 +37,22 @@ COMPDAT WCONHIST 'W_1' 'OPEN' 'ORAT' 4000.000 4.000 12345 5* / - 'W_2' 'OPEN' 'ORAT' 7998.000 2.000 1461075.000 5* / - 'W_3' 'OPEN' 'ORAT' 7999.000 1.000 1471824.000 5* / + 'W_2' 'SHUT' 'ORAT' 7998.000 2.000 1461075.000 5* / + 'W_3' 'AUTO' 'ORAT' 7999.000 1.000 1471824.000 5* / / -TSTEP -- 4,5,6 - 10 2*10 / +TSTEP -- 4 + 10 / + +TSTEP -- 5 + 10 / + +TSTEP -- 6 + 10 / + + + WCONHIST @@ -106,3 +115,7 @@ WCONINJH DATES -- 12 10 SEP 2008 / / + +WCONINJE + 'W_1' 'WATER' 'SHUT' 'RATE' 20000.000 200000.000 123 678 4* / +/