Handle wildcard in group keywords

Added function getGroups(pattern) to allow records with wildcard.

Included the functionality for GCONPROD, GCONINJE and GEFAC - currently
the only group keywords that should accept wildcards.
This commit is contained in:
Lars Petter Øren Hauge
2018-05-03 13:20:04 +02:00
parent 427833b089
commit 675858f1e0
9 changed files with 160 additions and 66 deletions

View File

@@ -502,7 +502,7 @@ BOOST_AUTO_TEST_CASE( test_invalid_wtemplate_config ) {
ParseContext parseContext;
Parser parser;
parseContext.update(ParseContext::SCHEDULE_INVALID_WELL , InputError::THROW_EXCEPTION );
parseContext.update(ParseContext::SCHEDULE_INVALID_NAME , InputError::THROW_EXCEPTION );
std::vector < std::string > testSamples;
std::string testSample;

View File

@@ -1022,6 +1022,67 @@ BOOST_AUTO_TEST_CASE(createDeckWithWPIMULT) {
}
}
BOOST_AUTO_TEST_CASE(createDeckModifyMultipleGCONPROD) {
Opm::Parser parser;
const std::string input = R"(
START -- 0
10 'JAN' 2000 /
RUNSPEC
DIMENS
10 10 10 /
GRID
DX
1000*0.25 /
DY
1000*0.25 /
DZ
1000*0.25 /
TOPS
100*0.25 /
SCHEDULE
DATES -- 1
10 OKT 2008 /
/
WELSPECS
'PROD1' 'G1' 1 1 10 'OIL' /
'PROD2' 'G2' 2 2 10 'OIL' /
'PROD3' 'H1' 3 3 10 'OIL' /
/
GCONPROD
'G1' 'ORAT' 1000 /
/
DATES -- 2
10 NOV 2008 /
/
GCONPROD
'G*' 'ORAT' 2000 /
/
)";
Opm::ParseContext parseContext;
auto deck = parser.parseString(input, parseContext);
EclipseGrid grid( deck );
TableManager table ( deck );
Eclipse3DProperties eclipseProperties ( deck , table, grid);
Opm::Schedule schedule(deck, grid, eclipseProperties, Opm::Phases(true, true, true) , parseContext);
Opm::UnitSystem unitSystem = deck.getActiveUnitSystem();
double siFactorL = unitSystem.parse("LiquidSurfaceVolume/Time").getSIScaling();
auto g_g1 = schedule.getGroup("G1");
BOOST_CHECK_EQUAL(g_g1.getOilTargetRate(1), 1000 * siFactorL);
BOOST_CHECK_EQUAL(g_g1.getOilTargetRate(2), 2000 * siFactorL);
auto g_g2 = schedule.getGroup("G2");
BOOST_CHECK_EQUAL(g_g2.getOilTargetRate(1), -999e100); // Invalid group rate - default
BOOST_CHECK_EQUAL(g_g2.getOilTargetRate(2), 2000 * siFactorL);
auto g_h1 = schedule.getGroup("H1");
BOOST_CHECK_EQUAL(g_h1.getOilTargetRate(0), -999e100);
BOOST_CHECK_EQUAL(g_h1.getOilTargetRate(1), -999e100);
BOOST_CHECK_EQUAL(g_h1.getOilTargetRate(2), -999e100);
}
BOOST_AUTO_TEST_CASE(createDeckWithDRSDT) {
Opm::Parser parser;
std::string input =