Skip to content

Commit

Permalink
Fault Reactivation: extract stress data using well log extraction.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Dec 18, 2023
1 parent c7e6ef5 commit 4d12d0f
Show file tree
Hide file tree
Showing 14 changed files with 376 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RimFaultReactivationDataAccess::RimFaultReactivationDataAccess( RimEclipseCase*
RimFaultReactivation::Property::LateralStressComponentY };
for ( auto property : stressProperties )
{
m_accessors.push_back( std::make_shared<RimFaultReactivationDataAccessorStress>( geoMechCase, property ) );
m_accessors.push_back( std::make_shared<RimFaultReactivationDataAccessorStress>( geoMechCase, property, 0.003 ) );
}
}
}
Expand Down Expand Up @@ -126,12 +126,18 @@ std::vector<double> RimFaultReactivationDataAccess::extractModelData( const RigF
};

std::shared_ptr<RimFaultReactivationDataAccessor> accessor = getAccessor( property );

if ( accessor )
{
accessor->setTimeStep( timeStep );
accessor->setModelAndTimeStep( model, timeStep );

auto grid = model.grid( gridPart );

const std::map<RimFaultReactivation::BorderSurface, std::vector<unsigned int>>& borderSurfaceElements = grid->borderSurfaceElements();
auto it = borderSurfaceElements.find( RimFaultReactivation::BorderSurface::Seabed );
CAF_ASSERT( it != borderSurfaceElements.end() && "Sea bed border surface does not exist" );
std::set<unsigned int> seabedElements( it->second.begin(), it->second.end() );

std::vector<double> values;

if ( nodeProperties.contains( property ) )
Expand All @@ -149,11 +155,15 @@ std::vector<double> RimFaultReactivationDataAccess::extractModelData( const RigF
{
std::vector<cvf::Vec3d> corners = grid->elementCorners( elementIndex );

double topDepth = computeAverageDepth( corners, { 0, 1, 2, 3 } );
// Move top of sea bed element down to end up inside top element
bool isTopElement = seabedElements.contains( static_cast<unsigned int>( elementIndex ) );
double topDepthAdjust = isTopElement ? 0.1 : 0.0;

double topDepth = computeAverageDepth( corners, { 0, 1, 2, 3 } ) - topDepthAdjust;
double bottomDepth = computeAverageDepth( corners, { 4, 5, 6, 7 } );

cvf::Vec3d position = RigCaseToCaseCellMapperTools::calculateCellCenter( corners.data() );
double value = accessor->valueAtPosition( position, model, gridPart, topDepth, bottomDepth );
double value = accessor->valueAtPosition( position, model, gridPart, topDepth, bottomDepth, elementIndex );
values.push_back( value );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "RimFaultReactivationDataAccessor.h"

#include "RigFaultReactivationModel.h"
#include "RigMainGrid.h"

#include "cafAssert.h"
Expand All @@ -28,6 +29,7 @@
RimFaultReactivationDataAccessor::RimFaultReactivationDataAccessor()
{
m_timeStep = -1;
m_model = nullptr;
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -40,8 +42,9 @@ RimFaultReactivationDataAccessor::~RimFaultReactivationDataAccessor()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultReactivationDataAccessor::setTimeStep( size_t timeStep )
void RimFaultReactivationDataAccessor::setModelAndTimeStep( const RigFaultReactivationModel& model, size_t timeStep )
{
m_model = &model;
m_timeStep = timeStep;
updateResultAccessor();
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ class RimFaultReactivationDataAccessor
RimFaultReactivationDataAccessor();
~RimFaultReactivationDataAccessor();

virtual void setTimeStep( size_t timeStep );
virtual void setModelAndTimeStep( const RigFaultReactivationModel& model, size_t timeStep );

virtual bool isMatching( RimFaultReactivation::Property property ) const = 0;

virtual double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const = 0;
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity(),
size_t elementIndex = std::numeric_limits<size_t>::max() ) const = 0;

protected:
virtual void updateResultAccessor() = 0;

size_t m_timeStep;
const RigFaultReactivationModel* m_model;
size_t m_timeStep;
};
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ double RimFaultReactivationDataAccessorGeoMech::valueAtPosition( const cvf::Vec3
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const

double bottomDepth,
size_t elementIndex ) const
{
if ( !m_resultFrames ) return std::numeric_limits<double>::infinity();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ class RimFaultReactivationDataAccessorGeoMech : public RimFaultReactivationDataA
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity(),
size_t elementIndex = std::numeric_limits<size_t>::max() ) const override;

private:
void updateResultAccessor() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ double RimFaultReactivationDataAccessorPorePressure::valueAtPosition( const cvf:
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const
double bottomDepth,
size_t elementIndex ) const
{
if ( ( m_mainGrid != nullptr ) && m_resultAccessor.notNull() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ class RimFaultReactivationDataAccessorPorePressure : public RimFaultReactivation
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity(),
size_t elementIndex = std::numeric_limits<size_t>::max() ) const override;

private:
void updateResultAccessor() override;
Expand Down
Loading

0 comments on commit 4d12d0f

Please sign in to comment.