Added support for WELOPEN in the Schedule class, NOT support specific completions, only the well

This commit is contained in:
Kristian Flikka
2014-02-04 16:12:49 +01:00
parent 0d35b7d3f6
commit 9db42f6eb3
6 changed files with 130 additions and 2 deletions

View File

@@ -88,6 +88,8 @@ namespace Opm {
if (keyword->name() == "COMPDAT")
handleCOMPDAT(keyword, currentStep);
if (keyword->name() == "WELOPEN")
handleWELOPEN(keyword, currentStep);
if (keyword->name() == "GRUPTREE")
handleGRUPTREE(keyword, currentStep);
@@ -287,6 +289,22 @@ namespace Opm {
}
}
void Schedule::handleWELOPEN(DeckKeywordConstPtr keyword, size_t currentStep) {
for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) {
DeckRecordConstPtr record = keyword->getRecord(recordNr);
const std::string& wellName = record->getItem("WELL")->getString(0);
WellPtr well = getWell(wellName);
for (size_t i=2; i<7; i++) {
if (record->getItem(i)->getInt(0) > 0 ) {
throw std::logic_error("Error processing WELOPEN keyword, specifying specific connections is not supported yet.");
}
}
WellCommon::StatusEnum status = WellCommon::StatusFromString( record->getItem("STATUS")->getString(0));
well->setStatus(currentStep, status);
}
}
void Schedule::handleGCONINJE(DeckKeywordConstPtr keyword, size_t currentStep) {
for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) {

View File

@@ -75,6 +75,7 @@ namespace Opm
void handleCOMPDAT(DeckKeywordConstPtr keyword , size_t currentStep);
void handleWCONINJE(DeckKeywordConstPtr keyword, size_t currentStep);
void handleWCONINJH(DeckKeywordConstPtr keyword, size_t currentStep);
void handleWELOPEN(DeckKeywordConstPtr keyword, size_t currentStep);
void handleGCONINJE(DeckKeywordConstPtr keyword, size_t currentStep);
void handleGCONPROD(DeckKeywordConstPtr keyword, size_t currentStep);
void handleDATES(DeckKeywordConstPtr keyword);

View File

@@ -408,3 +408,27 @@ BOOST_AUTO_TEST_CASE(WellTestWELSPECS_InvalidConfig_Throws) {
}
BOOST_AUTO_TEST_CASE(WellTestWELOPEN_ConfigWithIndexes_Throws) {
ParserPtr parser(new Parser());
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELOPEN_INVALID");
DeckPtr deck = parser->parseFile(scheduleFile.string());
BOOST_CHECK_THROW(new Schedule(deck), std::logic_error);
}
BOOST_AUTO_TEST_CASE(WellTestWELOPENControlsSet) {
ParserPtr parser(new Parser());
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELOPEN");
DeckPtr deck = parser->parseFile(scheduleFile.string());
ScheduleConstPtr sched(new Schedule(deck));
WellConstPtr well1 = sched->getWell("W_1");
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::OPEN, sched->getWell("W_1")->getStatus(0));
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::SHUT, sched->getWell("W_1")->getStatus(1));
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::OPEN, sched->getWell("W_1")->getStatus(2));
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::STOP, sched->getWell("W_1")->getStatus(3));
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::AUTO, sched->getWell("W_1")->getStatus(4));
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::STOP, sched->getWell("W_1")->getStatus(5));
}

View File

@@ -1,9 +1,9 @@
{"name" : "WELOPEN", "items" : [
{"name" : "well" , "value_type" : "STRING"},
{"name" : "WELL" , "value_type" : "STRING"},
{"name" : "STATUS" , "value_type" : "STRING" , "default" : "OPEN"},
{"name" : "I" , "value_type" : "INT" , "default" : -1},
{"name" : "J" , "value_type" : "INT" , "default" : -1},
{"name" : "K" , "value_type" : "INT" , "default" : -1},
{"name" : "C1" , "value_type" : "INT" , "default" : -1},
{"name" : "C2" , "value_type" : "INT" , "default" : -1}
]}
]}

View File

@@ -0,0 +1,58 @@
START
10 MAI 2007 /
SCHEDULE
WELSPECS
'W_1' 'GROUP1' 30 37 1* 'OIL' 7* /
/
COMPDAT
-- WELL I J K1 K2 Sat. CF DIAM KH SKIN ND DIR Ro
'W_1' 10 32 1 1 'OPEN' 1* 118.457 0.216 12025.229 2* 'Z' 24.860 /
/
TSTEP
10 /
WELOPEN
'W_1' 'SHUT' 5* /
/
TSTEP
10 /
WELOPEN
'W_1' 'OPEN' 5* /
/
TSTEP
10 /
WELOPEN
'W_1' 'STOP' 5* /
/
TSTEP
10 /
WELOPEN
'W_1' 'AUTO' 5* /
/
TSTEP
10 /
WELOPEN
'W_1' 'STOP' 0 0 0 2* /
/
TSTEP
10 /
END

View File

@@ -0,0 +1,27 @@
START
10 MAI 2007 /
SCHEDULE
WELSPECS
'W_1' 'GROUP1' 30 37 1* 'OIL' 7* /
'W_2' 'GROUP1' 20 51 1* 'OIL' 7* /
/
COMPDAT
-- WELL I J K1 K2 Sat. CF DIAM KH SKIN ND DIR Ro
'W_1' 10 32 1 1 'OPEN' 1* 118.457 0.216 12025.229 2* 'Z' 24.860 /
/
TSTEP
10 /
WELOPEN
'W_1' 'SHUT' 1 0 0 2* /
/
TSTEP
10 /
END