#6113 Use enum to identify curves in RimFractureModelPlot.

This commit is contained in:
Kristian Bendiksen 2020-07-02 13:53:39 +02:00
parent cac8607707
commit 3c2f540492
17 changed files with 357 additions and 202 deletions

View File

@ -19,6 +19,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.h
${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.h
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaFractureModelDefines.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -42,6 +43,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaFractureModelDefines.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RiaFractureModelDefines.h"
namespace caf
{
template <>
void AppEnum<RiaDefines::CurveProperty>::setUp()
{
addItem( RiaDefines::CurveProperty::FACIES, "FACIES", "Facies" );
addItem( RiaDefines::CurveProperty::LAYERS, "LAYERS", "Layers" );
addItem( RiaDefines::CurveProperty::POROSITY, "POROSITY", "Porosity" );
addItem( RiaDefines::CurveProperty::PERMEABILITY_X, "PERMEABILITY_X", "Permeability Horizontal" );
addItem( RiaDefines::CurveProperty::PERMEABILITY_Z, "PERMEABILITY_Z", "Permeability Vertical" );
addItem( RiaDefines::CurveProperty::INITIAL_PRESSURE, "INITIAL_PRESSURE", "Initial Pressure" );
addItem( RiaDefines::CurveProperty::PRESSURE, "PRESSURE", "Pressure" );
addItem( RiaDefines::CurveProperty::STRESS, "STRESS", "Stress" );
addItem( RiaDefines::CurveProperty::STRESS_GRADIENT, "STRESS_GRADIENT", "Stress Gradient" );
addItem( RiaDefines::CurveProperty::YOUNGS_MODULUS, "YOUNGS_MODULUS", "Young's Modulus" );
addItem( RiaDefines::CurveProperty::POISSONS_RATIO, "POISSONS_RATIO", "Poisson's Ratio" );
addItem( RiaDefines::CurveProperty::K_IC, "K_IC", "K-Ic" );
addItem( RiaDefines::CurveProperty::PROPPANT_EMBEDMENT, "PROPPANT_EMBEDMENT", "Proppant Embedment" );
addItem( RiaDefines::CurveProperty::BIOT_COEFFICIENT, "BIOT_COEFFICIENT", "Biot Coefficient" );
addItem( RiaDefines::CurveProperty::K0, "K0", "k0" );
addItem( RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT, "FLUID_LOSS_COEFFICIENT", "Fluid Loss Coefficient" );
addItem( RiaDefines::CurveProperty::SPURT_LOSS, "SPURT_LOSS", "Spurt Loss" );
setDefault( RiaDefines::CurveProperty::FACIES );
}
}; // namespace caf

View File

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- 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 "RiaEclipseUnitTools.h"
#include <QString>
namespace RiaDefines
{
enum class CurveProperty
{
FACIES,
LAYERS,
POROSITY,
PERMEABILITY_X,
PERMEABILITY_Z,
INITIAL_PRESSURE,
PRESSURE,
STRESS,
STRESS_GRADIENT,
YOUNGS_MODULUS,
POISSONS_RATIO,
K_IC,
PROPPANT_EMBEDMENT,
BIOT_COEFFICIENT,
K0,
FLUID_LOSS_COEFFICIENT,
SPURT_LOSS
};
}; // namespace RiaDefines

View File

@ -95,25 +95,30 @@ RimFractureModelPlot*
plots["Porosity"] = {std::make_tuple( "PORO",
RiaDefines::ResultCatType::STATIC_NATIVE,
RimFractureModelCurve::MissingValueStrategy::DEFAULT_VALUE,
false )};
false,
RiaDefines::CurveProperty::POROSITY )};
plots["Pressure"] = {std::make_tuple( "PRESSURE",
RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RimFractureModelCurve::MissingValueStrategy::LINEAR_INTERPOLATION,
false ),
false,
RiaDefines::CurveProperty::PRESSURE ),
std::make_tuple( "PRESSURE",
RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RimFractureModelCurve::MissingValueStrategy::LINEAR_INTERPOLATION,
true )};
true,
RiaDefines::CurveProperty::INITIAL_PRESSURE )};
plots["Permeability"] = {std::make_tuple( "PERMX",
RiaDefines::ResultCatType::STATIC_NATIVE,
RimFractureModelCurve::MissingValueStrategy::DEFAULT_VALUE,
false ),
false,
RiaDefines::CurveProperty::PERMEABILITY_X ),
std::make_tuple( "PERMZ",
RiaDefines::ResultCatType::STATIC_NATIVE,
RimFractureModelCurve::MissingValueStrategy::DEFAULT_VALUE,
false )};
false,
RiaDefines::CurveProperty::PERMEABILITY_Z )};
std::set<QString> logarithmicPlots;
logarithmicPlots.insert( "Permeability" );
@ -128,15 +133,14 @@ RimFractureModelPlot*
{
auto task = progInfo.task( "Creating facies properties track", 15 );
std::vector<RimElasticPropertiesCurve::PropertyType> results =
{RimElasticPropertiesCurve::PropertyType::YOUNGS_MODULUS,
RimElasticPropertiesCurve::PropertyType::POISSONS_RATIO,
RimElasticPropertiesCurve::PropertyType::K_IC,
RimElasticPropertiesCurve::PropertyType::PROPPANT_EMBEDMENT,
RimElasticPropertiesCurve::PropertyType::BIOT_COEFFICIENT,
RimElasticPropertiesCurve::PropertyType::K0,
RimElasticPropertiesCurve::PropertyType::FLUID_LOSS_COEFFICIENT,
RimElasticPropertiesCurve::PropertyType::SPURT_LOSS};
std::vector<RiaDefines::CurveProperty> results = {RiaDefines::CurveProperty::YOUNGS_MODULUS,
RiaDefines::CurveProperty::POISSONS_RATIO,
RiaDefines::CurveProperty::K_IC,
RiaDefines::CurveProperty::PROPPANT_EMBEDMENT,
RiaDefines::CurveProperty::BIOT_COEFFICIENT,
RiaDefines::CurveProperty::K0,
RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT,
RiaDefines::CurveProperty::SPURT_LOSS};
for ( auto result : results )
{
@ -146,8 +150,8 @@ 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 );
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::STRESS );
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::STRESS_GRADIENT );
}
{
@ -257,6 +261,7 @@ void RicNewFractureModelPlotFeature::createFaciesTrack( RimFractureModelPlot* pl
RimFractureModelCurve* curve = new RimFractureModelCurve;
curve->setFractureModel( fractureModel );
curve->setCurveProperty( RiaDefines::CurveProperty::FACIES );
curve->setCase( eclipseCase );
curve->setEclipseResultCategory( RiaDefines::ResultCatType::INPUT_PROPERTY );
curve->setEclipseResultVariable( defaultProperty );
@ -307,6 +312,7 @@ void RicNewFractureModelPlotFeature::createLayersTrack( RimFractureModelPlot* pl
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
RimLayerCurve* curve = new RimLayerCurve;
curve->setCurveProperty( RiaDefines::CurveProperty::LAYERS );
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setColor( colors.cycledColor3f( 0 ) );
@ -353,9 +359,10 @@ void RicNewFractureModelPlotFeature::createParametersTrack( RimFractureModelPlot
RiaDefines::ResultCatType resultCategoryType = std::get<1>( curveConfig );
RimFractureModelCurve::MissingValueStrategy missingValueStrategy = std::get<2>( curveConfig );
bool fixedInitialTimeStep = std::get<3>( curveConfig );
RiaDefines::CurveProperty curveProperty = std::get<4>( curveConfig );
RimFractureModelCurve* curve = new RimFractureModelCurve;
curve->setCurveProperty( curveProperty );
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setEclipseResultVariable( resultVariable );
@ -402,13 +409,13 @@ void RicNewFractureModelPlotFeature::createParametersTrack( RimFractureModelPlot
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::createElasticPropertiesTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RimElasticPropertiesCurve::PropertyType propertyType )
void RicNewFractureModelPlotFeature::createElasticPropertiesTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RiaDefines::CurveProperty propertyType )
{
QString trackName = caf::AppEnum<RimElasticPropertiesCurve::PropertyType>::uiText( propertyType );
QString trackName = caf::AppEnum<RiaDefines::CurveProperty>::uiText( propertyType );
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, trackName, plot );
plotTrack->setFormationWellPath( fractureModel->thicknessDirectionWellPath() );
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
@ -420,7 +427,7 @@ void RicNewFractureModelPlotFeature::createElasticPropertiesTrack( RimFractureMo
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
RimElasticPropertiesCurve* curve = new RimElasticPropertiesCurve;
curve->setPropertyType( propertyType );
curve->setCurveProperty( propertyType );
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setColor( colors.cycledColor3f( 0 ) );
@ -447,13 +454,13 @@ void RicNewFractureModelPlotFeature::createElasticPropertiesTrack( RimFractureMo
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RimFractureModelStressCurve::PropertyType propertyType )
void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RiaDefines::CurveProperty propertyType )
{
QString trackName = caf::AppEnum<RimFractureModelStressCurve::PropertyType>::uiText( propertyType );
QString trackName = caf::AppEnum<RiaDefines::CurveProperty>::uiText( propertyType );
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, trackName, plot );
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
plotTrack->setLogarithmicScale( false );
@ -464,7 +471,7 @@ void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot*
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
RimFractureModelStressCurve* curve = new RimFractureModelStressCurve;
curve->setPropertyType( propertyType );
curve->setCurveProperty( propertyType );
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setColor( colors.cycledColor3f( 0 ) );

View File

@ -31,8 +31,8 @@ class RimFractureModelPlot;
class RimFractureModelPlotCollection;
class RimFractureModel;
typedef std::tuple<QString, RiaDefines::ResultCatType, RimFractureModelCurve::MissingValueStrategy, bool> PlotDef;
typedef std::vector<PlotDef> PlotDefVector;
typedef std::tuple<QString, RiaDefines::ResultCatType, RimFractureModelCurve::MissingValueStrategy, bool, RiaDefines::CurveProperty> PlotDef;
typedef std::vector<PlotDef> PlotDefVector;
//==================================================================================================
///
@ -66,17 +66,17 @@ private:
const PlotDefVector& curveConfiguration,
bool isPlotLogarithmic );
static void createElasticPropertiesTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RimElasticPropertiesCurve::PropertyType propertyType );
static void createElasticPropertiesTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RiaDefines::CurveProperty propertyType );
static void createStressTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RimFractureModelStressCurve::PropertyType propertyType );
static void createStressTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RiaDefines::CurveProperty propertyType );
static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription );

View File

@ -162,6 +162,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.h
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelStressCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPropertyCurve.h
)

View File

@ -59,25 +59,6 @@
CAF_PDM_SOURCE_INIT( RimElasticPropertiesCurve, "ElasticPropertiesCurve" );
namespace caf
{
template <>
void AppEnum<RimElasticPropertiesCurve::PropertyType>::setUp()
{
addItem( RimElasticPropertiesCurve::PropertyType::YOUNGS_MODULUS, "YOUNGS_MODULUS", "Young's Modulus" );
addItem( RimElasticPropertiesCurve::PropertyType::POISSONS_RATIO, "POISSONS_RATIO", "Poisson's Ratio" );
addItem( RimElasticPropertiesCurve::PropertyType::K_IC, "K_IC", "K-Ic" );
addItem( RimElasticPropertiesCurve::PropertyType::PROPPANT_EMBEDMENT, "PROPPANT_EMBEDMENT", "Proppant Embedment" );
addItem( RimElasticPropertiesCurve::PropertyType::BIOT_COEFFICIENT, "BIOT_COEFFICIENT", "Biot Coefficient" );
addItem( RimElasticPropertiesCurve::PropertyType::K0, "K0", "k0" );
addItem( RimElasticPropertiesCurve::PropertyType::FLUID_LOSS_COEFFICIENT,
"FLUID_LOSS_COEFFICIENT",
"Fluid Loss Coefficient" );
addItem( RimElasticPropertiesCurve::PropertyType::SPURT_LOSS, "SPURT_LOSS", "Spurt Loss" );
setDefault( RimElasticPropertiesCurve::PropertyType::YOUNGS_MODULUS );
}
}; // namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -89,7 +70,8 @@ RimElasticPropertiesCurve::RimElasticPropertiesCurve()
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
m_fractureModel.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_propertyType, "PropertyType", "Property Type", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_curveProperty, "CurveProperty", "Curve Property", "", "", "" );
m_curveProperty.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
@ -121,9 +103,17 @@ void RimElasticPropertiesCurve::setEclipseResultCategory( RiaDefines::ResultCatT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimElasticPropertiesCurve::setPropertyType( PropertyType propertyType )
void RimElasticPropertiesCurve::setCurveProperty( RiaDefines::CurveProperty curveProperty )
{
m_propertyType = propertyType;
m_curveProperty = curveProperty;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::CurveProperty RimElasticPropertiesCurve::curveProperty() const
{
return m_curveProperty();
}
//--------------------------------------------------------------------------------------------------
@ -274,42 +264,42 @@ void RimElasticPropertiesCurve::performDataExtraction( bool* isUsingPseudoLength
{
const RigElasticProperties& rigElasticProperties = elasticProperties->propertiesForFacies( faciesKey );
if ( m_propertyType() == PropertyType::YOUNGS_MODULUS )
if ( m_curveProperty() == RiaDefines::CurveProperty::YOUNGS_MODULUS )
{
double val = rigElasticProperties.getYoungsModulus( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::POISSONS_RATIO )
else if ( m_curveProperty() == RiaDefines::CurveProperty::POISSONS_RATIO )
{
double val = rigElasticProperties.getPoissonsRatio( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::K_IC )
else if ( m_curveProperty() == RiaDefines::CurveProperty::K_IC )
{
double val = rigElasticProperties.getK_Ic( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::PROPPANT_EMBEDMENT )
else if ( m_curveProperty() == RiaDefines::CurveProperty::PROPPANT_EMBEDMENT )
{
double val = rigElasticProperties.getProppantEmbedment( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::BIOT_COEFFICIENT )
else if ( m_curveProperty() == RiaDefines::CurveProperty::BIOT_COEFFICIENT )
{
double val = rigElasticProperties.getBiotCoefficient( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::K0 )
else if ( m_curveProperty() == RiaDefines::CurveProperty::K0 )
{
double val = rigElasticProperties.getK0( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::FLUID_LOSS_COEFFICIENT )
else if ( m_curveProperty() == RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT )
{
double val = rigElasticProperties.getFluidLossCoefficient( porosity );
values.push_back( val );
}
else if ( m_propertyType() == PropertyType::SPURT_LOSS )
else if ( m_curveProperty() == RiaDefines::CurveProperty::SPURT_LOSS )
{
double val = rigElasticProperties.getSpurtLoss( porosity );
values.push_back( val );
@ -391,7 +381,7 @@ double RimElasticPropertiesCurve::findFaciesValue( const RimColorLegend& colorLe
//--------------------------------------------------------------------------------------------------
QString RimElasticPropertiesCurve::createCurveAutoName()
{
return caf::AppEnum<RimElasticPropertiesCurve::PropertyType>::uiText( m_propertyType() );
return caf::AppEnum<RiaDefines::CurveProperty>::uiText( m_curveProperty() );
}
//--------------------------------------------------------------------------------------------------

View File

@ -18,6 +18,7 @@
#pragma once
#include "RimFractureModelPropertyCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "RiuQwtSymbol.h"
@ -35,23 +36,11 @@ class RimColorLegend;
//==================================================================================================
///
//==================================================================================================
class RimElasticPropertiesCurve : public RimWellLogExtractionCurve
class RimElasticPropertiesCurve : public RimWellLogExtractionCurve, public RimFractureModelPropertyCurve
{
CAF_PDM_HEADER_INIT;
public:
enum class PropertyType
{
YOUNGS_MODULUS,
POISSONS_RATIO,
K_IC,
PROPPANT_EMBEDMENT,
BIOT_COEFFICIENT,
K0,
FLUID_LOSS_COEFFICIENT,
SPURT_LOSS
};
RimElasticPropertiesCurve();
~RimElasticPropertiesCurve() override;
@ -59,7 +48,8 @@ public:
void setEclipseResultCategory( RiaDefines::ResultCatType catType );
void setPropertyType( PropertyType propertyType );
void setCurveProperty( RiaDefines::CurveProperty ) override;
RiaDefines::CurveProperty curveProperty() const override;
protected:
QString createCurveAutoName() override;
@ -89,6 +79,6 @@ protected:
const QString& formationName,
double faciesValue );
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<PropertyType>> m_propertyType;
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
};

View File

@ -82,6 +82,9 @@ RimFractureModelCurve::RimFractureModelCurve()
CAF_PDM_InitField( &m_missingValueStrategy, "MissingValueStrategy", defaultValue, "Missing Value Strategy", "", "", "" );
m_missingValueStrategy.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_curveProperty, "CurveProperty", "Curve Property", "", "", "" );
m_curveProperty.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
@ -109,6 +112,22 @@ void RimFractureModelCurve::setEclipseResultCategory( RiaDefines::ResultCatType
m_eclipseResultDefinition->setResultType( catType );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::setCurveProperty( RiaDefines::CurveProperty curveProperty )
{
m_curveProperty = curveProperty;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::CurveProperty RimFractureModelCurve::curveProperty() const
{
return m_curveProperty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -18,6 +18,7 @@
#pragma once
#include "RimFractureModelPropertyCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "RiuQwtSymbol.h"
@ -37,7 +38,7 @@ class RigResultAccessor;
//==================================================================================================
///
//==================================================================================================
class RimFractureModelCurve : public RimWellLogExtractionCurve
class RimFractureModelCurve : public RimWellLogExtractionCurve, public RimFractureModelPropertyCurve
{
CAF_PDM_HEADER_INIT;
@ -57,6 +58,9 @@ public:
void setMissingValueStrategy( MissingValueStrategy strategy );
void setCurveProperty( RiaDefines::CurveProperty ) override;
RiaDefines::CurveProperty curveProperty() const override;
protected:
void performDataExtraction( bool* isUsingPseudoLength ) override;
@ -81,6 +85,7 @@ protected:
double underburdenHeight,
double defaultUnderburdenValue );
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<MissingValueStrategy>> m_missingValueStrategy;
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<MissingValueStrategy>> m_missingValueStrategy;
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
};

View File

@ -25,6 +25,7 @@
#include "RimEclipseCase.h"
#include "RimFractureModel.h"
#include "RimFractureModelCurve.h"
#include "RimFractureModelPropertyCurve.h"
#include "RimLayerCurve.h"
#include "RigWellLogCurveData.h"
@ -94,15 +95,10 @@ void RimFractureModelPlot::applyDataSource()
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::getPorosityValues( std::vector<double>& values ) const
{
std::vector<RimFractureModelCurve*> curves;
descendantsIncludingThisOfType( curves );
for ( RimFractureModelCurve* curve : curves )
RimWellLogExtractionCurve* curve = findCurveByProperty( RiaDefines::CurveProperty::POROSITY );
if ( curve )
{
if ( curve->eclipseResultVariable() == "PORO" )
{
values = curve->curveData()->xValues();
}
values = curve->curveData()->xValues();
}
}
@ -111,15 +107,10 @@ void RimFractureModelPlot::getPorosityValues( std::vector<double>& values ) cons
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::getFaciesValues( std::vector<double>& values ) const
{
std::vector<RimFractureModelCurve*> curves;
descendantsIncludingThisOfType( curves );
for ( RimFractureModelCurve* curve : curves )
RimWellLogExtractionCurve* curve = findCurveByProperty( RiaDefines::CurveProperty::FACIES );
if ( curve )
{
if ( curve->eclipseResultVariable() == "OPERNUM_1" )
{
values = curve->curveData()->xValues();
}
values = curve->curveData()->xValues();
}
}
@ -200,17 +191,16 @@ void RimFractureModelPlot::computeAverageByLayer( const std::vector<std::pair<si
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogExtractionCurve* RimFractureModelPlot::findCurveByName( const QString& curveName ) const
RimWellLogExtractionCurve* RimFractureModelPlot::findCurveByProperty( RiaDefines::CurveProperty curveProperty ) const
{
std::vector<RimWellLogExtractionCurve*> curves;
std::vector<RimFractureModelPropertyCurve*> curves;
descendantsIncludingThisOfType( curves );
for ( auto curve : curves )
for ( RimFractureModelPropertyCurve* curve : curves )
{
// TODO: This will not work if the user has changed the name of the curve: do something smarter.
if ( curve->curveName() == curveName )
if ( curve->curveProperty() == curveProperty )
{
return curve;
return dynamic_cast<RimWellLogExtractionCurve*>( curve );
}
}
@ -240,12 +230,13 @@ std::vector<double> RimFractureModelPlot::calculateTrueVerticalDepth() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::findCurveAndComputeLayeredAverage( const QString& curveName ) const
std::vector<double> RimFractureModelPlot::findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty curveProperty ) const
{
RimWellLogExtractionCurve* curve = findCurveByName( curveName );
RimWellLogExtractionCurve* curve = findCurveByProperty( curveProperty );
if ( !curve )
{
RiaLogging::error( QString( "No curve named '%1' found" ).arg( curveName ) );
QString curveName = caf::AppEnum<RiaDefines::CurveProperty>::uiText( curveProperty );
RiaLogging::error( QString( "No curve for '%1' found" ).arg( curveName ) );
return std::vector<double>();
}
@ -265,7 +256,7 @@ std::vector<double> RimFractureModelPlot::findCurveAndComputeLayeredAverage( con
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculatePorosity() const
{
return findCurveAndComputeLayeredAverage( "PORO" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::POROSITY );
}
//--------------------------------------------------------------------------------------------------
@ -273,7 +264,7 @@ std::vector<double> RimFractureModelPlot::calculatePorosity() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateReservoirPressure() const
{
return findCurveAndComputeLayeredAverage( "PRESSURE" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PRESSURE );
}
//--------------------------------------------------------------------------------------------------
@ -281,7 +272,7 @@ std::vector<double> RimFractureModelPlot::calculateReservoirPressure() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateHorizontalPermeability() const
{
return findCurveAndComputeLayeredAverage( "PERMX" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PERMEABILITY_X );
}
//--------------------------------------------------------------------------------------------------
@ -289,7 +280,7 @@ std::vector<double> RimFractureModelPlot::calculateHorizontalPermeability() cons
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateVerticalPermeability() const
{
return findCurveAndComputeLayeredAverage( "PERMZ" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PERMEABILITY_Z );
}
//--------------------------------------------------------------------------------------------------
@ -303,6 +294,21 @@ std::vector<double> RimFractureModelPlot::calculateStress() const
return stress;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::findCurveXValuesByProperty( RiaDefines::CurveProperty curveProperty ) const
{
RimWellLogExtractionCurve* curve = findCurveByProperty( curveProperty );
if ( !curve )
{
QString curveName = caf::AppEnum<RiaDefines::CurveProperty>::uiText( curveProperty );
RiaLogging::error( QString( "%1 data not found." ).arg( curveName ) );
return std::vector<double>();
}
return curve->curveData()->xValues();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -319,49 +325,26 @@ bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& st
calculateLayers( layerBoundaryDepths, layerBoundaryIndexes );
// Biot coefficient
RimWellLogExtractionCurve* biotCurve = findCurveByName( "Biot Coefficient" );
if ( !biotCurve )
{
RiaLogging::error( "Biot coefficient data not found." );
return false;
}
std::vector<double> biotData = biotCurve->curveData()->xValues();
std::vector<double> biotData = findCurveXValuesByProperty( RiaDefines::CurveProperty::BIOT_COEFFICIENT );
// Biot coefficient
RimWellLogExtractionCurve* k0Curve = findCurveByName( "k0" );
if ( !k0Curve )
{
RiaLogging::error( "k0 data not found." );
return false;
}
std::vector<double> k0Data = k0Curve->curveData()->xValues();
// K0
std::vector<double> k0Data = findCurveXValuesByProperty( RiaDefines::CurveProperty::K0 );
// Pressure at the give time step
RimWellLogExtractionCurve* timeStepPressureCurve = findCurveByName( "PRESSURE" );
if ( !timeStepPressureCurve )
{
RiaLogging::error( "Pressure data for time step not found." );
return false;
}
std::vector<double> timeStepPressureData = timeStepPressureCurve->curveData()->xValues();
std::vector<double> timeStepPressureData = findCurveXValuesByProperty( RiaDefines::CurveProperty::PRESSURE );
// Initial pressure
RimWellLogExtractionCurve* initialPressureCurve = findCurveByName( "INITIAL PRESSURE" );
if ( !initialPressureCurve )
{
RiaLogging::error( "Initial pressure data not found." );
return false;
}
std::vector<double> initialPressureData = initialPressureCurve->curveData()->xValues();
std::vector<double> initialPressureData = findCurveXValuesByProperty( RiaDefines::CurveProperty::INITIAL_PRESSURE );
// Poissons ratio
RimWellLogExtractionCurve* poissonsRatioCurve = findCurveByName( "Poisson's Ratio" );
if ( !poissonsRatioCurve )
std::vector<double> poissonsRatioData = findCurveXValuesByProperty( RiaDefines::CurveProperty::POISSONS_RATIO );
// Check that we have data from all curves
if ( biotData.empty() || k0Data.empty() || timeStepPressureData.empty() || initialPressureData.empty() ||
poissonsRatioData.empty() )
{
RiaLogging::error( "Poisson's ratio data not found." );
return false;
}
std::vector<double> poissonsRatioData = poissonsRatioCurve->curveData()->xValues();
std::vector<double> stressForGradients;
std::vector<double> pressureForGradients;
@ -448,7 +431,7 @@ std::vector<double> RimFractureModelPlot::calculateStressGradient() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateYoungsModulus() const
{
std::vector<double> valuesGPa = findCurveAndComputeLayeredAverage( "Young's Modulus" );
std::vector<double> valuesGPa = findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::YOUNGS_MODULUS );
std::vector<double> valuesMMpsi;
for ( auto value : valuesGPa )
{
@ -463,7 +446,7 @@ std::vector<double> RimFractureModelPlot::calculateYoungsModulus() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculatePoissonsRatio() const
{
return findCurveAndComputeLayeredAverage( "Poisson's Ratio" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::POISSONS_RATIO );
}
//--------------------------------------------------------------------------------------------------
@ -471,7 +454,7 @@ std::vector<double> RimFractureModelPlot::calculatePoissonsRatio() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateKIc() const
{
return findCurveAndComputeLayeredAverage( "K-Ic" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::K_IC );
}
//--------------------------------------------------------------------------------------------------
@ -479,7 +462,7 @@ std::vector<double> RimFractureModelPlot::calculateKIc() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateFluidLossCoefficient() const
{
return findCurveAndComputeLayeredAverage( "Fluid Loss Coefficient" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT );
}
//--------------------------------------------------------------------------------------------------
@ -487,7 +470,7 @@ std::vector<double> RimFractureModelPlot::calculateFluidLossCoefficient() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateSpurtLoss() const
{
return findCurveAndComputeLayeredAverage( "Spurt Loss" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::SPURT_LOSS );
}
//--------------------------------------------------------------------------------------------------
@ -495,5 +478,5 @@ std::vector<double> RimFractureModelPlot::calculateSpurtLoss() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateProppandEmbedment() const
{
return findCurveAndComputeLayeredAverage( "Proppant Embedment" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PROPPANT_EMBEDMENT );
}

View File

@ -19,6 +19,8 @@
#include "RimDepthTrackPlot.h"
#include "RiaFractureModelDefines.h"
#include "cafPdmField.h"
#include "cafPdmPtrField.h"
@ -32,6 +34,26 @@ class RimFractureModelPlot : public RimDepthTrackPlot
CAF_PDM_HEADER_INIT;
public:
enum class PropertyType
{
FACIES,
LAYERS,
POROSITY,
PERMEABILITY_X,
PERMEABILITY_Z,
INITIAL_PRESSURE,
PRESSURE,
STRESS,
STRESS_GRADIENT,
YOUNGS_MODULUS,
POISSONS_RATIO,
K_IC,
PROPPANT_EMBEDMENT,
BIOT_COEFFICIENT,
K0,
FLUID_LOSS_COEFFICIENT,
};
RimFractureModelPlot();
void setFractureModel( RimFractureModel* fractureModel );
@ -54,10 +76,12 @@ public:
std::vector<double> calculateProppandEmbedment() const;
protected:
std::vector<double> findCurveAndComputeLayeredAverage( const QString& curveName ) const;
std::vector<double> findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty curveProperty ) const;
std::vector<double> findCurveXValuesByProperty( RiaDefines::CurveProperty curveProperty ) const;
void calculateLayers( std::vector<std::pair<double, double>>& layerBoundaryDepths,
std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes ) const;
RimWellLogExtractionCurve* findCurveByName( const QString& curveName ) const;
RimWellLogExtractionCurve* findCurveByProperty( RiaDefines::CurveProperty curveProperty ) const;
bool calculateStressWithGradients( std::vector<double>& stress, std::vector<double>& stressGradients ) const;
static double computeValueAtDepth( const std::vector<double>& values,

View File

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RiaFractureModelDefines.h"
#include "RimWellLogExtractionCurve.h"
#include "cafPdmObject.h"
//==================================================================================================
///
//==================================================================================================
class RimFractureModelPropertyCurve
{
public:
virtual void setCurveProperty( RiaDefines::CurveProperty ) = 0;
virtual RiaDefines::CurveProperty curveProperty() const = 0;
};

View File

@ -43,17 +43,6 @@
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
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -65,7 +54,8 @@ RimFractureModelStressCurve::RimFractureModelStressCurve()
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
m_fractureModel.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_propertyType, "PropertyType", "Property Type", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_curveProperty, "CurveProperty", "Curve Property", "", "", "" );
m_curveProperty.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
@ -80,9 +70,17 @@ RimFractureModelStressCurve::~RimFractureModelStressCurve()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelStressCurve::setPropertyType( PropertyType propertyType )
void RimFractureModelStressCurve::setCurveProperty( RiaDefines::CurveProperty curveProperty )
{
m_propertyType = propertyType;
m_curveProperty = curveProperty;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::CurveProperty RimFractureModelStressCurve::curveProperty() const
{
return m_curveProperty();
}
//--------------------------------------------------------------------------------------------------
@ -123,7 +121,7 @@ void RimFractureModelStressCurve::performDataExtraction( bool* isUsingPseudoLeng
tvDepthValues.push_back( RiaEclipseUnitTools::feetToMeter( f ) );
}
if ( m_propertyType() == PropertyType::STRESS )
if ( m_curveProperty() == RiaDefines::CurveProperty::STRESS )
{
values = fractureModelPlot->calculateStress();
}
@ -188,5 +186,5 @@ void RimFractureModelStressCurve::performDataExtraction( bool* isUsingPseudoLeng
//--------------------------------------------------------------------------------------------------
QString RimFractureModelStressCurve::createCurveAutoName()
{
return caf::AppEnum<RimFractureModelStressCurve::PropertyType>::uiText( m_propertyType() );
return caf::AppEnum<RiaDefines::CurveProperty>::uiText( m_curveProperty() );
}

View File

@ -18,6 +18,7 @@
#pragma once
#include "RimFractureModelPropertyCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "RiuQwtSymbol.h"
@ -35,7 +36,7 @@ class RimColorLegend;
//==================================================================================================
///
//==================================================================================================
class RimFractureModelStressCurve : public RimWellLogExtractionCurve
class RimFractureModelStressCurve : public RimWellLogExtractionCurve, public RimFractureModelPropertyCurve
{
CAF_PDM_HEADER_INIT;
@ -51,13 +52,14 @@ public:
void setFractureModel( RimFractureModel* fractureModel );
void setPropertyType( PropertyType propertyType );
void setCurveProperty( RiaDefines::CurveProperty ) override;
RiaDefines::CurveProperty curveProperty() const override;
protected:
QString createCurveAutoName() override;
void performDataExtraction( bool* isUsingPseudoLength ) override;
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<PropertyType>> m_propertyType;
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
};

View File

@ -69,6 +69,9 @@ RimLayerCurve::RimLayerCurve()
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
m_fractureModel.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_curveProperty, "CurveProperty", "Curve Property", "", "", "" );
m_curveProperty.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
@ -88,22 +91,6 @@ void RimLayerCurve::setFractureModel( RimFractureModel* fractureModel )
m_wellPath = fractureModel->thicknessDirectionWellPath();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
// void RimLayerCurve::setEclipseResultCategory( RiaDefines::ResultCatType catType )
// {
// m_eclipseResultDefinition->setResultType( catType );
// }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
// void RimLayerCurve::setPropertyType( PropertyType propertyType )
// {
// m_propertyType = propertyType;
// }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -235,3 +222,19 @@ QString RimLayerCurve::createCurveAutoName()
{
return "Layers";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimLayerCurve::setCurveProperty( RiaDefines::CurveProperty curveProperty )
{
m_curveProperty = curveProperty;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::CurveProperty RimLayerCurve::curveProperty() const
{
return m_curveProperty();
}

View File

@ -18,6 +18,7 @@
#pragma once
#include "RimFractureModelPropertyCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "cafPdmField.h"
@ -29,7 +30,7 @@ class RimColorLegend;
//==================================================================================================
///
//==================================================================================================
class RimLayerCurve : public RimWellLogExtractionCurve
class RimLayerCurve : public RimWellLogExtractionCurve, public RimFractureModelPropertyCurve
{
CAF_PDM_HEADER_INIT;
@ -41,6 +42,9 @@ public:
void setEclipseResultCategory( RiaDefines::ResultCatType catType );
void setCurveProperty( RiaDefines::CurveProperty ) override;
RiaDefines::CurveProperty curveProperty() const override;
protected:
QString createCurveAutoName() override;
@ -51,6 +55,6 @@ protected:
const std::vector<std::pair<double, double>>& depthRanges,
double depth );
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
// caf::PdmField<caf::AppEnum<PropertyType>> m_propertyType;
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
};