mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-26 13:17:35 -05:00
Added porosity model to ResultDefinition
Keep this property hidden from GUI until more testing is done p4#: 20339
This commit is contained in:
@@ -525,12 +525,12 @@ void RigGridBase::computeMatrixAndFractureModelActiveCellCount()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigGridScalarDataAccess> RigGridBase::dataAccessObject(size_t timeStepIndex, size_t scalarSetIndex) const
|
||||
cvf::ref<RigGridScalarDataAccess> RigGridBase::dataAccessObject(RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) const
|
||||
{
|
||||
if (timeStepIndex != cvf::UNDEFINED_SIZE_T &&
|
||||
scalarSetIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::ref<RigGridScalarDataAccess> dataAccess = new RigGridScalarDataAccess(this, timeStepIndex, scalarSetIndex);
|
||||
cvf::ref<RigGridScalarDataAccess> dataAccess = new RigGridScalarDataAccess(this, porosityModel, timeStepIndex, scalarSetIndex);
|
||||
return dataAccess;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "cvfStructGridScalarDataAccess.h"
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
|
||||
class RigMainGrid;
|
||||
@@ -95,7 +96,7 @@ public:
|
||||
virtual bool isCellValid( size_t i, size_t j, size_t k ) const;
|
||||
virtual bool cellIJKNeighbor(size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const;
|
||||
|
||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject(size_t timeStepIndex, size_t scalarSetIndex) const;
|
||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject(RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) const;
|
||||
|
||||
private:
|
||||
std::string m_gridName;
|
||||
|
||||
@@ -29,17 +29,17 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGridScalarDataAccess::RigGridScalarDataAccess(const RigGridBase* grid, size_t timeStepIndex, size_t scalarSetIndex)
|
||||
RigGridScalarDataAccess::RigGridScalarDataAccess(const RigGridBase* grid, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex)
|
||||
{
|
||||
CVF_ASSERT(grid);
|
||||
CVF_ASSERT(grid->mainGrid());
|
||||
CVF_ASSERT(grid->mainGrid()->results());
|
||||
CVF_ASSERT(grid->mainGrid()->results(porosityModel));
|
||||
|
||||
m_grid = grid;
|
||||
|
||||
m_useGlobalActiveIndex = m_grid->mainGrid()->results()->isUsingGlobalActiveIndex(scalarSetIndex);
|
||||
m_useGlobalActiveIndex = m_grid->mainGrid()->results(porosityModel)->isUsingGlobalActiveIndex(scalarSetIndex);
|
||||
|
||||
std::vector< std::vector<double> > & scalarSetResults = m_grid->mainGrid()->results()->cellScalarResults(scalarSetIndex);
|
||||
std::vector< std::vector<double> > & scalarSetResults = m_grid->mainGrid()->results(porosityModel)->cellScalarResults(scalarSetIndex);
|
||||
CVF_ASSERT(timeStepIndex < scalarSetResults.size());
|
||||
|
||||
m_resultValues = &(scalarSetResults[timeStepIndex]);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "cvfStructGridScalarDataAccess.h"
|
||||
#include "RigGridBase.h"
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -29,7 +30,7 @@
|
||||
class RigGridScalarDataAccess : public cvf::StructGridScalarDataAccess
|
||||
{
|
||||
public:
|
||||
RigGridScalarDataAccess(const RigGridBase* grid, size_t timeStepIndex, size_t scalarSetIndex);
|
||||
RigGridScalarDataAccess(const RigGridBase* grid, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex);
|
||||
|
||||
virtual double cellScalar(size_t i, size_t j, size_t k) const;
|
||||
virtual double cellScalar(size_t cellIndex) const;
|
||||
|
||||
@@ -32,7 +32,8 @@ RigMainGrid::RigMainGrid(void)
|
||||
m_globalMatrixModelActiveCellCount(cvf::UNDEFINED_SIZE_T),
|
||||
m_globalFractureModelActiveCellCount(cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
m_results = new RigReservoirCellResults(this);
|
||||
m_matrixModelResults = new RigReservoirCellResults(this);
|
||||
m_fractureModelResults = new RigReservoirCellResults(this);
|
||||
|
||||
m_activeCellsBoundingBox.add(cvf::Vec3d::ZERO);
|
||||
m_gridIndex = 0;
|
||||
@@ -374,3 +375,29 @@ void RigMainGrid::computeGlobalActiveCellCount()
|
||||
if (m_cells[i].isActiveInFractureModel()) m_globalFractureModelActiveCellCount++;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigReservoirCellResults* RigMainGrid::results(RifReaderInterface::PorosityModelResultType porosityModel)
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
{
|
||||
return m_matrixModelResults.p();
|
||||
}
|
||||
|
||||
return m_fractureModelResults.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigReservoirCellResults* RigMainGrid::results(RifReaderInterface::PorosityModelResultType porosityModel) const
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
{
|
||||
return m_matrixModelResults.p();
|
||||
}
|
||||
|
||||
return m_fractureModelResults.p();
|
||||
}
|
||||
|
||||
@@ -23,11 +23,13 @@
|
||||
#include "RigLocalGrid.h"
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
class RigReservoirCellResults;
|
||||
|
||||
class RigMainGrid : public RigGridBase
|
||||
class RigMainGrid : public RigGridBase
|
||||
{
|
||||
public:
|
||||
RigMainGrid();
|
||||
@@ -40,8 +42,8 @@ public:
|
||||
std::vector<RigCell>& cells() {return m_cells;}
|
||||
const std::vector<RigCell>& cells() const {return m_cells;}
|
||||
|
||||
RigReservoirCellResults* results() {return m_results.p();}
|
||||
const RigReservoirCellResults* results() const {return m_results.p();}
|
||||
RigReservoirCellResults* results(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||
const RigReservoirCellResults* results(RifReaderInterface::PorosityModelResultType porosityModel) const;
|
||||
|
||||
size_t globalMatrixModelActiveCellCount();
|
||||
size_t globalFractureModelActiveCellCount();
|
||||
@@ -81,7 +83,10 @@ private:
|
||||
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
||||
std::vector<RigCell> m_cells; ///< Global array of all cells in the reservoir (including the ones in LGR's)
|
||||
cvf::Collection<RigLocalGrid> m_localGrids; ///< List of all the LGR's in this reservoir
|
||||
cvf::ref<RigReservoirCellResults> m_results;
|
||||
|
||||
cvf::ref<RigReservoirCellResults> m_matrixModelResults;
|
||||
cvf::ref<RigReservoirCellResults> m_fractureModelResults;
|
||||
|
||||
size_t m_globalMatrixModelActiveCellCount;
|
||||
size_t m_globalFractureModelActiveCellCount;
|
||||
|
||||
|
||||
@@ -763,3 +763,13 @@ size_t RigReservoirCellResults::addStaticScalarResult(RimDefines::ResultCatType
|
||||
return resultIdx;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderInterface::PorosityModelResultType RigReservoirCellResults::convertFromProjectModelPorosityModel(RimDefines::PorosityModelType porosityModel)
|
||||
{
|
||||
if (porosityModel == RimDefines::MATRIX_MODEL) return RifReaderInterface::MATRIX_RESULTS;
|
||||
|
||||
return RifReaderInterface::FRACTURE_RESULTS;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <QDateTime>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
class RifReaderInterface;
|
||||
class RigMainGrid;
|
||||
@@ -73,6 +74,8 @@ public:
|
||||
std::vector< std::vector<double> > & cellScalarResults(size_t scalarResultIndex);
|
||||
double cellScalarResult(size_t timeStepIndex, size_t scalarResultIndex, size_t resultValueIndex);
|
||||
|
||||
static RifReaderInterface::PorosityModelResultType convertFromProjectModelPorosityModel(RimDefines::PorosityModelType porosityModel);
|
||||
|
||||
private:
|
||||
size_t addStaticScalarResult(RimDefines::ResultCatType type, const QString& resultName, size_t resultValueCount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user