diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index 6e3e181543..b9ea8a427e 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -40,65 +40,46 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply, QString wellname, size_t timestep) - :m_case(caseToApply), - m_wellName(wellname), - m_timeStep(timestep) { - m_flowDiagSolution = caseToApply->defaultFlowDiagSolution(); - - computeTOFaccumulations(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigTofAccumulatedPhaseFractionsCalculator::computeTOFaccumulations() -{ - RigEclipseCaseData* eclipseCaseData = m_case->eclipseCaseData(); + RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData(); RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS; - - - RimReservoirCellResultsStorage* gridCellResults = m_case->results(porosityModel); + RimReservoirCellResultsStorage* gridCellResults = caseToApply->results(porosityModel); size_t scalarResultIndexSwat = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT"); size_t scalarResultIndexSoil = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL"); size_t scalarResultIndexSgas = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS"); size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORV"); + const std::vector* swatResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, timestep)); + const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, timestep)); + const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, timestep)); + const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, timestep)); - const std::vector* swatResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSwat, m_timeStep)); - const std::vector* soilResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSoil, m_timeStep)); - const std::vector* sgasResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexSgas, m_timeStep)); - const std::vector* porvResults = &(eclipseCaseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndexPorv, m_timeStep)); - const RigActiveCellInfo* activeCellInfo = eclipseCaseData->activeCellInfo(porosityModel); + RimFlowDiagSolution* flowDiagSolution = caseToApply->defaultFlowDiagSolution(); std::string resultNameTof = "TOF"; - const std::vector* tofData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, - m_wellName.toStdString()), - m_timeStep); - + const std::vector* tofData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof, + wellname.toStdString()), + timestep); + std::string resultNameFraction = "Fraction"; - const std::vector* fractionData = m_flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, - m_wellName.toStdString()), - m_timeStep); + const std::vector* fractionData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction, + wellname.toStdString()), + timestep); - sortTofAndCalculateAccPhaseFraction(tofData, - fractionData, - porvResults, - swatResults, - soilResults, - sgasResults, - m_accumulatedPhaseFractionSwat, - m_accumulatedPhaseFractionSoil, - m_accumulatedPhaseFractionSgas, + sortTofAndCalculateAccPhaseFraction(tofData, + fractionData, + porvResults, + swatResults, + soilResults, + sgasResults, + m_accumulatedPhaseFractionSwat, + m_accumulatedPhaseFractionSoil, + m_accumulatedPhaseFractionSgas, m_tofInIncreasingOrder); - - - } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h index 3c77fe0243..4a070c0985 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.h @@ -47,6 +47,8 @@ public: const std::vector& accumulatedPhaseFractionsSoil() const { return m_accumulatedPhaseFractionSoil; } const std::vector& accumulatedPhaseFractionsSgas() const { return m_accumulatedPhaseFractionSgas; } + +private: static void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, const std::vector* porvResults, @@ -59,16 +61,6 @@ public: std::vector& accumulatedPhaseFractionSgas); private: - void computeTOFaccumulations(); - - -private: - RimEclipseResultCase* m_case; - QString m_wellName; - size_t m_timeStep; - - RimFlowDiagSolution* m_flowDiagSolution ; //hente fra case, rimEclipseResultCase? - std::vector m_tofInIncreasingOrder; std::vector m_accumulatedPhaseFractionSwat; std::vector m_accumulatedPhaseFractionSgas; @@ -76,3 +68,4 @@ private: }; +//TODO: tester... \ No newline at end of file