Make Region Multiplier Aware of Aquifer Connections

This commit implements the 'NOAQUNNC' behaviour in member function

    MULTREGTScanner::getRegionMultiplier()

We use the new 'aquifer_cells' data member to identify connections
to and within numerical aquifers and ignore those if the record
stipulates 'NOAQUNNC' behaviour.
This commit is contained in:
Bård Skaflestad
2023-08-28 18:29:47 +02:00
parent f99ae4b7cc
commit 51b1cf614d
2 changed files with 24 additions and 12 deletions

View File

@@ -133,6 +133,9 @@ namespace Opm {
void addKeyword(const DeckKeyword& deckKeyword);
void assertKeywordSupported(const DeckKeyword& deckKeyword);
bool isAquNNC(std::size_t globalCellIdx1, std::size_t globalCellIdx2) const;
bool isAquCell(std::size_t globalCellIdx) const;
};
} // namespace Opm

View File

@@ -279,15 +279,19 @@ namespace Opm {
};
auto ignoreMultiplierRecord =
[is_adj = is_adjacent(this->gridDims, globalIndex1, globalIndex2)]
[is_adj = is_adjacent(this->gridDims, globalIndex1, globalIndex2),
is_aqu = this->isAquNNC(globalIndex1, globalIndex2)]
(const MULTREGT::NNCBehaviourEnum nnc_behaviour)
{
// We ignore the record if either of the following conditions hold
//
// 1. Cells are adjacent, but record stipulates NNCs only
// 2. Connection is an NNC, but record stipulates no NNCs
return ( is_adj && (nnc_behaviour == MULTREGT::NNCBehaviourEnum::NNC))
|| (!is_adj && (nnc_behaviour == MULTREGT::NNCBehaviourEnum::NONNC));
// 3. Connection is associated to a numerical aquifer, but
// record stipulates that no such connections apply.
return ((is_adj && !is_aqu) && (nnc_behaviour == MULTREGT::NNCBehaviourEnum::NNC))
|| ((!is_adj || is_aqu) && (nnc_behaviour == MULTREGT::NNCBehaviourEnum::NONNC))
|| (is_aqu && (nnc_behaviour == MULTREGT::NNCBehaviourEnum::NOAQUNNC));
};
for (const auto& [regName, regMap] : this->m_searchMap) {
@@ -335,15 +339,6 @@ namespace Opm {
};
}
}
const auto nnc_behaviour = MULTREGT::
NNCBehaviourFromString(deckRecord.getItem("NNC_MULT").get<std::string>(0));
if (nnc_behaviour == MULTREGT::NNCBehaviourEnum::NOAQUNNC) {
throw std::invalid_argument {
"Sorry - currently we do not support 'NOAQUNNC' for MULTREGT."
};
}
}
}
@@ -390,4 +385,18 @@ namespace Opm {
}
}
}
bool MULTREGTScanner::isAquNNC(const std::size_t globalCellIdx1,
const std::size_t globalCellIdx2) const
{
return this->isAquCell(globalCellIdx1)
|| this->isAquCell(globalCellIdx2);
}
bool MULTREGTScanner::isAquCell(const std::size_t globalCellIdx) const
{
return std::binary_search(this->aquifer_cells.begin(),
this->aquifer_cells.end(),
globalCellIdx);
}
} // namespace Opm