mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3630 Implement volume calculation on grid
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user