mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added special handling of combined transmissibility
This commit is contained in:
@@ -40,5 +40,7 @@ public:
|
||||
};
|
||||
|
||||
static QString undefinedResultName() { return "None"; }
|
||||
|
||||
static QString combinedTransmissibilityResultName() { return "CombTrans"; }
|
||||
};
|
||||
|
||||
|
@@ -727,6 +727,16 @@ size_t RimReservoirCellResultsStorage::storedResultsCount()
|
||||
return m_resultCacheMetaData.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimReservoirCellResultsStorage::createCombinedTransmissibilityResults()
|
||||
{
|
||||
if (!m_cellResults) return;
|
||||
|
||||
m_cellResults->createCombinedTransmissibilityResult();
|
||||
}
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimReservoirCellResultsStorageEntryInfo, "ResultStorageEntryInfo");
|
||||
|
||||
|
@@ -51,6 +51,7 @@ public:
|
||||
RifReaderInterface* readerInterface();
|
||||
|
||||
void loadOrComputeSOIL();
|
||||
void createCombinedTransmissibilityResults();
|
||||
void computeDepthRelatedResults();
|
||||
|
||||
size_t findOrLoadScalarResultForTimeStep(RimDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex);
|
||||
|
@@ -941,6 +941,7 @@ void RimReservoirView::loadDataAndUpdate()
|
||||
RimReservoirCellResultsStorage* results = currentGridCellResults();
|
||||
CVF_ASSERT(results);
|
||||
results->loadOrComputeSOIL();
|
||||
results->createCombinedTransmissibilityResults();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -196,7 +196,17 @@ void RimResultDefinition::loadResult()
|
||||
RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
||||
if (gridCellResults)
|
||||
{
|
||||
gridCellResults->findOrLoadScalarResult(m_resultType(), m_resultVariable);
|
||||
if (m_resultType() == RimDefines::STATIC_NATIVE &&
|
||||
m_resultVariable().compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
gridCellResults->findOrLoadScalarResult(m_resultType(), "TRANX");
|
||||
gridCellResults->findOrLoadScalarResult(m_resultType(), "TRANY");
|
||||
gridCellResults->findOrLoadScalarResult(m_resultType(), "TRANZ");
|
||||
}
|
||||
else
|
||||
{
|
||||
gridCellResults->findOrLoadScalarResult(m_resultType(), m_resultVariable);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,6 +33,8 @@ RigCaseCellResultsData::RigCaseCellResultsData(RigMainGrid* ownerGrid)
|
||||
{
|
||||
CVF_ASSERT(ownerGrid != NULL);
|
||||
m_ownerMainGrid = ownerGrid;
|
||||
|
||||
m_combinedTransmissibilityResultIndex = cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +117,18 @@ void RigCaseCellResultsData::minMaxCellScalarValues(size_t scalarResultIndex, si
|
||||
return;
|
||||
}
|
||||
|
||||
if (scalarResultIndex == m_combinedTransmissibilityResultIndex)
|
||||
{
|
||||
size_t tranX, tranY, tranZ;
|
||||
if (!findTransmissibilityResults(tranX, tranY, tranZ)) return;
|
||||
|
||||
minMaxCellScalarValues(tranX, timeStepIndex, min, max);
|
||||
minMaxCellScalarValues(tranY, timeStepIndex, min, max);
|
||||
minMaxCellScalarValues(tranZ, timeStepIndex, min, max);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<double>& values = m_cellScalarResults[scalarResultIndex][timeStepIndex];
|
||||
|
||||
size_t i;
|
||||
@@ -167,12 +181,28 @@ const std::vector<size_t>& RigCaseCellResultsData::cellScalarValuesHistogram(siz
|
||||
this->minMaxCellScalarValues( scalarResultIndex, min, max );
|
||||
RigHistogramCalculator histCalc(min, max, nBins, &m_histograms[scalarResultIndex]);
|
||||
|
||||
for (size_t tsIdx = 0; tsIdx < this->timeStepCount(scalarResultIndex); tsIdx++)
|
||||
if (scalarResultIndex == m_combinedTransmissibilityResultIndex)
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[scalarResultIndex][tsIdx];
|
||||
size_t tranX, tranY, tranZ;
|
||||
if (findTransmissibilityResults(tranX, tranY, tranZ))
|
||||
{
|
||||
for (size_t tsIdx = 0; tsIdx < this->timeStepCount(scalarResultIndex); tsIdx++)
|
||||
{
|
||||
histCalc.addData(m_cellScalarResults[tranX][tsIdx]);
|
||||
histCalc.addData(m_cellScalarResults[tranY][tsIdx]);
|
||||
histCalc.addData(m_cellScalarResults[tranZ][tsIdx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t tsIdx = 0; tsIdx < this->timeStepCount(scalarResultIndex); tsIdx++)
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[scalarResultIndex][tsIdx];
|
||||
|
||||
histCalc.addData(values);
|
||||
}
|
||||
histCalc.addData(values);
|
||||
}
|
||||
}
|
||||
|
||||
m_p10p90[scalarResultIndex].first = histCalc.calculatePercentil(0.1);
|
||||
m_p10p90[scalarResultIndex].second = histCalc.calculatePercentil(0.9);
|
||||
@@ -215,14 +245,52 @@ void RigCaseCellResultsData::meanCellScalarValues(size_t scalarResultIndex, doub
|
||||
|
||||
double valueSum = 0.0;
|
||||
size_t count = 0;
|
||||
for (size_t tIdx = 0; tIdx < timeStepCount(scalarResultIndex); tIdx++)
|
||||
|
||||
if (scalarResultIndex == m_combinedTransmissibilityResultIndex)
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[scalarResultIndex][tIdx];
|
||||
for (size_t cIdx = 0; cIdx < values.size(); ++cIdx)
|
||||
size_t tranX, tranY, tranZ;
|
||||
if (findTransmissibilityResults(tranX, tranY, tranZ))
|
||||
{
|
||||
valueSum += values[cIdx];
|
||||
for (size_t tIdx = 0; tIdx < timeStepCount(tranX); tIdx++)
|
||||
{
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[tranX][tIdx];
|
||||
for (size_t cIdx = 0; cIdx < values.size(); ++cIdx)
|
||||
{
|
||||
valueSum += values[cIdx];
|
||||
}
|
||||
count += values.size();
|
||||
}
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[tranY][tIdx];
|
||||
for (size_t cIdx = 0; cIdx < values.size(); ++cIdx)
|
||||
{
|
||||
valueSum += values[cIdx];
|
||||
}
|
||||
count += values.size();
|
||||
}
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[tranZ][tIdx];
|
||||
for (size_t cIdx = 0; cIdx < values.size(); ++cIdx)
|
||||
{
|
||||
valueSum += values[cIdx];
|
||||
}
|
||||
count += values.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t tIdx = 0; tIdx < timeStepCount(scalarResultIndex); tIdx++)
|
||||
{
|
||||
std::vector<double>& values = m_cellScalarResults[scalarResultIndex][tIdx];
|
||||
for (size_t cIdx = 0; cIdx < values.size(); ++cIdx)
|
||||
{
|
||||
valueSum += values[cIdx];
|
||||
}
|
||||
count += values.size();
|
||||
}
|
||||
count += values.size();
|
||||
}
|
||||
|
||||
m_meanValues[scalarResultIndex] = valueSum/count;
|
||||
@@ -665,6 +733,19 @@ void RigCaseCellResultsData::posNegClosestToZero(size_t scalarResultIndex, size_
|
||||
return;
|
||||
}
|
||||
|
||||
if (scalarResultIndex == m_combinedTransmissibilityResultIndex)
|
||||
{
|
||||
size_t tranX, tranY, tranZ;
|
||||
if (findTransmissibilityResults(tranX, tranY, tranZ))
|
||||
{
|
||||
posNegClosestToZero(tranX, timeStepIndex, pos, neg);
|
||||
posNegClosestToZero(tranY, timeStepIndex, pos, neg);
|
||||
posNegClosestToZero(tranZ, timeStepIndex, pos, neg);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<double>& values = m_cellScalarResults[scalarResultIndex][timeStepIndex];
|
||||
|
||||
size_t i;
|
||||
@@ -690,3 +771,37 @@ void RigCaseCellResultsData::posNegClosestToZero(size_t scalarResultIndex, size_
|
||||
m_posNegClosestToZeroPrTs[scalarResultIndex][timeStepIndex].second= neg;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::createCombinedTransmissibilityResult()
|
||||
{
|
||||
size_t combinedTransmissibilityIndex = findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName());
|
||||
if (combinedTransmissibilityIndex != cvf::UNDEFINED_SIZE_T) return;
|
||||
|
||||
size_t tranX, tranY, tranZ;
|
||||
if (!findTransmissibilityResults(tranX, tranY, tranZ)) return;
|
||||
|
||||
|
||||
m_combinedTransmissibilityResultIndex = addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName(), false, 0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCaseCellResultsData::findTransmissibilityResults(size_t& tranX, size_t& tranY, size_t& tranZ) const
|
||||
{
|
||||
tranX = findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANX");
|
||||
tranY = findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANY");
|
||||
tranZ = findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANZ");
|
||||
|
||||
if (tranX == cvf::UNDEFINED_SIZE_T ||
|
||||
tranY == cvf::UNDEFINED_SIZE_T ||
|
||||
tranZ == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -66,6 +66,8 @@ public:
|
||||
size_t addEmptyScalarResult(RimDefines::ResultCatType type, const QString& resultName, bool needsToBeStored);
|
||||
QString makeResultNameUnique(const QString& resultNameProposal) const;
|
||||
|
||||
void createCombinedTransmissibilityResult();
|
||||
|
||||
void removeResult(const QString& resultName);
|
||||
void clearAllResults();
|
||||
void freeAllocatedResultsData();
|
||||
@@ -106,6 +108,8 @@ public:
|
||||
const QString& resultName,
|
||||
bool needsToBeStored,
|
||||
size_t resultValueCount);
|
||||
private:
|
||||
bool findTransmissibilityResults(size_t& tranX, size_t& tranY, size_t& tranZ) const;
|
||||
|
||||
private:
|
||||
std::vector< std::vector< std::vector<double> > > m_cellScalarResults; ///< Scalar results on the complete reservoir for each Result index (ResultVariable) and timestep
|
||||
@@ -118,7 +122,7 @@ private:
|
||||
std::vector< std::vector< std::pair<double, double> > > m_maxMinValuesPrTs; ///< Max min values for each Result index and timestep
|
||||
std::vector< std::vector< std::pair<double, double> > > m_posNegClosestToZeroPrTs;
|
||||
|
||||
|
||||
size_t m_combinedTransmissibilityResultIndex;
|
||||
|
||||
private:
|
||||
std::vector<ResultInfo> m_resultInfos;
|
||||
|
Reference in New Issue
Block a user