mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-16 01:41:56 -06:00
ebos: add support for the ROCKOPTS keyword
this becomes important if th region which is supposed to be used by ROCK is not the same as the region for the PVT properties.
This commit is contained in:
parent
3b37038043
commit
f334bb32b9
@ -1028,20 +1028,41 @@ private:
|
|||||||
rockRecord.getItem("COMPRESSIBILITY").getSIDouble(0);
|
rockRecord.getItem("COMPRESSIBILITY").getSIDouble(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PVTNUM has not been specified, so everything is in the first region and we
|
// check the kind of region which is supposed to be used by checking the ROCKOPTS
|
||||||
// don't need to care...
|
// keyword. note that for some funny reason, the ROCK keyword uses PVTNUM by
|
||||||
if (!eclState.get3DProperties().hasDeckIntGridProperty("PVTNUM"))
|
// default, *not* ROCKNUM!
|
||||||
|
std::string propName = "PVTNUM";
|
||||||
|
if (deck.hasKeyword("ROCKOPTS")) {
|
||||||
|
const auto& rockoptsKeyword = deck.getKeyword("ROCKOPTS");
|
||||||
|
std::string rockTableType =
|
||||||
|
rockoptsKeyword.getRecord(0).getItem("TABLE_TYPE").getTrimmedString(0);
|
||||||
|
if (rockTableType == "PVTNUM")
|
||||||
|
propName = "PVTNUM";
|
||||||
|
else if (rockTableType == "SATNUM")
|
||||||
|
propName = "SATNUM";
|
||||||
|
else if (rockTableType == "ROCKNUM")
|
||||||
|
propName = "SATNUM";
|
||||||
|
else {
|
||||||
|
OPM_THROW(std::runtime_error,
|
||||||
|
"Unknown table type '" << rockTableType
|
||||||
|
<< " for the ROCKOPTS keyword given");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// the deck does not specify the selected keyword, so everything uses the first
|
||||||
|
// record of ROCK.
|
||||||
|
if (!eclState.get3DProperties().hasDeckIntGridProperty(propName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const std::vector<int>& pvtnumData =
|
const std::vector<int>& tablenumData =
|
||||||
eclState.get3DProperties().getIntGridProperty("PVTNUM").getData();
|
eclState.get3DProperties().getIntGridProperty(propName).getData();
|
||||||
unsigned numElem = gridManager.gridView().size(0);
|
unsigned numElem = gridManager.gridView().size(0);
|
||||||
rockTableIdx_.resize(numElem);
|
rockTableIdx_.resize(numElem);
|
||||||
for (size_t elemIdx = 0; elemIdx < numElem; ++ elemIdx) {
|
for (size_t elemIdx = 0; elemIdx < numElem; ++ elemIdx) {
|
||||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||||
|
|
||||||
// reminder: Eclipse uses FORTRAN-style indices
|
// reminder: Eclipse uses FORTRAN-style indices
|
||||||
rockTableIdx_[elemIdx] = pvtnumData[cartElemIdx] - 1;
|
rockTableIdx_[elemIdx] = tablenumData[cartElemIdx] - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user