Set number of columns in ROCKTAB to three

Throw if unsuppored directional and stress option is used
This commit is contained in:
Tor Harald Sandve 2020-09-28 08:13:54 +02:00
parent 6ee4e5ce9a
commit fc7ccd1603
3 changed files with 11 additions and 3 deletions

View File

@ -774,6 +774,12 @@ namespace Opm {
const auto rocktabKeyword = deck.getKeyword("ROCKTAB"); const auto rocktabKeyword = deck.getKeyword("ROCKTAB");
bool isDirectional = deck.hasKeyword<ParserKeywords::RKTRMDIR>(); bool isDirectional = deck.hasKeyword<ParserKeywords::RKTRMDIR>();
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; bool useStressOption = false;
if (deck.hasKeyword<ParserKeywords::ROCKOPTS>()) { if (deck.hasKeyword<ParserKeywords::ROCKOPTS>()) {
const auto rockoptsKeyword = deck.getKeyword<ParserKeywords::ROCKOPTS>(); const auto rockoptsKeyword = deck.getKeyword<ParserKeywords::ROCKOPTS>();
@ -781,6 +787,10 @@ namespace Opm {
const auto& item = rockoptsRecord.getItem<ParserKeywords::ROCKOPTS::METHOD>(); const auto& item = rockoptsRecord.getItem<ParserKeywords::ROCKOPTS::METHOD>();
useStressOption = (item.getTrimmedString(0) == "STRESS"); 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) { for (size_t tableIdx = 0; tableIdx < rocktabKeyword.size(); ++tableIdx) {
const auto& tableRecord = rocktabKeyword.getRecord( tableIdx ); const auto& tableRecord = rocktabKeyword.getRecord( tableIdx );

View File

@ -891,7 +891,7 @@ RocktabTable::RocktabTable(
Table::ColumnOrderEnum POOrder; Table::ColumnOrderEnum POOrder;
if (hasStressOption) if (!hasStressOption)
POOrder = Table::STRICTLY_INCREASING; POOrder = Table::STRICTLY_INCREASING;
else else
POOrder = Table::STRICTLY_DECREASING; POOrder = Table::STRICTLY_DECREASING;

View File

@ -15,8 +15,6 @@
"dimension": [ "dimension": [
"Pressure", "Pressure",
"1", "1",
"1",
"1",
"1" "1"
] ]
} }