mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2969 Fracture Truncations : Visualize fault truncations
This commit is contained in:
parent
61a7d5c7ba
commit
b0ee5a2834
@ -25,6 +25,7 @@
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureContainmentTools.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimSimWellFracture.h"
|
||||
#include "RimSimWellFractureCollection.h"
|
||||
@ -177,9 +178,11 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
|
||||
size_t stimPlanCellIndex = fractureGrid->getGlobalIndexFromIJ(fractureCell.getI(), fractureCell.getJ());
|
||||
|
||||
auto truncatedFractureCellIndices = RimFractureContainmentTools::fracturedCellsTruncatedByFaults(caseToApply, fracture);
|
||||
|
||||
for ( size_t i = 0; i < fractureCellContributingEclipseCells.size(); i++ )
|
||||
{
|
||||
if ( fracture->isEclipseCellWithinContainment(caseToApply->eclipseCaseData()->mainGrid(), fractureCellContributingEclipseCells[i]) )
|
||||
if ( fracture->isEclipseCellWithinContainment(caseToApply->eclipseCaseData()->mainGrid(), truncatedFractureCellIndices, fractureCellContributingEclipseCells[i]) )
|
||||
{
|
||||
if ( useFiniteConductivityInFracture )
|
||||
{
|
||||
|
@ -28,10 +28,12 @@
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureContainment.h"
|
||||
#include "RimFractureContainmentTools.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSimWellInView.h"
|
||||
@ -662,9 +664,13 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createContainmentMaskPart(const RimE
|
||||
|
||||
std::vector<cvf::Vec3f> maskTriangles;
|
||||
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
activeView.firstAncestorOrThisOfType(eclipseCase);
|
||||
auto containedFractureCells = RimFractureContainmentTools::fracturedCellsTruncatedByFaults(eclipseCase, m_rimFracture);
|
||||
|
||||
for (size_t resCellIdx : cellCandidates)
|
||||
{
|
||||
if (!m_rimFracture->isEclipseCellWithinContainment(activeView.mainGrid(), resCellIdx))
|
||||
if (!m_rimFracture->isEclipseCellWithinContainment(activeView.mainGrid(), containedFractureCells, resCellIdx))
|
||||
{
|
||||
// Calculate Eclipse cell intersection with fracture plane
|
||||
|
||||
|
@ -600,13 +600,17 @@ void RimFracture::setFractureUnit(RiaEclipseUnitTools::UnitSystem unitSystem)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFracture::isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t globalCellIndex) const
|
||||
bool RimFracture::isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
const std::set<size_t>& containmentCells,
|
||||
size_t globalCellIndex) const
|
||||
{
|
||||
CVF_ASSERT(fractureTemplate());
|
||||
if (!fractureTemplate()->fractureContainment()->isEnabled()) return true;
|
||||
|
||||
size_t anchorEclipseCell = findAnchorEclipseCell(mainGrid);
|
||||
return fractureTemplate()->fractureContainment()->isEclipseCellWithinContainment(mainGrid, anchorEclipseCell, globalCellIndex);
|
||||
|
||||
return fractureTemplate()->fractureContainment()->isEclipseCellWithinContainment(
|
||||
mainGrid, anchorEclipseCell, globalCellIndex, containmentCells);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -67,7 +67,9 @@ public:
|
||||
void setFractureUnit(RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
const std::set<size_t>& containmentCells,
|
||||
size_t globalCellIndex) const;
|
||||
|
||||
size_t findAnchorEclipseCell(const RigMainGrid* mainGrid) const;
|
||||
|
||||
cvf::Mat4d transformMatrix() const;
|
||||
|
@ -47,7 +47,8 @@ RimFractureContainment::RimFractureContainment()
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture Containment", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_isUsingFractureContainment_OBSOLETE, "IsUsingFractureContainment", false, "Fracture Containment", "", "", "");
|
||||
CAF_PDM_InitField(
|
||||
&m_isUsingFractureContainment_OBSOLETE, "IsUsingFractureContainment", false, "Fracture Containment", "", "", "");
|
||||
m_isUsingFractureContainment_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_isUsingFractureContainment_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||
|
||||
@ -98,10 +99,13 @@ bool RimFractureContainment::isEnabled() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* mainGrid,
|
||||
size_t anchorEclipseCell,
|
||||
size_t globalCellIndex) const
|
||||
size_t globalCellIndex,
|
||||
const std::set<size_t>& containmentCells) const
|
||||
{
|
||||
if (!isEnabled()) return true;
|
||||
|
||||
if (m_faultTruncation() == CONTINUE_IN_CONTAINMENT_ZONE || m_faultTruncation() == TRUNCATE_AT_FAULT)
|
||||
{
|
||||
CVF_ASSERT(mainGrid);
|
||||
|
||||
size_t i, j, k;
|
||||
@ -118,8 +122,19 @@ bool RimFractureContainment::isEclipseCellWithinContainment(const RigMainGrid* m
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Todo: use fault propagation mode
|
||||
if (m_faultTruncation() == TRUNCATE_AT_FAULT)
|
||||
{
|
||||
if (containmentCells.count(globalCellIndex) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -147,7 +162,7 @@ void RimFractureContainment::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
{
|
||||
uiOrdering.add(&m_faultTruncation);
|
||||
|
||||
if (m_faultTruncation() == CONTINUE_IN_CONTAINMENT_ZONE)
|
||||
if (m_faultTruncation() == CONTINUE_IN_CONTAINMENT_ZONE || m_faultTruncation() == TRUNCATE_AT_FAULT)
|
||||
{
|
||||
uiOrdering.add(&m_topKLayer);
|
||||
uiOrdering.add(&m_baseKLayer);
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
};
|
||||
|
||||
bool isEnabled() const;
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex) const;
|
||||
bool isEclipseCellWithinContainment(const RigMainGrid* mainGrid, size_t anchorEclipseCell, size_t globalCellIndex, const std::set<size_t>& containmentCells) const;
|
||||
|
||||
void setTopKLayer(int topKLayer);
|
||||
void setBaseKLayer(int baseKLayer);
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -69,7 +71,14 @@ void RimFractureContainmentTools::checkFaultAndAppendNeighborCell(const std::set
|
||||
std::set<size_t>& connectedCells)
|
||||
{
|
||||
const RigFault* fault = mainGrid->findFaultFromCellIndexAndCellFace(currentCell, face);
|
||||
if (fault) return;
|
||||
if (fault)
|
||||
{
|
||||
size_t i, j, k;
|
||||
mainGrid->ijkFromCellIndex(currentCell, &i, &j, &k);
|
||||
|
||||
qDebug() << QString("Found cell at ijk %1").arg(i).arg(j).arg(k);
|
||||
return;
|
||||
}
|
||||
|
||||
appendNeighborCellForFace(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_I, connectedCells);
|
||||
}
|
||||
@ -96,13 +105,18 @@ void RimFractureContainmentTools::appendNeighborCells(const std::set<size_t>& al
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(const RimEclipseView* eclipseView,
|
||||
std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(const RimEclipseCase* eclipseCase,
|
||||
RimFracture* fracture)
|
||||
{
|
||||
std::set<size_t> fracturedCellsContainedByFaults;
|
||||
|
||||
auto mainGrid = eclipseView->mainGrid();
|
||||
auto activeCellInfo = eclipseView->currentActiveCellInfo();
|
||||
if (eclipseCase && fracture)
|
||||
{
|
||||
auto eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
if (eclipseCaseData)
|
||||
{
|
||||
auto mainGrid = eclipseCaseData->mainGrid();
|
||||
auto activeCellInfo = eclipseCaseData->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
if (mainGrid && activeCellInfo)
|
||||
{
|
||||
@ -112,6 +126,8 @@ std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(co
|
||||
|
||||
appendNeighborCells(allFracturedCells, mainGrid, anchorCellGlobalIndex, fracturedCellsContainedByFaults);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fracturedCellsContainedByFaults;
|
||||
}
|
||||
|
@ -26,12 +26,12 @@
|
||||
class RigMainGrid;
|
||||
class RigActiveCellInfo;
|
||||
class RimFracture;
|
||||
class RimEclipseView;
|
||||
class RimEclipseCase;
|
||||
|
||||
class RimFractureContainmentTools
|
||||
{
|
||||
public:
|
||||
static std::set<size_t> fracturedCellsTruncatedByFaults(const RimEclipseView* eclipseView, RimFracture* fracture);
|
||||
static std::set<size_t> fracturedCellsTruncatedByFaults(const RimEclipseCase* eclipseCase, RimFracture* fracture);
|
||||
|
||||
private:
|
||||
// TODO: Try to change RimStimPlanFractureTemplate::fractureTriangleGeometry to be able to use const RimFracture
|
||||
|
Loading…
Reference in New Issue
Block a user