diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake
index e57c41b0a..6e1226687 100644
--- a/CMakeLists_files.cmake
+++ b/CMakeLists_files.cmake
@@ -124,6 +124,8 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableSchema.cpp
src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
+ src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
+ src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
@@ -236,6 +238,7 @@ if(ENABLE_ECL_INPUT)
tests/parser/PORVTests.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/RestartConfigTests.cpp
+ tests/parser/RockTableTests.cpp
tests/parser/RunspecTests.cpp
tests/parser/SatfuncPropertyInitializersTests.cpp
tests/parser/ScheduleTests.cpp
@@ -467,6 +470,10 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/SgwfnTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvdsTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp
+ opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp
+ opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
+ opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
+ opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp
opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp
opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp
opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp
diff --git a/opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp b/opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp
new file mode 100644
index 000000000..3e48191b3
--- /dev/null
+++ b/opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp
@@ -0,0 +1,38 @@
+/*
+ Copyright (C) 2019 by Norce
+
+ 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 .
+ */
+#ifndef OPM_PARSER_OVERBURD_TABLE_HPP
+#define OPM_PARSER_OVERBURD_TABLE_HPP
+
+#include "SimpleTable.hpp"
+
+namespace Opm {
+
+ class DeckItem;
+
+ class OverburdTable : public SimpleTable {
+ public:
+ OverburdTable( const DeckItem& item );
+
+ const TableColumn& getDepthColumn() const;
+ const TableColumn& getOverburdenPressureColumn() const;
+
+ };
+}
+
+#endif
diff --git a/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp b/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp
new file mode 100644
index 000000000..d5f2eb5be
--- /dev/null
+++ b/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2019 by Norce
+
+ 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 .
+ */
+#ifndef OPM_PARSER_ROCK2D_TABLE_HPP
+#define OPM_PARSER_ROCK2D_TABLE_HPP
+
+#include
+
+namespace Opm {
+
+ class DeckKeyword;
+
+ class Rock2dTable {
+ public:
+ Rock2dTable();
+ void init(const Opm::DeckRecord& record, size_t tableIdx);
+ size_t size() const;
+ size_t sizeMultValues() const;
+ double getPressureValue(size_t index) const;
+ double getPvmultValue(size_t pressureIndex, size_t saturationIndex ) const;
+
+
+ protected:
+ std::vector< std::vector > m_pvmultValues;
+ std::vector< double > m_pressureValues;
+
+ };
+
+}
+
+#endif
diff --git a/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp b/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
new file mode 100644
index 000000000..ed684888e
--- /dev/null
+++ b/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2019 by Norce
+
+ 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 .
+ */
+#ifndef OPM_PARSER_ROCK2DTR_TABLE_HPP
+#define OPM_PARSER_ROCK2DTR_TABLE_HPP
+
+#include
+
+namespace Opm {
+
+ class DeckKeyword;
+
+ class Rock2dtrTable {
+ public:
+ Rock2dtrTable();
+ void init(const Opm::DeckRecord& record, size_t tableIdx);
+ size_t size() const;
+ size_t sizeMultValues() const;
+ double getPressureValue(size_t index) const;
+ double getTransMultValue(size_t pressureIndex, size_t saturationIndex ) const;
+
+ protected:
+ std::vector< std::vector > m_transMultValues;
+ std::vector< double > m_pressureValues;
+
+ };
+
+}
+
+#endif
diff --git a/opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp b/opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
new file mode 100644
index 000000000..a80409add
--- /dev/null
+++ b/opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
@@ -0,0 +1,36 @@
+/*
+ Copyright (C) 2019 Norce
+
+ 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 .
+ */
+#ifndef OPM_PARSER_ROCKWNOD_TABLE_HPP
+#define OPM_PARSER_ROCKWNOD_TABLE_HPP
+
+#include "SimpleTable.hpp"
+
+namespace Opm {
+
+ class DeckItem;
+
+ class RockwnodTable : public SimpleTable {
+ public:
+ RockwnodTable( const DeckItem& item );
+
+ const TableColumn& getSaturationColumn() const;
+ };
+}
+
+#endif
diff --git a/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp b/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
index 544e28224..a4d1ee48b 100644
--- a/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
+++ b/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
@@ -33,6 +33,8 @@
#include // Phase::PhaseEnum
#include
#include
+#include
+#include
#include
#include
@@ -118,6 +120,11 @@ namespace Opm {
const std::vector& getPvtgTables() const;
const std::vector& getPvtoTables() const;
+ const std::vector& getRock2dTables() const;
+ const std::vector& getRock2dtrTables() const;
+ const TableContainer& getRockwnodTables() const;
+ const TableContainer& getOverburdTables() const;
+
const PvtwTable& getPvtwTable() const;
const PvcdoTable& getPvcdoTable() const;
const DensityTable& getDensityTable() const;
@@ -161,7 +168,42 @@ namespace Opm {
void initSkprwatTables(const Deck& deck);
void initSkprpolyTables(const Deck& deck);
+ //void initRockTables(const Deck& deck, const std::string& keywordName);
+ template
+ void initRockTables(const Deck& deck, const std::string& keywordName, std::vector& rocktable ) {
+
+ if (!deck.hasKeyword(keywordName))
+ return;
+
+ if (!deck.hasKeyword("ROCKCOMP")) {
+ OpmLog::error("ROCKCOMP must be present if ROCK2DTR is used");
+ }
+
+ if (!deck.hasKeyword("ROCKWNOD")) {
+ OpmLog::error("ROCKWNOD must be present if ROCK2DTR is used");
+ }
+
+ const auto& rockcompKeyword = deck.getKeyword("ROCKCOMP");
+ const auto& record = rockcompKeyword.getRecord( 0 );
+ size_t numTables = record.getItem("NTROCC").get< int >(0);
+ rocktable.resize(numTables);
+
+ const auto& keyword = deck.getKeyword(keywordName);
+ size_t numEntries = keyword.size();
+ size_t regionIdx = 0;
+ size_t tableIdx = 0;
+ for (unsigned lineIdx = 0; lineIdx < numEntries; ++lineIdx) {
+ if (keyword.getRecord(lineIdx).getItem("PRESSURE").size() > 0) {
+ rocktable[regionIdx].init(keyword.getRecord(lineIdx), tableIdx);
+ tableIdx++;
+ } else { // next region
+ tableIdx = 0;
+ regionIdx++;
+ }
+ }
+ assert(regionIdx == numTables - 1 );
+ }
/**
@@ -291,7 +333,9 @@ namespace Opm {
std::map m_simpleTables;
std::vector m_pvtgTables;
std::vector m_pvtoTables;
- PvtwTable m_pvtwTable;
+ std::vector m_rock2dTables;
+ std::vector m_rock2dtrTables;
+ PvtwTable m_pvtwTable;
PvcdoTable m_pvcdoTable;
DensityTable m_densityTable;
RockTable m_rockTable;
diff --git a/src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp b/src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
new file mode 100644
index 000000000..8455df30c
--- /dev/null
+++ b/src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2019 by Norce
+
+ 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 .
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+namespace Opm {
+
+ Rock2dTable::Rock2dTable()
+ {
+ }
+
+ void Rock2dTable::init(const DeckRecord& record, size_t tableIdx)
+ {
+ m_pressureValues.push_back(record.getItem("PRESSURE").getSIDoubleData()[0]);
+ m_pvmultValues.push_back(record.getItem("PVMULT").getSIDoubleData());
+ }
+
+ size_t Rock2dTable::size() const
+ {
+ return m_pressureValues.size();
+ }
+
+ size_t Rock2dTable::sizeMultValues() const
+ {
+ return m_pvmultValues[0].size();
+ }
+
+ double Rock2dTable::getPressureValue(size_t index) const
+ {
+ return m_pressureValues[index];
+ }
+
+ double Rock2dTable::getPvmultValue(size_t pressureIndex, size_t saturationIndex) const
+ {
+ return m_pvmultValues[pressureIndex][saturationIndex];
+ }
+
+}
+
diff --git a/src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp b/src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
new file mode 100644
index 000000000..0fbb883b4
--- /dev/null
+++ b/src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2019 by Norce
+
+ 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 .
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+namespace Opm {
+
+ Rock2dtrTable::Rock2dtrTable()
+ {
+ }
+
+ void Rock2dtrTable::init(const DeckRecord& record, size_t tableIdx)
+ {
+ m_pressureValues.push_back(record.getItem("PRESSURE").getSIDoubleData()[0]);
+ m_transMultValues.push_back(record.getItem("TRANSMULT").getSIDoubleData());
+ }
+
+ size_t Rock2dtrTable::size() const
+ {
+ return m_pressureValues.size();
+ }
+
+ size_t Rock2dtrTable::sizeMultValues() const
+ {
+ return m_transMultValues[0].size();
+ }
+
+ double Rock2dtrTable::getPressureValue(size_t index) const
+ {
+ return m_pressureValues[index];
+ }
+
+ double Rock2dtrTable::getTransMultValue(size_t pressureIndex, size_t saturationIndex) const
+ {
+ return m_transMultValues[pressureIndex][saturationIndex];
+ }
+
+}
+
diff --git a/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp b/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
index 5d0132684..0daff7e31 100644
--- a/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
+++ b/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
@@ -57,6 +57,8 @@
#include
#include
#include
+#include
+#include
#include
#include
#include
@@ -132,6 +134,13 @@ namespace Opm {
m_rtemp = deck.getKeyword("RTEMP").getRecord(0).getItem("TEMP").getSIDouble( 0 );
else if (deck.hasKeyword( "RTEMPA" ) )
m_rtemp = deck.getKeyword("RTEMPA").getRecord(0).getItem("TEMP").getSIDouble( 0 );
+
+ if ( deck.hasKeyword( "ROCK2D") )
+ initRockTables(deck, "ROCK2D", m_rock2dTables );
+
+ if ( deck.hasKeyword( "ROCK2DTR") )
+ initRockTables(deck, "ROCK2DTR", m_rock2dtrTables );
+
}
void TableManager::initDims(const Deck& deck) {
@@ -274,6 +283,8 @@ namespace Opm {
numRocktabTables = static_cast(record.getItem().get< int >(0));
}
addTables( "ROCKTAB", numRocktabTables);
+ addTables( "ROCKWNOD", numRocktabTables);
+ addTables( "OVERBURD", numRocktabTables);
}
@@ -325,6 +336,17 @@ namespace Opm {
initSimpleTableContainer(deck, "TLPMIXPA", numMiscibleTables);
}
+ {
+ size_t numRocktabTables = ParserKeywords::ROCKCOMP::NTROCC::defaultValue;
+
+ if (deck.hasKeyword()) {
+ const auto& keyword = deck.getKeyword();
+ const auto& record = keyword.getRecord(0);
+ numRocktabTables = static_cast(record.getItem().get< int >(0));
+ }
+ initSimpleTableContainer(deck, "ROCKWNOD", numRocktabTables);
+ initSimpleTableContainer(deck, "OVERBURD", numRocktabTables);
+ }
initSimpleTableContainer(deck, "PVDG", m_tabdims.getNumPVTTables());
initSimpleTableContainer(deck, "PVDO", m_tabdims.getNumPVTTables());
@@ -574,11 +596,9 @@ namespace Opm {
std::shared_ptr table = std::make_shared( dataItem , isDirectional, useStressOption );
container.addTable( tableIdx , table );
}
- }
+ }
}
-
-
size_t TableManager::numFIPRegions() const {
size_t ntfip = m_tabdims.getNumFIPRegions();
if (m_regdims->getNTFIP( ) > ntfip)
@@ -756,6 +776,22 @@ namespace Opm {
return m_pvtoTables;
}
+ const std::vector& TableManager::getRock2dTables() const {
+ return m_rock2dTables;
+ }
+
+ const std::vector& TableManager::getRock2dtrTables() const {
+ return m_rock2dtrTables;
+ }
+
+ const TableContainer& TableManager::getRockwnodTables() const {
+ return getTables("ROCKWNOD");
+ }
+
+ const TableContainer& TableManager::getOverburdTables() const {
+ return getTables("OVERBURD");
+ }
+
const PvtwTable& TableManager::getPvtwTable() const {
return this->m_pvtwTable;
}
diff --git a/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp b/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
index 5a60da944..f9724ff49 100644
--- a/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
+++ b/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
@@ -52,6 +52,8 @@
#include
#include
#include
+#include
+#include
#include
#include
#include
@@ -1134,6 +1136,29 @@ const TableColumn& MsfnTable::getOilRelpermMultiplierColumn() const {
return SimpleTable::getColumn(2);
}
+RockwnodTable::RockwnodTable( const DeckItem& item ) {
+ m_schema.addColumn( ColumnSchema( "Saturation" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE) );
+ SimpleTable::init( item );
+}
+
+const TableColumn& RockwnodTable::getSaturationColumn() const {
+ return SimpleTable::getColumn(0);
+}
+
+OverburdTable::OverburdTable( const DeckItem& item ) {
+ m_schema.addColumn( ColumnSchema( "Depth" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE) );
+ m_schema.addColumn( ColumnSchema( "OverburdenPressure" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE) );
+ SimpleTable::init( item );
+}
+
+const TableColumn& OverburdTable::getDepthColumn() const {
+ return SimpleTable::getColumn(0);
+}
+
+const TableColumn& OverburdTable::getOverburdenPressureColumn() const {
+ return SimpleTable::getColumn(1);
+}
+
namespace {
/*
diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/O/OVERBURD b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/O/OVERBURD
new file mode 100644
index 000000000..7df557795
--- /dev/null
+++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/O/OVERBURD
@@ -0,0 +1,6 @@
+{"name" : "OVERBURD" , "sections" : ["PROPS"], "size" : {"keyword" : "ROCKCOMP" , "item" : "NTROCC"},
+ "items" : [
+ {"name":"DEPTH", "value_type" : "DOUBLE", "size_type" : "ALL" , "dimension":"Length" },
+ {"name":"OVERBURDENPRESSURE", "value_type":"DOUBLE", "size_type" : "ALL" , "dimension" : "Pressure"}
+ ]
+}
diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCK2D b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCK2D
new file mode 100644
index 000000000..328fa73a9
--- /dev/null
+++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCK2D
@@ -0,0 +1,6 @@
+{"name" : "ROCK2D" , "sections" : ["PROPS"], "num_tables" : {"keyword" : "ROCKCOMP" , "item" : "NTROCC"},
+ "items" : [
+ {"name":"PRESSURE", "value_type" : "DOUBLE", "dimension":"Pressure" },
+ {"name":"PVMULT", "value_type":"DOUBLE", "size_type" : "ALL" , "dimension" : "1"}
+ ]
+}
diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCK2DTR b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCK2DTR
new file mode 100644
index 000000000..b4699d274
--- /dev/null
+++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCK2DTR
@@ -0,0 +1,6 @@
+{"name" : "ROCK2DTR" , "sections" : ["PROPS"], "num_tables" : {"keyword" : "ROCKCOMP" , "item" : "NTROCC"} ,
+ "items" : [
+ {"name":"PRESSURE", "value_type" : "DOUBLE", "dimension":"Pressure" },
+ {"name":"TRANSMULT", "value_type":"DOUBLE", "size_type" : "ALL" , "dimension" : "1"}
+ ]
+}
diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKWNOD b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKWNOD
new file mode 100644
index 000000000..323c4df97
--- /dev/null
+++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKWNOD
@@ -0,0 +1,5 @@
+{"name" : "ROCKWNOD" , "sections" : ["PROPS"], "size" : {"keyword" : "ROCKCOMP" , "item" : "NTROCC"},
+ "items" : [
+ {"name":"SATURATION", "value_type" : "DOUBLE", "size_type" : "ALL", "dimension":"1" }
+ ]
+}
diff --git a/src/opm/parser/eclipse/share/keywords/keyword_list.cmake b/src/opm/parser/eclipse/share/keywords/keyword_list.cmake
index c5ecd327c..77092cb04 100644
--- a/src/opm/parser/eclipse/share/keywords/keyword_list.cmake
+++ b/src/opm/parser/eclipse/share/keywords/keyword_list.cmake
@@ -198,6 +198,7 @@ set( keywords
000_Eclipse100/O/OPERNUM
000_Eclipse100/O/OPTIONS
000_Eclipse100/O/OUTRAD
+ 000_Eclipse100/O/OVERBURD
000_Eclipse100/P/PARALLEL
000_Eclipse100/P/PATHS
000_Eclipse100/P/PBVD
@@ -254,10 +255,13 @@ set( keywords
000_Eclipse100/R/RESTART
000_Eclipse100/R/RKTRMDIR
000_Eclipse100/R/ROCK
+ 000_Eclipse100/R/ROCK2D
+ 000_Eclipse100/R/ROCK2DTR
000_Eclipse100/R/ROCKCOMP
000_Eclipse100/R/ROCKNUM
000_Eclipse100/R/ROCKOPTS
000_Eclipse100/R/ROCKTAB
+ 000_Eclipse100/R/ROCKWNOD
000_Eclipse100/R/RPTGRID
000_Eclipse100/R/RPTONLY
000_Eclipse100/R/RPTONLYO
diff --git a/tests/parser/RockTableTests.cpp b/tests/parser/RockTableTests.cpp
new file mode 100644
index 000000000..225b99cb4
--- /dev/null
+++ b/tests/parser/RockTableTests.cpp
@@ -0,0 +1,140 @@
+/*
+ Copyright (C) 2019 by Norce
+
+ 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 RockTableTests
+
+#include
+
+#include
+#include
+#include
+#include
+
+// generic table classes
+#include
+#include
+
+// keyword specific table classes
+//#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+
+using namespace Opm;
+
+BOOST_AUTO_TEST_CASE( Rock2d ) {
+ const char *input =
+ "TABDIMS\n"
+ "1 1 /\n"
+ "\n"
+ "ROCKCOMP\n"
+ " REVERS 2 /\n"
+ "\n"
+ "OVERBURD\n"
+ "1 1.0\n"
+ "10 2.0\n"
+ " / \n"
+ "1 1.0\n"
+ "10 2.0\n"
+ " / \n"
+ "ROCK2D\n"
+ " 0.0 0.01\n"
+ " 0.02\n"
+ " 0.03 / \n"
+ "10.0 0.11 \n"
+ " 0.12 \n"
+ " 0.13/ \n"
+ "20.0 0.21\n"
+ " 0.22\n"
+ " 0.23/\n"
+ " / \n"
+ "0.7 0.04 \n"
+ " 0.05 /\n"
+ "10.0 0.14\n"
+ " 0.15/\n"
+ "20.0 0.24\n"
+ " 0.25/\n"
+ " / \n"
+ "ROCK2DTR\n"
+ " 0.0 0.01\n"
+ " 0.02\n"
+ " 0.03 / \n"
+ "10.0 0.11 \n"
+ " 0.12 \n"
+ " 0.13/ \n"
+ "20.0 0.21\n"
+ " 0.22\n"
+ " 0.23/\n"
+ " / \n"
+ "0.7 0.04 \n"
+ " 0.05 /\n"
+ "10.0 0.14\n"
+ " 0.15/\n"
+ "20.0 0.24\n"
+ " 0.25/\n"
+ " / \n"
+ "ROCKWNOD\n"
+ "0.0\n"
+ "0.5\n"
+ "1.0 /\n"
+ "0.9\n"
+ "1.0 /\n"
+ "\n";
+
+ auto deck = Parser().parseString( input );
+ TableManager tables( deck );
+
+ const auto& rock2d = tables.getRock2dTables();
+ const auto& rock2dtr = tables.getRock2dtrTables();
+ const auto& rockwnod = tables.getRockwnodTables();
+ const auto& overburd = tables.getOverburdTables();
+
+ const auto& rec1 = rock2d[0];
+ const auto& rec2 = rock2d.at(1);
+ const auto& rec1tr = rock2dtr[0];
+
+ const RockwnodTable& rockwnodTable1 = rockwnod.getTable(0);
+ const RockwnodTable& rockwnodTable2 = rockwnod.getTable(1);
+
+ const OverburdTable& overburdTable = overburd.getTable(0);
+ BOOST_CHECK_THROW( rock2d.at(2), std::out_of_range );
+ BOOST_REQUIRE_EQUAL(3, rec1.size());
+ BOOST_REQUIRE_EQUAL(3, rec2.size());
+ BOOST_REQUIRE_EQUAL(0.0, rec1.getPressureValue(0));
+ BOOST_REQUIRE_EQUAL(0.13, rec1.getPvmultValue(1,2));
+ BOOST_REQUIRE_EQUAL(rec1.sizeMultValues(), rockwnodTable1.getSaturationColumn().size());
+ BOOST_REQUIRE_EQUAL(rec2.sizeMultValues(), rockwnodTable2.getSaturationColumn().size());
+ BOOST_REQUIRE_EQUAL(0.0, rockwnodTable1.getSaturationColumn()[0]);
+ BOOST_REQUIRE_EQUAL(1, overburdTable.getDepthColumn()[0]);
+ BOOST_REQUIRE_EQUAL(1.0, overburdTable.getOverburdenPressureColumn()[0]);
+ BOOST_REQUIRE_EQUAL(0.0, rec1tr.getPressureValue(0));
+ BOOST_REQUIRE_EQUAL(0.13, rec1tr.getTransMultValue(1,2));
+
+ //BOOST_CHECK_CLOSE( 2, rec1.size() , 1e-5 );
+}