mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3032 Completion Export Fracture Header : Refactoring
Rename to reservoirCellIndicesOpenForFlow Include inactive cells in area calculation Consider containment/truncation for header related calculations Moved calculations from stim plan fracture to stim plan calculator
This commit is contained in:
@@ -646,17 +646,15 @@ void RimFracture::setFractureUnit(RiaEclipseUnitTools::UnitSystem unitSystem)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFracture::isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
const std::set<size_t>& containmentCells,
|
||||
size_t globalCellIndex) const
|
||||
bool RimFracture::isEclipseCellOpenForFlow(const RigMainGrid* mainGrid,
|
||||
const std::set<size_t>& reservoirCellIndicesOpenForFlow,
|
||||
size_t globalCellIndex) const
|
||||
{
|
||||
CVF_ASSERT(fractureTemplate());
|
||||
if (!fractureTemplate()->fractureContainment()->isEnabled()) return true;
|
||||
|
||||
size_t anchorEclipseCell = mainGrid->findReservoirCellIndexFromPoint(m_anchorPosition);
|
||||
|
||||
return fractureTemplate()->fractureContainment()->isEclipseCellWithinContainment(
|
||||
mainGrid, anchorEclipseCell, globalCellIndex, containmentCells);
|
||||
return fractureTemplate()->fractureContainment()->isEclipseCellOpenForFlow(
|
||||
mainGrid, globalCellIndex, reservoirCellIndicesOpenForFlow);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
RiaEclipseUnitTools::UnitSystem fractureUnit() const;
|
||||
void setFractureUnit(RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
const std::set<size_t>& containmentCells,
|
||||
size_t globalCellIndex) const;
|
||||
bool isEclipseCellOpenForFlow(const RigMainGrid* mainGrid,
|
||||
const std::set<size_t>& reservoirCellIndicesOpenForFlow,
|
||||
size_t globalCellIndex) const;
|
||||
|
||||
cvf::Mat4d transformMatrix() const;
|
||||
double dip() const;
|
||||
|
||||
@@ -69,10 +69,9 @@ bool RimFractureContainment::isEnabled() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
size_t anchorEclipseCell,
|
||||
size_t globalCellIndex,
|
||||
const std::set<size_t>& containmentCells) const
|
||||
bool RimFractureContainment::isEclipseCellOpenForFlow(const RigMainGrid* mainGrid,
|
||||
size_t globalCellIndex,
|
||||
const std::set<size_t>& reservoirCellIndicesOpenForFlow) const
|
||||
{
|
||||
if (!isEnabled()) return true;
|
||||
|
||||
@@ -82,7 +81,7 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid*
|
||||
|
||||
if (globalCellIndex >= mainGrid->globalCellArray().size()) return false;
|
||||
|
||||
auto cell = mainGrid->globalCellArray()[globalCellIndex];
|
||||
auto cell = mainGrid->globalCellArray()[globalCellIndex];
|
||||
auto mainGridCellIndex = cell.mainGridCellIndex();
|
||||
|
||||
size_t i, j, k;
|
||||
@@ -101,7 +100,7 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid*
|
||||
|
||||
if (m_truncateAtFaults())
|
||||
{
|
||||
if (containmentCells.count(globalCellIndex) > 0)
|
||||
if (reservoirCellIndicesOpenForFlow.count(globalCellIndex) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -123,7 +122,7 @@ void RimFractureContainment::setTopKLayer(int topKLayer)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimFractureContainment::topKLayer() const
|
||||
{
|
||||
@@ -139,7 +138,7 @@ void RimFractureContainment::setBaseKLayer(int baseKLayer)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimFractureContainment::baseKLayer() const
|
||||
{
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RigMainGrid;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RimFractureContainment : public caf::PdmObject
|
||||
class RimFractureContainment : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@@ -34,25 +34,27 @@ public:
|
||||
~RimFractureContainment();
|
||||
|
||||
bool isEnabled() const;
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex, const std::set<size_t>& containmentCells) const;
|
||||
bool isEclipseCellOpenForFlow(const RigMainGrid* mainGrid,
|
||||
size_t globalCellIndex,
|
||||
const std::set<size_t>& reservoirCellIndicesOpenForFlow) const;
|
||||
|
||||
void setTopKLayer(int topKLayer);
|
||||
int topKLayer() const;
|
||||
int topKLayer() const;
|
||||
|
||||
void setBaseKLayer(int baseKLayer);
|
||||
int baseKLayer() const;
|
||||
int baseKLayer() const;
|
||||
|
||||
double minimumFaultThrow() const; // Negative value means do not test for fault throw
|
||||
|
||||
private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_useContainment;
|
||||
caf::PdmField<int> m_topKLayer;
|
||||
caf::PdmField<int> m_baseKLayer;
|
||||
|
||||
caf::PdmField<bool> m_truncateAtFaults;
|
||||
caf::PdmField<float> m_minimumFaultThrow;
|
||||
caf::PdmField<bool> m_truncateAtFaults;
|
||||
caf::PdmField<float> m_minimumFaultThrow;
|
||||
};
|
||||
|
||||
@@ -201,10 +201,10 @@ void RimFractureContainmentTools::appendNeighborCells(const std::set<size_t>& al
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(const RimEclipseCase* eclipseCase,
|
||||
std::set<size_t> RimFractureContainmentTools::reservoirCellIndicesOpenForFlow(const RimEclipseCase* eclipseCase,
|
||||
const RimFracture* fracture)
|
||||
{
|
||||
std::set<size_t> fracturedCellsContainedByFaults;
|
||||
std::set<size_t> cellsOpenForFlow;
|
||||
|
||||
if (eclipseCase && fracture)
|
||||
{
|
||||
@@ -230,12 +230,12 @@ std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(co
|
||||
appendNeighborCells(cellsIntersectingFracturePlane,
|
||||
mainGrid,
|
||||
anchorCellGlobalIndex,
|
||||
fracturedCellsContainedByFaults,
|
||||
cellsOpenForFlow,
|
||||
maximumFaultThrow);
|
||||
}
|
||||
else
|
||||
{
|
||||
fracturedCellsContainedByFaults = cellsIntersectingFracturePlane;
|
||||
cellsOpenForFlow = cellsIntersectingFracturePlane;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(co
|
||||
}
|
||||
}
|
||||
|
||||
return fracturedCellsContainedByFaults;
|
||||
return cellsOpenForFlow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,7 +30,7 @@ class RimEclipseCase;
|
||||
class RimFractureContainmentTools
|
||||
{
|
||||
public:
|
||||
static std::set<size_t> fracturedCellsTruncatedByFaults(const RimEclipseCase* eclipseCase, const RimFracture* fracture);
|
||||
static std::set<size_t> reservoirCellIndicesOpenForFlow(const RimEclipseCase* eclipseCase, const RimFracture* fracture);
|
||||
|
||||
private:
|
||||
static std::set<size_t> getCellsIntersectingFracturePlane(const RigMainGrid* mainGrid, const RimFracture* fracture);
|
||||
|
||||
@@ -84,10 +84,6 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
|
||||
m_fractureGrid = new RigFractureGrid();
|
||||
m_readError = false;
|
||||
|
||||
m_areaWeightedConductivity = 0.0;
|
||||
m_areaWeightedWidth = 0.0;
|
||||
m_longestYRangeAboveConductivityThreshold = 0.0;
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
@@ -824,25 +820,18 @@ double RimStimPlanFractureTemplate::resultValueAtIJ(const QString& uiResultName,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimStimPlanFractureTemplate::areaWeightedWidth() const
|
||||
std::vector<double> RimStimPlanFractureTemplate::widthResultValues() const
|
||||
{
|
||||
return m_areaWeightedWidth;
|
||||
}
|
||||
std::vector<double> resultValues;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimStimPlanFractureTemplate::areaWeightedConductivity() const
|
||||
{
|
||||
return m_areaWeightedConductivity;
|
||||
}
|
||||
auto nameUnit = widthParameterNameAndUnit();
|
||||
if (!nameUnit.first.isEmpty())
|
||||
{
|
||||
resultValues =
|
||||
fractureGridResultsForUnitSystem(nameUnit.first, nameUnit.second, m_activeTimeStepIndex, fractureTemplateUnit());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimStimPlanFractureTemplate::longestYRange() const
|
||||
{
|
||||
return m_longestYRangeAboveConductivityThreshold;
|
||||
return resultValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -875,80 +864,12 @@ const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::updateFractureGrid()
|
||||
{
|
||||
m_fractureGrid = nullptr;
|
||||
m_areaWeightedConductivity = 0.0;
|
||||
m_areaWeightedWidth = 0.0;
|
||||
m_longestYRangeAboveConductivityThreshold = 0.0;
|
||||
m_fractureGrid = nullptr;
|
||||
|
||||
if (m_stimPlanFractureDefinitionData.notNull())
|
||||
{
|
||||
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(
|
||||
m_conductivityResultNameOnFile, m_activeTimeStepIndex, m_wellPathDepthAtFracture, m_fractureTemplateUnit());
|
||||
if (m_fractureGrid.notNull())
|
||||
{
|
||||
std::vector<double> areaPerCell;
|
||||
|
||||
double totalArea = 0.0;
|
||||
|
||||
for (const auto& c : m_fractureGrid->fractureCells())
|
||||
{
|
||||
double cellArea = c.cellSizeX() * c.cellSizeZ();
|
||||
|
||||
areaPerCell.push_back(cellArea);
|
||||
totalArea += cellArea;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < areaPerCell.size(); i++)
|
||||
{
|
||||
const auto& c = m_fractureGrid->fractureCells()[i];
|
||||
|
||||
double perCellValue = c.getConductivityValue() * areaPerCell[i] / totalArea;
|
||||
|
||||
m_areaWeightedConductivity += perCellValue;
|
||||
}
|
||||
|
||||
auto nameUnit = widthParameterNameAndUnit();
|
||||
if (!nameUnit.first.isEmpty())
|
||||
{
|
||||
auto resultValues = fractureGridResultsForUnitSystem(
|
||||
nameUnit.first, nameUnit.second, m_activeTimeStepIndex, fractureTemplateUnit());
|
||||
|
||||
for (size_t i = 0; i < areaPerCell.size(); i++)
|
||||
{
|
||||
double perCellValue = resultValues[i] * areaPerCell[i] / totalArea;
|
||||
|
||||
m_areaWeightedWidth += perCellValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute longest y-range with continuous non-zero conductivity
|
||||
{
|
||||
double longestYRange = 0.0;
|
||||
|
||||
for (size_t i = 0; i < m_fractureGrid->iCellCount(); i++)
|
||||
{
|
||||
double currentYRange = 0.0;
|
||||
for (size_t j = 0; j < m_fractureGrid->jCellCount(); j++)
|
||||
{
|
||||
size_t globalIndex = m_fractureGrid->getGlobalIndexFromIJ(i, j);
|
||||
const auto& cell = m_fractureGrid->cellFromIndex(globalIndex);
|
||||
if (cell.hasNonZeroConductivity())
|
||||
{
|
||||
currentYRange += cell.cellSizeZ();
|
||||
}
|
||||
else
|
||||
{
|
||||
longestYRange = std::max(longestYRange, currentYRange);
|
||||
currentYRange = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
longestYRange = std::max(longestYRange, currentYRange);
|
||||
}
|
||||
|
||||
m_longestYRangeAboveConductivityThreshold = longestYRange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,9 +79,7 @@ public:
|
||||
bool hasConductivity() const;
|
||||
double resultValueAtIJ(const QString& uiResultName, const QString& unitName, size_t timeStepIndex, size_t i, size_t j);
|
||||
|
||||
double areaWeightedWidth() const;
|
||||
double areaWeightedConductivity() const;
|
||||
double longestYRange() const;
|
||||
std::vector<double> widthResultValues() const;
|
||||
|
||||
void appendDataToResultStatistics(const QString& uiResultName,
|
||||
const QString& unit,
|
||||
@@ -128,9 +126,5 @@ private:
|
||||
cvf::ref<RigFractureGrid> m_fractureGrid;
|
||||
bool m_readError;
|
||||
|
||||
double m_areaWeightedConductivity;
|
||||
double m_areaWeightedWidth;
|
||||
double m_longestYRangeAboveConductivityThreshold;
|
||||
|
||||
caf::PdmField<bool> m_showStimPlanMesh_OBSOLETE;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user