From fc7ccd16036fb4c7619bc494c885ed7fe227af7c Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 28 Sep 2020 08:13:54 +0200 Subject: [PATCH] Set number of columns in ROCKTAB to three Throw if unsuppored directional and stress option is used --- .../eclipse/EclipseState/Tables/TableManager.cpp | 10 ++++++++++ src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp | 2 +- .../eclipse/share/keywords/000_Eclipse100/R/ROCKTAB | 2 -- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp b/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp index 8f27e51d0..6255189b7 100644 --- a/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp +++ b/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp @@ -774,6 +774,12 @@ namespace Opm { const auto rocktabKeyword = deck.getKeyword("ROCKTAB"); bool isDirectional = deck.hasKeyword(); + if (isDirectional) { + const std::string msg = "RKTRMDIR is in the deck. Flow does not support directional rock compaction mulipliers. \n" + "Make sure that your ROCKTAB table only has 3 columns"; + throw std::invalid_argument(msg); + } + bool useStressOption = false; if (deck.hasKeyword()) { const auto rockoptsKeyword = deck.getKeyword(); @@ -781,6 +787,10 @@ namespace Opm { const auto& item = rockoptsRecord.getItem(); useStressOption = (item.getTrimmedString(0) == "STRESS"); } + if (useStressOption) { + const std::string msg = "STRESS option is set in ROCKOPTS. Flow does not support stress option in rock compaction mulipliers"; + throw std::invalid_argument(msg); + } for (size_t tableIdx = 0; tableIdx < rocktabKeyword.size(); ++tableIdx) { const auto& tableRecord = rocktabKeyword.getRecord( tableIdx ); diff --git a/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp b/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp index 92b1c51fb..28e45187f 100644 --- a/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp +++ b/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp @@ -891,7 +891,7 @@ RocktabTable::RocktabTable( Table::ColumnOrderEnum POOrder; - if (hasStressOption) + if (!hasStressOption) POOrder = Table::STRICTLY_INCREASING; else POOrder = Table::STRICTLY_DECREASING; diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKTAB b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKTAB index 00fa5a1eb..45fd963f5 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKTAB +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/R/ROCKTAB @@ -15,8 +15,6 @@ "dimension": [ "Pressure", "1", - "1", - "1", "1" ] }