#1487 - pre-proto - Adding class RigFractureGrid, which now holds RigStimPlanFracTemplateCells and functions for accessing these.

This commit is contained in:
astridkbjorke
2017-05-26 16:27:48 +02:00
parent 7420c069c7
commit 8ca5a5a90a
12 changed files with 227 additions and 73 deletions

View File

@@ -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
)

View 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;
}
}

View 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;
};

View File

@@ -17,6 +17,8 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RigStimPlanFracTemplateCell.h"
#include "RiaLogging.h"
#include <QString>
//--------------------------------------------------------------------------------------------------
///
@@ -63,3 +65,4 @@ double RigStimPlanFracTemplateCell::cellSizeZ() const
return cvf::UNDEFINED_DOUBLE;
}

View File

@@ -57,3 +57,4 @@ private:
size_t m_j;
};

View File

@@ -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;

View File

@@ -7,6 +7,7 @@
#include "cvfMatrix4.h"
#include "RigStimPlanFracTemplateCell.h"
#include "RimStimPlanFractureTemplate.h"
#include "RigFractureGrid.h"
#include <cmath>