Skip to content

Commit

Permalink
Add ui for lateral stress components.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Jan 17, 2024
1 parent 4423da6 commit 70588df
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,13 @@ RimFaultReactivationDataAccess::RimFaultReactivationDataAccess( const RimFaultRe
std::map<RimFaultReactivation::ElementSets, double> densities = extractDensities( model );
for ( auto property : stressProperties )
{
m_accessors.push_back(
std::make_shared<RimFaultReactivationDataAccessorStressEclipse>( thecase, property, porePressureGradient, seabedDepth, densities ) );
m_accessors.push_back( std::make_shared<RimFaultReactivationDataAccessorStressEclipse>( thecase,
property,
porePressureGradient,
seabedDepth,
model.lateralStressCoefficientX(),
model.lateralStressCoefficientY(),
densities ) );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,37 @@ double RimFaultReactivationDataAccessorStress::valueAtPosition( const cvf::Vec3d
}
else if ( m_property == RimFaultReactivation::Property::LateralStressComponentX )
{
auto [porBar, extractionPos] = calculatePorBar( position, m_gradient, gridPart );
if ( std::isinf( porBar ) ) return porBar;
double s11 = extractStressValue( StressType::S11, extractionPos, gridPart );
double s33 = extractStressValue( StressType::S33, extractionPos, gridPart );
return ( s11 - porBar ) / ( s33 - porBar );
return lateralStressComponentX( position, gridPart );
}
else if ( m_property == RimFaultReactivation::Property::LateralStressComponentY )
{
auto [porBar, extractionPos] = calculatePorBar( position, m_gradient, gridPart );
if ( std::isinf( porBar ) ) return porBar;
double s22 = extractStressValue( StressType::S22, extractionPos, gridPart );
double s33 = extractStressValue( StressType::S33, extractionPos, gridPart );
return ( s22 - porBar ) / ( s33 - porBar );
return lateralStressComponentY( position, gridPart );
}
}

return std::numeric_limits<double>::infinity();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorStress::lateralStressComponentX( const cvf::Vec3d& position, RimFaultReactivation::GridPart gridPart ) const
{
auto [porBar, extractionPos] = calculatePorBar( position, m_gradient, gridPart );
if ( std::isinf( porBar ) ) return porBar;
double s11 = extractStressValue( StressType::S11, extractionPos, gridPart );
double s33 = extractStressValue( StressType::S33, extractionPos, gridPart );
return ( s11 - porBar ) / ( s33 - porBar );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorStress::lateralStressComponentY( const cvf::Vec3d& position, RimFaultReactivation::GridPart gridPart ) const
{
auto [porBar, extractionPos] = calculatePorBar( position, m_gradient, gridPart );
if ( std::isinf( porBar ) ) return porBar;
double s22 = extractStressValue( StressType::S22, extractionPos, gridPart );
double s33 = extractStressValue( StressType::S33, extractionPos, gridPart );
return ( s22 - porBar ) / ( s33 - porBar );
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class RimFaultReactivationDataAccessorStress : public RimFaultReactivationDataAc
const cvf::Vec3d& bottomPosition,
RimFaultReactivation::GridPart gridPart ) const = 0;

virtual double lateralStressComponentX( const cvf::Vec3d& position, RimFaultReactivation::GridPart gridPart ) const;
virtual double lateralStressComponentY( const cvf::Vec3d& position, RimFaultReactivation::GridPart gridPart ) const;

RimFaultReactivation::Property m_property;
double m_gradient;
double m_seabedDepth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ RimFaultReactivationDataAccessorStressEclipse::RimFaultReactivationDataAccessorS
RimFaultReactivation::Property property,
double gradient,
double seabedDepth,
double lateralStressComponentX,
double lateralStressComponentY,
const std::map<RimFaultReactivation::ElementSets, double>& densities )
: RimFaultReactivationDataAccessorStress( property, gradient, seabedDepth )
, m_eclipseCase( eclipseCase )
, m_caseData( nullptr )
, m_mainGrid( nullptr )
, m_lateralStressComponentX( lateralStressComponentX )
, m_lateralStressComponentY( lateralStressComponentY )
, m_densities( densities )
{
if ( m_eclipseCase )
Expand Down Expand Up @@ -245,7 +249,6 @@ std::vector<double>
return { false, RimFaultReactivation::ElementSets::OverBurden };
};

int numMisses = 0;
for ( size_t i = 1; i < intersections.size(); i++ )
{
double previousValue = values[i - 1];
Expand All @@ -267,9 +270,26 @@ std::vector<double>
else
{
values.push_back( std::numeric_limits<double>::infinity() );
numMisses++;
}
}

return values;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorStressEclipse::lateralStressComponentX( const cvf::Vec3d& position,
RimFaultReactivation::GridPart gridPart ) const
{
return m_lateralStressComponentX;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorStressEclipse::lateralStressComponentY( const cvf::Vec3d& position,
RimFaultReactivation::GridPart gridPart ) const
{
return m_lateralStressComponentY;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class RimFaultReactivationDataAccessorStressEclipse : public RimFaultReactivatio
RimFaultReactivation::Property property,
double gradient,
double seabedDepth,
double lateralStressComponentX,
double lateralStressComponentY,
const std::map<RimFaultReactivation::ElementSets, double>& densities );
~RimFaultReactivationDataAccessorStressEclipse() override;

Expand All @@ -65,6 +67,9 @@ class RimFaultReactivationDataAccessorStressEclipse : public RimFaultReactivatio
const cvf::Vec3d& bottomPosition,
RimFaultReactivation::GridPart gridPart ) const override;

double lateralStressComponentX( const cvf::Vec3d& position, RimFaultReactivation::GridPart gridPart ) const override;
double lateralStressComponentY( const cvf::Vec3d& position, RimFaultReactivation::GridPart gridPart ) const override;

static std::vector<double> integrateVerticalStress( const RigWellPath& wellPath,
const std::vector<cvf::Vec3d>& intersections,
const RigFaultReactivationModel& model,
Expand All @@ -79,6 +84,8 @@ class RimFaultReactivationDataAccessorStressEclipse : public RimFaultReactivatio
RigEclipseCaseData* m_caseData;
const RigMainGrid* m_mainGrid;
cvf::ref<RigResultAccessor> m_resultAccessor;
double m_lateralStressComponentX;
double m_lateralStressComponentY;

std::map<RimFaultReactivation::GridPart, cvf::ref<RigWellPath>> m_wellPaths;
std::map<RimFaultReactivation::GridPart, cvf::ref<RigEclipseWellLogExtractor>> m_extractors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ RimFaultReactivationModel::RimFaultReactivationModel()
CAF_PDM_InitField( &m_frictionAngleDeg, "FrictionAngle", 20.0, "Friction Angle [degree]" );
CAF_PDM_InitField( &m_seabedTemperature, "SeabedTemperature", 5.0, "Seabed Temperature [C]" );

CAF_PDM_InitField( &m_lateralStressCoefficientX, "LateralStressCoefficientX", 0.5, "Lateral Stress Coeff. X" );
CAF_PDM_InitField( &m_lateralStressCoefficientY, "LateralStressCoefficientY", 0.5, "Lateral Stress Coeff. Y" );

CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" );
m_targets.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() );
m_targets.uiCapability()->setUiTreeChildrenHidden( true );
Expand Down Expand Up @@ -486,15 +489,20 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
{
propertiesGrp->add( &m_useGridDensity );
propertiesGrp->add( &m_useGridElasticProperties );
propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_waterDensity );

propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_seabedTemperature );

bool useTemperatureFromGrid = m_useGridTemperature();
m_seabedTemperature.uiCapability()->setUiReadOnly( !useTemperatureFromGrid );
}

if ( !hasGeoMechCase || !m_useGridStress() )
{
propertiesGrp->add( &m_lateralStressCoefficientX );
propertiesGrp->add( &m_lateralStressCoefficientY );
}

propertiesGrp->add( &m_frictionAngleDeg );

uiOrdering.skipRemainingFields();
Expand Down Expand Up @@ -811,3 +819,19 @@ double RimFaultReactivationModel::seabedTemperature() const
{
return m_seabedTemperature;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationModel::lateralStressCoefficientX() const
{
return m_lateralStressCoefficientX;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationModel::lateralStressCoefficientY() const
{
return m_lateralStressCoefficientY;
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ class RimFaultReactivationModel : public RimCheckableNamedObject, public RimPoly
double waterDensity() const;
double frictionAngleDeg() const;
double seabedTemperature() const;
double lateralStressCoefficientX() const;
double lateralStressCoefficientY() const;

RimEclipseCase* eclipseCase() const;
RimGeoMechCase* geoMechCase() const;
Expand Down Expand Up @@ -185,6 +187,8 @@ class RimFaultReactivationModel : public RimCheckableNamedObject, public RimPoly
caf::PdmField<double> m_waterDensity;
caf::PdmField<double> m_frictionAngleDeg;
caf::PdmField<double> m_seabedTemperature;
caf::PdmField<double> m_lateralStressCoefficientX;
caf::PdmField<double> m_lateralStressCoefficientY;

caf::PdmField<size_t> m_startCellIndex;
caf::PdmField<int> m_startCellFace;
Expand Down

0 comments on commit 70588df

Please sign in to comment.