Updated opm-material to use new opm-parser Eclipse3DProperties API
This commit is contained in:
@@ -177,31 +177,32 @@ public:
|
||||
else
|
||||
enableThreePointKrSatScaling_ = false;
|
||||
|
||||
auto& props = eclState->getEclipseProperties();
|
||||
// check if we are supposed to scale the Y axis of the capillary pressure
|
||||
if (twoPhaseSystemType == EclOilWaterSystem)
|
||||
enablePcScaling_ =
|
||||
eclState->hasDeckDoubleGridProperty("PCW")
|
||||
|| eclState->hasDeckDoubleGridProperty("SWATINIT");
|
||||
props.hasDeckDoubleGridProperty("PCW")
|
||||
|| props.hasDeckDoubleGridProperty("SWATINIT");
|
||||
|
||||
else {
|
||||
assert(twoPhaseSystemType == EclGasOilSystem);
|
||||
enablePcScaling_ = eclState->hasDeckDoubleGridProperty("PCG");
|
||||
enablePcScaling_ = props.hasDeckDoubleGridProperty("PCG");
|
||||
}
|
||||
|
||||
// check if we are supposed to scale the Y axis of the wetting phase relperm
|
||||
if (twoPhaseSystemType == EclOilWaterSystem)
|
||||
enableKrwScaling_ = eclState->hasDeckDoubleGridProperty("KRW");
|
||||
enableKrwScaling_ = props.hasDeckDoubleGridProperty("KRW");
|
||||
else {
|
||||
assert(twoPhaseSystemType == EclGasOilSystem);
|
||||
enableKrwScaling_ = eclState->hasDeckDoubleGridProperty("KRO");
|
||||
enableKrwScaling_ = props.hasDeckDoubleGridProperty("KRO");
|
||||
}
|
||||
|
||||
// check if we are supposed to scale the Y axis of the non-wetting phase relperm
|
||||
if (twoPhaseSystemType == EclOilWaterSystem)
|
||||
enableKrnScaling_ = eclState->hasDeckDoubleGridProperty("KRO");
|
||||
enableKrnScaling_ = props.hasDeckDoubleGridProperty("KRO");
|
||||
else {
|
||||
assert(twoPhaseSystemType == EclGasOilSystem);
|
||||
enableKrnScaling_ = eclState->hasDeckDoubleGridProperty("KRG");
|
||||
enableKrnScaling_ = props.hasDeckDoubleGridProperty("KRG");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -70,9 +70,9 @@ public:
|
||||
std::string kwPrefix = useImbibition?"I":"";
|
||||
|
||||
if (useImbibition)
|
||||
satnum = &eclState->getIntGridProperty("IMBNUM")->getData();
|
||||
satnum = &eclState->getEclipseProperties().getIntGridProperty("IMBNUM").getData();
|
||||
else
|
||||
satnum = &eclState->getIntGridProperty("SATNUM")->getData();
|
||||
satnum = &eclState->getEclipseProperties().getIntGridProperty("SATNUM").getData();
|
||||
|
||||
retrieveGridPropertyData_(&swl, eclState, kwPrefix+"SWL");
|
||||
retrieveGridPropertyData_(&sgl, eclState, kwPrefix+"SGL");
|
||||
@@ -115,8 +115,8 @@ private:
|
||||
const std::string& properyName)
|
||||
{
|
||||
(*data) = 0;
|
||||
if (eclState->hasDeckDoubleGridProperty(properyName))
|
||||
(*data) = &eclState->getDoubleGridProperty(properyName)->getData();
|
||||
if (eclState->getEclipseProperties().hasDeckDoubleGridProperty(properyName))
|
||||
(*data) = &eclState->getEclipseProperties().getDoubleGridProperty(properyName).getData();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
@@ -193,13 +193,13 @@ struct EclEpsScalingPointsInfo
|
||||
unsigned satRegionIdx)
|
||||
{
|
||||
// TODO: support for the SOF2/SOF3 keyword family
|
||||
auto tables = eclState->getTableManager();
|
||||
const TableContainer& swofTables = tables->getSwofTables();
|
||||
const TableContainer& sgofTables = tables->getSgofTables();
|
||||
const TableContainer& slgofTables = tables->getSlgofTables();
|
||||
const TableContainer& swfnTables = tables->getSwfnTables();
|
||||
const TableContainer& sgfnTables = tables->getSgfnTables();
|
||||
const TableContainer& sof3Tables = tables->getSof3Tables();
|
||||
const auto& tables = eclState->getTableManager();
|
||||
const TableContainer& swofTables = tables.getSwofTables();
|
||||
const TableContainer& sgofTables = tables.getSgofTables();
|
||||
const TableContainer& slgofTables = tables.getSlgofTables();
|
||||
const TableContainer& swfnTables = tables.getSwfnTables();
|
||||
const TableContainer& sgfnTables = tables.getSgfnTables();
|
||||
const TableContainer& sof3Tables = tables.getSof3Tables();
|
||||
|
||||
bool hasWater = deck->hasKeyword("WATER");
|
||||
bool hasGas = deck->hasKeyword("GAS");
|
||||
|
||||
@@ -123,8 +123,8 @@ public:
|
||||
// copy the SATNUM grid property. in some cases this is not necessary, but it
|
||||
// should not require much memory anyway...
|
||||
std::vector<int> satnumRegionArray(numCompressedElems);
|
||||
if (eclState->hasDeckIntGridProperty("SATNUM")) {
|
||||
const auto& satnumRawData = eclState->getIntGridProperty("SATNUM")->getData();
|
||||
if (eclState->getEclipseProperties().hasDeckIntGridProperty("SATNUM")) {
|
||||
const auto& satnumRawData = eclState->getEclipseProperties().getIntGridProperty("SATNUM").getData();
|
||||
for (unsigned elemIdx = 0; elemIdx < numCompressedElems; ++elemIdx) {
|
||||
unsigned cartesianElemIdx = static_cast<unsigned>(compressedToCartesianElemIdx[elemIdx]);
|
||||
satnumRegionArray[elemIdx] = satnumRawData[cartesianElemIdx] - 1;
|
||||
@@ -449,7 +449,7 @@ private:
|
||||
oilWaterImbParams.resize(numCompressedElems);
|
||||
}
|
||||
|
||||
const auto& imbnumData = eclState->getIntGridProperty("IMBNUM")->getData();
|
||||
const auto& imbnumData = eclState->getEclipseProperties().getIntGridProperty("IMBNUM").getData();
|
||||
assert(numCompressedElems == satnumRegionArray.size());
|
||||
for (unsigned elemIdx = 0; elemIdx < numCompressedElems; ++elemIdx) {
|
||||
unsigned satnumIdx = static_cast<unsigned>(satnumRegionArray[elemIdx]);
|
||||
@@ -541,12 +541,13 @@ private:
|
||||
SaturationFunctionFamily getSaturationFunctionFamily(Opm::EclipseStateConstPtr eclState) const
|
||||
{
|
||||
const auto& tableManager = eclState->getTableManager();
|
||||
const TableContainer& swofTables = tableManager->getSwofTables();
|
||||
const TableContainer& slgofTables= tableManager->getSlgofTables();
|
||||
const TableContainer& sgofTables = tableManager->getSgofTables();
|
||||
const TableContainer& swfnTables = tableManager->getSwfnTables();
|
||||
const TableContainer& sgfnTables = tableManager->getSgfnTables();
|
||||
const TableContainer& sof3Tables = tableManager->getSof3Tables();
|
||||
const TableContainer& swofTables = tableManager.getSwofTables();
|
||||
const TableContainer& slgofTables= tableManager.getSlgofTables();
|
||||
const TableContainer& sgofTables = tableManager.getSgofTables();
|
||||
const TableContainer& swfnTables = tableManager.getSwfnTables();
|
||||
const TableContainer& sgfnTables = tableManager.getSgfnTables();
|
||||
const TableContainer& sof3Tables = tableManager.getSof3Tables();
|
||||
|
||||
|
||||
bool family1 = (!sgofTables.empty() || !slgofTables.empty()) && !swofTables.empty();
|
||||
bool family2 = !swfnTables.empty() && !sgfnTables.empty() && !sof3Tables.empty();
|
||||
@@ -590,8 +591,8 @@ private:
|
||||
// handle the twophase case
|
||||
const auto& tableManager = eclState->getTableManager();
|
||||
if (!hasWater) {
|
||||
const TableContainer& sgofTables = tableManager->getSgofTables();
|
||||
const TableContainer& slgofTables = tableManager->getSlgofTables();
|
||||
const TableContainer& sgofTables = tableManager.getSgofTables();
|
||||
const TableContainer& slgofTables = tableManager.getSlgofTables();
|
||||
if (!sgofTables.empty())
|
||||
readGasOilEffectiveParametersSgof_(effParams,
|
||||
Swco,
|
||||
@@ -618,8 +619,8 @@ private:
|
||||
switch (getSaturationFunctionFamily(eclState)) {
|
||||
case FamilyI:
|
||||
{
|
||||
const TableContainer& sgofTables = tableManager->getSgofTables();
|
||||
const TableContainer& slgofTables = tableManager->getSlgofTables();
|
||||
const TableContainer& sgofTables = tableManager.getSgofTables();
|
||||
const TableContainer& slgofTables = tableManager.getSlgofTables();
|
||||
if (!sgofTables.empty())
|
||||
readGasOilEffectiveParametersSgof_(effParams,
|
||||
Swco,
|
||||
@@ -633,8 +634,8 @@ private:
|
||||
|
||||
case FamilyII:
|
||||
{
|
||||
const Sof3Table& sof3Table = tableManager->getSof3Tables().getTable<Sof3Table>( satnumIdx );
|
||||
const SgfnTable& sgfnTable = tableManager->getSgfnTables().getTable<SgfnTable>( satnumIdx );
|
||||
const Sof3Table& sof3Table = tableManager.getSof3Tables().getTable<Sof3Table>( satnumIdx );
|
||||
const SgfnTable& sgfnTable = tableManager.getSgfnTables().getTable<SgfnTable>( satnumIdx );
|
||||
readGasOilEffectiveParametersFamily2_(effParams,
|
||||
Swco,
|
||||
sof3Table,
|
||||
@@ -715,7 +716,7 @@ private:
|
||||
bool hasGas = deck->hasKeyword("GAS");
|
||||
bool hasOil = deck->hasKeyword("OIL");
|
||||
|
||||
const auto tableManager = eclState->getTableManager();
|
||||
const auto& tableManager = eclState->getTableManager();
|
||||
auto& effParams = *dest[satnumIdx];
|
||||
|
||||
// handle the twophase case
|
||||
@@ -723,7 +724,7 @@ private:
|
||||
return;
|
||||
}
|
||||
else if (!hasGas) {
|
||||
const auto& swofTable = tableManager->getSwofTables().getTable<SwofTable>(satnumIdx);
|
||||
const auto& swofTable = tableManager.getSwofTables().getTable<SwofTable>(satnumIdx);
|
||||
std::vector<double> SwColumn = swofTable.getColumn("SW").vectorCopy();
|
||||
|
||||
effParams.setKrwSamples(SwColumn, swofTable.getColumn("KRW").vectorCopy());
|
||||
@@ -742,7 +743,7 @@ private:
|
||||
|
||||
switch (getSaturationFunctionFamily(eclState)) {
|
||||
case FamilyI: {
|
||||
const auto& swofTable = tableManager->getSwofTables().getTable<SwofTable>(satnumIdx);
|
||||
const auto& swofTable = tableManager.getSwofTables().getTable<SwofTable>(satnumIdx);
|
||||
std::vector<double> SwColumn = swofTable.getColumn("SW").vectorCopy();
|
||||
|
||||
effParams.setKrwSamples(SwColumn, swofTable.getColumn("KRW").vectorCopy());
|
||||
@@ -753,8 +754,8 @@ private:
|
||||
}
|
||||
case FamilyII:
|
||||
{
|
||||
const auto& swfnTable = tableManager->getSwfnTables().getTable<SwfnTable>(satnumIdx);
|
||||
const auto& sof3Table = tableManager->getSof3Tables().getTable<Sof3Table>(satnumIdx);
|
||||
const auto& swfnTable = tableManager.getSwfnTables().getTable<SwfnTable>(satnumIdx);
|
||||
const auto& sof3Table = tableManager.getSof3Tables().getTable<Sof3Table>(satnumIdx);
|
||||
std::vector<double> SwColumn = swfnTable.getColumn("SW").vectorCopy();
|
||||
|
||||
// convert the saturations of the SOF3 keyword from oil to water saturations
|
||||
|
||||
Reference in New Issue
Block a user