diff --git a/ApplicationCode/ProjectDataModel/RimDefines.h b/ApplicationCode/ProjectDataModel/RimDefines.h index 68c16695ec..5d97f36820 100644 --- a/ApplicationCode/ProjectDataModel/RimDefines.h +++ b/ApplicationCode/ProjectDataModel/RimDefines.h @@ -47,6 +47,10 @@ public: static QString ternarySaturationResultName() { return "TERNARY"; } static QString combinedMultResultName() { return "MULTXYZ"; } static QString combinedRiTransResultName() { return "riTRANSXYZ"; } + static QString riTransXResultName() { return "riTRANSX"; } + static QString riTransYResultName() { return "riTRANSY"; } + static QString riTransZResultName() { return "riTRANSZ"; } + // Mock model text identifiers static QString mockModelBasic() { return "Result Mock Debug Model Simple"; } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index 5baa428661..62e8a444ed 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -219,7 +219,8 @@ RifReaderInterface* RimReservoirCellResultsStorage::readerInterface() } //-------------------------------------------------------------------------------------------------- -/// +/// This method is intended to be used for multicase cross statistical calculations, when +/// we need process one timestep at a time, freeing memory as we go. //-------------------------------------------------------------------------------------------------- size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RimDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex) { @@ -296,7 +297,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RimDefines::Result size_t scalarResultIndex = m_cellResults->findScalarResultIndex(type, resultName); if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) return cvf::UNDEFINED_SIZE_T; - // If we have any results on any time step, assume we have loaded results already + if (isDataPresent(scalarResultIndex)) { return scalarResultIndex; @@ -316,6 +317,20 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RimDefines::Result return scalarResultIndex; } + if (resultName == RimDefines::combinedRiTransResultName()) + { + computeRiTransComponent(RimDefines::riTransXResultName()); + computeRiTransComponent(RimDefines::riTransYResultName()); + computeRiTransComponent(RimDefines::riTransZResultName()); + } + + if ( resultName == RimDefines::riTransXResultName() + || resultName == RimDefines::riTransYResultName() + || resultName == RimDefines::riTransZResultName()) + { + computeRiTransComponent(resultName); + } + if (type == RimDefines::GENERATED) { return cvf::UNDEFINED_SIZE_T; @@ -665,21 +680,47 @@ size_t reservoirActiveCellIndex(const RigActiveCellInfo* activeCellinfo, size_t //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimReservoirCellResultsStorage::computeRiTransX() +void RimReservoirCellResultsStorage::computeRiTransComponent(const QString& riTransComponentResultName) { if (!m_cellResults) return; - - cvf::StructGridInterface::FaceType faceId = cvf::StructGridInterface::POS_I; - QString riTRANName = "riTRANX"; - QString permName = "PERMX"; + // Set up which component to compute + + cvf::StructGridInterface::FaceType faceId; + QString permCompName; + + if (riTransComponentResultName == RimDefines::riTransXResultName()) + { + permCompName = "PERMX"; + faceId = cvf::StructGridInterface::POS_I; + } + else if (riTransComponentResultName == RimDefines::riTransYResultName()) + { + permCompName = "PERMY"; + faceId = cvf::StructGridInterface::POS_J; + } + else if (riTransComponentResultName == RimDefines::riTransZResultName()) + { + permCompName = "PERMZ"; + faceId = cvf::StructGridInterface::POS_K; + } + else + { + CVF_ASSERT(false); + } + + // Todo: Get the correct one from Unit set read by ERT double cdarchy = 0.008527; // (ECLIPSE 100) (METRIC) // Get the needed result indices we depend on - size_t permResultIdx = findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMX"); - size_t ntgResultIdx = findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "NTG"); + size_t permResultIdx = findOrLoadScalarResult(RimDefines::STATIC_NATIVE, permCompName); + size_t ntgResultIdx = findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "NTG"); + + // Get the result index of the output + size_t riTransResultIdx = m_cellResults->findScalarResultIndex(RimDefines::STATIC_NATIVE, riTransComponentResultName); + CVF_ASSERT(riTransResultIdx != cvf::UNDEFINED_SIZE_T); // Get the result count, to handle that one of them might be globally defined @@ -688,14 +729,15 @@ void RimReservoirCellResultsStorage::computeRiTransX() size_t resultValueCount = CVF_MIN(permxResultValueCount, ntgResultValueCount); - // Check if we need to create a placeholder result, or if it exists already + // Get all the actual result values - size_t riTransResultIdx = findOrLoadScalarResult(RimDefines::STATIC_NATIVE, riTRANName); + std::vector & permResults = m_cellResults->cellScalarResults(permResultIdx)[0]; + std::vector & ntgResults = m_cellResults->cellScalarResults(ntgResultIdx)[0]; + std::vector & riTransResults = m_cellResults->cellScalarResults(riTransResultIdx)[0]; - if (riTransResultIdx == cvf::UNDEFINED_SIZE_T) - { - riTransResultIdx = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, riTRANName, false, resultValueCount); - } + // Set up output container to correct number of results + + riTransResults.resize(resultValueCount); // Prepare how to index the result values: @@ -709,19 +751,17 @@ void RimReservoirCellResultsStorage::computeRiTransX() ResultIndexFunction permIdxFunc = isPermUsingResIdx ? &reservoirActiveCellIndex : &directReservoirCellIndex; ResultIndexFunction ntgIdxFunc = isNtgUsingResIdx ? &reservoirActiveCellIndex : &directReservoirCellIndex; - // Get all the actual result values - - std::vector & riTransResults = m_cellResults->cellScalarResults(riTransResultIdx)[0]; - std::vector & permResults = m_cellResults->cellScalarResults(permResultIdx)[0]; - std::vector & ntgResults = m_cellResults->cellScalarResults(ntgResultIdx)[0]; const RigActiveCellInfo* activeCellInfo = m_cellResults->activeCellInfo(); const std::vector& nodes = m_ownerMainGrid->nodes(); + bool isFaceNormalsOutwards = m_ownerMainGrid->faceNormalsIsOutwards(); for (size_t nativeResvCellIndex = 0; nativeResvCellIndex < m_ownerMainGrid->cells().size(); nativeResvCellIndex++) { // Do nothing if we are only dealing with active cells, and this cell is not active: - if ((*riTranIdxFunc)(activeCellInfo, nativeResvCellIndex) == cvf::UNDEFINED_SIZE_T) continue; + size_t tranResIdx = (*riTranIdxFunc)(activeCellInfo, nativeResvCellIndex); + + if (tranResIdx == cvf::UNDEFINED_SIZE_T) continue; const RigCell& nativeCell = m_ownerMainGrid->cells()[nativeResvCellIndex]; RigGridBase* grid = nativeCell.hostGrid(); @@ -737,6 +777,10 @@ void RimReservoirCellResultsStorage::computeRiTransX() size_t neighborResvCellIdx = grid->reservoirCellIndex(gridLocalNeighborCellIdx); const RigCell& neighborCell = m_ownerMainGrid->cells()[neighborResvCellIdx]; + // Do nothing if neighbor cell has no results + size_t neighborCellPermResIdx = (*permIdxFunc)(activeCellInfo, neighborResvCellIdx); + if (neighborCellPermResIdx == cvf::UNDEFINED_SIZE_T) continue; + // Connection geometry const RigFault* fault = grid->mainGrid()->findFaultFromCellIndexAndCellFace(nativeResvCellIndex, faceId); @@ -757,6 +801,8 @@ void RimReservoirCellResultsStorage::computeRiTransX() faceAreaVec = nativeCell.faceNormalWithAreaLenght(faceId); } + if (!isFaceNormalsOutwards) faceAreaVec = -faceAreaVec; + double halfCellTrans = 0; double neighborHalfCellTrans = 0; @@ -781,8 +827,7 @@ void RimReservoirCellResultsStorage::computeRiTransX() { cvf::Vec3d centerToFace = faceCenter - neighborCell.center(); - size_t permResIdx = (*permIdxFunc)(activeCellInfo, neighborResvCellIdx); - double perm = permResults[permResIdx]; + double perm = permResults[neighborCellPermResIdx]; double ntg = 1.0; if (faceId != cvf::StructGridInterface::POS_K) @@ -794,7 +839,6 @@ void RimReservoirCellResultsStorage::computeRiTransX() neighborHalfCellTrans = halfCellTransmissibility(perm, ntg, centerToFace, -faceAreaVec); } - size_t tranResIdx = (*riTranIdxFunc)(activeCellInfo, nativeResvCellIndex); riTransResults[tranResIdx] = newtran(cdarchy, 1.0, halfCellTrans, neighborHalfCellTrans);; } @@ -938,7 +982,7 @@ size_t RimReservoirCellResultsStorage::storedResultsCount() } //-------------------------------------------------------------------------------------------------- -/// +/// If we have any results on any time step, assume we have loaded results //-------------------------------------------------------------------------------------------------- bool RimReservoirCellResultsStorage::isDataPresent(size_t scalarResultIndex) const { diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h index 78631bfe41..56136624c8 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h @@ -65,11 +65,11 @@ protected: private: void computeSOILForTimeStep(size_t timeStepIndex); - void computeSOILForAllTimeStep(); + void computeRiTransComponent(const QString& riTransComponentResultName); QString getValidCacheFileName(); QString getCacheDirectoryPath(); - void computeRiTransX(); + // Fields caf::PdmField m_resultCacheFileName; caf::PdmPointersField diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index ca375bfcbd..ad6dcd7d65 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -2131,6 +2131,20 @@ void RimReservoirView::appendTextFromResultSlot(RigCaseData* eclipseCase, size_t resultInfoText->append(QString("MULTZ- : %1\n").arg(scalarValue)); } } + else if (resultSlot->resultVariable().compare(RimDefines::combinedRiTransResultName(), Qt::CaseInsensitive) == 0) + { + cvf::ref transResultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCase, gridIndex, porosityModel, 0, RimDefines::combinedRiTransResultName()); + { + double scalarValue = transResultAccessor->cellFaceScalar(cellIndex, cvf::StructGridInterface::POS_I); + resultInfoText->append(QString("riTran X : %1\n").arg(scalarValue)); + + scalarValue = transResultAccessor->cellFaceScalar(cellIndex, cvf::StructGridInterface::POS_J); + resultInfoText->append(QString("riTran Y : %1\n").arg(scalarValue)); + + scalarValue = transResultAccessor->cellFaceScalar(cellIndex, cvf::StructGridInterface::POS_K); + resultInfoText->append(QString("riTran Z : %1\n").arg(scalarValue)); + } + } else { resultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCase, gridIndex, porosityModel, 0, resultSlot->gridScalarIndex()); diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 97f80208d9..a7df18f536 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -214,80 +214,71 @@ size_t RigCaseCellResultsData::findScalarResultIndex(const QString& resultName) //-------------------------------------------------------------------------------------------------- /// Adds an empty scalar set, and returns the scalarResultIndex to it. -/// if resultName already exists, it returns the scalarResultIndex to the existing result. +/// if resultName already exists, it just returns the scalarResultIndex to the existing result. //-------------------------------------------------------------------------------------------------- size_t RigCaseCellResultsData::addEmptyScalarResult(RimDefines::ResultCatType type, const QString& resultName, bool needsToBeStored) { - size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; + size_t scalarResultIndex = this->findScalarResultIndex(type, resultName); - scalarResultIndex = this->findScalarResultIndex(type, resultName); - if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) + // If the result exists, do nothing + + if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) { - scalarResultIndex = this->resultCount(); - m_cellScalarResults.push_back(std::vector >()); - ResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex); - m_resultInfos.push_back(resInfo); - - cvf::ref statisticsCalculator; - - // Create statistics calculator and add cache object - if (resultName == RimDefines::combinedTransmissibilityResultName()) - { - size_t tranX = findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANX"); - size_t tranY = findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANY"); - size_t tranZ = findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANZ"); - - cvf::ref calc = new RigMultipleDatasetStatCalc(); - calc->addStatisticsCalculator(new RigNativeStatCalc(this, tranX)); - calc->addStatisticsCalculator(new RigNativeStatCalc(this, tranY)); - calc->addStatisticsCalculator(new RigNativeStatCalc(this, tranZ)); - - statisticsCalculator = calc; - } - else if (resultName == RimDefines::combinedMultResultName()) - { - cvf::ref calc = new RigMultipleDatasetStatCalc(); - - { - size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTX"); - if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx)); - } - { - size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTX-"); - if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx)); - } - { - size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTY"); - if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx)); - } - { - size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTY-"); - if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx)); - } - { - size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTZ"); - if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx)); - } - { - size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTZ-"); - if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx)); - } - - statisticsCalculator = calc; - } - else if (resultName == RimDefines::combinedRiTransResultName()) - { - - } - else - { - statisticsCalculator = new RigNativeStatCalc(this, scalarResultIndex); - } - - cvf::ref dataCache = new RigStatisticsDataCache(statisticsCalculator.p()); - m_statisticsDataCache.push_back(dataCache.p()); + return scalarResultIndex; } + // Create the new empty result with metadata + + scalarResultIndex = this->resultCount(); + m_cellScalarResults.push_back(std::vector >()); + ResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex); + m_resultInfos.push_back(resInfo); + + // Create statistics calculator and add statistics cache object + // Todo: Move to a "factory" method + + cvf::ref statisticsCalculator; + + if (resultName == RimDefines::combinedTransmissibilityResultName()) + { + cvf::ref calc = new RigMultipleDatasetStatCalc(); + + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANX")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANY")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "TRANZ")); + + statisticsCalculator = calc; + } + else if (resultName == RimDefines::combinedMultResultName()) + { + cvf::ref calc = new RigMultipleDatasetStatCalc(); + + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTX")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTX-")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTY")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTY-")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTZ")); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTZ-")); + + statisticsCalculator = calc; + } + else if (resultName == RimDefines::combinedRiTransResultName()) + { + cvf::ref calc = new RigMultipleDatasetStatCalc(); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::riTransXResultName())); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::riTransYResultName())); + calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::riTransZResultName())); + statisticsCalculator = calc; + } + else + { + statisticsCalculator = new RigNativeStatCalc(this, scalarResultIndex); + } + + cvf::ref dataCache = new RigStatisticsDataCache(statisticsCalculator.p()); + m_statisticsDataCache.push_back(dataCache.p()); + + return scalarResultIndex; } @@ -453,13 +444,14 @@ void RigCaseCellResultsData::freeAllocatedResultsData() } //-------------------------------------------------------------------------------------------------- -/// Add a result with given type and name, and allocate one result vector for the static result values +/// Make sure we have a result with given type and name, and make sure one "timestep" result vector +// for the static result values are allocated //-------------------------------------------------------------------------------------------------- size_t RigCaseCellResultsData::addStaticScalarResult(RimDefines::ResultCatType type, const QString& resultName, bool needsToBeStored, size_t resultValueCount) { size_t resultIdx = addEmptyScalarResult(type, resultName, needsToBeStored); - m_cellScalarResults[resultIdx].push_back(std::vector()); + m_cellScalarResults[resultIdx].resize(1, std::vector()); m_cellScalarResults[resultIdx][0].resize(resultValueCount, HUGE_VAL); return resultIdx; @@ -512,37 +504,42 @@ void RigCaseCellResultsData::setMustBeCalculated(size_t scalarResultIndex) //-------------------------------------------------------------------------------------------------- void RigCaseCellResultsData::createPlaceholderResultEntries() { + // SOIL { - size_t soilIndex = findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, "SOIL"); - if (soilIndex == cvf::UNDEFINED_SIZE_T) - { - size_t swatIndex = findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, "SWAT"); - size_t sgasIndex = findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, "SGAS"); + size_t swatIndex = findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, "SWAT"); + size_t sgasIndex = findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, "SGAS"); - if (swatIndex != cvf::UNDEFINED_SIZE_T || sgasIndex != cvf::UNDEFINED_SIZE_T) - { - addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL", false); - } + if (swatIndex != cvf::UNDEFINED_SIZE_T || sgasIndex != cvf::UNDEFINED_SIZE_T) + { + addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL", false); } } + // TRANSXYZ { - size_t combinedTransmissibilityIndex = findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName()); - if (combinedTransmissibilityIndex == cvf::UNDEFINED_SIZE_T) + size_t tranX, tranY, tranZ; + if (findTransmissibilityResults(tranX, tranY, tranZ)) { - size_t tranX, tranY, tranZ; - if (findTransmissibilityResults(tranX, tranY, tranZ)) - { - addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName(), false, 0); - } + addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName(), false, 0); } } - + // MULTXYZ { - size_t combinedMultIndex = findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedMultResultName()); - if (combinedMultIndex == cvf::UNDEFINED_SIZE_T) + addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedMultResultName(), false, 0); + } + + // riTRANSXYZ and X,Y,Z + { + size_t ntgResIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "NTG"); + if ( findScalarResultIndex(RimDefines::STATIC_NATIVE, "NTG") != cvf::UNDEFINED_SIZE_T + && findScalarResultIndex(RimDefines::STATIC_NATIVE, "PERMX") != cvf::UNDEFINED_SIZE_T + && findScalarResultIndex(RimDefines::STATIC_NATIVE, "PERMY") != cvf::UNDEFINED_SIZE_T + && findScalarResultIndex(RimDefines::STATIC_NATIVE, "PERMZ") != cvf::UNDEFINED_SIZE_T) { - addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedMultResultName(), false, 0); + addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::riTransXResultName(), false, 0); + addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::riTransYResultName(), false, 0); + addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::riTransZResultName(), false, 0); + addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedRiTransResultName(), false, 0); } } } diff --git a/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp b/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp index 0c1916477b..118f22fb3b 100644 --- a/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp +++ b/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp @@ -361,7 +361,7 @@ void RigMainGrid::calculateFaults() //-------------------------------------------------------------------------------------------------- /// The cell is normally inverted due to Depth becoming -Z at import, -/// but if (only) one of the flipX/Y is done, the cell is back to nomal +/// but if (only) one of the flipX/Y is done, the cell is back to normal //-------------------------------------------------------------------------------------------------- bool RigMainGrid::faceNormalsIsOutwards() const { diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp index 895b3798d4..15c6665f8b 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp @@ -82,6 +82,16 @@ cvf::ref RigResultAccessorFactory::createResultAccessor(RigCa } else if (uiResultName == RimDefines::combinedRiTransResultName()) { + cvf::ref cellFaceAccessObject = new RigCombTransResultAccessor(grid); + + cvf::ref xTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, RimDefines::riTransXResultName()); + cvf::ref yTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, RimDefines::riTransYResultName()); + cvf::ref zTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, RimDefines::riTransZResultName()); + + cellFaceAccessObject->setTransResultAccessors(xTransAccessor.p(), yTransAccessor.p(), zTransAccessor.p()); + + return cellFaceAccessObject; +#if 0 cvf::ref cellFaceAccessObject = new RigCombRiTransResultAccessor(grid); cvf::ref permX = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "PERMX"); @@ -94,6 +104,7 @@ cvf::ref RigResultAccessorFactory::createResultAccessor(RigCa // todo : cellFaceAccessObject->setCDARCHY(); return cellFaceAccessObject; +#endif } return RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, uiResultName); diff --git a/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.cpp index 48d98e035c..a35bac926e 100644 --- a/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.cpp @@ -238,3 +238,14 @@ size_t RigMultipleDatasetStatCalc::timeStepCount() return 0; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigMultipleDatasetStatCalc::addNativeStatisticsCalculator(RigCaseCellResultsData* cellResultsData, size_t scalarResultIndex) +{ + if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) + { + this->addStatisticsCalculator(new RigNativeStatCalc(cellResultsData, scalarResultIndex)); + } +} + diff --git a/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.h b/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.h index fbd4a43270..5edeb22196 100644 --- a/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigStatisticsCalculator.h @@ -73,6 +73,7 @@ class RigMultipleDatasetStatCalc : public RigStatisticsCalculator public: RigMultipleDatasetStatCalc(); void addStatisticsCalculator(RigStatisticsCalculator* statisticsCalculator); + void addNativeStatisticsCalculator(RigCaseCellResultsData* cellResultsData, size_t scalarResultIndices); virtual void minMaxCellScalarValues(size_t timeStepIndex, double& min, double& max); virtual void posNegClosestToZero(size_t timeStepIndex, double& pos, double& neg);