#2967 Fracture Truncation at Faults: Add Fault Throw

This commit is contained in:
Magne Sjaastad 2018-06-04 11:16:34 +02:00
parent 0abc41afdb
commit 3cf35f673a
4 changed files with 98 additions and 20 deletions

View File

@ -58,6 +58,9 @@ RimFractureContainment::RimFractureContainment()
// m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault(&m_faultTruncation, "FaultTruncationType", "Fault Truncation", "", "", "");
CAF_PDM_InitField(&m_useFaultThrow, "UseFaultThrow", false, "Use Fault Throw", "", "", "");
CAF_PDM_InitField(&m_faultThrowValue, "FaultThrowValue", 0.0f, " Fault Throw", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -86,6 +89,19 @@ void RimFractureContainment::initAfterRead()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureContainment::faultThrow() const
{
if ((m_faultTruncation() == CONTINUE_IN_CONTAINMENT_ZONE || m_faultTruncation() == TRUNCATE_AT_FAULT) && m_useFaultThrow())
{
return m_faultThrowValue;
}
return -1.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -166,6 +182,12 @@ void RimFractureContainment::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
{
uiOrdering.add(&m_topKLayer);
uiOrdering.add(&m_baseKLayer);
uiOrdering.add(&m_useFaultThrow);
if (m_useFaultThrow())
{
uiOrdering.add(&m_faultThrowValue);
}
}
uiOrdering.skipRemainingFields();
@ -178,7 +200,8 @@ void RimFractureContainment::fieldChangedByUi(const caf::PdmFieldHandle* changed
const QVariant& oldValue,
const QVariant& newValue)
{
if (changedField == &m_faultTruncation || changedField == &m_topKLayer || changedField == &m_baseKLayer)
if (changedField == &m_faultTruncation || changedField == &m_topKLayer || changedField == &m_baseKLayer ||
changedField == &m_useFaultThrow || changedField == &m_faultThrowValue)
{
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
@ -188,7 +211,7 @@ void RimFractureContainment::fieldChangedByUi(const caf::PdmFieldHandle* changed
}
}
if (changedField == &m_faultTruncation)
if (changedField == &m_useFaultThrow || changedField == &m_faultTruncation)
{
RimFractureTemplate* fractureTemplate = nullptr;
this->firstAncestorOrThisOfType(fractureTemplate);

View File

@ -47,6 +47,8 @@ public:
void setTopKLayer(int topKLayer);
void setBaseKLayer(int baseKLayer);
double faultThrow() 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;
@ -60,5 +62,8 @@ private:
caf::PdmField<int> m_topKLayer;
caf::PdmField<int> m_baseKLayer;
caf::PdmField<bool> m_useFaultThrow;
caf::PdmField<float> m_faultThrowValue;
caf::PdmField<bool> m_isUsingFractureContainment_OBSOLETE;
};

View File

@ -28,6 +28,8 @@
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimFracture.h"
#include "RimFractureContainment.h"
#include "RimFractureTemplate.h"
#include "cvfStructGrid.h"
@ -40,15 +42,18 @@ void RimFractureContainmentTools::appendNeighborCellForFace(const std::set<size_
const RigMainGrid* mainGrid,
size_t currentCell,
cvf::StructGridInterface::FaceType face,
std::set<size_t>& connectedCells)
std::set<size_t>& connectedCells,
double faultThrow)
{
// TODO: Remove when we know if LGR can have faults
size_t anchorI, anchorJ, anchorK;
mainGrid->ijkFromCellIndex(currentCell, &anchorI, &anchorJ, &anchorK);
size_t candidate;
if (mainGrid->cellIJKNeighbor(anchorI, anchorJ, anchorK, face, &candidate))
{
appendNeighborCells(allFracturedCells, mainGrid, candidate, connectedCells);
appendNeighborCells(allFracturedCells, mainGrid, candidate, connectedCells, faultThrow);
}
}
@ -57,17 +62,51 @@ void RimFractureContainmentTools::appendNeighborCellForFace(const std::set<size_
//--------------------------------------------------------------------------------------------------
void RimFractureContainmentTools::checkFaultAndAppendNeighborCell(const std::set<size_t>& allFracturedCells,
const RigMainGrid* mainGrid,
size_t currentCell,
size_t globalReservoirCellIndex,
cvf::StructGridInterface::FaceType face,
std::set<size_t>& connectedCells)
std::set<size_t>& connectedCells,
double faultThrow)
{
const RigFault* fault = mainGrid->findFaultFromCellIndexAndCellFace(currentCell, face);
const RigFault* fault = mainGrid->findFaultFromCellIndexAndCellFace(globalReservoirCellIndex, face);
if (fault)
{
return;
if (faultThrow < 0.0)
{
return;
}
else
{
// See RigMainGrid::calculateFaults()
// TODO: Remove when we know if LGR can have faults
const RigGridBase* hostGrid = nullptr;
size_t gridLocalCellIndex;
hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(globalReservoirCellIndex, &gridLocalCellIndex);
size_t i, j, k;
hostGrid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);
size_t neighborGridLocalCellIndex;
bool foundCell = hostGrid->cellIJKNeighbor(i, j, k, face, &neighborGridLocalCellIndex);
CVF_ASSERT(foundCell);
size_t neighborGlobalReservoirCellIndex = hostGrid->reservoirCellIndex(neighborGridLocalCellIndex);
const RigCell& currentCell = mainGrid->globalCellArray()[globalReservoirCellIndex];
const RigCell& neightborCell = mainGrid->globalCellArray()[neighborGlobalReservoirCellIndex];
auto diffBetweenFaceCenters = currentCell.faceCenter(face) - neightborCell.faceCenter(cvf::StructGridInterface::oppositeFace(face));
if (diffBetweenFaceCenters.length() < faultThrow)
{
return;
}
}
}
appendNeighborCellForFace(allFracturedCells, mainGrid, currentCell, face, connectedCells);
appendNeighborCellForFace(allFracturedCells, mainGrid, globalReservoirCellIndex, face, connectedCells, faultThrow);
}
//--------------------------------------------------------------------------------------------------
@ -76,7 +115,8 @@ void RimFractureContainmentTools::checkFaultAndAppendNeighborCell(const std::set
void RimFractureContainmentTools::appendNeighborCells(const std::set<size_t>& allFracturedCells,
const RigMainGrid* mainGrid,
size_t currentCell,
std::set<size_t>& connectedCells)
std::set<size_t>& connectedCells,
double faultThrow)
{
if (std::find(connectedCells.begin(), connectedCells.end(), currentCell) != connectedCells.end())
{
@ -93,14 +133,14 @@ void RimFractureContainmentTools::appendNeighborCells(const std::set<size_t>& al
connectedCells.insert(currentCell);
// Check faults in IJ directions
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_I, connectedCells);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::POS_I, connectedCells);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_J, connectedCells);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::POS_J, connectedCells);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_I, connectedCells, faultThrow);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::POS_I, connectedCells, faultThrow);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_J, connectedCells, faultThrow);
checkFaultAndAppendNeighborCell(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::POS_J, connectedCells, faultThrow);
// Append cells without fault check in K direction
appendNeighborCellForFace(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_K, connectedCells);
appendNeighborCellForFace(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::POS_K, connectedCells);
appendNeighborCellForFace(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::NEG_K, connectedCells, faultThrow);
appendNeighborCellForFace(allFracturedCells, mainGrid, currentCell, cvf::StructGridInterface::POS_K, connectedCells, faultThrow);
}
//--------------------------------------------------------------------------------------------------
@ -126,8 +166,15 @@ std::set<size_t> RimFractureContainmentTools::fracturedCellsTruncatedByFaults(co
size_t anchorCellGlobalIndex = fracture->findAnchorEclipseCell(mainGrid);
// Negative faultThrow disables test on faultThrow
double faultThrow = -1.0;
if (fracture && fracture->fractureTemplate())
{
faultThrow = fracture->fractureTemplate()->fractureContainment()->faultThrow();
}
appendNeighborCells(
cellsIntersectingFracturePlane, mainGrid, anchorCellGlobalIndex, fracturedCellsContainedByFaults);
cellsIntersectingFracturePlane, mainGrid, anchorCellGlobalIndex, fracturedCellsContainedByFaults, faultThrow);
}
/*

View File

@ -42,16 +42,19 @@ private:
const RigMainGrid* mainGrid,
size_t currentCell,
cvf::StructGridInterface::FaceType face,
std::set<size_t>& connectedCells);
std::set<size_t>& connectedCells,
double faultThrow);
static void checkFaultAndAppendNeighborCell(const std::set<size_t>& allFracturedCells,
const RigMainGrid* mainGrid,
size_t currentCell,
cvf::StructGridInterface::FaceType face,
std::set<size_t>& connectedCells);
std::set<size_t>& connectedCells,
double faultThrow);
static void appendNeighborCells(const std::set<size_t>& allFracturedCells,
const RigMainGrid* mainGrid,
size_t currentCell,
std::set<size_t>& connectedCells);
std::set<size_t>& connectedCells,
double faultThrow);
};