From 25549b6b05852184712efd6c52601215c9533be2 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 7 Mar 2019 20:38:42 +0100 Subject: [PATCH] #4186 Porosity Model : Make sure fracture model data is read from file --- .../ReservoirDataModel/RigCaseCellResultsData.cpp | 13 +++++++------ .../ReservoirDataModel/RigCaseCellResultsData.h | 6 ++++-- .../ReservoirDataModel/RigEclipseCaseData.cpp | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index aefb4a4bcf..0898ce15bf 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -50,8 +50,9 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigCaseCellResultsData::RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData) +RigCaseCellResultsData::RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData, RiaDefines::PorosityModelType porosityModel) : m_activeCellInfo(nullptr) + , m_porosityModel(porosityModel) { CVF_ASSERT(ownerCaseData != nullptr); CVF_ASSERT(ownerCaseData->mainGrid() != nullptr); @@ -1085,7 +1086,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult(const RigEclipseResul if (resVarAddr.hasDifferenceCase() || resVarAddr.isTimeLapse()) { - if (!RigCaseCellResultCalculator::computeDifference(this->m_ownerCaseData, RiaDefines::MATRIX_MODEL, resVarAddr)) + if (!RigCaseCellResultCalculator::computeDifference(this->m_ownerCaseData, m_porosityModel, resVarAddr)) { return cvf::UNDEFINED_SIZE_T; } @@ -1235,7 +1236,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult(const RigEclipseResul for (i = 0; i < timeStepCount; i++) { std::vector& values = m_cellScalarResults[scalarResultIndex][i]; - if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, i, &values)) + if (!m_readerInterface->dynamicResult(resultName, m_porosityModel, i, &values)) { resultLoadingSucess = false; } @@ -1255,7 +1256,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult(const RigEclipseResul m_cellScalarResults[scalarResultIndex].resize(1); std::vector& values = m_cellScalarResults[scalarResultIndex][0]; - if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) + if (!m_readerInterface->staticResult(resultName, m_porosityModel, &values)) { resultLoadingSucess = false; } @@ -1369,7 +1370,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep(const RigE std::vector& values = m_cellScalarResults[scalarResultIndex][timeStepIndex]; if (values.size() == 0) { - if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, timeStepIndex, &values)) + if (!m_readerInterface->dynamicResult(resultName, m_porosityModel, timeStepIndex, &values)) { resultLoadingSucess = false; } @@ -1380,7 +1381,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep(const RigE m_cellScalarResults[scalarResultIndex].resize(1); std::vector& values = m_cellScalarResults[scalarResultIndex][0]; - if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values)) + if (!m_readerInterface->staticResult(resultName, m_porosityModel, &values)) { resultLoadingSucess = false; } diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index f8453afcda..cac97fc235 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -23,13 +23,14 @@ #include "RiaDefines.h" #include "RiaPorosityModel.h" +#include "RigEclipseResultAddress.h" + #include "cvfCollection.h" #include #include #include -#include "RigEclipseResultAddress.h" class RifReaderInterface; @@ -51,7 +52,7 @@ class RimEclipseCase; class RigCaseCellResultsData : public cvf::Object { public: - explicit RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData); + explicit RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData, RiaDefines::PorosityModelType porosityModel); // Initialization @@ -192,4 +193,5 @@ private: RigMainGrid* m_ownerMainGrid; RigEclipseCaseData* m_ownerCaseData; RigActiveCellInfo* m_activeCellInfo; + RiaDefines::PorosityModelType m_porosityModel; }; diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp index 7362f77da0..0cf564ceb3 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseCaseData.cpp @@ -47,8 +47,8 @@ RigEclipseCaseData::RigEclipseCaseData(RimEclipseCase* ownerCase) m_mainGrid = new RigMainGrid(); m_ownerCase = ownerCase; - m_matrixModelResults = new RigCaseCellResultsData(this); - m_fractureModelResults = new RigCaseCellResultsData(this); + m_matrixModelResults = new RigCaseCellResultsData(this, RiaDefines::MATRIX_MODEL); + m_fractureModelResults = new RigCaseCellResultsData(this, RiaDefines::FRACTURE_MODEL); m_activeCellInfo = new RigActiveCellInfo; m_fractureActiveCellInfo = new RigActiveCellInfo;