#722 Grid Case Group Statistics: Include in-active cells for ACTNUM statistics

This commit is contained in:
Magne Sjaastad
2016-09-01 18:34:59 +02:00
parent f1451a1126
commit c9be561937
3 changed files with 15 additions and 11 deletions

View File

@@ -256,11 +256,11 @@ void RimEclipseStatisticsCase::computeStatistics()
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RimDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx]));
}
RimEclipseStatisticsCaseEvaluator stat(sourceCases, timeStepIndices, statisticsConfig, resultCase);
RimEclipseStatisticsCaseEvaluator stat(sourceCases, timeStepIndices, statisticsConfig, resultCase, gridCaseGroup);
if (m_useZeroAsInactiveCellValue)
{
stat.useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells(gridCaseGroup);
stat.useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells();
}
stat.evaluateForResults(resultSpecification);

View File

@@ -209,10 +209,11 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
{
double val = sourceDataAccessList.at(caseIdx)->cellScalar(cellIdx);
// If identical grid case group is set, treat huge_val as zero in the statistical computation
if (m_identicalGridCaseGroup && m_identicalGridCaseGroup->unionOfActiveCells(poroModel)->isActive(reservoirCellIndex))
// Replace huge_val with zero in the statistical computation for the following case
if (m_useZeroAsInactiveCellValue || resultName.toUpper() == "ACTNUM")
{
if (val == HUGE_VAL)
if (m_identicalGridCaseGroup->unionOfActiveCells(poroModel)->isActive(reservoirCellIndex) &&
val == HUGE_VAL)
{
val = 0.0;
}
@@ -315,13 +316,14 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::vector<RimEclipseCase*>& sourceCases, const std::vector<size_t>& timeStepIndices, const RimStatisticsConfig& statisticsConfig, RigCaseData* destinationCase)
RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::vector<RimEclipseCase*>& sourceCases, const std::vector<size_t>& timeStepIndices, const RimStatisticsConfig& statisticsConfig, RigCaseData* destinationCase, RimIdenticalGridCaseGroup* identicalGridCaseGroup)
: m_sourceCases(sourceCases),
m_statisticsConfig(statisticsConfig),
m_destinationCase(destinationCase),
m_reservoirCellCount(0),
m_timeStepIndices(timeStepIndices),
m_identicalGridCaseGroup(NULL)
m_identicalGridCaseGroup(identicalGridCaseGroup),
m_useZeroAsInactiveCellValue(false)
{
if (sourceCases.size() > 0)
{
@@ -334,8 +336,8 @@ RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseStatisticsCaseEvaluator::useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells(RimIdenticalGridCaseGroup* identicalGridCaseGroup)
void RimEclipseStatisticsCaseEvaluator::useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells()
{
m_identicalGridCaseGroup = identicalGridCaseGroup;
m_useZeroAsInactiveCellValue = true;
}

View File

@@ -59,7 +59,8 @@ public:
RimEclipseStatisticsCaseEvaluator(const std::vector<RimEclipseCase*>& sourceCases,
const std::vector<size_t>& timeStepIndices,
const RimStatisticsConfig& statisticsConfig,
RigCaseData* destinationCase);
RigCaseData* destinationCase,
RimIdenticalGridCaseGroup* identicalGridCaseGroup);
struct ResSpec
{
@@ -73,7 +74,7 @@ public:
QString m_resVarName;
};
void useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells(RimIdenticalGridCaseGroup* identicalGridCaseGroup);
void useZeroAsValueForInActiveCellsBasedOnUnionOfActiveCells();
void evaluateForResults(const QList<ResSpec >& resultSpecification);
@@ -91,5 +92,6 @@ private:
RimStatisticsConfig m_statisticsConfig;
RigCaseData* m_destinationCase;
RimIdenticalGridCaseGroup* m_identicalGridCaseGroup;
bool m_useZeroAsInactiveCellValue;
};