#3630 Implement volume calculation on grid

This commit is contained in:
Gaute Lindkvist
2018-11-06 12:47:54 +01:00
parent 8ebfe074f1
commit ef4b70d6e5
12 changed files with 261 additions and 22 deletions

View File

@@ -961,6 +961,12 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
}
}
// Cell Volume
{
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::riCellVolumeResultName(), false, 0);
}
// Mobile Pore Volume
{
if (findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PORV") != cvf::UNDEFINED_SIZE_T)
@@ -1140,6 +1146,10 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
progressInfo.incrementProgress();
}
}
else if (resultName == RiaDefines::riCellVolumeResultName())
{
computeCellVolumes();
}
else if (resultName == RiaDefines::mobilePoreVolumeName())
{
computeMobilePV();
@@ -2404,6 +2414,30 @@ double RigCaseCellResultsData::darchysValue()
return RiaEclipseUnitTools::darcysConstant(m_ownerCaseData->unitsType());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::computeCellVolumes()
{
size_t cellVolIdx = this->findOrCreateScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riCellVolumeResultName(), false);
std::vector<double>& cellVolumeResults = this->cellScalarResults(cellVolIdx)[0];
size_t cellResultCount = m_activeCellInfo->reservoirCellResultCount();
cellVolumeResults.resize(cellResultCount, 0u);
#pragma omp parallel for
for (int nativeResvCellIndex = 0; nativeResvCellIndex < static_cast<int>(m_ownerMainGrid->globalCellArray().size()); nativeResvCellIndex++)
{
size_t resultIndex = activeCellInfo()->cellResultIndex(nativeResvCellIndex);
if (resultIndex != cvf::UNDEFINED_SIZE_T)
{
const RigCell& cell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
cellVolumeResults[resultIndex] = cell.volume();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------