mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fault reactivation updates (#11079)
* Allow extending cell intersection lines outside cell * Update default values, and clean up some things * Populate fault zone element set * Update to latest openzgy to fix typo
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfMatrix4.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfPlane.h"
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfTextureImage.h"
|
||||
#include "cvfVector3.h"
|
||||
@@ -37,7 +36,6 @@
|
||||
|
||||
class RigGriddedPart3d;
|
||||
class RigMainGrid;
|
||||
class RimFaultReactivationDataAccess;
|
||||
class RigFaultReactivationModelGenerator;
|
||||
|
||||
class RigFRModelPart
|
||||
|
||||
@@ -36,9 +36,10 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFaultReactivationModelGenerator::RigFaultReactivationModelGenerator( cvf::Vec3d position, cvf::Vec3d normal )
|
||||
RigFaultReactivationModelGenerator::RigFaultReactivationModelGenerator( cvf::Vec3d position, cvf::Vec3d normal, cvf::Vec3d modelDirection )
|
||||
: m_startPosition( position )
|
||||
, m_normal( normal )
|
||||
, m_modelDirection( modelDirection )
|
||||
, m_bufferAboveFault( 0.0 )
|
||||
, m_bufferBelowFault( 0.0 )
|
||||
, m_startDepth( 0.0 )
|
||||
@@ -52,6 +53,7 @@ RigFaultReactivationModelGenerator::RigFaultReactivationModelGenerator( cvf::Vec
|
||||
, m_minCellHeight( 0.5 )
|
||||
, m_maxCellHeight( 20.0 )
|
||||
, m_minCellWidth( 20.0 )
|
||||
, m_faultZoneCells( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -89,10 +91,11 @@ void RigFaultReactivationModelGenerator::setActiveCellInfo( const RigActiveCellI
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFaultReactivationModelGenerator::setFaultBufferDepth( double aboveFault, double belowFault )
|
||||
void RigFaultReactivationModelGenerator::setFaultBufferDepth( double aboveFault, double belowFault, int faultZoneCells )
|
||||
{
|
||||
m_bufferAboveFault = aboveFault;
|
||||
m_bufferBelowFault = belowFault;
|
||||
m_faultZoneCells = faultZoneCells;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -142,10 +145,7 @@ void RigFaultReactivationModelGenerator::setModelGriddingOptions( double minCell
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<cvf::Vec3d, cvf::Vec3d> RigFaultReactivationModelGenerator::modelLocalNormalsXY()
|
||||
{
|
||||
cvf::Vec3d xNormal = m_normal ^ cvf::Vec3d::Z_AXIS;
|
||||
xNormal.z() = 0.0;
|
||||
xNormal.normalize();
|
||||
|
||||
cvf::Vec3d xNormal = m_modelDirection;
|
||||
cvf::Vec3d yNormal = xNormal ^ cvf::Vec3d::Z_AXIS;
|
||||
|
||||
return std::make_pair( xNormal, yNormal );
|
||||
@@ -197,8 +197,11 @@ const std::array<int, 4> RigFaultReactivationModelGenerator::faceIJCornerIndexes
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RigFaultReactivationModelGenerator::lineIntersect( const cvf::Plane& plane, cvf::Vec3d lineA, cvf::Vec3d lineB )
|
||||
{
|
||||
double dist = 0.0;
|
||||
return caf::HexGridIntersectionTools::planeLineIntersectionForMC( plane, lineA, lineB, &dist );
|
||||
double dist = 0.0;
|
||||
cvf::Vec3d intersect;
|
||||
caf::HexGridIntersectionTools::planeLineIntersect( plane, lineA, lineB, &intersect, &dist, 0.01 );
|
||||
|
||||
return intersect;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -292,14 +295,11 @@ void RigFaultReactivationModelGenerator::generatePointsFrontBack()
|
||||
{
|
||||
std::array<cvf::Vec3d, 24> points;
|
||||
|
||||
auto alongModel = m_normal ^ cvf::Vec3d::Z_AXIS;
|
||||
alongModel.normalize();
|
||||
|
||||
double top_depth = -m_startDepth;
|
||||
m_bottomDepth = m_bottomFault.z() - m_depthBelowFault;
|
||||
|
||||
cvf::Vec3d edge_front = m_startPosition - m_horzExtentFromFault * alongModel;
|
||||
cvf::Vec3d edge_back = m_startPosition + m_horzExtentFromFault * alongModel;
|
||||
cvf::Vec3d edge_front = m_startPosition - m_horzExtentFromFault * m_modelDirection;
|
||||
cvf::Vec3d edge_back = m_startPosition + m_horzExtentFromFault * m_modelDirection;
|
||||
|
||||
points[8] = m_bottomFault;
|
||||
points[8].z() = m_bottomDepth;
|
||||
@@ -503,7 +503,9 @@ void RigFaultReactivationModelGenerator::generateGeometry( size_t
|
||||
m_cellSizeHeightFactor,
|
||||
m_horizontalPartition,
|
||||
m_modelThickness,
|
||||
m_topReservoirFront.z() );
|
||||
m_topReservoirFront.z(),
|
||||
m_normal,
|
||||
m_faultZoneCells );
|
||||
backPart->generateGeometry( m_backPoints,
|
||||
backReservoirLayers,
|
||||
kLayersBack,
|
||||
@@ -511,7 +513,9 @@ void RigFaultReactivationModelGenerator::generateGeometry( size_t
|
||||
m_cellSizeHeightFactor,
|
||||
m_horizontalPartition,
|
||||
m_modelThickness,
|
||||
m_topReservoirBack.z() );
|
||||
m_topReservoirBack.z(),
|
||||
m_normal,
|
||||
m_faultZoneCells );
|
||||
|
||||
frontPart->generateLocalNodes( m_localCoordTransform );
|
||||
backPart->generateLocalNodes( m_localCoordTransform );
|
||||
|
||||
@@ -37,13 +37,13 @@ class RigActiveCellInfo;
|
||||
class RigFaultReactivationModelGenerator : cvf::Object
|
||||
{
|
||||
public:
|
||||
RigFaultReactivationModelGenerator( cvf::Vec3d position, cvf::Vec3d normal );
|
||||
RigFaultReactivationModelGenerator( cvf::Vec3d position, cvf::Vec3d normal, cvf::Vec3d direction );
|
||||
~RigFaultReactivationModelGenerator() override;
|
||||
|
||||
void setFault( const RigFault* fault );
|
||||
void setGrid( const RigMainGrid* grid );
|
||||
void setActiveCellInfo( const RigActiveCellInfo* activeCellInfo );
|
||||
void setFaultBufferDepth( double aboveFault, double belowFault );
|
||||
void setFaultBufferDepth( double aboveFault, double belowFault, int faultZoneCells );
|
||||
void setModelSize( double startDepth, double depthBelowFault, double horzExtentFromFault );
|
||||
void setModelThickness( double thickness );
|
||||
void setModelGriddingOptions( double minCellHeight,
|
||||
@@ -90,6 +90,7 @@ protected:
|
||||
private:
|
||||
cvf::Vec3d m_startPosition;
|
||||
cvf::Vec3d m_normal;
|
||||
cvf::Vec3d m_modelDirection;
|
||||
|
||||
std::array<cvf::Vec3d, 12> m_frontPoints;
|
||||
std::array<cvf::Vec3d, 12> m_backPoints;
|
||||
@@ -102,6 +103,7 @@ private:
|
||||
|
||||
double m_bufferAboveFault;
|
||||
double m_bufferBelowFault;
|
||||
int m_faultZoneCells;
|
||||
|
||||
double m_startDepth;
|
||||
double m_bottomDepth;
|
||||
|
||||
@@ -234,7 +234,9 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
|
||||
double cellSizeFactor,
|
||||
const std::vector<double>& horizontalPartition,
|
||||
double modelThickness,
|
||||
double topHeight )
|
||||
double topHeight,
|
||||
cvf::Vec3d thicknessDirection,
|
||||
int nFaultZoneCells )
|
||||
{
|
||||
reset();
|
||||
|
||||
@@ -266,9 +268,7 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
|
||||
|
||||
const std::vector<double> m_thicknessFactors = { -1.0, 0.0, 1.0 };
|
||||
const int nThicknessCells = 2;
|
||||
cvf::Vec3d tVec = stepVector( inputPoints[0], inputPoints[6], 1 ) ^ cvf::Vec3d::Z_AXIS;
|
||||
tVec.normalize();
|
||||
tVec *= modelThickness;
|
||||
cvf::Vec3d tVec = modelThickness * thicknessDirection;
|
||||
|
||||
size_t reserveSize = ( nVertCells + 1 ) * ( nHorzCells + 1 ) * ( nThicknessCells + 1 );
|
||||
m_nodes.reserve( reserveSize );
|
||||
@@ -391,6 +391,7 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
|
||||
m_elementSets[ElementSets::Reservoir] = {};
|
||||
m_elementSets[ElementSets::IntraReservoir] = {};
|
||||
m_elementSets[ElementSets::UnderBurden] = {};
|
||||
m_elementSets[ElementSets::FaultZone] = {};
|
||||
|
||||
m_boundaryElements[Boundary::Bottom] = {};
|
||||
m_boundaryElements[Boundary::FarSide] = {};
|
||||
@@ -415,6 +416,8 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
|
||||
const int nThicknessOff = nThicknessCells + 1;
|
||||
const int seaBedLayer = (int)( nVertCells - 2 );
|
||||
|
||||
const int nFaultZoneStart = (int)nHorzCells - nFaultZoneCells - 1;
|
||||
|
||||
for ( int v = 0; v < (int)nVertCells - 1; v++ )
|
||||
{
|
||||
if ( v >= nVertCellsLower ) currentSurfaceRegion = RimFaultReactivation::BorderSurface::FaultSurface;
|
||||
@@ -452,21 +455,28 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
|
||||
m_boundaryElements[Boundary::FarSide].push_back( elementIdx );
|
||||
}
|
||||
|
||||
bool inFaultZone = ( currentSurfaceRegion == RimFaultReactivation::BorderSurface::FaultSurface ) && ( h > nFaultZoneStart );
|
||||
|
||||
if ( inFaultZone ) m_elementSets[RimFaultReactivation::ElementSets::FaultZone].push_back( elementIdx );
|
||||
|
||||
if ( currentElementSet == RimFaultReactivation::ElementSets::Reservoir )
|
||||
{
|
||||
m_elementKLayer[elementIdx] = kLayers[kLayer];
|
||||
if ( kLayers[kLayer] < 0 )
|
||||
if ( !inFaultZone )
|
||||
{
|
||||
m_elementSets[RimFaultReactivation::ElementSets::IntraReservoir].push_back( elementIdx );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_elementSets[currentElementSet].push_back( elementIdx );
|
||||
if ( kLayers[kLayer] < 0 )
|
||||
{
|
||||
m_elementSets[RimFaultReactivation::ElementSets::IntraReservoir].push_back( elementIdx );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_elementSets[currentElementSet].push_back( elementIdx );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_elementSets[currentElementSet].push_back( elementIdx );
|
||||
if ( !inFaultZone ) m_elementSets[currentElementSet].push_back( elementIdx );
|
||||
m_elementKLayer[elementIdx] = -2000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,9 @@ public:
|
||||
double cellSizeFactor,
|
||||
const std::vector<double>& horizontalPartition,
|
||||
double modelThickness,
|
||||
double topHeight );
|
||||
double topHeight,
|
||||
cvf::Vec3d thicknessDirection,
|
||||
int nFaultZoneCells );
|
||||
|
||||
void generateLocalNodes( const cvf::Mat4d transform );
|
||||
void setUseLocalCoordinates( bool useLocalCoordinates );
|
||||
|
||||
Reference in New Issue
Block a user