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:
parent
a48faeb6d0
commit
251952e6ef
@ -86,6 +86,7 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
|
||||
{ RimFaultReactivation::ElementSets::IntraReservoir, "INTRA_RESERVOIR" },
|
||||
{ RimFaultReactivation::ElementSets::Reservoir, "RESERVOIR" },
|
||||
{ RimFaultReactivation::ElementSets::UnderBurden, "UNDERBURDEN" },
|
||||
{ RimFaultReactivation::ElementSets::FaultZone, "FAULT_ZONE" },
|
||||
};
|
||||
|
||||
bool useGridVoidRatio = rimModel.useGridVoidRatio();
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "RigFaultReactivationModel.h"
|
||||
#include "RigGriddedPart3d.h"
|
||||
|
||||
#include "RimFaultReactivationDataAccess.h"
|
||||
#include "RimFaultReactivationModel.h"
|
||||
|
||||
#include <map>
|
||||
|
@ -90,7 +90,8 @@ RimFaultReactivationDataAccess::RimFaultReactivationDataAccess( const RimFaultRe
|
||||
std::vector<RimFaultReactivation::ElementSets> elementSets = { RimFaultReactivation::ElementSets::OverBurden,
|
||||
RimFaultReactivation::ElementSets::UnderBurden,
|
||||
RimFaultReactivation::ElementSets::Reservoir,
|
||||
RimFaultReactivation::ElementSets::IntraReservoir };
|
||||
RimFaultReactivation::ElementSets::IntraReservoir,
|
||||
RimFaultReactivation::ElementSets::FaultZone };
|
||||
for ( auto e : elementSets )
|
||||
{
|
||||
densities[e] = model.materialParameters( e )[2];
|
||||
|
@ -46,7 +46,8 @@ enum class ElementSets
|
||||
OverBurden,
|
||||
UnderBurden,
|
||||
Reservoir,
|
||||
IntraReservoir
|
||||
IntraReservoir,
|
||||
FaultZone
|
||||
};
|
||||
|
||||
enum class Property
|
||||
|
@ -82,7 +82,7 @@ RimFaultReactivationModel::RimFaultReactivationModel()
|
||||
CAF_PDM_InitFieldNoDefault( &m_baseDir, "BaseDirectory", "Working Folder" );
|
||||
CAF_PDM_InitField( &m_modelThickness, "ModelThickness", 100.0, "Model Cell Thickness" );
|
||||
|
||||
CAF_PDM_InitField( &m_modelExtentFromAnchor, "ModelExtentFromAnchor", 3000.0, "Horz. Extent from Anchor" );
|
||||
CAF_PDM_InitField( &m_modelExtentFromAnchor, "ModelExtentFromAnchor", 1000.0, "Horz. Extent from Anchor" );
|
||||
CAF_PDM_InitField( &m_modelMinZ, "ModelMinZ", 0.0, "Seabed Depth" );
|
||||
CAF_PDM_InitField( &m_modelBelowSize, "ModelBelowSize", 500.0, "Depth Below Fault" );
|
||||
|
||||
@ -96,6 +96,8 @@ RimFaultReactivationModel::RimFaultReactivationModel()
|
||||
CAF_PDM_InitField( &m_faultExtendDownwards, "FaultExtendDownwards", 0.0, "Below Reservoir" );
|
||||
m_faultExtendDownwards.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_faultZoneCells, "FaultZoneCells", 0, "Fault Zone Width [cells]" );
|
||||
|
||||
CAF_PDM_InitField( &m_showModelPlane, "ShowModelPlane", true, "Show 2D Model" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_fault, "Fault", "Fault" );
|
||||
@ -104,14 +106,14 @@ RimFaultReactivationModel::RimFaultReactivationModel()
|
||||
CAF_PDM_InitField( &m_modelPart1Color, "ModelPart1Color", cvf::Color3f( cvf::Color3f::GREEN ), "Part 1 Color" );
|
||||
CAF_PDM_InitField( &m_modelPart2Color, "ModelPart2Color", cvf::Color3f( cvf::Color3f::BLUE ), "Part 2 Color" );
|
||||
|
||||
CAF_PDM_InitField( &m_maxReservoirCellHeight, "MaxReservoirCellHeight", 20.0, "Max. Reservoir Cell Height" );
|
||||
CAF_PDM_InitField( &m_maxReservoirCellHeight, "MaxReservoirCellHeight", 5.0, "Max. Reservoir Cell Height" );
|
||||
CAF_PDM_InitField( &m_minReservoirCellHeight, "MinReservoirCellHeight", 0.5, "Min. Reservoir Cell Height" );
|
||||
CAF_PDM_InitField( &m_cellHeightGrowFactor, "CellHeightGrowFactor", 1.05, "Cell Height Grow Factor" );
|
||||
CAF_PDM_InitField( &m_cellHeightGrowFactor, "CellHeightGrowFactor", 1.15, "Cell Height Grow Factor" );
|
||||
|
||||
CAF_PDM_InitField( &m_minReservoirCellWidth, "MinReservoirCellWidth", 20.0, "Reservoir Cell Width" );
|
||||
CAF_PDM_InitField( &m_cellWidthGrowFactor, "CellWidthGrowFactor", 1.05, "Cell Width Grow Factor" );
|
||||
CAF_PDM_InitField( &m_minReservoirCellWidth, "MinReservoirCellWidth", 5.0, "Reservoir Cell Width" );
|
||||
CAF_PDM_InitField( &m_cellWidthGrowFactor, "CellWidthGrowFactor", 1.15, "Cell Width Grow Factor" );
|
||||
|
||||
CAF_PDM_InitField( &m_useLocalCoordinates, "UseLocalCoordinates", false, "Export Using Local Coordinates" );
|
||||
CAF_PDM_InitField( &m_useLocalCoordinates, "UseLocalCoordinates", false, "Use Local Coordinates" );
|
||||
|
||||
// Time Step Selection
|
||||
CAF_PDM_InitFieldNoDefault( &m_timeStepFilter, "TimeStepFilter", "Available Time Steps" );
|
||||
@ -321,14 +323,14 @@ void RimFaultReactivationModel::updateVisualization()
|
||||
if ( !normal.normalize() ) return;
|
||||
|
||||
auto modelNormal = normal ^ cvf::Vec3d::Z_AXIS;
|
||||
modelNormal.normalize();
|
||||
if ( !modelNormal.normalize() ) return;
|
||||
|
||||
auto generator = std::make_shared<RigFaultReactivationModelGenerator>( m_targets[0]->targetPointXYZ(), modelNormal );
|
||||
auto generator = std::make_shared<RigFaultReactivationModelGenerator>( m_targets[0]->targetPointXYZ(), modelNormal, normal );
|
||||
generator->setFault( m_fault()->faultGeometry() );
|
||||
generator->setGrid( eclipseCase()->mainGrid() );
|
||||
generator->setActiveCellInfo( eclipseCase()->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ) );
|
||||
generator->setModelSize( m_modelMinZ, m_modelBelowSize, m_modelExtentFromAnchor );
|
||||
generator->setFaultBufferDepth( m_faultExtendUpwards, m_faultExtendDownwards );
|
||||
generator->setFaultBufferDepth( m_faultExtendUpwards, m_faultExtendDownwards, m_faultZoneCells );
|
||||
generator->setModelThickness( m_modelThickness );
|
||||
generator->setModelGriddingOptions( m_minReservoirCellHeight,
|
||||
m_maxReservoirCellHeight,
|
||||
@ -443,6 +445,7 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
sizeModelGrp->add( &m_modelExtentFromAnchor );
|
||||
sizeModelGrp->add( &m_modelMinZ );
|
||||
sizeModelGrp->add( &m_modelBelowSize );
|
||||
sizeModelGrp->add( &m_faultZoneCells );
|
||||
|
||||
const bool hasGeoMechCase = ( m_geomechCase() != nullptr );
|
||||
|
||||
@ -505,6 +508,8 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
|
||||
propertiesGrp->add( &m_frictionAngleDeg );
|
||||
|
||||
uiOrdering.add( &m_targets );
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
|
||||
@ -618,6 +623,15 @@ void RimFaultReactivationModel::updateTimeSteps()
|
||||
m_availableTimeSteps.clear();
|
||||
const auto eCase = eclipseCase();
|
||||
if ( eCase != nullptr ) m_availableTimeSteps = eCase->timeStepDates();
|
||||
|
||||
if ( m_selectedTimeSteps().size() == 0 )
|
||||
{
|
||||
std::vector<QDateTime> newVal;
|
||||
if ( m_availableTimeSteps.size() > 0 ) newVal.push_back( m_availableTimeSteps.front() );
|
||||
if ( m_availableTimeSteps.size() > 1 ) newVal.push_back( m_availableTimeSteps.back() );
|
||||
|
||||
m_selectedTimeSteps.setValue( newVal );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -714,7 +728,8 @@ std::array<double, 3> RimFaultReactivationModel::materialParameters( ElementSets
|
||||
static std::map<ElementSets, std::string> groupMap = { { ElementSets::OverBurden, "material_overburden" },
|
||||
{ ElementSets::Reservoir, "material_reservoir" },
|
||||
{ ElementSets::IntraReservoir, "material_intrareservoir" },
|
||||
{ ElementSets::UnderBurden, "material_underburden" } };
|
||||
{ ElementSets::UnderBurden, "material_underburden" },
|
||||
{ ElementSets::FaultZone, "material_faultzone" } };
|
||||
|
||||
auto keyName = QString::fromStdString( groupMap[elementSet] );
|
||||
|
||||
|
@ -168,6 +168,7 @@ private:
|
||||
|
||||
caf::PdmField<double> m_faultExtendUpwards;
|
||||
caf::PdmField<double> m_faultExtendDownwards;
|
||||
caf::PdmField<int> m_faultZoneCells;
|
||||
|
||||
caf::PdmField<double> m_maxReservoirCellHeight;
|
||||
caf::PdmField<double> m_minReservoirCellHeight;
|
||||
|
@ -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 );
|
||||
@ -198,7 +198,10 @@ 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 );
|
||||
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,9 +455,15 @@ 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 ( !inFaultZone )
|
||||
{
|
||||
if ( kLayers[kLayer] < 0 )
|
||||
{
|
||||
m_elementSets[RimFaultReactivation::ElementSets::IntraReservoir].push_back( elementIdx );
|
||||
@ -464,9 +473,10 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
|
||||
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 );
|
||||
|
2
ThirdParty/openzgy
vendored
2
ThirdParty/openzgy
vendored
@ -1 +1 @@
|
||||
Subproject commit 61126458c761f4fa4fffa817cb162f7912afef3c
|
||||
Subproject commit 194068f4dca443a782b81d35533a89877e25a7e4
|
Loading…
Reference in New Issue
Block a user