Merge pull request #400 from iLoop2/Add_COMPLUMP_keyword

Add complump keyword
This commit is contained in:
Joakim Hove 2015-01-26 12:21:12 +01:00
commit 85092991f6
4 changed files with 160 additions and 4 deletions

View File

@ -102,7 +102,7 @@ namespace Opm {
handleCOMPDAT(keyword, logger, currentStep);
if (keyword->name() == "WELOPEN")
handleWELOPEN(keyword, logger, currentStep);
handleWELOPEN(keyword, logger, currentStep, deck->hasKeyword("COMPLUMP"));
if (keyword->name() == "GRUPTREE")
handleGRUPTREE(keyword, logger, currentStep);
@ -401,7 +401,7 @@ namespace Opm {
return data;
}
void Schedule::handleWELOPEN(DeckKeywordConstPtr keyword, LoggerPtr /*logger*/, size_t currentStep) {
void Schedule::handleWELOPEN(DeckKeywordConstPtr keyword, LoggerPtr /*logger*/, size_t currentStep, bool hascomplump) {
for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) {
DeckRecordConstPtr record = keyword->getRecord(recordNr);
@ -432,6 +432,11 @@ namespace Opm {
Opm::Value<int> C1 = getValueItem(record->getItem("C1"));
Opm::Value<int> C2 = getValueItem(record->getItem("C2"));
if(hascomplump && (C2.hasValue() || C1.hasValue())){
std::cerr << "ERROR the keyword COMPLUMP is not supported used when C1 or C2 in WELOPEN have values" << std::endl;
throw std::exception();
}
size_t completionSize = currentCompletionSet->size();
for(size_t i = 0; i < completionSize;i++) {

View File

@ -85,7 +85,7 @@ namespace Opm
void handleWCONINJE(DeckConstPtr deck, DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep);
void handleWPOLYMER(DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep);
void handleWCONINJH(DeckConstPtr deck, DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep);
void handleWELOPEN(DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep);
void handleWELOPEN(DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep, bool hascomplump);
void handleGCONINJE(DeckConstPtr deck, DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep);
void handleGCONPROD(DeckKeywordConstPtr keyword, LoggerPtr logger, size_t currentStep);
void handleDATES(DeckKeywordConstPtr keyword, LoggerPtr logger);

View File

@ -449,7 +449,149 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWELOPEN_TryToOpenWellWithShutCompleti
}
BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithCOMPLUMPwithC1_ThrowsExcpetion) {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 NOV 1979 / \n"
"SCHEDULE\n"
"DATES -- 1\n"
" 1 DES 1979/ \n"
"/\n"
"WELSPECS\n"
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
"/\n"
"COMPDAT\n"
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
"/\n"
"DATES -- 3\n"
" 10 OKT 2008 / \n"
"/\n"
"WELOPEN\n"
" 'OP_1' OPEN 0 0 0 1 0 / \n"
"/\n"
"COMPLUMP\n"
" 'OP_1' 0 0 0 0 0 / \n "
"/\n"
"DATES -- 4\n"
" 10 NOV 2008 / \n"
"/\n";
DeckPtr deck = parser.parseString(input);
BOOST_CHECK_THROW(Schedule schedule(deck), std::exception);
}
BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithCOMPLUMPwithC1andC2_ThrowsExcpetion) {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 NOV 1979 / \n"
"SCHEDULE\n"
"DATES -- 1\n"
" 1 DES 1979/ \n"
"/\n"
"WELSPECS\n"
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
"/\n"
"COMPDAT\n"
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
"/\n"
"DATES -- 3\n"
" 10 OKT 2008 / \n"
"/\n"
"WELOPEN\n"
" 'OP_1' OPEN 0 0 0 1 4 / \n"
"/\n"
"COMPLUMP\n"
" 'OP_1' 0 0 0 0 0 / \n "
"/\n"
"DATES -- 4\n"
" 10 NOV 2008 / \n"
"/\n";
DeckPtr deck = parser.parseString(input);
BOOST_CHECK_THROW(Schedule schedule(deck), std::exception);
}
BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithCOMPLUMPwithC2_ThrowsExcpetion) {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 NOV 1979 / \n"
"SCHEDULE\n"
"DATES -- 1\n"
" 1 DES 1979/ \n"
"/\n"
"WELSPECS\n"
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
"/\n"
"COMPDAT\n"
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
"/\n"
"DATES -- 3\n"
" 10 OKT 2008 / \n"
"/\n"
"WELOPEN\n"
" 'OP_1' OPEN 0 0 0 0 4 / \n"
"/\n"
"COMPLUMP\n"
" 'OP_1' 0 0 0 0 0 / \n "
"/\n"
"DATES -- 4\n"
" 10 NOV 2008 / \n"
"/\n";
DeckPtr deck = parser.parseString(input);
BOOST_CHECK_THROW(Schedule schedule(deck), std::exception);
}
BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithCOMPLUMPwithDefaultValuesInWELOPEN) {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 NOV 1979 / \n"
"SCHEDULE\n"
"DATES -- 1\n"
" 1 DES 1979/ \n"
"/\n"
"WELSPECS\n"
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
"/\n"
"COMPDAT\n"
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
"/\n"
"DATES -- 3\n"
" 10 OKT 2008 / \n"
"/\n"
"WELOPEN\n"
" 'OP_1' OPEN 0 0 0 0 0 / \n"
"/\n"
"COMPLUMP\n"
" 'OP_1' 0 0 0 0 0 / \n "
"/\n"
"DATES -- 4\n"
" 10 NOV 2008 / \n"
"/\n";
DeckPtr deck = parser.parseString(input);
Schedule schedule(deck);
WellPtr well;
well = schedule.getWell("OP_1");
size_t currentStep = 0;
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::OPEN, well->getStatus(currentStep));
}

View File

@ -0,0 +1,9 @@
{"name" : "COMPLUMP", "sections" : ["SCHEDULE"], "items" : [
{"name" : "WELL" , "value_type" : "STRING"},
{"name" : "I" , "value_type" : "INT" },
{"name" : "J" , "value_type" : "INT" },
{"name" : "K1" , "value_type" : "INT" },
{"name" : "K2" , "value_type" : "INT" },
{"name" : "N" , "value_type" : "INT" }
]}