mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-20 11:48:25 -06:00
ebos: use the PVTNUM grid property instead of the PVTNUM keyword
besides enabling support for the modifier keywords, this should also be slightly faster (because no traversal of a binary is needed for every element anymore.)
This commit is contained in:
parent
70e55bf0ca
commit
323e4f1570
@ -689,15 +689,10 @@ public:
|
||||
*/
|
||||
unsigned pvtRegionIndex(unsigned elemIdx) const
|
||||
{
|
||||
auto deck = this->simulator().gridManager().deck();
|
||||
|
||||
if (!deck->hasKeyword("PVTNUM"))
|
||||
if (pvtnum_.empty())
|
||||
return 0;
|
||||
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
|
||||
unsigned cartesianDofIdx = gridManager.cartesianIndex(elemIdx);
|
||||
return deck->getKeyword("PVTNUM").getIntData()[cartesianDofIdx] - 1;
|
||||
return pvtnum_[elemIdx];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -891,6 +886,9 @@ private:
|
||||
|
||||
size_t numDof = this->model().numGridDof();
|
||||
|
||||
// the PVT region number
|
||||
updatePvtnum_();
|
||||
|
||||
////////////////////////////////
|
||||
// intrinsic permeability
|
||||
|
||||
@ -1238,6 +1236,25 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
void updatePvtnum_()
|
||||
{
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& eclProps = eclState->get3DProperties();
|
||||
|
||||
if (!eclProps.hasDeckIntGridProperty("PVTNUM"))
|
||||
return;
|
||||
|
||||
const auto& pvtnumData = eclProps.getIntGridProperty("PVTNUM").getData();
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
|
||||
unsigned numElems = gridManager.gridView().size(/*codim=*/0);
|
||||
pvtnum_.resize(numElems);
|
||||
for (unsigned elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
pvtnum_[elemIdx] = pvtnumData[cartElemIdx] - 1;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Scalar> porosity_;
|
||||
std::vector<Scalar> elementCenterDepth_;
|
||||
std::vector<DimMatrix> intrinsicPermeability_;
|
||||
@ -1247,6 +1264,7 @@ private:
|
||||
|
||||
EclThresholdPressure<TypeTag> thresholdPressures_;
|
||||
|
||||
std::vector<unsigned short> pvtnum_;
|
||||
std::vector<unsigned short> rockTableIdx_;
|
||||
std::vector<RockParams> rockParams_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user