mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
#1574 Make export of fractures to compdat now respects the containment settings
This commit is contained in:
1 parent
d63fdf0c80
commit
5a02cf1498
2 files changed
+62
-16
No files matched your search
@@ -41,6 +41,7 @@
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include <vector>
|
||||
#include "RiaLogging.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -120,7 +121,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
for (RimFracture* fracture : fractures)
|
||||
{
|
||||
|
||||
bool fractureFiniteCond = (fracture->fractureTemplate()->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
|
||||
bool useFiniteConductivityInFracture = (fracture->fractureTemplate()->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
|
||||
|
||||
using CellIdxSpace = RigTransmissibilityCondenser::CellAddress;
|
||||
|
||||
@@ -132,7 +133,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
//////
|
||||
// Calculate Matrix To Fracture Trans
|
||||
|
||||
std::vector<RigFractureCell> fractureCells = fractureGrid->fractureCells();
|
||||
const std::vector<RigFractureCell>& fractureCells = fractureGrid->fractureCells();
|
||||
std::set<size_t> blockedFractureCellIndices;
|
||||
|
||||
for (const RigFractureCell fractureCell : fractureCells)
|
||||
{
|
||||
@@ -149,9 +151,14 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
|
||||
size_t stimPlanCellIndex = fractureGrid->getGlobalIndexFromIJ(fractureCell.getI(), fractureCell.getJ());
|
||||
|
||||
bool hasAnyContribEclCellWithinContainment = false;
|
||||
|
||||
for ( size_t i = 0; i < fractureCellContributingEclipseCells.size(); i++ )
|
||||
{
|
||||
if (fractureFiniteCond)
|
||||
if ( fracture->isEclipseCellWithinContainment(caseToApply->eclipseCaseData()->mainGrid(), fractureCellContributingEclipseCells[i]) )
|
||||
{
|
||||
hasAnyContribEclCellWithinContainment = true;
|
||||
if ( useFiniteConductivityInFracture )
|
||||
{
|
||||
transCondenser.addNeighborTransmissibility({ true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] },
|
||||
{ false, CellIdxSpace::STIMPLAN, stimPlanCellIndex },
|
||||
@@ -167,24 +174,36 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasAnyContribEclCellWithinContainment)
|
||||
{
|
||||
blockedFractureCellIndices.insert(stimPlanCellIndex);
|
||||
}
|
||||
}
|
||||
|
||||
//////
|
||||
// Calculate Transmissibility in the fracture: From one StimPlan Cell to the other
|
||||
|
||||
if (fractureFiniteCond)
|
||||
if (useFiniteConductivityInFracture)
|
||||
{
|
||||
for (size_t i = 0; i < fractureGrid->iCellCount(); i++)
|
||||
{
|
||||
for (size_t j = 0; j < fractureGrid->jCellCount(); j++)
|
||||
{
|
||||
size_t fractureCellIndex = fractureGrid->getGlobalIndexFromIJ(i, j);
|
||||
const RigFractureCell fractureCell = fractureGrid->cellFromIndex(fractureCellIndex);
|
||||
|
||||
if (blockedFractureCellIndices.count(fractureCellIndex)) continue;
|
||||
|
||||
const RigFractureCell& fractureCell = fractureGrid->cellFromIndex(fractureCellIndex);
|
||||
|
||||
if (fractureCell.getConductivtyValue() < 1e-7) continue;
|
||||
|
||||
if ( i < fractureGrid->iCellCount() - 1 )
|
||||
{
|
||||
size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ(i + 1, j);
|
||||
const RigFractureCell fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex);
|
||||
if ( !blockedFractureCellIndices.count(fractureCellNeighbourXIndex) )
|
||||
{
|
||||
|
||||
const RigFractureCell& fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex);
|
||||
|
||||
double horizontalTransToXneigbour =
|
||||
RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivtyValue(),
|
||||
@@ -198,13 +217,15 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex },
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourXIndex },
|
||||
horizontalTransToXneigbour);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( j < fractureGrid->jCellCount() - 1 )
|
||||
{
|
||||
size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ(i, j + 1);
|
||||
const RigFractureCell fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex);
|
||||
if ( !blockedFractureCellIndices.count(fractureCellNeighbourZIndex) )
|
||||
{
|
||||
const RigFractureCell& fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex);
|
||||
|
||||
double verticalTransToZneigbour =
|
||||
RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivtyValue(),
|
||||
@@ -218,7 +239,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex },
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourZIndex },
|
||||
verticalTransToZneigbour);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,7 +248,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
/////
|
||||
// Calculate transmissibility into the well
|
||||
|
||||
if (fractureFiniteCond)
|
||||
if (useFiniteConductivityInFracture)
|
||||
{
|
||||
////
|
||||
//If fracture has orientation Azimuth or Transverse, assume only radial inflow
|
||||
@@ -238,7 +259,10 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
const RigFractureGrid* fracGrid = fracture->fractureTemplate()->fractureGrid();
|
||||
std::pair<size_t, size_t> wellCellIJ = fracGrid->fractureCellAtWellCenter();
|
||||
size_t wellCellIndex = fracGrid->getGlobalIndexFromIJ(wellCellIJ.first, wellCellIJ.second);
|
||||
const RigFractureCell wellCell = fractureGrid->cellFromIndex(wellCellIndex);
|
||||
|
||||
if(!blockedFractureCellIndices.count(wellCellIndex))
|
||||
{
|
||||
const RigFractureCell& wellCell = fractureGrid->cellFromIndex(wellCellIndex);
|
||||
|
||||
double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivtyValue(),
|
||||
wellCell.cellSizeX(),
|
||||
@@ -251,21 +275,30 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex },
|
||||
radialTrans);
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning(QString("Fracture well cell is not located within the settings provided by Fracture Containment.")
|
||||
+ "\n Fracture named: " + fracture->name());
|
||||
}
|
||||
}
|
||||
else if (fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
|
||||
{
|
||||
|
||||
////
|
||||
//If fracture has orientation along well, linear inflow along well and radial flow at endpoints
|
||||
|
||||
else if (fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
|
||||
{
|
||||
RigWellPathStimplanIntersector wellFractureIntersector(wellPathGeometry, fracture);
|
||||
const std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection >& fractureWellCells = wellFractureIntersector.intersections();
|
||||
|
||||
for (const auto& fracCellIdxIsectDataPair : fractureWellCells)
|
||||
{
|
||||
size_t fracWellCellIdx = fracCellIdxIsectDataPair.first;
|
||||
|
||||
if(!blockedFractureCellIndices.count(fracWellCellIdx))
|
||||
{
|
||||
RigWellPathStimplanIntersector::WellCellIntersection intersection = fracCellIdxIsectDataPair.second;
|
||||
|
||||
const RigFractureCell fractureWellCell = fractureGrid->cellFromIndex(fracWellCellIdx);
|
||||
const RigFractureCell& fractureWellCell = fractureGrid->cellFromIndex(fracWellCellIdx);
|
||||
|
||||
double radialTrans = 0.0;
|
||||
if (intersection.endpointCount)
|
||||
@@ -297,6 +330,12 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fracWellCellIdx },
|
||||
totalWellTrans);
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning(QString("Fracture well cell is not located within the settings provided by Fracture Containment.")
|
||||
+ "\n Fracture named: " + fracture->name());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,8 +96,15 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* m
|
||||
|
||||
bool ok = mainGrid->ijkFromCellIndex(globalCellIndex, &i, &j, &k);
|
||||
|
||||
if (k <= m_topKLayer()) return false;
|
||||
if (k >= m_baseKLayer()) return false;
|
||||
if (k+1 <= m_topKLayer())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (k+1 >= m_baseKLayer())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Todo: use fault propagation mode
|
||||
|
||||
|
||||
Reference in new issue
Block a user