From 6623b87ee6f4dd0a9a8ed7764d6c12ddf7328c4e Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Thu, 17 Sep 2015 22:28:30 +0200 Subject: [PATCH] Added Polymer integration test. --- .../eclipse/IntegrationTests/CMakeLists.txt | 3 +- .../eclipse/IntegrationTests/Polymer.cpp | 75 +++++++++++++++++++ testdata/integration_tests/POLYMER/POLY.inc | 52 +++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 opm/parser/eclipse/IntegrationTests/Polymer.cpp create mode 100644 testdata/integration_tests/POLYMER/POLY.inc diff --git a/opm/parser/eclipse/IntegrationTests/CMakeLists.txt b/opm/parser/eclipse/IntegrationTests/CMakeLists.txt index f142d4de5..ce036d535 100644 --- a/opm/parser/eclipse/IntegrationTests/CMakeLists.txt +++ b/opm/parser/eclipse/IntegrationTests/CMakeLists.txt @@ -7,7 +7,8 @@ foreach(tapp CheckDeckValidity IntegrationTests ParseWellProbe CompletionsFromDeck ParseEND IncludeTest ParseEQUIL ParseRSVD ParsePVTG ParsePVTO ParseSWOF BoxTest ParseMULTREGT ParseSGOF ParseSLGOF EclipseGridCreateFromDeck NNCTests - ResinsightTest IOConfigIntegrationTest ) + ResinsightTest IOConfigIntegrationTest + Polymer) opm_add_test(run${tapp} SOURCES ${tapp}.cpp LIBRARIES opmparser ${Boost_LIBRARIES}) endforeach() diff --git a/opm/parser/eclipse/IntegrationTests/Polymer.cpp b/opm/parser/eclipse/IntegrationTests/Polymer.cpp new file mode 100644 index 000000000..5114f51f7 --- /dev/null +++ b/opm/parser/eclipse/IntegrationTests/Polymer.cpp @@ -0,0 +1,75 @@ +/* + Copyright 2013 Statoil ASA. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ + +#define BOOST_TEST_MODULE ParserIntegrationTests +#include +#include + +#include +#include +#include +#include + +using namespace Opm; + + + + +BOOST_AUTO_TEST_CASE( parse_polymer_tables ) { + ParserPtr parser(new Parser()); + DeckPtr deck = parser->parseFile("testdata/integration_tests/POLYMER/POLY.inc", ParseMode()); + Opm::TableManager tables( *deck ); + const std::vector& plymax = tables.getPlymaxTables(); + const std::vector plyrock = tables.getPlyrockTables(); + const std::vector plyvis = tables.getPlyviscTables(); + const std::vector plyads = tables.getPlyadsTables(); + + BOOST_CHECK_EQUAL( plymax.size() , 1U ); + BOOST_CHECK_EQUAL( plyrock.size() , 1U ); + BOOST_CHECK_EQUAL( plyvis.size() , 1U ); + BOOST_CHECK_EQUAL( plyads.size() , 1U ); + + { + const Opm::PlymaxTable& table0 = plymax[0]; + BOOST_CHECK_EQUAL( table0.numColumns() , 2U ); + BOOST_CHECK_EQUAL( table0.getPolymerConcentrationColumn()[0] , 3.0 ); + BOOST_CHECK_EQUAL( table0.getMaxPolymerConcentrationColumn()[0] , 0.0 ); + } + + { + const Opm::PlyviscTable& table0 = plyvis[0]; + BOOST_CHECK_EQUAL( table0.numColumns() , 2U ); + BOOST_CHECK_EQUAL( table0.getPolymerConcentrationColumn()[5] , 3.0 ); + BOOST_CHECK_EQUAL( table0.getViscosityMultiplierColumn()[5] , 48.0 ); + } + + { + const Opm::PlyrockTable& table0 = plyrock[0]; + BOOST_CHECK_EQUAL( table0.numColumns() , 5U ); + BOOST_CHECK_EQUAL( table0.getDeadPoreVolumeColumn()[0] , 0.05 ); + BOOST_CHECK_EQUAL( table0.getMaxAdsorbtionColumn()[0] , 0.000025 ); + } + + { + const Opm::PlyadsTable& table0 = plyads[0]; + BOOST_CHECK_EQUAL( table0.numColumns() , 2U ); + BOOST_CHECK_EQUAL( table0.getPolymerConcentrationColumn()[8] , 3.0 ); + BOOST_CHECK_EQUAL( table0.getAdsorbedPolymerColumn()[8] , 0.000025 ); + } +} diff --git a/testdata/integration_tests/POLYMER/POLY.inc b/testdata/integration_tests/POLYMER/POLY.inc new file mode 100644 index 000000000..ec133bbb7 --- /dev/null +++ b/testdata/integration_tests/POLYMER/POLY.inc @@ -0,0 +1,52 @@ +-- This reservoir simulation deck is made available under the Open Database +-- License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in +-- individual contents of the database are licensed under the Database Contents +-- License: http://opendatacommons.org/licenses/dbcl/1.0/ + +-- Copyright (C) 2015 Statoil +-- Copyright (C) 2015 SINTEF ICT, Applied Mathematics +RUNSPEC + +TABDIMS + 1 1 / + + +REGDIMS + 9* 1 / + + +PROPS +NOECHO +PLYVISC +0 1.0 +0.5 3.0 +1.0 6.0 +1.5 12.0 +2.0 24.0 +3.0 48.0 / + + +PLYROCK +--IPV RRF dens AI max ads + 0.05 1.2 2500 2 0.000025 / + + +PLYADS +-- conc adsorb-conc + 0.000 0.000000 + 0.250 0.000012 + 0.500 0.000016 + 0.750 0.000019 + 1.000 0.000020 + 1.250 0.000021 + 1.500 0.000023 + 1.750 0.000025 + 3.000 0.000025 / + +PLMIXPAR + 1.0 / + +PLYMAX + 3.00 0 / + +ECHO