Skip to content

Commit

Permalink
Add seabed border surface
Browse files Browse the repository at this point in the history
Fix issue with 0 fault extension
  • Loading branch information
jonjenssen committed Dec 5, 2023
1 parent 222c42a commit 83dee0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ enum class BorderSurface
{
UpperSurface,
FaultSurface,
LowerSurface
LowerSurface,
Seabed
};

enum class Boundary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ 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", 2000.0, "Horz. Extent from Anchor" );
CAF_PDM_InitField( &m_modelMinZ, "ModelMinZ", 0.0, "Start Depth" );
CAF_PDM_InitField( &m_modelExtentFromAnchor, "ModelExtentFromAnchor", 3000.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" );

CAF_PDM_InitFieldNoDefault( &m_startCellIndex, "StartCellIndex", "Start Cell Index" );
CAF_PDM_InitFieldNoDefault( &m_startCellFace, "StartCellFace", "Start Cell Face" );
m_startCellIndex = 0;
m_startCellFace = cvf::StructGridInterface::FaceType::NO_FACE;

CAF_PDM_InitField( &m_faultExtendUpwards, "FaultExtendUpwards", 100.0, "Above Reservoir" );
CAF_PDM_InitField( &m_faultExtendUpwards, "FaultExtendUpwards", 0.0, "Above Reservoir" );
m_faultExtendUpwards.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_faultExtendDownwards, "FaultExtendDownwards", 100.0, "Below Reservoir" );
CAF_PDM_InitField( &m_faultExtendDownwards, "FaultExtendDownwards", 0.0, "Below Reservoir" );
m_faultExtendDownwards.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );

CAF_PDM_InitField( &m_showModelPlane, "ShowModelPlane", true, "Show 2D Model" );
Expand Down
9 changes: 9 additions & 0 deletions ApplicationLibCode/ReservoirDataModel/RigGriddedPart3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ std::vector<double> RigGriddedPart3d::generateConstantLayers( double zFrom, doub
std::vector<double> layers;

double diff = zTo - zFrom;

if ( diff == 0.0 ) return layers;

if ( std::abs( diff ) <= maxSize )
{
layers.push_back( std::min( zFrom, zTo ) );
Expand Down Expand Up @@ -362,6 +365,7 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
m_elementIndices.resize( (size_t)( ( nVertCells - 1 ) * nHorzCells * nThicknessCells ) );
m_elementKLayer.resize( (size_t)( ( nVertCells - 1 ) * nHorzCells * nThicknessCells ) );

m_borderSurfaceElements[RimFaultReactivation::BorderSurface::Seabed] = {};
m_borderSurfaceElements[RimFaultReactivation::BorderSurface::UpperSurface] = {};
m_borderSurfaceElements[RimFaultReactivation::BorderSurface::FaultSurface] = {};
m_borderSurfaceElements[RimFaultReactivation::BorderSurface::LowerSurface] = {};
Expand Down Expand Up @@ -392,6 +396,7 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input

const int nextLayerIdxOff = ( (int)nHorzCells + 1 ) * ( nThicknessCells + 1 );
const int nThicknessOff = nThicknessCells + 1;
const int seaBedLayer = (int)( nVertCells - 2 );

for ( int v = 0; v < (int)nVertCells - 1; v++ )
{
Expand Down Expand Up @@ -421,6 +426,10 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
{
m_boundaryElements[Boundary::Bottom].push_back( elementIdx );
}
else if ( v == seaBedLayer )
{
m_borderSurfaceElements[RimFaultReactivation::BorderSurface::Seabed].push_back( elementIdx );
}
if ( h == 0 )
{
m_boundaryElements[Boundary::FarSide].push_back( elementIdx );
Expand Down

0 comments on commit 83dee0f

Please sign in to comment.