mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6089 Display stress and stress gradient in fracture model plot.
This commit is contained in:
@@ -144,6 +144,12 @@ RimFractureModelPlot*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto task = progInfo.task( "Creating stress track", 2 );
|
||||||
|
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RimFractureModelStressCurve::PropertyType::STRESS );
|
||||||
|
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RimFractureModelStressCurve::PropertyType::STRESS_GRADIENT );
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto task = progInfo.task( "Updating all tracks", 5 );
|
auto task = progInfo.task( "Updating all tracks", 5 );
|
||||||
|
|
||||||
@@ -438,6 +444,50 @@ void RicNewFractureModelPlotFeature::createElasticPropertiesTrack( RimFractureMo
|
|||||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot* plot,
|
||||||
|
RimFractureModel* fractureModel,
|
||||||
|
RimEclipseCase* eclipseCase,
|
||||||
|
int timeStep,
|
||||||
|
RimFractureModelStressCurve::PropertyType propertyType )
|
||||||
|
{
|
||||||
|
QString trackName = caf::AppEnum<RimFractureModelStressCurve::PropertyType>::uiText( propertyType );
|
||||||
|
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, trackName, plot );
|
||||||
|
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
|
||||||
|
plotTrack->setLogarithmicScale( false );
|
||||||
|
plotTrack->setShowRegionLabels( true );
|
||||||
|
plotTrack->setShowWindow( true );
|
||||||
|
plotTrack->setColSpan( RimPlot::TWO );
|
||||||
|
|
||||||
|
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
|
||||||
|
|
||||||
|
RimFractureModelStressCurve* curve = new RimFractureModelStressCurve;
|
||||||
|
curve->setPropertyType( propertyType );
|
||||||
|
curve->setFractureModel( fractureModel );
|
||||||
|
curve->setCase( eclipseCase );
|
||||||
|
curve->setColor( colors.cycledColor3f( 0 ) );
|
||||||
|
curve->setLineStyle( RiuQwtPlotCurve::STYLE_SOLID );
|
||||||
|
curve->setLineThickness( 2 );
|
||||||
|
curve->setUiName( trackName );
|
||||||
|
curve->setAutoNameComponents( false, false, false, false, false );
|
||||||
|
|
||||||
|
plotTrack->addCurve( curve );
|
||||||
|
plotTrack->setAutoScaleXEnabled( true );
|
||||||
|
curve->loadDataAndUpdate( true );
|
||||||
|
|
||||||
|
curve->updateConnectedEditors();
|
||||||
|
plotTrack->updateConnectedEditors();
|
||||||
|
plot->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
|
||||||
|
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
|
||||||
|
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "RimElasticPropertiesCurve.h"
|
#include "RimElasticPropertiesCurve.h"
|
||||||
#include "RimFractureModelCurve.h"
|
#include "RimFractureModelCurve.h"
|
||||||
|
#include "RimFractureModelStressCurve.h"
|
||||||
|
|
||||||
class RimEclipseCase;
|
class RimEclipseCase;
|
||||||
class RimFractureModelPlot;
|
class RimFractureModelPlot;
|
||||||
@@ -71,6 +72,12 @@ private:
|
|||||||
int timeStep,
|
int timeStep,
|
||||||
RimElasticPropertiesCurve::PropertyType propertyType );
|
RimElasticPropertiesCurve::PropertyType propertyType );
|
||||||
|
|
||||||
|
static void createStressTrack( RimFractureModelPlot* plot,
|
||||||
|
RimFractureModel* fractureModel,
|
||||||
|
RimEclipseCase* eclipseCase,
|
||||||
|
int timeStep,
|
||||||
|
RimFractureModelStressCurve::PropertyType propertyType );
|
||||||
|
|
||||||
static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription );
|
static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription );
|
||||||
|
|
||||||
static RimFractureModelPlotCollection* fractureModelPlotCollection();
|
static RimFractureModelPlotCollection* fractureModelPlotCollection();
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.h
|
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.h
|
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.h
|
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelStressCurve.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -326,6 +327,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelStressCurve.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
|||||||
192
ApplicationCode/ProjectDataModel/RimFractureModelStressCurve.cpp
Normal file
192
ApplicationCode/ProjectDataModel/RimFractureModelStressCurve.cpp
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2020- Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimFractureModelStressCurve.h"
|
||||||
|
|
||||||
|
#include "RiaDefines.h"
|
||||||
|
#include "RigEclipseCaseData.h"
|
||||||
|
#include "RigEclipseWellLogExtractor.h"
|
||||||
|
#include "RigResultAccessorFactory.h"
|
||||||
|
#include "RigWellLogCurveData.h"
|
||||||
|
#include "RigWellPath.h"
|
||||||
|
#include "RigWellPathGeometryTools.h"
|
||||||
|
|
||||||
|
#include "RimCase.h"
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimFractureModel.h"
|
||||||
|
#include "RimFractureModelPlot.h"
|
||||||
|
#include "RimModeledWellPath.h"
|
||||||
|
#include "RimWellLogFile.h"
|
||||||
|
#include "RimWellLogPlot.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
#include "RimWellPathCollection.h"
|
||||||
|
#include "RimWellPlotTools.h"
|
||||||
|
|
||||||
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT( RimFractureModelStressCurve, "RimFractureModelStressCurve" );
|
||||||
|
|
||||||
|
namespace caf
|
||||||
|
{
|
||||||
|
template <>
|
||||||
|
void AppEnum<RimFractureModelStressCurve::PropertyType>::setUp()
|
||||||
|
{
|
||||||
|
addItem( RimFractureModelStressCurve::PropertyType::STRESS, "STRESS", "Stress" );
|
||||||
|
addItem( RimFractureModelStressCurve::PropertyType::STRESS_GRADIENT, "STRESS_GRADIENT", "Stress Gradient" );
|
||||||
|
setDefault( RimFractureModelStressCurve::PropertyType::STRESS );
|
||||||
|
}
|
||||||
|
}; // namespace caf
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimFractureModelStressCurve::RimFractureModelStressCurve()
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Fracture Model Curve", "", "", "" );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" );
|
||||||
|
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
|
||||||
|
m_fractureModel.uiCapability()->setUiHidden( true );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_propertyType, "PropertyType", "Property Type", "", "", "" );
|
||||||
|
|
||||||
|
m_wellPath = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimFractureModelStressCurve::~RimFractureModelStressCurve()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFractureModelStressCurve::setPropertyType( PropertyType propertyType )
|
||||||
|
{
|
||||||
|
m_propertyType = propertyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFractureModelStressCurve::setFractureModel( RimFractureModel* fractureModel )
|
||||||
|
{
|
||||||
|
m_fractureModel = fractureModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFractureModelStressCurve::performDataExtraction( bool* isUsingPseudoLength )
|
||||||
|
{
|
||||||
|
std::vector<double> values;
|
||||||
|
std::vector<double> measuredDepthValues;
|
||||||
|
std::vector<double> tvDepthValues;
|
||||||
|
double rkbDiff = 0.0;
|
||||||
|
|
||||||
|
RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_METER;
|
||||||
|
QString xUnits = RiaWellLogUnitTools<double>::noUnitString();
|
||||||
|
|
||||||
|
*isUsingPseudoLength = false;
|
||||||
|
|
||||||
|
// Extract porosity data: get the porosity values from parent
|
||||||
|
RimFractureModelPlot* fractureModelPlot;
|
||||||
|
firstAncestorOrThisOfType( fractureModelPlot );
|
||||||
|
if ( !fractureModelPlot )
|
||||||
|
{
|
||||||
|
RiaLogging::error( QString( "No fracture model plot found." ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<double> tvDepthInFeet = fractureModelPlot->calculateTrueVerticalDepth();
|
||||||
|
for ( double f : tvDepthInFeet )
|
||||||
|
{
|
||||||
|
tvDepthValues.push_back( RiaEclipseUnitTools::feetToMeter( f ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_propertyType() == PropertyType::STRESS )
|
||||||
|
{
|
||||||
|
values = fractureModelPlot->calculateStress();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
values = fractureModelPlot->calculateStressGradient();
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
|
||||||
|
if ( eclipseCase )
|
||||||
|
{
|
||||||
|
RigWellPath* wellPathGeometry = m_fractureModel->thicknessDirectionWellPath()->wellPathGeometry();
|
||||||
|
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" );
|
||||||
|
|
||||||
|
rkbDiff = eclExtractor.wellPathData()->rkbDiff();
|
||||||
|
|
||||||
|
// Generate MD data by interpolation
|
||||||
|
const std::vector<double>& mdValuesOfWellPath = wellPathGeometry->measureDepths();
|
||||||
|
std::vector<double> tvdValuesOfWellPath = wellPathGeometry->trueVerticalDepths();
|
||||||
|
|
||||||
|
measuredDepthValues =
|
||||||
|
RigWellPathGeometryTools::interpolateMdFromTvd( mdValuesOfWellPath, tvdValuesOfWellPath, tvDepthValues );
|
||||||
|
CVF_ASSERT( measuredDepthValues.size() == tvDepthValues.size() );
|
||||||
|
}
|
||||||
|
|
||||||
|
RiaEclipseUnitTools::UnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
|
||||||
|
if ( eclipseUnitsType == RiaEclipseUnitTools::UnitSystem::UNITS_FIELD )
|
||||||
|
{
|
||||||
|
// See https://github.com/OPM/ResInsight/issues/538
|
||||||
|
|
||||||
|
depthUnit = RiaDefines::DepthUnitType::UNIT_FEET;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool performDataSmoothing = false;
|
||||||
|
if ( !values.empty() && !measuredDepthValues.empty() )
|
||||||
|
{
|
||||||
|
if ( tvDepthValues.empty() )
|
||||||
|
{
|
||||||
|
this->setValuesAndDepths( values,
|
||||||
|
measuredDepthValues,
|
||||||
|
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
||||||
|
0.0,
|
||||||
|
depthUnit,
|
||||||
|
!performDataSmoothing,
|
||||||
|
xUnits );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->setValuesWithMdAndTVD( values,
|
||||||
|
measuredDepthValues,
|
||||||
|
tvDepthValues,
|
||||||
|
rkbDiff,
|
||||||
|
depthUnit,
|
||||||
|
!performDataSmoothing,
|
||||||
|
xUnits );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimFractureModelStressCurve::createCurveAutoName()
|
||||||
|
{
|
||||||
|
return caf::AppEnum<RimFractureModelStressCurve::PropertyType>::uiText( m_propertyType() );
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2020- Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "RimWellLogExtractionCurve.h"
|
||||||
|
|
||||||
|
#include "RiuQwtSymbol.h"
|
||||||
|
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class RimWellPath;
|
||||||
|
class RimWellMeasurement;
|
||||||
|
class RimFractureModel;
|
||||||
|
class RimColorLegend;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimFractureModelStressCurve : public RimWellLogExtractionCurve
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum class PropertyType
|
||||||
|
{
|
||||||
|
STRESS,
|
||||||
|
STRESS_GRADIENT
|
||||||
|
};
|
||||||
|
|
||||||
|
RimFractureModelStressCurve();
|
||||||
|
~RimFractureModelStressCurve() override;
|
||||||
|
|
||||||
|
void setFractureModel( RimFractureModel* fractureModel );
|
||||||
|
|
||||||
|
void setPropertyType( PropertyType propertyType );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QString createCurveAutoName() override;
|
||||||
|
|
||||||
|
void performDataExtraction( bool* isUsingPseudoLength ) override;
|
||||||
|
|
||||||
|
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
|
||||||
|
caf::PdmField<caf::AppEnum<PropertyType>> m_propertyType;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user