Fault activation: node adjustments along fault (#11235)

Make sure same thickness vectors and fault lines are used for both parts.
This commit is contained in:
jonjenssen
2024-02-27 17:05:48 +01:00
committed by GitHub
parent a0ecdf47a5
commit 86c33c1b46
8 changed files with 109 additions and 38 deletions

View File

@@ -25,8 +25,11 @@
#include "RimFaultReactivationEnums.h"
#include "cvfBoundingBox.h"
#include "cvfPlane.h"
#include "cvfTextureImage.h"
#include "cafLine.h"
#include <cmath>
#include <map>
@@ -165,7 +168,7 @@ std::vector<double> RigGriddedPart3d::generateGrowingLayers( double zFrom, doubl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigGriddedPart3d::extractZValues( std::vector<cvf::Vec3d> points )
std::vector<double> RigGriddedPart3d::extractZValues( const std::vector<cvf::Vec3d>& points )
{
std::vector<double> layers;
@@ -199,15 +202,15 @@ std::vector<double> RigGriddedPart3d::extractZValues( std::vector<cvf::Vec3d> po
/// Assumes horizontal lines are parallel
///
//--------------------------------------------------------------------------------------------------
void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& inputPoints,
const std::vector<cvf::Vec3d>& reservoirLayers,
const double maxCellHeight,
double cellSizeFactor,
const std::vector<double>& horizontalPartition,
double modelThickness,
double topHeight,
cvf::Vec3d thicknessDirection,
int nFaultZoneCells )
void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& inputPoints,
const std::vector<cvf::Vec3d>& reservoirLayers,
double maxCellHeight,
double cellSizeFactor,
const std::vector<double>& horizontalPartition,
const std::vector<caf::Line<double>> faultLines,
const std::vector<cvf::Vec3d>& thicknessVectors,
double topHeight,
int nFaultZoneCells )
{
reset();
@@ -224,9 +227,10 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
layersPerRegion[Regions::LowerUnderburden].pop_back(); // to avoid overlap with bottom of next region
layersPerRegion[Regions::Reservoir].pop_back(); // to avoid overlap with bottom of next region
m_boundaryNodes[Boundary::Bottom] = {};
m_boundaryNodes[Boundary::FarSide] = {};
m_boundaryNodes[Boundary::Fault] = {};
m_boundaryNodes[Boundary::Bottom] = {};
m_boundaryNodes[Boundary::FarSide] = {};
m_boundaryNodes[Boundary::Fault] = {};
m_boundaryNodes[Boundary::Reservoir] = {};
size_t nVertCells = 0;
const size_t nHorzCells = horizontalPartition.size() - 1;
@@ -236,9 +240,7 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
nVertCells += layersPerRegion[region].size();
}
const std::vector<double> thicknessFactors = { -1.0, 0.0, 1.0 };
const int nThicknessCells = 2;
cvf::Vec3d tVec = modelThickness * thicknessDirection;
const int nThicknessCells = 2;
size_t reserveSize = ( nVertCells + 1 ) * ( nHorzCells + 1 ) * ( nThicknessCells + 1 );
m_nodes.reserve( reserveSize );
@@ -316,12 +318,31 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
for ( int h = 0; h <= (int)nHorzCells; h++ )
{
p = toPos - horizontalPartition[h] * stepHorz;
if ( h == (int)nHorzCells )
{
p = toPos;
}
else
{
p = toPos - horizontalPartition[h] * stepHorz;
}
for ( int t = 0; t <= nThicknessCells; t++, nodeIndex++ )
{
m_nodes.push_back( p + thicknessFactors[t] * tVec );
auto nodePoint = p + thicknessVectors[t];
// adjust points along the fault line inside the reservoir to make sure they end up at the fault
if ( ( h == (int)nHorzCells ) &&
( ( region == Regions::Reservoir ) || region == Regions::LowerOverburden || region == Regions::UpperUnderburden ) )
{
cvf::Plane zPlane;
zPlane.setFromPointAndNormal( nodePoint, cvf::Vec3d::Z_AXIS );
zPlane.intersect( faultLines[t].start(), faultLines[t].end(), &nodePoint );
}
m_nodes.push_back( nodePoint );
// move nodes at fault used for data extraction a bit away from the fault
if ( h == (int)nHorzCells )
{
m_dataNodes.push_back( p + safetyOffset );
@@ -342,6 +363,11 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
else if ( h == (int)nHorzCells )
{
m_boundaryNodes[Boundary::Fault].push_back( nodeIndex );
if ( region == Regions::Reservoir )
{
m_boundaryNodes[Boundary::Reservoir].push_back( nodeIndex );
}
}
}
}