Merge pull request #6166 from OPM/fracture-model-plot-overburden-6038

Fracture model plot overburden 6038
This commit is contained in:
Kristian Bendiksen 2020-07-03 09:18:53 +02:00 committed by GitHub
commit aad3f55a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1224 additions and 256 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 )
{
@ -144,6 +148,12 @@ RimFractureModelPlot*
}
}
{
auto task = progInfo.task( "Creating stress track", 2 );
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::STRESS );
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::STRESS_GRADIENT );
}
{
auto task = progInfo.task( "Updating all tracks", 5 );
@ -215,6 +225,8 @@ void RicNewFractureModelPlotFeature::createFormationTrack( RimFractureModelPlot*
formationTrack->setFormationCase( eclipseCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setOverburdenHeight( fractureModel->overburdenHeight() );
formationTrack->setUnderburdenHeight( fractureModel->underburdenHeight() );
formationTrack->setColSpan( RimPlot::ONE );
}
@ -232,6 +244,8 @@ void RicNewFractureModelPlotFeature::createFaciesTrack( RimFractureModelPlot* pl
faciesTrack->setFormationCase( eclipseCase );
faciesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS );
faciesTrack->setRegionPropertyResultType( RiaDefines::ResultCatType::INPUT_PROPERTY, defaultProperty );
faciesTrack->setOverburdenHeight( fractureModel->overburdenHeight() );
faciesTrack->setUnderburdenHeight( fractureModel->underburdenHeight() );
RimColorLegend* faciesColors =
RimProject::current()->colorLegendCollection()->findByName( RiaDefines::faciesColorLegendName() );
@ -247,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 );
@ -254,7 +269,6 @@ void RicNewFractureModelPlotFeature::createFaciesTrack( RimFractureModelPlot* pl
curve->setLineStyle( RiuQwtPlotCurve::STYLE_SOLID );
curve->setLineThickness( 2 );
curve->setAutoNameComponents( false, true, false, false, false );
curve->setCurveVisibility( false );
faciesTrack->addCurve( curve );
faciesTrack->setAutoScaleXEnabled( true );
@ -297,6 +311,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 ) );
@ -343,9 +358,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 );
@ -392,13 +408,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 );
@ -410,7 +426,51 @@ 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 ) );
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();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
RiaDefines::CurveProperty 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 );
plotTrack->setShowRegionLabels( true );
plotTrack->setShowWindow( true );
plotTrack->setColSpan( RimPlot::TWO );
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
RimFractureModelStressCurve* curve = new RimFractureModelStressCurve;
curve->setCurveProperty( propertyType );
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setColor( colors.cycledColor3f( 0 ) );

View File

@ -24,14 +24,15 @@
#include "RimElasticPropertiesCurve.h"
#include "RimFractureModelCurve.h"
#include "RimFractureModelStressCurve.h"
class RimEclipseCase;
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;
//==================================================================================================
///
@ -65,11 +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,
RiaDefines::CurveProperty propertyType );
static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription );

View File

@ -161,6 +161,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.h
${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
)
@ -326,6 +328,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertiesCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelStressCurve.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -21,6 +21,7 @@
#include "RiaColorTables.h"
#include "RiaCompletionTypeCalculationScheduler.h"
#include "RiaEclipseUnitTools.h"
#include "RiaFractureDefines.h"
#include "RiaLogging.h"
#include "Riu3DMainWindowTools.h"
@ -30,6 +31,9 @@
#include "RigWellPath.h"
#include "Rim3dView.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
@ -115,6 +119,18 @@ RimFractureModel::RimFractureModel()
CAF_PDM_InitField( &m_verticalStressGradient, "VerticalStressGradient", 0.238, "Vertical Stress Gradient", "", "", "" );
CAF_PDM_InitField( &m_stressDepth, "StressDepth", 1000.0, "Stress Depth", "", "", "" );
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 50.0, "Overburden Height", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_overburdenFormation, "OverburdenFormation", "Overburden Formation", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_overburdenFacies, "OverburdenFacies", "Overburden Facies", "", "", "" );
CAF_PDM_InitField( &m_overburdenPorosity, "OverburdenPorosity", 0.0, "Overburden Porosity", "", "", "" );
CAF_PDM_InitField( &m_overburdenPermeability, "OverburdenPermeability", 10.0e-6, "Overburden Permeability", "", "", "" );
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 50.0, "Underburden Height", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_underburdenFormation, "UnderburdenFormation", "Underburden Formation", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_underburdenFacies, "UnderburdenFacies", "Underburden Facies", "", "", "" );
CAF_PDM_InitField( &m_underburdenPorosity, "UnderburdenPorosity", 0.0, "Underburden Porosity", "", "", "" );
CAF_PDM_InitField( &m_underburdenPermeability, "UnderburdenPermeability", 10.0e-6, "Underburden Permeability", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
m_elasticProperties.uiCapability()->setUiHidden( true );
m_elasticProperties.uiCapability()->setUiTreeHidden( true );
@ -176,6 +192,48 @@ void RimFractureModel::fieldChangedByUi( const caf::PdmFieldHandle* changedField
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimFractureModel::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_overburdenFormation || fieldNeedingOptions == &m_underburdenFormation )
{
// Find an eclipse case
RimProject* proj = RimProject::current();
if ( proj->eclipseCases().empty() ) return options;
RimEclipseCase* eclipseCase = proj->eclipseCases()[0];
if ( !eclipseCase ) return options;
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
if ( !eclipseCaseData ) return options;
std::vector<QString> formationNames = eclipseCase->eclipseCaseData()->formationNames();
for ( const QString& formationName : formationNames )
{
options.push_back( caf::PdmOptionItemInfo( formationName, formationName ) );
}
}
else if ( fieldNeedingOptions == &m_overburdenFacies || fieldNeedingOptions == &m_underburdenFacies )
{
RimColorLegend* faciesColors =
RimProject::current()->colorLegendCollection()->findByName( RiaDefines::faciesColorLegendName() );
if ( faciesColors )
{
for ( RimColorLegendItem* item : faciesColors->colorLegendItems() )
{
options.push_back( caf::PdmOptionItemInfo( item->categoryName(), item->categoryName() ) );
}
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -530,6 +588,46 @@ double RimFractureModel::getDefaultForMissingValue( const QString& keyword ) con
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::getDefaultForMissingOverburdenValue( const QString& keyword ) const
{
if ( keyword == QString( "PORO" ) )
{
return defaultOverburdenPorosity();
}
else if ( keyword == QString( "PERMX" ) || keyword == QString( "PERMZ" ) )
{
return defaultOverburdenPermeability();
}
else
{
RiaLogging::error( QString( "Missing default overburden value for %1." ).arg( keyword ) );
return std::numeric_limits<double>::infinity();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::getDefaultForMissingUnderburdenValue( const QString& keyword ) const
{
if ( keyword == QString( "PORO" ) )
{
return defaultUnderburdenPorosity();
}
else if ( keyword == QString( "PERMX" ) || keyword == QString( "PERMZ" ) )
{
return defaultUnderburdenPermeability();
}
else
{
RiaLogging::error( QString( "Missing default underburden value for %1." ).arg( keyword ) );
return std::numeric_limits<double>::infinity();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -553,3 +651,83 @@ double RimFractureModel::stressDepth() const
{
return m_stressDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::overburdenHeight() const
{
return m_overburdenHeight;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::underburdenHeight() const
{
return m_underburdenHeight;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultOverburdenPorosity() const
{
return m_overburdenPorosity;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultUnderburdenPorosity() const
{
return m_underburdenPorosity;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultOverburdenPermeability() const
{
return m_overburdenPermeability;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::defaultUnderburdenPermeability() const
{
return m_underburdenPermeability;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::overburdenFormation() const
{
return m_overburdenFormation;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::overburdenFacies() const
{
return m_overburdenFacies;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::underburdenFormation() const
{
return m_underburdenFormation;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::underburdenFacies() const
{
return m_underburdenFacies;
}

View File

@ -67,6 +67,21 @@ public:
double verticalStressGradient() const;
double stressDepth() const;
double overburdenHeight() const;
double underburdenHeight() const;
double defaultOverburdenPorosity() const;
double defaultUnderburdenPorosity() const;
double defaultOverburdenPermeability() const;
double defaultUnderburdenPermeability() const;
QString overburdenFormation() const;
QString overburdenFacies() const;
QString underburdenFormation() const;
QString underburdenFacies() const;
// RimWellPathCompletionsInterface overrides.
RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override;
@ -85,10 +100,14 @@ public:
void setElasticProperties( RimElasticProperties* elasticProperties );
RimElasticProperties* elasticProperties() const;
double getDefaultForMissingOverburdenValue( const QString& keyword ) const;
double getDefaultForMissingUnderburdenValue( const QString& keyword ) const;
double getDefaultForMissingValue( const QString& keyword ) const;
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
private:
void updatePositionFromMeasuredDepth();
@ -112,4 +131,14 @@ protected:
caf::PdmField<double> m_verticalStress;
caf::PdmField<double> m_verticalStressGradient;
caf::PdmField<double> m_stressDepth;
caf::PdmField<double> m_overburdenHeight;
caf::PdmField<double> m_overburdenPorosity;
caf::PdmField<double> m_overburdenPermeability;
caf::PdmField<QString> m_overburdenFormation;
caf::PdmField<QString> m_overburdenFacies;
caf::PdmField<double> m_underburdenHeight;
caf::PdmField<double> m_underburdenPorosity;
caf::PdmField<double> m_underburdenPermeability;
caf::PdmField<QString> m_underburdenFormation;
caf::PdmField<QString> m_underburdenFacies;
};

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();
}
//--------------------------------------------------------------------------------------------------
@ -169,16 +159,11 @@ void RimElasticPropertiesCurve::performDataExtraction( bool* isUsingPseudoLength
CurveSamplingPointData curveData =
RimWellLogTrack::curveSamplingPointData( &eclExtractor, formationResultAccessor.p() );
std::vector<double> formationValues = curveData.data;
std::vector<std::pair<double, double>> yValues;
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( eclipseCase );
std::vector<QString> formationNamesToPlot;
RimWellLogTrack::findRegionNamesToPlot( curveData,
formationNamesVector,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
&formationNamesToPlot,
&yValues );
// Extract facies data
m_eclipseResultDefinition->setResultVariable( "OPERNUM_1" );
m_eclipseResultDefinition->setResultType( RiaDefines::ResultCatType::INPUT_PROPERTY );
@ -229,12 +214,49 @@ void RimElasticPropertiesCurve::performDataExtraction( bool* isUsingPseudoLength
return;
}
double overburdenHeight = m_fractureModel->overburdenHeight();
if ( overburdenHeight > 0.0 )
{
double defaultPoroValue = m_fractureModel->defaultOverburdenPorosity();
QString overburdenFormation = m_fractureModel->overburdenFormation();
QString overburdenFacies = m_fractureModel->overburdenFacies();
addOverburden( formationNamesVector,
formationValues,
faciesValues,
tvDepthValues,
measuredDepthValues,
overburdenHeight,
defaultPoroValue,
overburdenFormation,
findFaciesValue( *colorLegend, overburdenFacies ) );
}
double underburdenHeight = m_fractureModel->underburdenHeight();
if ( underburdenHeight > 0.0 )
{
double defaultPoroValue = m_fractureModel->defaultUnderburdenPorosity();
QString underburdenFormation = m_fractureModel->underburdenFormation();
QString underburdenFacies = m_fractureModel->underburdenFacies();
addUnderburden( formationNamesVector,
formationValues,
faciesValues,
tvDepthValues,
measuredDepthValues,
underburdenHeight,
defaultPoroValue,
underburdenFormation,
findFaciesValue( *colorLegend, underburdenFacies ) );
}
for ( size_t i = 0; i < tvDepthValues.size(); i++ )
{
// TODO: get from somewhere??
QString fieldName = "Norne";
QString faciesName = findFaciesName( *colorLegend, faciesValues[i] );
QString formationName = findFormationNameForDepth( formationNamesToPlot, yValues, tvDepthValues[i] );
int idx = static_cast<int>( formationValues[i] );
QString formationName = formationNamesVector[idx];
double porosity = poroValues[i];
FaciesKey faciesKey = std::make_tuple( fieldName, formationName, faciesName );
@ -242,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 );
@ -344,22 +366,14 @@ QString RimElasticPropertiesCurve::findFaciesName( const RimColorLegend& colorLe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimElasticPropertiesCurve::findFormationNameForDepth( const std::vector<QString>& formationNames,
const std::vector<std::pair<double, double>>& depthRanges,
double depth )
double RimElasticPropertiesCurve::findFaciesValue( const RimColorLegend& colorLegend, const QString& name )
{
// assert(formationNames.size() == depthRanges.size());
for ( size_t i = 0; i < formationNames.size(); i++ )
for ( auto item : colorLegend.colorLegendItems() )
{
double high = depthRanges[i].second;
double low = depthRanges[i].first;
if ( depth >= low && depth <= high )
{
return formationNames[i];
}
if ( item->categoryName() == name ) return item->categoryValue();
}
return "not found";
return std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
@ -367,5 +381,76 @@ QString RimElasticPropertiesCurve::findFormationNameForDepth( const std::vector<
//--------------------------------------------------------------------------------------------------
QString RimElasticPropertiesCurve::createCurveAutoName()
{
return caf::AppEnum<RimElasticPropertiesCurve::PropertyType>::uiText( m_propertyType() );
return caf::AppEnum<RiaDefines::CurveProperty>::uiText( m_curveProperty() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimElasticPropertiesCurve::addOverburden( std::vector<QString>& formationNames,
std::vector<double>& formationValues,
std::vector<double>& faciesValues,
std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
double overburdenHeight,
double defaultPoroValue,
const QString& formationName,
double faciesValue )
{
if ( !faciesValues.empty() )
{
// Prepend the new "fake" depth for start of overburden
double tvdTop = tvDepthValues[0];
tvDepthValues.insert( tvDepthValues.begin(), tvdTop );
tvDepthValues.insert( tvDepthValues.begin(), tvdTop - overburdenHeight );
// TODO: this is not always correct
double mdTop = measuredDepthValues[0];
measuredDepthValues.insert( measuredDepthValues.begin(), mdTop );
measuredDepthValues.insert( measuredDepthValues.begin(), mdTop - overburdenHeight );
formationNames.push_back( formationName );
formationValues.insert( formationValues.begin(), formationNames.size() - 1 );
formationValues.insert( formationValues.begin(), formationNames.size() - 1 );
faciesValues.insert( faciesValues.begin(), faciesValue );
faciesValues.insert( faciesValues.begin(), faciesValue );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimElasticPropertiesCurve::addUnderburden( std::vector<QString>& formationNames,
std::vector<double>& formationValues,
std::vector<double>& faciesValues,
std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
double underburdenHeight,
double defaultPoroValue,
const QString& formationName,
double faciesValue )
{
if ( !faciesValues.empty() )
{
size_t lastIndex = tvDepthValues.size() - 1;
double tvdBottom = tvDepthValues[lastIndex];
tvDepthValues.push_back( tvdBottom );
tvDepthValues.push_back( tvdBottom + underburdenHeight );
// TODO: this is not always correct
double mdBottom = measuredDepthValues[lastIndex];
measuredDepthValues.push_back( mdBottom );
measuredDepthValues.push_back( mdBottom + underburdenHeight );
formationNames.push_back( formationName );
formationValues.push_back( formationNames.size() - 1 );
formationValues.push_back( formationNames.size() - 1 );
faciesValues.push_back( faciesValue );
faciesValues.push_back( faciesValue );
}
}

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;
@ -67,10 +57,28 @@ protected:
void performDataExtraction( bool* isUsingPseudoLength ) override;
static QString findFaciesName( const RimColorLegend& colorLegend, double value );
static QString findFormationNameForDepth( const std::vector<QString>& formationNames,
const std::vector<std::pair<double, double>>& depthRanges,
double depth );
static double findFaciesValue( const RimColorLegend& colorLegend, const QString& name );
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<PropertyType>> m_propertyType;
static void addOverburden( std::vector<QString>& formationNames,
std::vector<double>& formationValues,
std::vector<double>& faciesValues,
std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
double overburdenHeight,
double defaultPoroValue,
const QString& formationName,
double faciesValue );
static void addUnderburden( std::vector<QString>& formationNames,
std::vector<double>& formationValues,
std::vector<double>& faciesValues,
std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
double overburdenHeight,
double defaultPoroValue,
const QString& formationName,
double faciesValue );
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();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -151,7 +170,33 @@ void RimFractureModelCurve::performDataExtraction( bool* isUsingPseudoLength )
}
else
{
std::cerr << "RESULT ACCESSOR IS NULL" << std::endl;
RiaLogging::error( QString( "No result found for %1" ).arg( m_eclipseResultDefinition()->resultVariable() ) );
}
double overburdenHeight = m_fractureModel->overburdenHeight();
if ( overburdenHeight > 0.0 )
{
double defaultOverburdenValue = std::numeric_limits<double>::infinity();
if ( m_missingValueStrategy() == RimFractureModelCurve::MissingValueStrategy::DEFAULT_VALUE )
{
defaultOverburdenValue =
m_fractureModel->getDefaultForMissingOverburdenValue( m_eclipseResultDefinition()->resultVariable() );
}
addOverburden( tvDepthValues, measuredDepthValues, values, overburdenHeight, defaultOverburdenValue );
}
double underburdenHeight = m_fractureModel->underburdenHeight();
if ( underburdenHeight > 0.0 )
{
double defaultUnderburdenValue = std::numeric_limits<double>::infinity();
if ( m_missingValueStrategy() == RimFractureModelCurve::MissingValueStrategy::DEFAULT_VALUE )
{
defaultUnderburdenValue =
m_fractureModel->getDefaultForMissingUnderburdenValue( m_eclipseResultDefinition()->resultVariable() );
}
addUnderburden( tvDepthValues, measuredDepthValues, values, underburdenHeight, defaultUnderburdenValue );
}
if ( hasMissingValues( values ) )
@ -319,3 +364,58 @@ cvf::ref<RigResultAccessor>
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::addOverburden( std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
std::vector<double>& values,
double overburdenHeight,
double defaultOverburdenValue )
{
if ( !values.empty() )
{
// Prepend the new "fake" depth for start of overburden
double tvdTop = tvDepthValues[0];
tvDepthValues.insert( tvDepthValues.begin(), tvdTop );
tvDepthValues.insert( tvDepthValues.begin(), tvdTop - overburdenHeight );
// TODO: this is not always correct
double mdTop = measuredDepthValues[0];
measuredDepthValues.insert( measuredDepthValues.begin(), mdTop );
measuredDepthValues.insert( measuredDepthValues.begin(), mdTop - overburdenHeight );
values.insert( values.begin(), defaultOverburdenValue );
values.insert( values.begin(), defaultOverburdenValue );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::addUnderburden( std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
std::vector<double>& values,
double underburdenHeight,
double defaultUnderburdenValue )
{
if ( !values.empty() )
{
size_t lastIndex = tvDepthValues.size() - 1;
// Append the new "fake" depth for start of underburden
double tvdBottom = tvDepthValues[lastIndex];
tvDepthValues.push_back( tvdBottom );
tvDepthValues.push_back( tvdBottom + underburdenHeight );
// Append the new "fake" md
// TODO: check if this is correct???
double mdBottom = measuredDepthValues[lastIndex];
measuredDepthValues.push_back( mdBottom );
measuredDepthValues.push_back( mdBottom + underburdenHeight );
values.push_back( defaultUnderburdenValue );
values.push_back( defaultUnderburdenValue );
}
}

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;
@ -69,6 +73,19 @@ protected:
int timeStepIndex,
RimEclipseResultDefinition* eclipseResultDefinition );
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
caf::PdmField<caf::AppEnum<MissingValueStrategy>> m_missingValueStrategy;
static void addOverburden( std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
std::vector<double>& values,
double overburdenHeight,
double defaultOverburdenValue );
static void addUnderburden( std::vector<double>& tvDepthValues,
std::vector<double>& measuredDepthValues,
std::vector<double>& values,
double underburdenHeight,
double defaultUnderburdenValue );
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,22 @@ 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();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::getFaciesValues( std::vector<double>& values ) const
{
RimWellLogExtractionCurve* curve = findCurveByProperty( RiaDefines::CurveProperty::FACIES );
if ( curve )
{
values = curve->curveData()->xValues();
}
}
@ -183,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 );
}
}
@ -223,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>();
}
@ -248,7 +256,7 @@ std::vector<double> RimFractureModelPlot::findCurveAndComputeLayeredAverage( con
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculatePorosity() const
{
return findCurveAndComputeLayeredAverage( "PORO" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::POROSITY );
}
//--------------------------------------------------------------------------------------------------
@ -256,7 +264,7 @@ std::vector<double> RimFractureModelPlot::calculatePorosity() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateReservoirPressure() const
{
return findCurveAndComputeLayeredAverage( "PRESSURE" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PRESSURE );
}
//--------------------------------------------------------------------------------------------------
@ -264,7 +272,7 @@ std::vector<double> RimFractureModelPlot::calculateReservoirPressure() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateHorizontalPermeability() const
{
return findCurveAndComputeLayeredAverage( "PERMX" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PERMEABILITY_X );
}
//--------------------------------------------------------------------------------------------------
@ -272,7 +280,7 @@ std::vector<double> RimFractureModelPlot::calculateHorizontalPermeability() cons
//--------------------------------------------------------------------------------------------------
std::vector<double> RimFractureModelPlot::calculateVerticalPermeability() const
{
return findCurveAndComputeLayeredAverage( "PERMZ" );
return findCurveAndComputeLayeredAverage( RiaDefines::CurveProperty::PERMEABILITY_Z );
}
//--------------------------------------------------------------------------------------------------
@ -286,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();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -302,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;
@ -431,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 )
{
@ -446,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 );
}
//--------------------------------------------------------------------------------------------------
@ -454,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 );
}
//--------------------------------------------------------------------------------------------------
@ -462,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 );
}
//--------------------------------------------------------------------------------------------------
@ -470,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 );
}
//--------------------------------------------------------------------------------------------------
@ -478,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,11 +34,32 @@ 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 );
void getPorosityValues( std::vector<double>& values ) const;
void getFaciesValues( std::vector<double>& values ) const;
std::vector<double> calculateTrueVerticalDepth() const;
std::vector<double> calculatePorosity() const;
@ -53,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

@ -0,0 +1,190 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
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_curveProperty, "CurveProperty", "Curve Property", "", "", "" );
m_curveProperty.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelStressCurve::~RimFractureModelStressCurve()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelStressCurve::setCurveProperty( RiaDefines::CurveProperty curveProperty )
{
m_curveProperty = curveProperty;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::CurveProperty RimFractureModelStressCurve::curveProperty() const
{
return m_curveProperty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
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_curveProperty() == RiaDefines::CurveProperty::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<RiaDefines::CurveProperty>::uiText( m_curveProperty() );
}

View File

@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimFractureModelPropertyCurve.h"
#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, public RimFractureModelPropertyCurve
{
CAF_PDM_HEADER_INIT;
public:
enum class PropertyType
{
STRESS,
STRESS_GRADIENT
};
RimFractureModelStressCurve();
~RimFractureModelStressCurve() override;
void setFractureModel( RimFractureModel* fractureModel );
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<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;
// }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -126,9 +113,7 @@ void RimLayerCurve::performDataExtraction( bool* isUsingPseudoLength )
m_fractureModel->thicknessDirectionWellPath()->wellPathGeometry(),
"fracture model" );
measuredDepthValues = eclExtractor.cellIntersectionMDs();
tvDepthValues = eclExtractor.cellIntersectionTVDs();
rkbDiff = eclExtractor.wellPathData()->rkbDiff();
rkbDiff = eclExtractor.wellPathData()->rkbDiff();
// Extract formation data
cvf::ref<RigResultAccessor> formationResultAccessor = RigResultAccessorFactory::
@ -147,53 +132,52 @@ void RimLayerCurve::performDataExtraction( bool* isUsingPseudoLength )
CurveSamplingPointData curveData =
RimWellLogTrack::curveSamplingPointData( &eclExtractor, formationResultAccessor.p() );
std::vector<std::pair<double, double>> yValues;
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( eclipseCase );
std::vector<QString> formationNamesToPlot;
RimWellLogTrack::findRegionNamesToPlot( curveData,
formationNamesVector,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
&formationNamesToPlot,
&yValues );
double overburdenHeight = m_fractureModel->overburdenHeight();
if ( overburdenHeight > 0.0 )
{
RimWellLogTrack::addOverburden( formationNamesVector, curveData, overburdenHeight );
}
double underburdenHeight = m_fractureModel->underburdenHeight();
if ( underburdenHeight > 0.0 )
{
RimWellLogTrack::addUnderburden( formationNamesVector, curveData, underburdenHeight );
}
measuredDepthValues = curveData.md;
tvDepthValues = curveData.tvd;
// Extract facies data
m_eclipseResultDefinition->setResultVariable( "OPERNUM_1" );
m_eclipseResultDefinition->setResultType( RiaDefines::ResultCatType::INPUT_PROPERTY );
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
m_eclipseResultDefinition->loadResult();
cvf::ref<RigResultAccessor> faciesResultAccessor =
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(),
0,
m_timeStep,
m_eclipseResultDefinition );
if ( !faciesResultAccessor.notNull() )
RimFractureModelPlot* fractureModelPlot;
firstAncestorOrThisOfType( fractureModelPlot );
if ( !fractureModelPlot )
{
RiaLogging::error( QString( "No facies result found." ) );
RiaLogging::error( QString( "No facies data found for layer curve." ) );
return;
}
std::vector<double> faciesValues;
eclExtractor.curveData( faciesResultAccessor.p(), &faciesValues );
fractureModelPlot->getFaciesValues( faciesValues );
assert( faciesValues.size() == curveData.data.size() );
values.resize( faciesValues.size() );
int layerNo = 0;
QString previousFormationName = "";
double previousFacies = -1.0;
int layerNo = 0;
double previousFormation = -1.0;
double previousFacies = -1.0;
for ( size_t i = 0; i < faciesValues.size(); i++ )
{
QString formationName = findFormationNameForDepth( formationNamesToPlot, yValues, tvDepthValues[i] );
if ( previousFormationName != formationName || previousFacies != faciesValues[i] )
if ( previousFormation != curveData.data[i] || previousFacies != faciesValues[i] )
{
layerNo++;
}
values[i] = layerNo;
previousFormationName = formationName;
previousFacies = faciesValues[i];
values[i] = layerNo;
previousFormation = curveData.data[i];
previousFacies = faciesValues[i];
}
RiaEclipseUnitTools::UnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
@ -231,40 +215,6 @@ void RimLayerCurve::performDataExtraction( bool* isUsingPseudoLength )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
// QString RimLayerCurve::findFaciesName( const RimColorLegend& colorLegend, double value )
// {
// for ( auto item : colorLegend.colorLegendItems() )
// {
// if ( item->categoryValue() == static_cast<int>( value ) ) return item->categoryName();
// }
// return "not found";
// }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimLayerCurve::findFormationNameForDepth( const std::vector<QString>& formationNames,
const std::vector<std::pair<double, double>>& depthRanges,
double depth )
{
// assert(formationNames.size() == depthRanges.size());
for ( size_t i = 0; i < formationNames.size(); i++ )
{
double high = depthRanges[i].second;
double low = depthRanges[i].first;
if ( depth >= low && depth <= high )
{
return formationNames[i];
}
}
return "not found";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -272,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;
};

View File

@ -259,6 +259,11 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes", "", "", "" );
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 0.0, "Overburden Height", "", "", "" );
m_overburdenHeight.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 0.0, "Underburden Height", "", "", "" );
m_underburdenHeight.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_resultDefinition, "ResultDefinition", "Result Definition", "", "", "" );
m_resultDefinition.uiCapability()->setUiHidden( true );
m_resultDefinition.uiCapability()->setUiTreeChildrenHidden( true );
@ -2393,11 +2398,11 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
extractor = geoMechWellLogExtractor;
}
// Attach water and rock base formations
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
if ( geoMechWellLogExtractor )
{
// Attach water and rock base formations
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors();
const std::vector<std::pair<double, double>> waterAndRockIntervals =
waterAndRockRegions( plot->depthType(), extractor );
@ -2419,9 +2424,20 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
m_formationCase == nullptr )
return;
std::vector<std::pair<double, double>> yValues;
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( m_formationCase );
if ( m_overburdenHeight > 0.0 )
{
addOverburden( formationNamesVector, curveData, m_overburdenHeight );
}
if ( m_underburdenHeight > 0.0 )
{
addUnderburden( formationNamesVector, curveData, m_underburdenHeight );
}
std::vector<std::pair<double, double>> yValues;
std::vector<QString> formationNamesToPlot;
RimWellLogTrack::findRegionNamesToPlot( curveData,
formationNamesVector,
@ -2429,6 +2445,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
&formationNamesToPlot,
&yValues );
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
m_annotationTool->attachNamedRegions( m_plotWidget,
formationNamesToPlot,
@ -2492,6 +2510,16 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
namesVector.push_back( legendItem->categoryName() );
}
if ( m_overburdenHeight > 0.0 )
{
addOverburden( namesVector, curveData, m_overburdenHeight );
}
if ( m_underburdenHeight > 0.0 )
{
addUnderburden( namesVector, curveData, m_underburdenHeight );
}
std::vector<QString> namesToPlot;
std::vector<std::pair<double, double>> yValues;
RimWellLogTrack::findRegionNamesToPlot( curveData, namesVector, plot->depthType(), &namesToPlot, &yValues );
@ -2767,3 +2795,69 @@ void RimWellLogTrack::onChildDeleted( caf::PdmChildArrayFieldHandle* childA
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateWellLogPlotToolBar();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setOverburdenHeight( double overburdenHeight )
{
m_overburdenHeight = overburdenHeight;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setUnderburdenHeight( double underburdenHeight )
{
m_underburdenHeight = underburdenHeight;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::addOverburden( std::vector<QString>& namesVector, CurveSamplingPointData& curveData, double height )
{
if ( !curveData.data.empty() )
{
namesVector.push_back( "Overburden" );
// Prepend the new "fake" depth for start of overburden
double tvdTop = curveData.tvd[0];
curveData.tvd.insert( curveData.tvd.begin(), tvdTop );
curveData.tvd.insert( curveData.tvd.begin(), tvdTop - height );
// TODO: this is not always correct
double mdTop = curveData.md[0];
curveData.md.insert( curveData.md.begin(), mdTop );
curveData.md.insert( curveData.md.begin(), mdTop - height );
curveData.data.insert( curveData.data.begin(), namesVector.size() - 1 );
curveData.data.insert( curveData.data.begin(), namesVector.size() - 1 );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::addUnderburden( std::vector<QString>& namesVector, CurveSamplingPointData& curveData, double height )
{
if ( !curveData.data.empty() )
{
namesVector.push_back( "Underburden" );
size_t lastIndex = curveData.tvd.size() - 1;
// Append the new "fake" depth for start of underburden
double tvdBottom = curveData.tvd[lastIndex];
curveData.tvd.push_back( tvdBottom );
curveData.tvd.push_back( tvdBottom + height );
// TODO: this is not always correct
double mdBottom = curveData.md[lastIndex];
curveData.md.push_back( mdBottom );
curveData.md.push_back( mdBottom + height );
curveData.data.push_back( namesVector.size() - 1 );
curveData.data.push_back( namesVector.size() - 1 );
}
}

View File

@ -182,6 +182,9 @@ public:
void setShowBothSidesOfWell( bool on );
void setWellPathAttributesSource( RimWellPath* wellPath );
void setOverburdenHeight( double overburdenHeight );
void setUnderburdenHeight( double underburdenHeight );
RimWellPath* wellPathAttributeSource() const;
caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const override;
@ -222,6 +225,9 @@ public:
static std::vector<QString> formationNamesVector( RimCase* rimCase );
static void addOverburden( std::vector<QString>& namesVector, CurveSamplingPointData& curveData, double height );
static void addUnderburden( std::vector<QString>& namesVector, CurveSamplingPointData& curveData, double height );
protected:
// RimViewWindow overrides
void deleteViewWidget() override;
@ -331,6 +337,8 @@ private:
caf::PdmPtrField<RimWellPath*> m_wellPathComponentSource;
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection;
caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;
caf::PdmField<double> m_overburdenHeight;
caf::PdmField<double> m_underburdenHeight;
caf::PdmField<bool> m_showFormations_OBSOLETE;
caf::PdmField<bool> m_show_OBSOLETE;