Merge pull request #569 from joakim-hove/OPERATER

Add support for OPERATER keyword
This commit is contained in:
Joakim Hove
2018-11-23 13:05:08 +01:00
committed by GitHub
6 changed files with 152 additions and 31 deletions

View File

@@ -147,13 +147,17 @@ static Opm::Deck createValidIntDeck() {
" 5 5 1 /\n"
"GRID\n"
"DX\n"
"25*0.25 /\n"
"25*1.0 /\n"
"DY\n"
"25*0.25 /\n"
"25*1.0 /\n"
"DZ\n"
"25*0.25 /\n"
"25*1.0 /\n"
"TOPS\n"
"25*0.25 /\n"
"PERMY\n"
" 25*1.0 /\n"
"PORO\n"
" 25*1.0 /\n"
"REGIONS\n"
"SATNUM \n"
"1 1 2 2 2\n"
@@ -169,6 +173,18 @@ static Opm::Deck createValidIntDeck() {
"1 1 2 2 2\n"
"1 1 2 2 2\n"
"/\n"
"OPERNUM \n"
"1 2 3 4 5\n"
"6 7 8 9 10\n"
"11 12 13 14 15\n"
"16 17 18 19 20\n"
"21 22 23 24 25\n"
"/\n"
"OPERATER\n"
" PERMX 1 MULTX PERMY 0.50 /\n"
" PERMX 2 COPY PERMY /\n"
" PORV 1 'MULTX' PORV 0.50 /\n"
"/\n"
"MULTIREG\n"
" SATNUM 11 1 M / \n"
" SATNUM 20 2 / \n"
@@ -212,6 +228,7 @@ BOOST_AUTO_TEST_CASE(UnInitializedVectorThrows) {
BOOST_CHECK_THROW( new Opm::EclipseState( deck, Opm::ParseContext()) , std::invalid_argument );
}
BOOST_AUTO_TEST_CASE(IntSetCorrectly) {
Opm::Deck deck = createValidIntDeck();
Opm::TableManager tm(deck);
@@ -227,3 +244,20 @@ BOOST_AUTO_TEST_CASE(IntSetCorrectly) {
BOOST_CHECK_EQUAL(40, property.iget(i, j, 0));
}
}
BOOST_AUTO_TEST_CASE(Test_OPERATER) {
Opm::Deck deck = createValidIntDeck();
Opm::TableManager tm(deck);
Opm::EclipseGrid eg(deck);
Opm::Eclipse3DProperties props(deck, tm, eg);
const auto& porv = props.getDoubleGridProperty("PORV");
const auto& permx = props.getDoubleGridProperty("PERMX");
const auto& permy = props.getDoubleGridProperty("PERMY");
BOOST_CHECK_EQUAL( porv.iget(0,0,0), 0.50 );
BOOST_CHECK_EQUAL( permx.iget(0) / permy.iget(0), 0.50 );
BOOST_CHECK_EQUAL( permx.iget(1), permy.iget(1));
}