From 5f8d24c43172831da46e3cc8211e0405832f0128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 3 Jul 2019 11:46:49 +0200 Subject: [PATCH] Add tests for WFOAM. --- tests/parser/ParseContextTests.cpp | 17 +++++ tests/parser/ScheduleTests.cpp | 47 +++++++++++++ .../integration_tests/SCHEDULE/SCHEDULE_FOAM | 70 +++++++++++++++++++ .../integration/ScheduleCreateFromDeck.cpp | 67 ++++++++++++++++++ 4 files changed, 201 insertions(+) create mode 100644 tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_FOAM diff --git a/tests/parser/ParseContextTests.cpp b/tests/parser/ParseContextTests.cpp index aac700f56..8f955de05 100644 --- a/tests/parser/ParseContextTests.cpp +++ b/tests/parser/ParseContextTests.cpp @@ -649,6 +649,23 @@ BOOST_AUTO_TEST_CASE( test_invalid_wtemplate_config ) { )"; testSamples.push_back(testSample); + // Invalid well name in WFOAM + testSample = R"( + COMPDAT + 'INJ' 10 10 3 3 'OPEN' 1* 1* 0.5 / + / + WCONINJE + 'INJ' 'WATER' 'OPEN' 'RATE' 20000 4* / + / + DATES + 15 OKT 2008 / + / + WFOAM + 'SOMETHINGELSE' 0.02 / + / + )"; + testSamples.push_back(testSample); + // Invalid well name in WELOPEN testSample = R"( COMPDAT diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index 1d77a9f38..66f4d3581 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -3049,6 +3049,53 @@ BOOST_AUTO_TEST_CASE(POLYINJ_TEST) { BOOST_CHECK_EQUAL(poly3.m_skprpolytable, 2); } +// Test for WFOAM +BOOST_AUTO_TEST_CASE(WFOAM_TEST) { + const char *deckData = + "START\n" + " 8 MAR 2018/\n" + "GRID\n" + "PERMX\n" + " 1000*0.25 /\n" + "COPY\n" + " PERMX PERMY /\n" + " PERMX PERMZ /\n" + "/\n" + "PROPS\n \n" + "SCHEDULE\n" + "WELSPECS\n" + "'INJE01' 'I' 1 1 1 'WATER' /\n" + "/\n" + "TSTEP\n" + " 1/\n" + "WFOAM\n" + " 'INJE01' 0.2 /\n" + "/\n" + "TSTEP\n" + " 2*1/\n" + "WFOAM\n" + " 'INJE01' 0.3 /\n" + "/\n" + "TSTEP\n" + " 1 /\n"; + + Opm::Parser parser; + auto deck = parser.parseString(deckData); + EclipseGrid grid1(10,10,10); + TableManager table ( deck ); + Eclipse3DProperties eclipseProperties ( deck , table, grid1); + Runspec runspec (deck); + Schedule schedule(deck, grid1 , eclipseProperties, runspec); + + const auto& f0 = schedule.getWell2("INJE01", 0).getFoamProperties(); + const auto& f1 = schedule.getWell2("INJE01", 1).getFoamProperties(); + const auto& f3 = schedule.getWell2("INJE01", 3).getFoamProperties(); + + BOOST_CHECK_EQUAL(f0.m_foamConcentration, 0.0); + BOOST_CHECK_EQUAL(f1.m_foamConcentration, 0.2); + BOOST_CHECK_EQUAL(f3.m_foamConcentration, 0.3); +} + BOOST_AUTO_TEST_CASE(WTEST_CONFIG) { auto deck = createDeckWTEST(); diff --git a/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_FOAM b/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_FOAM new file mode 100644 index 000000000..65447eaab --- /dev/null +++ b/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_FOAM @@ -0,0 +1,70 @@ +-- Based on the SCHEDULE_POLYMER test + +START + 10 MAI 2007 / +RUNSPEC + +DIMENS + 30 30 30 / + +GRID + +PERMX + 27000*0.25 / + +COPY + PERMX PERMY / + PERMX PERMZ / +/ + +SCHEDULE + + +WELSPECS + 'INJE01' 'I' 1 1 1* 'GAS' / + 'INJE02' 'I' 5 1 1* 'GAS' / + 'INJE03' 'I' 10 1 1* 'GAS' / + 'PROD01' 'P' 20 1 1* 'OIL' 7* / +/ + +COMPDAT + 'INJE01' 1 1 2 2 'OPEN' 1* 200. 0.5 / + 'INJE02' 5 1 2 2 'OPEN' 1* 200. 0.5 / + 'INJE03' 10 1 2 2 'OPEN' 1* 200. 0.5 / + 'PROD01' 20 1 1 1 'OPEN' 1* 200. 0.5 / +/ + +WCONINJE + 'INJE01' 'GAS' 'OPEN' 'RATE' 80000.00 1* 1000 / + 'INJE02' 'GAS' 'OPEN' 'RATE' 80000.00 1* 1000 / + 'INJE03' 'GAS' 'OPEN' 'RATE' 80000.00 1* 1000 / +/ +WCONPROD + 'PROD01' 'OPEN' 'BHP' 5* 200 / +/ + +WFOAM + 'INJE01' 0.11 / + 'INJE03' 0.31 / +/ +TSTEP +10 +/ +WFOAM + 'INJE01' 0.12 / + 'INJE02' 0.22 / + 'INJE03' 0.0 / +/ +TSTEP +10 +/ + +WFOAM + 'INJE01' 0.13 / + 'INJE02' 0.0 / + 'INJE03' 0.33 / +/ + +TSTEP +10 +/ diff --git a/tests/parser/integration/ScheduleCreateFromDeck.cpp b/tests/parser/integration/ScheduleCreateFromDeck.cpp index b6743ed41..98fa7e4c3 100644 --- a/tests/parser/integration/ScheduleCreateFromDeck.cpp +++ b/tests/parser/integration/ScheduleCreateFromDeck.cpp @@ -680,6 +680,73 @@ BOOST_AUTO_TEST_CASE(WellTestWPOLYMER) { } +BOOST_AUTO_TEST_CASE(WellTestWFOAM) { + Parser parser; + std::string scheduleFile(pathprefix() + "SCHEDULE/SCHEDULE_FOAM"); + auto deck = parser.parseFile(scheduleFile); + EclipseGrid grid(30,30,30); + TableManager table ( deck ); + Eclipse3DProperties eclipseProperties ( deck , table, grid); + Runspec runspec (deck); + Schedule sched(deck, grid , eclipseProperties, runspec); + + + BOOST_CHECK_EQUAL(4U, sched.numWells()); + BOOST_CHECK(sched.hasWell("INJE01")); + BOOST_CHECK(sched.hasWell("PROD01")); + + { + const auto& well1 = sched.getWell2("INJE01", 0); + BOOST_CHECK( well1.isInjector()); + const WellFoamProperties& props_well10 = well1.getFoamProperties(); + BOOST_CHECK_EQUAL(0.11, props_well10.m_foamConcentration); + } + { + const auto& well1 = sched.getWell2("INJE01", 1); + const WellFoamProperties& props_well11 = well1.getFoamProperties(); + BOOST_CHECK_EQUAL(0.12, props_well11.m_foamConcentration); + } + { + const auto& well1 = sched.getWell2("INJE01", 2); + const WellFoamProperties& props_well12 = well1.getFoamProperties(); + BOOST_CHECK_EQUAL(0.13, props_well12.m_foamConcentration); + } + + { + const auto& well2 = sched.getWell2("INJE02", 0); + BOOST_CHECK( well2.isInjector()); + const WellFoamProperties& props_well20 = well2.getFoamProperties(); + BOOST_CHECK_EQUAL(0.0, props_well20.m_foamConcentration); + } + { + const auto& well2 = sched.getWell2("INJE02", 1); + const WellFoamProperties& props_well21 = well2.getFoamProperties(); + BOOST_CHECK_EQUAL(0.22, props_well21.m_foamConcentration); + } + { + const auto& well2 = sched.getWell2("INJE02", 2); + const WellFoamProperties& props_well22 = well2.getFoamProperties(); + BOOST_CHECK_EQUAL(0.0, props_well22.m_foamConcentration); + } + { + const auto& well3 = sched.getWell2("INJE03", 0); + BOOST_CHECK( well3.isInjector()); + const WellFoamProperties& props_well30 = well3.getFoamProperties(); + BOOST_CHECK_EQUAL(0.31, props_well30.m_foamConcentration); + } + { + const auto& well3 = sched.getWell2("INJE03", 1); + const WellFoamProperties& props_well31 = well3.getFoamProperties(); + BOOST_CHECK_EQUAL(0.0, props_well31.m_foamConcentration); + } + { + const auto& well3 = sched.getWell2("INJE03", 2); + const WellFoamProperties& props_well32 = well3.getFoamProperties(); + BOOST_CHECK_EQUAL(0.33, props_well32.m_foamConcentration); + } +} + + BOOST_AUTO_TEST_CASE(WellTestWECON) { Parser parser; std::string scheduleFile(pathprefix() + "SCHEDULE/SCHEDULE_WECON");