mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#273 Undefined grid faults between cells where one or both are inactive is now sorted into a seaparate predefined fault section.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "RimDefines.h"
|
||||
#include "RigFault.h"
|
||||
#include "cvfBoundingBoxTree.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
|
||||
|
||||
RigMainGrid::RigMainGrid(void)
|
||||
@@ -218,8 +219,9 @@ void RigMainGrid::setFaults(const cvf::Collection<RigFault>& faults)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::calculateFaults()
|
||||
void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo)
|
||||
{
|
||||
{
|
||||
m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(m_cells.size());
|
||||
|
||||
// Spread fault idx'es on the cells from the faults
|
||||
@@ -234,6 +236,9 @@ void RigMainGrid::calculateFaults()
|
||||
RigFault * unNamedFault = new RigFault;
|
||||
int unNamedFaultIdx = static_cast<int>(m_faults.size());
|
||||
|
||||
RigFault * unNamedFaultWithInactive = new RigFault;
|
||||
int unNamedFaultWithInactiveIdx = static_cast<int>(m_faults.size());
|
||||
|
||||
const std::vector<cvf::Vec3d>& vxs = m_mainGrid->nodes();
|
||||
|
||||
for (int gcIdx = 0 ; gcIdx < static_cast<int>(m_cells.size()); ++gcIdx)
|
||||
@@ -248,6 +253,7 @@ void RigMainGrid::calculateFaults()
|
||||
size_t i, j, k;
|
||||
RigGridBase* hostGrid = NULL;
|
||||
bool firstNO_FAULTFaceForCell = true;
|
||||
bool isCellActive = true;
|
||||
|
||||
for (char faceIdx = 0; faceIdx < 6; ++faceIdx)
|
||||
{
|
||||
@@ -262,6 +268,8 @@ void RigMainGrid::calculateFaults()
|
||||
{
|
||||
hostGrid = m_cells[gcIdx].hostGrid();
|
||||
hostGrid->ijkFromCellIndex(m_cells[gcIdx].gridLocalCellIndex(), &i,&j, &k);
|
||||
isCellActive = activeCellInfo->isActive(gcIdx);
|
||||
|
||||
firstNO_FAULTFaceForCell = false;
|
||||
}
|
||||
|
||||
@@ -276,8 +284,9 @@ void RigMainGrid::calculateFaults()
|
||||
continue;
|
||||
}
|
||||
|
||||
bool isNeighborCellActive = activeCellInfo->isActive(neighborReservoirCellIdx);
|
||||
|
||||
double tolerance = 1e-6;
|
||||
|
||||
|
||||
caf::SizeTArray4 faceIdxs;
|
||||
m_cells[gcIdx].faceIndices(face, &faceIdxs);
|
||||
@@ -296,10 +305,12 @@ void RigMainGrid::calculateFaults()
|
||||
continue;
|
||||
}
|
||||
|
||||
// To avoid doing this calculation for the opposite face
|
||||
// To avoid doing this calculation for the opposite face
|
||||
int faultIdx = unNamedFaultIdx;
|
||||
if (!(isCellActive && isNeighborCellActive)) faultIdx = unNamedFaultWithInactiveIdx;
|
||||
|
||||
m_faultsPrCellAcc->setFaultIdx(gcIdx, face, unNamedFaultIdx);
|
||||
m_faultsPrCellAcc->setFaultIdx(neighborReservoirCellIdx, StructGridInterface::oppositeFace(face), unNamedFaultIdx);
|
||||
m_faultsPrCellAcc->setFaultIdx(gcIdx, face, faultIdx);
|
||||
m_faultsPrCellAcc->setFaultIdx(neighborReservoirCellIdx, StructGridInterface::oppositeFace(face), faultIdx);
|
||||
|
||||
// Add as fault face only if the grid index is less than the neighbors
|
||||
|
||||
@@ -307,7 +318,14 @@ void RigMainGrid::calculateFaults()
|
||||
{
|
||||
{
|
||||
RigFault::FaultFace ff(gcIdx, cvf::StructGridInterface::FaceType(faceIdx), neighborReservoirCellIdx);
|
||||
unNamedFault->faultFaces().push_back(ff);
|
||||
if(isCellActive && isNeighborCellActive)
|
||||
{
|
||||
unNamedFault->faultFaces().push_back(ff);
|
||||
}
|
||||
else
|
||||
{
|
||||
unNamedFaultWithInactive->faultFaces().push_back(ff);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -325,6 +343,12 @@ void RigMainGrid::calculateFaults()
|
||||
m_faults.push_back(unNamedFault);
|
||||
}
|
||||
|
||||
if(unNamedFaultWithInactive->faultFaces().size())
|
||||
{
|
||||
unNamedFaultWithInactive->setName(RimDefines::undefinedGridFaultWithInactiveName());
|
||||
m_faults.push_back(unNamedFaultWithInactive);
|
||||
}
|
||||
}
|
||||
// Distribute nnc's to the faults
|
||||
|
||||
const std::vector<RigConnection>& nncs = this->nncData()->connections();
|
||||
|
||||
@@ -30,11 +30,14 @@
|
||||
#include <QtGlobal>
|
||||
#include "RigNNCData.h"
|
||||
|
||||
class RigActiveCellInfo;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class BoundingBoxTree;
|
||||
}
|
||||
|
||||
|
||||
class RigMainGrid : public RigGridBase
|
||||
{
|
||||
public:
|
||||
@@ -57,7 +60,7 @@ public:
|
||||
RigNNCData* nncData();
|
||||
void setFaults(const cvf::Collection<RigFault>& faults);
|
||||
const cvf::Collection<RigFault>& faults() { return m_faults; }
|
||||
void calculateFaults();
|
||||
void calculateFaults(const RigActiveCellInfo* activeCellInfo);
|
||||
const RigFault* findFaultFromCellIndexAndCellFace(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const;
|
||||
bool isFaceNormalsOutwards() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user