#2146 Num Flooded PV: Add volume weighted mean for visible cells and current time step

This commit is contained in:
Rebecca Cox
2017-11-16 10:50:48 +01:00
parent 4b2af286e3
commit 49417bbb3a
13 changed files with 214 additions and 54 deletions

View File

@@ -41,7 +41,6 @@
#include <math.h>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -887,6 +886,14 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiAreaNormTranResultName(), false, 0);
}
}
//Mobile Pore Volume
{
if (findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PORV") != cvf::UNDEFINED_SIZE_T)
{
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName(), false, 0);
}
}
}
//--------------------------------------------------------------------------------------------------
@@ -1065,6 +1072,10 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
progressInfo.incrementProgress();
}
}
else if (resultName == RiaDefines::mobilePoreVolumeName())
{
computeMobilePV();
}
if (type == RiaDefines::GENERATED)
{
@@ -2242,6 +2253,59 @@ double RigCaseCellResultsData::darchysValue()
return RiaEclipseUnitTools::darcysConstant(m_ownerCaseData->unitsType());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::computeMobilePV()
{
std::vector<double> porvDataTemp;
std::vector<double> swcrDataTemp;
std::vector<double> multpvDataTemp;
const std::vector<double>* porvResults = nullptr;
const std::vector<double>* swcrResults = nullptr;
const std::vector<double>* multpvResults = nullptr;
porvResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "PORV", porvDataTemp);
swcrResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "SWCR", swcrDataTemp);
multpvResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "MULTPV", multpvDataTemp);
CVF_ASSERT(!porvResults->empty());
size_t mobPVIdx = this->findOrCreateScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName(), false);
std::vector<double> &mobPVResults = this->cellScalarResults(mobPVIdx)[0];
// Set up output container to correct number of results
mobPVResults.resize(porvResults->size());
if (!(multpvResults || swcrResults))
{
mobPVResults.assign(porvResults->begin(), porvResults->end());
}
else if (!multpvResults)
{
for (size_t vIdx = 0; vIdx < porvResults->size(); ++vIdx)
{
mobPVResults[vIdx] = (*porvResults)[vIdx] * (1.0 - (*swcrResults)[vIdx]);
}
}
else if (!swcrResults)
{
for (size_t vIdx = 0; vIdx < porvResults->size(); ++vIdx)
{
mobPVResults[vIdx] = (*multpvResults)[vIdx] * (*porvResults)[vIdx];
}
}
else
{
for (size_t vIdx = 0; vIdx < porvResults->size(); ++vIdx)
{
mobPVResults[vIdx] = (*multpvResults)[vIdx] * (*porvResults)[vIdx] * (1.0 - (*swcrResults)[vIdx]);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------