From 8ca5a5a90a15909a2b036038d92382dec1282905 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 26 May 2017 16:27:48 +0200 Subject: [PATCH] #1487 - pre-proto - Adding class RigFractureGrid, which now holds RigStimPlanFracTemplateCells and functions for accessing these. --- .../FileInterface/RifFractureExportTools.cpp | 40 ++++---- .../RivWellFracturePartMgr.cpp | 4 +- .../RimStimPlanFractureTemplate.cpp | 97 +++++++++++-------- .../RimStimPlanFractureTemplate.h | 21 ++-- .../ReservoirDataModel/CMakeLists_files.cmake | 3 + .../ReservoirDataModel/RigFractureGrid.cpp | 59 +++++++++++ .../ReservoirDataModel/RigFractureGrid.h | 57 +++++++++++ .../RigStimPlanFracTemplateCell.cpp | 3 + .../RigStimPlanFracTemplateCell.h | 1 + .../RigStimPlanUpscalingCalc.cpp | 7 +- .../RigWellPathStimplanIntersector.cpp | 1 + doc/fracture_clases.plantuml | 7 +- 12 files changed, 227 insertions(+), 73 deletions(-) create mode 100644 ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp create mode 100644 ApplicationCode/ReservoirDataModel/RigFractureGrid.h diff --git a/ApplicationCode/FileInterface/RifFractureExportTools.cpp b/ApplicationCode/FileInterface/RifFractureExportTools.cpp index a83ed64693..b1977c8bb5 100644 --- a/ApplicationCode/FileInterface/RifFractureExportTools.cpp +++ b/ApplicationCode/FileInterface/RifFractureExportTools.cpp @@ -48,6 +48,7 @@ #include "RigStimPlanUpscalingCalc.h" #include "RigTransmissibilityCondenser.h" #include "RigWellPathStimplanIntersector.h" +#include "RigFractureGrid.h" @@ -224,6 +225,7 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const using CellIdxSpace = RigTransmissibilityCondenser::CellAddress; RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast(fracture->attachedFractureDefinition()); + const RigFractureGrid fractureGrid = fracTemplateStimPlan->fractureGrid(); if (!fracTemplateStimPlan) continue; // We do not handle Elliptical fractures yet @@ -232,7 +234,7 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const ////// // Calculate Matrix To Fracture Trans - auto stimPlanCells = fracTemplateStimPlan->getStimPlanCells(); + auto stimPlanCells = fractureGrid.getStimPlanCells(); for (const RigStimPlanFracTemplateCell stimPlanCell : stimPlanCells) { @@ -247,7 +249,7 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const const std::vector& stimPlanContributingEclipseCells = eclToStimPlanTransCalc.globalIndeciesToContributingEclipseCells(); const std::vector& stimPlanContributingEclipseCellTransmissibilities = eclToStimPlanTransCalc.contributingEclipseCellTransmissibilities(); - size_t stimPlanCellIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(stimPlanCell.getI(), stimPlanCell.getJ()); + size_t stimPlanCellIndex = fractureGrid.getGlobalIndexFromIJ(stimPlanCell.getI(), stimPlanCell.getJ()); for (size_t i = 0; i < stimPlanContributingEclipseCells.size(); i++) { @@ -260,19 +262,19 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const ////// // Calculate Transmissibility in the fracture: From one StimPlan Cell to the other - for (size_t i = 0; i < fracTemplateStimPlan->stimPlanGridNumberOfColums()-2; i++) + for (size_t i = 0; i < fractureGrid.stimPlanGridNumberOfColums()-2; i++) { - for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfRows()-2; j++) + for (size_t j = 0; j < fractureGrid.stimPlanGridNumberOfRows()-2; j++) { - size_t stimPlanCellIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i, j); - const RigStimPlanFracTemplateCell stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellIndex); + size_t stimPlanCellIndex = fractureGrid.getGlobalIndexFromIJ(i, j); + const RigStimPlanFracTemplateCell stimPlanCell = fractureGrid.stimPlanCellFromIndex(stimPlanCellIndex); if (stimPlanCell.getConductivtyValue() < 1e-7) continue; - if (i < fracTemplateStimPlan->stimPlanGridNumberOfColums() - 2-1) + if (i < fractureGrid.stimPlanGridNumberOfColums() -2-1) { - size_t stimPlanCellNeighbourXIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i + 1, j); - const RigStimPlanFracTemplateCell stimPlanCellNeighbourX = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellNeighbourXIndex); + size_t stimPlanCellNeighbourXIndex = fractureGrid.getGlobalIndexFromIJ(i + 1, j); + const RigStimPlanFracTemplateCell stimPlanCellNeighbourX = fractureGrid.stimPlanCellFromIndex(stimPlanCellNeighbourXIndex); double horizontalTransToXneigbour = RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFractureCenterToCenterForTwoCells(stimPlanCell.getConductivtyValue(), @@ -289,10 +291,10 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const } - if (j < fracTemplateStimPlan->stimPlanGridNumberOfRows() - 2-1) + if (j < fractureGrid.stimPlanGridNumberOfRows() - 2-1) { - size_t stimPlanCellNeighbourZIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i, j + 1); - const RigStimPlanFracTemplateCell stimPlanCellNeighbourZ = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellNeighbourZIndex); + size_t stimPlanCellNeighbourZIndex = fractureGrid.getGlobalIndexFromIJ(i, j + 1); + const RigStimPlanFracTemplateCell stimPlanCellNeighbourZ = fractureGrid.stimPlanCellFromIndex(stimPlanCellNeighbourZIndex); double verticalTransToZneigbour = RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFractureCenterToCenterForTwoCells(stimPlanCell.getConductivtyValue(), @@ -322,7 +324,7 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const size_t stpWellCellIdx = stpCellIdxIsectDataPair.first; RigWellPathStimplanIntersector::WellCellIntersection intersection = stpCellIdxIsectDataPair.second; - const RigStimPlanFracTemplateCell stimPlanWellCell = fracTemplateStimPlan->stimPlanCellFromIndex(stpWellCellIdx); + const RigStimPlanFracTemplateCell stimPlanWellCell = fractureGrid.stimPlanCellFromIndex(stpWellCellIdx); double radialTrans = 0.0; if (intersection.endpointCount) @@ -521,7 +523,7 @@ void RifFractureExportTools::printStimPlanCellsMatrixTransContributions(const st double cDarcyInCorrectUnit = caseToApply->eclipseCaseData()->darchysValue(); - std::vector stimPlanCells = fracTemplateStimPlan->getStimPlanCells(); + std::vector stimPlanCells = fracTemplateStimPlan->fractureGrid().getStimPlanCells(); for (RigStimPlanFracTemplateCell stimPlanCell : stimPlanCells) { @@ -611,7 +613,7 @@ void RifFractureExportTools::printStimPlanFractureTrans(const std::vector stimPlanCells = fracTemplateStimPlan->getStimPlanCells(); + std::vector stimPlanCells = fracTemplateStimPlan->fractureGrid().getStimPlanCells(); for (RigStimPlanFracTemplateCell stimPlanCell : stimPlanCells) { @@ -839,14 +841,14 @@ void RifFractureExportTools::printTransmissibilityFractureToWell(const std::vect double perforationLengthVert = fracture->perforationLength * cos(wellDip); double perforationLengthHor = fracture->perforationLength * sin(wellDip); - std::pair wellCenterStimPlanCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter(); + std::pair wellCenterStimPlanCellIJ = fracTemplateStimPlan->fractureGrid().getStimPlanCellAtWellCenter(); out << qSetFieldWidth(5); out << wellCenterStimPlanCellIJ.first; out << wellCenterStimPlanCellIJ.second; //RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second); - const RigStimPlanFracTemplateCell& stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(fracTemplateStimPlan->getGlobalIndexFromIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second)); + const RigStimPlanFracTemplateCell& stimPlanCell = fracTemplateStimPlan->fractureGrid().stimPlanCellFromIndex(fracTemplateStimPlan->fractureGrid().getGlobalIndexFromIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second)); double linTransInStimPlanCell = RigFractureTransmissibilityEquations::computeLinearTransmissibilityToWellinStimPlanCell(stimPlanCell.getConductivtyValue(), stimPlanCell.cellSizeX(), @@ -875,12 +877,12 @@ void RifFractureExportTools::printTransmissibilityFractureToWell(const std::vect } else continue; - std::pair wellCenterStimPlanCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter(); + std::pair wellCenterStimPlanCellIJ = fracTemplateStimPlan->fractureGrid().getStimPlanCellAtWellCenter(); out << qSetFieldWidth(5); out << wellCenterStimPlanCellIJ.first; out << wellCenterStimPlanCellIJ.second; - const RigStimPlanFracTemplateCell& stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(fracTemplateStimPlan->getGlobalIndexFromIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second)); + const RigStimPlanFracTemplateCell& stimPlanCell = fracTemplateStimPlan->fractureGrid().stimPlanCellFromIndex(fracTemplateStimPlan->fractureGrid().getGlobalIndexFromIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second)); double radTransInStimPlanCell = RigFractureTransmissibilityEquations::computeRadialTransmissibilityToWellinStimPlanCell(stimPlanCell.getConductivtyValue(), stimPlanCell.cellSizeX(), diff --git a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp index 6b2f45992a..f942336cb1 100644 --- a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp @@ -20,6 +20,8 @@ #include "RiaApplication.h" +#include "RigFractureGrid.h" + #include "RimEclipseView.h" #include "RimEclipseWell.h" #include "RimFracture.h" @@ -288,7 +290,7 @@ cvf::ref RivWellFracturePartMgr::createStimPlanMeshDrawable(Ri //Should probably be moved, since it now is called twice in some cases... stimPlanFracTemplate->setupStimPlanCells(); - std::vector stimPlanCells = stimPlanFracTemplate->getStimPlanCells(); + std::vector stimPlanCells = stimPlanFracTemplate->fractureGrid().getStimPlanCells(); std::vector stimPlanMeshVertices; for (RigStimPlanFracTemplateCell stimPlanCell : stimPlanCells) diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp index 78cecaa9bd..3c72982fd1 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp @@ -45,6 +45,7 @@ #include #include #include "RigFractureTransCalc.h" +#include "RigFractureGrid.h" @@ -68,7 +69,7 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate(void) CAF_PDM_InitField(&showStimPlanMesh, "showStimPlanMesh", true, "Show StimPlan Mesh", "", "", ""); //TODO: Is this correct way of doing this...? - wellCenterStimPlanCellIJ = std::make_pair(0, 0); + //wellCenterStimPlanCellIJ = std::make_pair(0, 0); } //-------------------------------------------------------------------------------------------------- @@ -820,6 +821,7 @@ void RimStimPlanFractureTemplate::setupStimPlanCells() QString resultUnitFromColors = activeView->stimPlanColors->unit(); std::vector stimPlanCells; + std::pair wellCenterStimPlanCellIJ = std::make_pair(0,0); bool wellCenterStimPlanCellFound = false; @@ -889,17 +891,30 @@ void RimStimPlanFractureTemplate::setupStimPlanCells() } - m_stimPlanCells = stimPlanCells; + RigFractureGrid fractureGrid; + fractureGrid.setFractureCells(stimPlanCells); + fractureGrid.setWellCenterStimPlanCellIJ(wellCenterStimPlanCellIJ); + fractureGrid.setIcount(getNegAndPosXcoords().size()); + fractureGrid.setJcount(adjustedDepthCoordsAroundWellPathPosition().size()); + m_fractureGrid = fractureGrid; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const std::vector& RimStimPlanFractureTemplate::getStimPlanCells() const +const RigFractureGrid& RimStimPlanFractureTemplate::fractureGrid() const { - return m_stimPlanCells; + return m_fractureGrid; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +// const std::vector& RimStimPlanFractureTemplate::getStimPlanCells() const +// { +// return m_stimPlanCells; +// } + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -949,43 +964,43 @@ std::vector RimStimPlanFractureTemplate::getStimPlanColPolygon(size_ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::pair RimStimPlanFractureTemplate::getStimPlanCellAtWellCenter() -{ - return wellCenterStimPlanCellIJ; -} +// std::pair RimStimPlanFractureTemplate::getStimPlanCellAtWellCenter() +// { +// return wellCenterStimPlanCellIJ; +// } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -size_t RimStimPlanFractureTemplate::getGlobalIndexFromIJ(size_t i, size_t j) const -{ - size_t cellCountJ = stimPlanGridNumberOfRows() - 2; - size_t globIndex = i * cellCountJ + j; - - CVF_ASSERT(m_stimPlanCells[globIndex].getI() == i && m_stimPlanCells[globIndex].getJ() == j); - - return globIndex; -} +//size_t RimStimPlanFractureTemplate::getGlobalIndexFromIJ(size_t i, size_t j) const +//{ +// size_t cellCountJ = stimPlanGridNumberOfRows() - 2; +// size_t globIndex = i * cellCountJ + j; +// +// CVF_ASSERT(m_stimPlanCells[globIndex].getI() == i && m_stimPlanCells[globIndex].getJ() == j); +// +// return globIndex; +//} //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigStimPlanFracTemplateCell& RimStimPlanFractureTemplate::stimPlanCellFromIndex(size_t index) const -{ - if (index < m_stimPlanCells.size()) - { - const RigStimPlanFracTemplateCell& cell = m_stimPlanCells[index]; - return cell; - } - else - { - //TODO: Better error handling? - RiaLogging::error("Requesting non-existent StimPlanCell"); - RiaLogging::error("Returning cell 0, results will be invalid"); - const RigStimPlanFracTemplateCell& cell = m_stimPlanCells[0]; - return cell; - } -} +// const RigStimPlanFracTemplateCell& RimStimPlanFractureTemplate::stimPlanCellFromIndex(size_t index) const +// { +// if (index < m_stimPlanCells.size()) +// { +// const RigStimPlanFracTemplateCell& cell = m_stimPlanCells[index]; +// return cell; +// } +// else +// { +// //TODO: Better error handling? +// RiaLogging::error("Requesting non-existent StimPlanCell"); +// RiaLogging::error("Returning cell 0, results will be invalid"); +// const RigStimPlanFracTemplateCell& cell = m_stimPlanCells[0]; +// return cell; +// } +// } //-------------------------------------------------------------------------------------------------- /// @@ -1114,18 +1129,18 @@ void RimStimPlanFractureTemplate::sortPolygon(std::vector &polygon) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -size_t RimStimPlanFractureTemplate::stimPlanGridNumberOfColums() const -{ - return getNegAndPosXcoords().size(); -} +// size_t RimStimPlanFractureTemplate::stimPlanGridNumberOfColums() const +// { +// return getNegAndPosXcoords().size(); +// } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -size_t RimStimPlanFractureTemplate::stimPlanGridNumberOfRows() const -{ - return adjustedDepthCoordsAroundWellPathPosition().size(); -} +// size_t RimStimPlanFractureTemplate::stimPlanGridNumberOfRows() const +// { +// return adjustedDepthCoordsAroundWellPathPosition().size(); +// } //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h index 743c282227..63a6436b54 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h +++ b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h @@ -32,10 +32,13 @@ #include "cvfVector3.h" #include +#include "RigStimPlanFracTemplateCell.h" +#include "RigFractureGrid.h" class RigStimPlanFractureDefinition; class RimStimPlanLegendConfig; class RigStimPlanFracTemplateCell; +class RigFractureGrid; //================================================================================================== /// @@ -74,13 +77,14 @@ public: std::vector> getDataAtTimeIndex(const QString& resultName, const QString& unitName, size_t timeStepIndex) const; void setupStimPlanCells(); - const std::vector& getStimPlanCells() const; - size_t getGlobalIndexFromIJ(size_t i, size_t j) const; - const RigStimPlanFracTemplateCell& stimPlanCellFromIndex(size_t index) const; - size_t stimPlanGridNumberOfRows() const; - size_t stimPlanGridNumberOfColums() const; + const RigFractureGrid& fractureGrid() const; +// const std::vector& getStimPlanCells() const; +// size_t getGlobalIndexFromIJ(size_t i, size_t j) const; +// const RigStimPlanFracTemplateCell& stimPlanCellFromIndex(size_t index) const; +// size_t stimPlanGridNumberOfRows() const; +// size_t stimPlanGridNumberOfColums() const; - std::pair getStimPlanCellAtWellCenter(); +// std::pair getStimPlanCellAtWellCenter(); //Functions used by upscaling only @@ -113,6 +117,7 @@ private: caf::PdmField m_stimPlanFileName; cvf::ref m_stimPlanFractureDefinitionData; - std::vector m_stimPlanCells; - std::pair wellCenterStimPlanCellIJ; +// std::vector m_stimPlanCells; +// std::pair wellCenterStimPlanCellIJ; + RigFractureGrid m_fractureGrid; }; diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index 7e93e05f9c..d72dc51df0 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -63,6 +63,8 @@ ${CEE_CURRENT_LIST_DIR}RigCellGeometryTools.h ${CEE_CURRENT_LIST_DIR}RigStimPlanFractureDefinition.h ${CEE_CURRENT_LIST_DIR}RigStimPlanFracTemplateCell.h ${CEE_CURRENT_LIST_DIR}RigStimPlanUpscalingCalc.h +${CEE_CURRENT_LIST_DIR}RigFractureGrid.h + @@ -123,6 +125,7 @@ ${CEE_CURRENT_LIST_DIR}RigCellGeometryTools.cpp ${CEE_CURRENT_LIST_DIR}RigStimPlanFractureDefinition.cpp ${CEE_CURRENT_LIST_DIR}RigStimPlanFracTemplateCell.cpp ${CEE_CURRENT_LIST_DIR}RigStimPlanUpscalingCalc.cpp +${CEE_CURRENT_LIST_DIR}RigFractureGrid.cpp ) diff --git a/ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp b/ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp new file mode 100644 index 0000000000..71b6c68c64 --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp @@ -0,0 +1,59 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 - Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigFractureGrid.h" +#include "RiaLogging.h" +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigFractureGrid::RigFractureGrid() +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RigFractureGrid::getGlobalIndexFromIJ(size_t i, size_t j) const +{ + return i * m_jCount + j; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigStimPlanFracTemplateCell& RigFractureGrid::stimPlanCellFromIndex(size_t index) const +{ + if (index < m_fractureCells.size()) + { + const RigStimPlanFracTemplateCell& cell = m_fractureCells[index]; + return cell; + } + else + { + //TODO: Better error handling? + RiaLogging::error(QString("Requesting non-existent StimPlanCell")); + RiaLogging::error(QString("Returning cell 0, results will be invalid")); + const RigStimPlanFracTemplateCell& cell = m_fractureCells[0]; + return cell; + } +} + + diff --git a/ApplicationCode/ReservoirDataModel/RigFractureGrid.h b/ApplicationCode/ReservoirDataModel/RigFractureGrid.h new file mode 100644 index 0000000000..23d2ea3dfd --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigFractureGrid.h @@ -0,0 +1,57 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 - Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RigStimPlanFracTemplateCell.h" +#include +class RigStimPlanFracTemplateCell; + +//================================================================================================== +/// +/// +//================================================================================================== +class RigFractureGrid +{ +public: + RigFractureGrid(); + + void setFractureCells(std::vector stimPlanCells) { m_fractureCells = stimPlanCells; } + void setWellCenterStimPlanCellIJ(std::pair wellCenterStimPlanCellIJ) { m_wellCenterStimPlanCellIJ = wellCenterStimPlanCellIJ; } + void setIcount(size_t icount) { m_iCount = icount; } + void setJcount(size_t jcount) { m_jCount = jcount; } + + const std::vector& getStimPlanCells() const { return m_fractureCells; } + size_t getGlobalIndexFromIJ(size_t i, size_t j) const; + const RigStimPlanFracTemplateCell& stimPlanCellFromIndex(size_t index) const; + size_t stimPlanGridNumberOfRows() const { return m_jCount; } + size_t stimPlanGridNumberOfColums() const { return m_iCount; } + + std::pair getStimPlanCellAtWellCenter() const { return m_wellCenterStimPlanCellIJ; } + + +private: + std::vector m_fractureCells; + std::pair m_wellCenterStimPlanCellIJ; + size_t m_iCount; + size_t m_jCount; + + + +}; + diff --git a/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.cpp b/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.cpp index acb46189f6..a4a212aa78 100644 --- a/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.cpp +++ b/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.cpp @@ -17,6 +17,8 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RigStimPlanFracTemplateCell.h" +#include "RiaLogging.h" +#include //-------------------------------------------------------------------------------------------------- /// @@ -63,3 +65,4 @@ double RigStimPlanFracTemplateCell::cellSizeZ() const return cvf::UNDEFINED_DOUBLE; } + diff --git a/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.h b/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.h index 3863f1005b..e862e0be5f 100644 --- a/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.h +++ b/ApplicationCode/ReservoirDataModel/RigStimPlanFracTemplateCell.h @@ -57,3 +57,4 @@ private: size_t m_j; }; + diff --git a/ApplicationCode/ReservoirDataModel/RigStimPlanUpscalingCalc.cpp b/ApplicationCode/ReservoirDataModel/RigStimPlanUpscalingCalc.cpp index 57f250fb87..5d88ad0853 100644 --- a/ApplicationCode/ReservoirDataModel/RigStimPlanUpscalingCalc.cpp +++ b/ApplicationCode/ReservoirDataModel/RigStimPlanUpscalingCalc.cpp @@ -6,6 +6,7 @@ #include "RigCellGeometryTools.h" #include "RigStimPlanFracTemplateCell.h" #include "RiaLogging.h" +#include "RigFractureGrid.h" //-------------------------------------------------------------------------------------------------- @@ -52,7 +53,7 @@ std::pair RigStimPlanUpscalingCalc::flowAcrossLayersUpscaling(QS } else return std::make_pair(cvf::UNDEFINED_DOUBLE, cvf::UNDEFINED_DOUBLE); - std::vector stimPlanCells = fracTemplateStimPlan->getStimPlanCells(); + std::vector stimPlanCells = fracTemplateStimPlan->fractureGrid().getStimPlanCells(); @@ -111,7 +112,7 @@ double RigStimPlanUpscalingCalc::computeHAupscale(RimStimPlanFractureTemplate* f std::vector lavgCol; std::vector CondHarmCol; - for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfColums(); j++) + for (size_t j = 0; j < fracTemplateStimPlan->fractureGrid().stimPlanGridNumberOfColums(); j++) { std::vector conductivitiesInStimPlanCells; std::vector lengthsLiOfStimPlanCol; @@ -180,7 +181,7 @@ double RigStimPlanUpscalingCalc::computeAHupscale(RimStimPlanFractureTemplate* f std::vector liRowSum; std::vector CondAritRow; - for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfRows(); j++) + for (size_t j = 0; j < fracTemplateStimPlan->fractureGrid().stimPlanGridNumberOfRows(); j++) { std::vector conductivitiesInStimPlanCells; std::vector lengthsLiOfStimPlanCol; diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp index 563b4b118d..186337b552 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp @@ -7,6 +7,7 @@ #include "cvfMatrix4.h" #include "RigStimPlanFracTemplateCell.h" #include "RimStimPlanFractureTemplate.h" +#include "RigFractureGrid.h" #include diff --git a/doc/fracture_clases.plantuml b/doc/fracture_clases.plantuml index a2c95f270a..e4fbde0bb7 100644 --- a/doc/fracture_clases.plantuml +++ b/doc/fracture_clases.plantuml @@ -68,8 +68,13 @@ class RigStimPlanFracTemplateCell{ } +class RigFractureGrid{ +} + + RimStimPlanFractureTemplate "1" *-- "1" RigStimPlanFractureDefinition -RimStimPlanFractureTemplate "1" *-- "many" RigStimPlanFracTemplateCell +RimStimPlanFractureTemplate "1" *-- "1" RigFractureGrid +RigFractureGrid "1" *-- "many" RigStimPlanFracTemplateCell RigStimPlanFractureCell <.> RigStimPlanFracTemplateCell