mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-28 18:01:08 -06:00
#1487 - pre-proto - Adding class RigFractureGrid, which now holds RigStimPlanFracTemplateCells and functions for accessing these.
This commit is contained in:
parent
7420c069c7
commit
8ca5a5a90a
@ -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<RimStimPlanFractureTemplate*>(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<size_t>& stimPlanContributingEclipseCells = eclToStimPlanTransCalc.globalIndeciesToContributingEclipseCells();
|
||||
const std::vector<double>& 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<RigStimPlanFracTemplateCell> stimPlanCells = fracTemplateStimPlan->getStimPlanCells();
|
||||
std::vector<RigStimPlanFracTemplateCell> stimPlanCells = fracTemplateStimPlan->fractureGrid().getStimPlanCells();
|
||||
|
||||
for (RigStimPlanFracTemplateCell stimPlanCell : stimPlanCells)
|
||||
{
|
||||
@ -611,7 +613,7 @@ void RifFractureExportTools::printStimPlanFractureTrans(const std::vector<RimFra
|
||||
}
|
||||
else return;
|
||||
|
||||
std::vector<RigStimPlanFracTemplateCell> stimPlanCells = fracTemplateStimPlan->getStimPlanCells();
|
||||
std::vector<RigStimPlanFracTemplateCell> 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<size_t, size_t> wellCenterStimPlanCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter();
|
||||
std::pair<size_t, size_t> 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<size_t, size_t> wellCenterStimPlanCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter();
|
||||
std::pair<size_t, size_t> 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(),
|
||||
|
@ -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<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable(Ri
|
||||
//Should probably be moved, since it now is called twice in some cases...
|
||||
stimPlanFracTemplate->setupStimPlanCells();
|
||||
|
||||
std::vector<RigStimPlanFracTemplateCell> stimPlanCells = stimPlanFracTemplate->getStimPlanCells();
|
||||
std::vector<RigStimPlanFracTemplateCell> stimPlanCells = stimPlanFracTemplate->fractureGrid().getStimPlanCells();
|
||||
std::vector<cvf::Vec3f> stimPlanMeshVertices;
|
||||
|
||||
for (RigStimPlanFracTemplateCell stimPlanCell : stimPlanCells)
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#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<RigStimPlanFracTemplateCell> stimPlanCells;
|
||||
std::pair<size_t, size_t> 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<RigStimPlanFracTemplateCell>& RimStimPlanFractureTemplate::getStimPlanCells() const
|
||||
const RigFractureGrid& RimStimPlanFractureTemplate::fractureGrid() const
|
||||
{
|
||||
return m_stimPlanCells;
|
||||
return m_fractureGrid;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
// const std::vector<RigStimPlanFracTemplateCell>& RimStimPlanFractureTemplate::getStimPlanCells() const
|
||||
// {
|
||||
// return m_stimPlanCells;
|
||||
// }
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -949,43 +964,43 @@ std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanColPolygon(size_
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<size_t, size_t> RimStimPlanFractureTemplate::getStimPlanCellAtWellCenter()
|
||||
{
|
||||
return wellCenterStimPlanCellIJ;
|
||||
}
|
||||
// std::pair<size_t, size_t> 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<cvf::Vec3f> &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();
|
||||
// }
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -32,10 +32,13 @@
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
#include "RigStimPlanFracTemplateCell.h"
|
||||
#include "RigFractureGrid.h"
|
||||
|
||||
class RigStimPlanFractureDefinition;
|
||||
class RimStimPlanLegendConfig;
|
||||
class RigStimPlanFracTemplateCell;
|
||||
class RigFractureGrid;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -74,13 +77,14 @@ public:
|
||||
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unitName, size_t timeStepIndex) const;
|
||||
|
||||
void setupStimPlanCells();
|
||||
const std::vector<RigStimPlanFracTemplateCell>& 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<RigStimPlanFracTemplateCell>& 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<size_t, size_t> getStimPlanCellAtWellCenter();
|
||||
// std::pair<size_t, size_t> getStimPlanCellAtWellCenter();
|
||||
|
||||
|
||||
//Functions used by upscaling only
|
||||
@ -113,6 +117,7 @@ private:
|
||||
|
||||
caf::PdmField<QString> m_stimPlanFileName;
|
||||
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
|
||||
std::vector<RigStimPlanFracTemplateCell> m_stimPlanCells;
|
||||
std::pair<size_t, size_t> wellCenterStimPlanCellIJ;
|
||||
// std::vector<RigStimPlanFracTemplateCell> m_stimPlanCells;
|
||||
// std::pair<size_t, size_t> wellCenterStimPlanCellIJ;
|
||||
RigFractureGrid m_fractureGrid;
|
||||
};
|
||||
|
@ -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
|
||||
|
||||
)
|
||||
|
||||
|
59
ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp
Normal file
59
ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp
Normal file
@ -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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigFractureGrid.h"
|
||||
#include "RiaLogging.h"
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
57
ApplicationCode/ReservoirDataModel/RigFractureGrid.h
Normal file
57
ApplicationCode/ReservoirDataModel/RigFractureGrid.h
Normal file
@ -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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigStimPlanFracTemplateCell.h"
|
||||
#include <vector>
|
||||
class RigStimPlanFracTemplateCell;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigFractureGrid
|
||||
{
|
||||
public:
|
||||
RigFractureGrid();
|
||||
|
||||
void setFractureCells(std::vector<RigStimPlanFracTemplateCell> stimPlanCells) { m_fractureCells = stimPlanCells; }
|
||||
void setWellCenterStimPlanCellIJ(std::pair<size_t, size_t> wellCenterStimPlanCellIJ) { m_wellCenterStimPlanCellIJ = wellCenterStimPlanCellIJ; }
|
||||
void setIcount(size_t icount) { m_iCount = icount; }
|
||||
void setJcount(size_t jcount) { m_jCount = jcount; }
|
||||
|
||||
const std::vector<RigStimPlanFracTemplateCell>& 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<size_t, size_t> getStimPlanCellAtWellCenter() const { return m_wellCenterStimPlanCellIJ; }
|
||||
|
||||
|
||||
private:
|
||||
std::vector<RigStimPlanFracTemplateCell> m_fractureCells;
|
||||
std::pair<size_t, size_t> m_wellCenterStimPlanCellIJ;
|
||||
size_t m_iCount;
|
||||
size_t m_jCount;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
@ -17,6 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigStimPlanFracTemplateCell.h"
|
||||
#include "RiaLogging.h"
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -63,3 +65,4 @@ double RigStimPlanFracTemplateCell::cellSizeZ() const
|
||||
return cvf::UNDEFINED_DOUBLE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,3 +57,4 @@ private:
|
||||
size_t m_j;
|
||||
|
||||
};
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "RigCellGeometryTools.h"
|
||||
#include "RigStimPlanFracTemplateCell.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RigFractureGrid.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -52,7 +53,7 @@ std::pair<double, double> RigStimPlanUpscalingCalc::flowAcrossLayersUpscaling(QS
|
||||
}
|
||||
else return std::make_pair(cvf::UNDEFINED_DOUBLE, cvf::UNDEFINED_DOUBLE);
|
||||
|
||||
std::vector<RigStimPlanFracTemplateCell> stimPlanCells = fracTemplateStimPlan->getStimPlanCells();
|
||||
std::vector<RigStimPlanFracTemplateCell> stimPlanCells = fracTemplateStimPlan->fractureGrid().getStimPlanCells();
|
||||
|
||||
|
||||
|
||||
@ -111,7 +112,7 @@ double RigStimPlanUpscalingCalc::computeHAupscale(RimStimPlanFractureTemplate* f
|
||||
std::vector<double> lavgCol;
|
||||
std::vector<double> CondHarmCol;
|
||||
|
||||
for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfColums(); j++)
|
||||
for (size_t j = 0; j < fracTemplateStimPlan->fractureGrid().stimPlanGridNumberOfColums(); j++)
|
||||
{
|
||||
std::vector<double> conductivitiesInStimPlanCells;
|
||||
std::vector<double> lengthsLiOfStimPlanCol;
|
||||
@ -180,7 +181,7 @@ double RigStimPlanUpscalingCalc::computeAHupscale(RimStimPlanFractureTemplate* f
|
||||
std::vector<double> liRowSum;
|
||||
std::vector<double> CondAritRow;
|
||||
|
||||
for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfRows(); j++)
|
||||
for (size_t j = 0; j < fracTemplateStimPlan->fractureGrid().stimPlanGridNumberOfRows(); j++)
|
||||
{
|
||||
std::vector<double> conductivitiesInStimPlanCells;
|
||||
std::vector<double> lengthsLiOfStimPlanCol;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "cvfMatrix4.h"
|
||||
#include "RigStimPlanFracTemplateCell.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
#include "RigFractureGrid.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user