Merge pull request #6220 from OPM/fracture-model-plot-improvements

Fracture model plot improvements
This commit is contained in:
Kristian Bendiksen 2020-07-08 10:24:12 +02:00 committed by GitHub
commit 7d7840bb5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 106 additions and 4 deletions

View File

@ -478,6 +478,10 @@ void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot*
curve->setLineThickness( 2 );
curve->setUiName( trackName );
curve->setAutoNameComponents( false, false, false, false, false );
if ( propertyType == RiaDefines::CurveProperty::STRESS_GRADIENT )
{
curve->setInterpolation( RiuQwtPlotCurve::INTERPOLATION_STEP_LEFT );
}
plotTrack->addCurve( curve );
plotTrack->setAutoScaleXEnabled( true );

View File

@ -39,6 +39,7 @@
#include "RimEclipseView.h"
#include "RimElasticProperties.h"
#include "RimEllipseFractureTemplate.h"
#include "RimFractureModelPlot.h"
#include "RimModeledWellPath.h"
#include "RimOilField.h"
#include "RimProject.h"
@ -189,6 +190,8 @@ void RimFractureModel::fieldChangedByUi( const caf::PdmFieldHandle* changedField
}
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
updateReferringPlots();
}
}
@ -731,3 +734,18 @@ QString RimFractureModel::underburdenFacies() const
{
return m_underburdenFacies;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::updateReferringPlots()
{
// Update plots referring to this fracture model
std::vector<RimFractureModelPlot*> referringObjects;
objectsWithReferringPtrFieldsOfType( referringObjects );
for ( auto modelPlot : referringObjects )
{
if ( modelPlot ) modelPlot->loadDataAndUpdate();
}
}

View File

@ -103,6 +103,7 @@ public:
double getDefaultForMissingOverburdenValue( const QString& keyword ) const;
double getDefaultForMissingUnderburdenValue( const QString& keyword ) const;
double getDefaultForMissingValue( const QString& keyword ) const;
void updateReferringPlots();
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;

View File

@ -196,6 +196,11 @@ void RimElasticPropertiesCurve::performDataExtraction( bool* isUsingPseudoLength
std::vector<double> poroValues;
fractureModelPlot->getPorosityValues( poroValues );
if ( poroValues.empty() )
{
RiaLogging::error( QString( "Empty porosity data found when extracting elastic properties." ) );
return;
}
// TODO: make this settable??
QString colorLegendName = RiaDefines::faciesColorLegendName();

View File

@ -128,6 +128,23 @@ RiaDefines::CurveProperty RimFractureModelCurve::curveProperty() const
return m_curveProperty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
RimWellLogExtractionCurve::fieldChangedByUi( changedField, oldValue, newValue );
RimFractureModelPlot* fractureModelPlot;
firstAncestorOrThisOfTypeAsserted( fractureModelPlot );
if ( fractureModelPlot )
{
fractureModelPlot->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -62,6 +62,8 @@ public:
RiaDefines::CurveProperty curveProperty() const override;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
void performDataExtraction( bool* isUsingPseudoLength ) override;
static bool hasMissingValues( const std::vector<double>& values );

View File

@ -156,7 +156,7 @@ double RimFractureModelPlot::findValueAtTopOfLayer( const std::vector<double>&
const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
size_t layerNo )
{
int index = layerBoundaryIndexes[layerNo].first;
size_t index = layerBoundaryIndexes[layerNo].first;
return values.at( index );
}
@ -167,7 +167,7 @@ double RimFractureModelPlot::findValueAtBottomOfLayer( const std::vector<double>
const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
size_t layerNo )
{
int index = layerBoundaryIndexes[layerNo].second;
size_t index = layerBoundaryIndexes[layerNo].second;
return values.at( index );
}
@ -191,6 +191,19 @@ void RimFractureModelPlot::computeAverageByLayer( const std::vector<std::pair<si
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::extractTopOfLayerValues( const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
const std::vector<double>& inputVector,
std::vector<double>& result )
{
for ( size_t i = 0; i < layerBoundaryIndexes.size(); i++ )
{
result.push_back( findValueAtTopOfLayer( inputVector, layerBoundaryIndexes, i ) );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -254,6 +267,30 @@ std::vector<double> RimFractureModelPlot::findCurveAndComputeLayeredAverage( Ria
return result;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::findCurveAndComputeTopOfLayer( RiaDefines::CurveProperty curveProperty ) const
{
RimWellLogExtractionCurve* curve = findCurveByProperty( curveProperty );
if ( !curve )
{
QString curveName = caf::AppEnum<RiaDefines::CurveProperty>::uiText( curveProperty );
RiaLogging::error( QString( "No curve for '%1' found" ).arg( curveName ) );
return std::vector<double>();
}
std::vector<std::pair<double, double>> layerBoundaryDepths;
std::vector<std::pair<size_t, size_t>> layerBoundaryIndexes;
calculateLayers( layerBoundaryDepths, layerBoundaryIndexes );
const RigWellLogCurveData* curveData = curve->curveData();
std::vector<double> values = curveData->xValues();
std::vector<double> result;
extractTopOfLayerValues( layerBoundaryIndexes, values, result );
return result;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -267,7 +304,7 @@ std::vector<double> RimFractureModelPlot::calculatePorosity() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateReservoirPressure() const
{
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PRESSURE );
return findCurveAndComputeTopOfLayer( RiaDefines::CurveProperty::PRESSURE );
}
//--------------------------------------------------------------------------------------------------
@ -438,7 +475,7 @@ std::vector<double> RimFractureModelPlot::calculateYoungsModulus() const
std::vector<double> valuesMMpsi;
for ( auto value : valuesGPa )
{
valuesMMpsi.push_back( value * 0.000145037737 );
valuesMMpsi.push_back( value * 0.14503773773 );
}
return valuesMMpsi;

View File

@ -78,6 +78,7 @@ public:
protected:
std::vector<double> findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty curveProperty ) const;
std::vector<double> findCurveXValuesByProperty( RiaDefines::CurveProperty curveProperty ) const;
std::vector<double> findCurveAndComputeTopOfLayer( RiaDefines::CurveProperty curveProperty ) const;
void calculateLayers( std::vector<std::pair<double, double>>& layerBoundaryDepths,
std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes ) const;
@ -93,6 +94,9 @@ protected:
static void computeAverageByLayer( const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
const std::vector<double>& inputVector,
std::vector<double>& result );
static void extractTopOfLayerValues( const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
const std::vector<double>& inputVector,
std::vector<double>& result );
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;

View File

@ -160,6 +160,11 @@ void RimLayerCurve::performDataExtraction( bool* isUsingPseudoLength )
std::vector<double> faciesValues;
fractureModelPlot->getFaciesValues( faciesValues );
if ( faciesValues.empty() )
{
RiaLogging::error( QString( "Empty facies data found for layer curve." ) );
return;
}
assert( faciesValues.size() == curveData.data.size() );

View File

@ -890,6 +890,14 @@ void RimPlotCurve::setSymbol( RiuQwtSymbol::PointSymbolEnum symbolStyle )
m_pointSymbol = symbolStyle;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setInterpolation( RiuQwtPlotCurve::CurveInterpolationEnum curveInterpolation )
{
m_curveInterpolation = curveInterpolation;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -69,6 +69,7 @@ public:
cvf::Color3f color() const { return m_curveColor; }
void setLineStyle( RiuQwtPlotCurve::LineStyleEnum lineStyle );
void setSymbol( RiuQwtSymbol::PointSymbolEnum symbolStyle );
void setInterpolation( RiuQwtPlotCurve::CurveInterpolationEnum );
RiuQwtSymbol::PointSymbolEnum symbol();
int symbolSize() const;
cvf::Color3f symbolEdgeColor() const;