From c349047a9115c2f750dc5dfe661de7ceb79b4ca5 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 29 May 2020 14:54:47 +0200 Subject: [PATCH] #6007 Add plot track and interpolation for facies properties. --- .../RicNewFractureModelPlotFeature.cpp | 68 ++++ .../RicNewFractureModelPlotFeature.h | 8 + .../ProjectDataModel/CMakeLists_files.cmake | 2 + .../ProjectDataModel/RimFaciesProperties.cpp | 18 +- .../ProjectDataModel/RimFaciesProperties.h | 4 +- .../RimFaciesPropertiesCurve.cpp | 351 ++++++++++++++++++ .../RimFaciesPropertiesCurve.h | 72 ++++ .../ProjectDataModel/RimWellLogTrack.h | 26 +- .../RigFaciesProperties.cpp | 10 +- 9 files changed, 540 insertions(+), 19 deletions(-) create mode 100644 ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.cpp create mode 100644 ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.h diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.cpp index 1b56174a4a..d0110e91f9 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.cpp @@ -29,6 +29,7 @@ #include "RimEclipseCase.h" #include "RimEclipseView.h" +#include "RimFaciesPropertiesCurve.h" #include "RimFractureModel.h" #include "RimFractureModelCurve.h" #include "RimFractureModelPlot.h" @@ -90,6 +91,21 @@ RimFractureModelPlot* } } + { + auto task = progInfo.task( "Creating facies properties track", 15 ); + + std::vector results = + { RimFaciesPropertiesCurve::PropertyType::YOUNGS_MODULUS, + RimFaciesPropertiesCurve::PropertyType::POISSONS_RATIO, + RimFaciesPropertiesCurve::PropertyType::K_IC, + RimFaciesPropertiesCurve::PropertyType::PROPPANT_EMBEDMENT }; + + for ( auto result : results ) + { + createFaciesPropertiesTrack( plot, fractureModel, eclipseCase, timeStep, result ); + } + } + { auto task = progInfo.task( "Updating all tracks", 5 ); @@ -264,6 +280,58 @@ void RicNewFractureModelPlotFeature::createParametersTrack( RimFractureModelPlot RiuPlotMainWindowTools::showPlotMainWindow(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewFractureModelPlotFeature::createFaciesPropertiesTrack( RimFractureModelPlot* plot, + RimFractureModel* fractureModel, + RimEclipseCase* eclipseCase, + int timeStep, + RimFaciesPropertiesCurve::PropertyType propertyType ) +{ + QString trackName = caf::AppEnum::uiText( propertyType ); + RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, trackName, plot ); + plotTrack->setFormationWellPath( fractureModel->thicknessDirectionWellPath() ); + plotTrack->setColSpan( RimPlot::TWO ); + plotTrack->setVisibleXRange( 0.0, 2.0 ); + plotTrack->setAutoScaleXEnabled( true ); + plotTrack->setTickIntervals( 1.0, 0.2 ); + plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); + plotTrack->setShowRegionLabels( true ); + plotTrack->setShowWindow( true ); + + caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors(); + std::vector lineStyles = { RiuQwtPlotCurve::STYLE_SOLID, + RiuQwtPlotCurve::STYLE_DASH, + RiuQwtPlotCurve::STYLE_DASH_DOT }; + + RimFaciesPropertiesCurve* curve = new RimFaciesPropertiesCurve; + curve->setPropertyType( propertyType ); + curve->setFractureModel( fractureModel ); + curve->setCase( eclipseCase ); + // curve->setEclipseResultVariable( resultVariable ); + // curve->setEclipseResultCategory( resultCategoryType ); + curve->setColor( colors.cycledColor3f( 0 ) ); + curve->setLineStyle( lineStyles[0] ); + 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(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.h b/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.h index 56589da70a..da351f0959 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.h +++ b/ApplicationCode/Commands/CompletionCommands/RicNewFractureModelPlotFeature.h @@ -22,6 +22,8 @@ #include "RiaDefines.h" +#include "RimFaciesPropertiesCurve.h" + class RimEclipseCase; class RimFractureModelPlot; class RimFractureModelPlotCollection; @@ -55,6 +57,12 @@ private: const QString& resultVariable, RiaDefines::ResultCatType resultCategoryType ); + static void createFaciesPropertiesTrack( RimFractureModelPlot* plot, + RimFractureModel* fractureModel, + RimEclipseCase* eclipseCase, + int timeStep, + RimFaciesPropertiesCurve::PropertyType propertyType ); + static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription ); static RimFractureModelPlotCollection* fractureModelPlotCollection(); diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index be73b151c4..bc3676ffd1 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -159,6 +159,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h +${CMAKE_CURRENT_LIST_DIR}/RimFaciesPropertiesCurve.h ) @@ -322,6 +323,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp +${CMAKE_CURRENT_LIST_DIR}/RimFaciesPropertiesCurve.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ProjectDataModel/RimFaciesProperties.cpp b/ApplicationCode/ProjectDataModel/RimFaciesProperties.cpp index 8fcff8dab8..a5b031d3cf 100644 --- a/ApplicationCode/ProjectDataModel/RimFaciesProperties.cpp +++ b/ApplicationCode/ProjectDataModel/RimFaciesProperties.cpp @@ -72,6 +72,23 @@ void RimFaciesProperties::setPropertiesForFacies( FaciesKey& key, const RigFacie m_propertiesTable = generatePropertiesTable(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimFaciesProperties::hasPropertiesForFacies( FaciesKey& key ) const +{ + return m_properties.find( key ) != m_properties.end(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigFaciesProperties& RimFaciesProperties::propertiesForFacies( FaciesKey& key ) const +{ + assert( hasPropertiesForFacies( key ) ); + return m_properties.find( key )->second; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -95,7 +112,6 @@ void RimFaciesProperties::defineEditorAttribute( const caf::PdmFieldHandle* fiel //-------------------------------------------------------------------------------------------------- QString RimFaciesProperties::generatePropertiesTable() { - QString header( "" " " " " diff --git a/ApplicationCode/ProjectDataModel/RimFaciesProperties.h b/ApplicationCode/ProjectDataModel/RimFaciesProperties.h index 3ecb51612b..d0a5f43cfa 100644 --- a/ApplicationCode/ProjectDataModel/RimFaciesProperties.h +++ b/ApplicationCode/ProjectDataModel/RimFaciesProperties.h @@ -44,7 +44,9 @@ public: QString filePath() const; void setFilePath( const QString& filePath ); - void setPropertiesForFacies( FaciesKey& key, const RigFaciesProperties& properties ); + void setPropertiesForFacies( FaciesKey& key, const RigFaciesProperties& properties ); + bool hasPropertiesForFacies( FaciesKey& key ) const; + const RigFaciesProperties& propertiesForFacies( FaciesKey& key ) const; protected: void defineEditorAttribute( const caf::PdmFieldHandle* field, diff --git a/ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.cpp b/ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.cpp new file mode 100644 index 0000000000..fb6471c13c --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.cpp @@ -0,0 +1,351 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFaciesPropertiesCurve.h" + +#include "RigEclipseCaseData.h" +#include "RigEclipseWellLogExtractor.h" +#include "RigFaciesProperties.h" +#include "RigResultAccessorFactory.h" +#include "RigWellLogCurveData.h" +#include "RigWellPath.h" + +#include "RimCase.h" +#include "RimColorLegend.h" +#include "RimColorLegendCollection.h" +#include "RimColorLegendItem.h" +#include "RimEclipseCase.h" +#include "RimEclipseResultDefinition.h" +#include "RimFaciesProperties.h" +#include "RimFractureModel.h" +#include "RimFractureModelPlot.h" +#include "RimModeledWellPath.h" +#include "RimProject.h" +#include "RimTools.h" +#include "RimWellLogFile.h" +#include "RimWellLogPlot.h" +#include "RimWellLogTrack.h" +#include "RimWellPath.h" +#include "RimWellPathCollection.h" +#include "RimWellPlotTools.h" + +#include "RiuQwtPlotCurve.h" +#include "RiuQwtPlotWidget.h" + +#include "RiaApplication.h" +#include "RiaPreferences.h" + +#include "cafPdmUiTreeOrdering.h" + +#include +#include + +CAF_PDM_SOURCE_INIT( RimFaciesPropertiesCurve, "FaciesPropertiesCurve" ); + +namespace caf +{ +template <> +void AppEnum::setUp() +{ + addItem( RimFaciesPropertiesCurve::PropertyType::YOUNGS_MODULUS, "YOUNGS_MODULUS", "Young's Modulus" ); + addItem( RimFaciesPropertiesCurve::PropertyType::POISSONS_RATIO, "POISSONS_RATIO", "Poisson's Ratio" ); + addItem( RimFaciesPropertiesCurve::PropertyType::K_IC, "K_IC", "K-Ic" ); + addItem( RimFaciesPropertiesCurve::PropertyType::PROPPANT_EMBEDMENT, "PROPPANT_EMBEDMENT", "Proppant Embedment" ); + setDefault( RimFaciesPropertiesCurve::PropertyType::YOUNGS_MODULUS ); +} +}; // namespace caf + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFaciesPropertiesCurve::RimFaciesPropertiesCurve() +{ + CAF_PDM_InitObject( "Fracture Model Curve", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" ); + m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true ); + m_fractureModel.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_propertyType, "PropertyType", "Property Type", "", "", "" ); + + m_wellPath = nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFaciesPropertiesCurve::~RimFaciesPropertiesCurve() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFaciesPropertiesCurve::setFractureModel( RimFractureModel* fractureModel ) +{ + m_fractureModel = fractureModel; + m_wellPath = fractureModel->thicknessDirectionWellPath(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFaciesPropertiesCurve::setEclipseResultCategory( RiaDefines::ResultCatType catType ) +{ + m_eclipseResultDefinition->setResultType( catType ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFaciesPropertiesCurve::setPropertyType( PropertyType propertyType ) +{ + m_propertyType = propertyType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFaciesPropertiesCurve::performDataExtraction( bool* isUsingPseudoLength ) +{ + std::vector values; + std::vector measuredDepthValues; + std::vector tvDepthValues; + double rkbDiff = 0.0; + + RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_METER; + QString xUnits = RiaWellLogUnitTools::noUnitString(); + + *isUsingPseudoLength = false; + + RimEclipseCase* eclipseCase = dynamic_cast( m_case.value() ); + if ( eclipseCase ) + { + RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), + m_fractureModel->thicknessDirectionWellPath()->wellPathGeometry(), + "fracture model" ); + + measuredDepthValues = eclExtractor.cellIntersectionMDs(); + tvDepthValues = eclExtractor.cellIntersectionTVDs(); + rkbDiff = eclExtractor.wellPathData()->rkbDiff(); + + // Extract formation data + cvf::ref formationResultAccessor = RigResultAccessorFactory:: + createFromResultAddress( eclipseCase->eclipseCaseData(), + 0, + RiaDefines::PorosityModelType::MATRIX_MODEL, + 0, + RigEclipseResultAddress( RiaDefines::ResultCatType::FORMATION_NAMES, + RiaDefines::activeFormationNamesResultName() ) ); + if ( !formationResultAccessor.notNull() ) + { + std::cerr << "NO FORMATION RES ACCEESOR" << std::endl; + return; + } + + // std::vector formationValues; + // eclExtractor.curveData( formationResultAccessor.p(), &formationValues ); + + CurveSamplingPointData curveData = + RimWellLogTrack::curveSamplingPointData( &eclExtractor, formationResultAccessor.p() ); + + std::vector> yValues; + std::vector formationNamesVector = RimWellLogTrack::formationNamesVector( eclipseCase ); + + std::vector 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 ); + m_eclipseResultDefinition->setEclipseCase( eclipseCase ); + m_eclipseResultDefinition->loadResult(); + + cvf::ref faciesResultAccessor = + RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(), + 0, + m_timeStep, + m_eclipseResultDefinition ); + + if ( !faciesResultAccessor.notNull() ) + { + std::cerr << "NO FACIES RES ACCESSOR" << std::endl; + return; + } + + std::vector faciesValues; + eclExtractor.curveData( faciesResultAccessor.p(), &faciesValues ); + + // Extract porosity data + // m_eclipseResultDefinition->setResultType(); + cvf::ref poroResAcc = + RigResultAccessorFactory::createFromResultAddress( eclipseCase->eclipseCaseData(), + 0, + RiaDefines::PorosityModelType::MATRIX_MODEL, + 0, + RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, + "PORO" ) ); + if ( !poroResAcc.notNull() ) + { + std::cerr << "NO PORO RES ACCESSOR" << std::endl; + return; + } + + std::vector poroValues; + eclExtractor.curveData( poroResAcc.p(), &poroValues ); + + std::cout << "Dims: FOrmation names to plot: " << formationNamesToPlot.size() << " Y: " << yValues.size() + << " FACIES: " << faciesValues.size() << " PORO: " << poroValues.size() << std::endl; + + for ( size_t i = 0; i < yValues.size(); i++ ) + { + std::cout << i << ": " << yValues[i].first << "-" << yValues[i].second << " ==> " + << formationNamesToPlot[i].toStdString() << std::endl; + } + + // TODO: make this settable?? + RimColorLegend* colorLegend = RimProject::current()->colorLegendCollection()->findByName( "Facies colors" ); + if ( !colorLegend ) + { + std::cerr << "NO COLOR LEGEND" << std::endl; + return; + } + + RimFaciesProperties* faciesProperties = m_fractureModel->faciesProperties(); + if ( !faciesProperties ) + { + std::cerr << "No facies properties" << std::endl; + return; + } + + 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] ); + double porosity = poroValues[i]; + + // std::cout << i << ": Depth: " << tvDepthValues[i] << " Poro: " << poroValues[i] + // << " Facies: " << faciesValues[i] << " name: " << faciesName.toStdString() + // << " formation: " << formationName.toStdString(); + + FaciesKey faciesKey = std::make_tuple( fieldName, formationName, faciesName ); + if ( faciesProperties->hasPropertiesForFacies( faciesKey ) ) + { + const RigFaciesProperties& rigFaciesProperties = faciesProperties->propertiesForFacies( faciesKey ); + + if ( m_propertyType() == PropertyType::YOUNGS_MODULUS ) + { + double val = rigFaciesProperties.getYoungsModulus( porosity ); + values.push_back( val ); + } + else if ( m_propertyType() == PropertyType::POISSONS_RATIO ) + { + double val = rigFaciesProperties.getPoissonsRatio( porosity ); + values.push_back( val ); + } + else if ( m_propertyType() == PropertyType::K_IC ) + { + double val = rigFaciesProperties.getK_Ic( porosity ); + values.push_back( val ); + } + else if ( m_propertyType() == PropertyType::PROPPANT_EMBEDMENT ) + { + double val = rigFaciesProperties.getProppantEmbedment( porosity ); + values.push_back( val ); + } + } + else + { + std::cerr << " Missing key" << std::endl; + return; + } + } + + 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 RimFaciesPropertiesCurve::findFaciesName( const RimColorLegend& colorLegend, double value ) +{ + for ( auto item : colorLegend.colorLegendItems() ) + { + if ( item->categoryValue() == static_cast( value ) ) return item->categoryName(); + } + + return "not found"; +} + +QString RimFaciesPropertiesCurve::findFormationNameForDepth( const std::vector& formationNames, + const std::vector>& 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"; +} + +QString RimFaciesPropertiesCurve::createCurveAutoName() +{ + return caf::AppEnum::uiText( m_propertyType() ); +} diff --git a/ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.h b/ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.h new file mode 100644 index 0000000000..c53cff827d --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFaciesPropertiesCurve.h @@ -0,0 +1,72 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimWellLogExtractionCurve.h" + +#include "RiuQwtSymbol.h" + +#include "cafPdmField.h" +#include "cafPdmPtrField.h" + +#include + +class RimWellPath; +class RimWellMeasurement; +class RimFractureModel; +class RimColorLegend; + +//================================================================================================== +/// +//================================================================================================== +class RimFaciesPropertiesCurve : public RimWellLogExtractionCurve +{ + CAF_PDM_HEADER_INIT; + +public: + enum class PropertyType + { + YOUNGS_MODULUS, + POISSONS_RATIO, + K_IC, + PROPPANT_EMBEDMENT + }; + + RimFaciesPropertiesCurve(); + ~RimFaciesPropertiesCurve() override; + + void setFractureModel( RimFractureModel* fractureModel ); + + void setEclipseResultCategory( RiaDefines::ResultCatType catType ); + + void setPropertyType( PropertyType propertyType ); + +protected: + QString createCurveAutoName() override; + + void performDataExtraction( bool* isUsingPseudoLength ) override; + + static QString findFaciesName( const RimColorLegend& colorLegend, double value ); + static QString findFormationNameForDepth( const std::vector& formationNames, + const std::vector>& depthRanges, + double depth ); + + caf::PdmPtrField m_fractureModel; + caf::PdmField> m_propertyType; +}; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h index 5fb48b5c81..b0bf38720f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h @@ -208,6 +208,19 @@ public: void updateAxes() override; + static CurveSamplingPointData curveSamplingPointData( RigEclipseWellLogExtractor* extractor, + RigResultAccessor* resultAccessor ); + static CurveSamplingPointData curveSamplingPointData( RigGeoMechWellLogExtractor* extractor, + const RigFemResultAddress& resultAddress ); + + static void findRegionNamesToPlot( const CurveSamplingPointData& curveData, + const std::vector& formationNamesVector, + RimWellLogPlot::DepthTypeEnum depthType, + std::vector* formationNamesToPlot, + std::vector>* yValues ); + + static std::vector formationNamesVector( RimCase* rimCase ); + protected: // RimViewWindow overrides void deleteViewWidget() override; @@ -251,19 +264,6 @@ private: int branchIndex, bool useBranchDetection ); - static CurveSamplingPointData curveSamplingPointData( RigEclipseWellLogExtractor* extractor, - RigResultAccessor* resultAccessor ); - static CurveSamplingPointData curveSamplingPointData( RigGeoMechWellLogExtractor* extractor, - const RigFemResultAddress& resultAddress ); - - static void findRegionNamesToPlot( const CurveSamplingPointData& curveData, - const std::vector& formationNamesVector, - RimWellLogPlot::DepthTypeEnum depthType, - std::vector* formationNamesToPlot, - std::vector>* yValues ); - - static std::vector formationNamesVector( RimCase* rimCase ); - void setFormationFieldsUiReadOnly( bool readOnly = true ); void updateRegionAnnotationsOnPlot(); diff --git a/ApplicationCode/ReservoirDataModel/RigFaciesProperties.cpp b/ApplicationCode/ReservoirDataModel/RigFaciesProperties.cpp index 88cfbf504d..f0f80f9eef 100644 --- a/ApplicationCode/ReservoirDataModel/RigFaciesProperties.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFaciesProperties.cpp @@ -18,6 +18,8 @@ #include "RigFaciesProperties.h" +#include "RiaInterpolationTools.h" + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -113,7 +115,7 @@ void RigFaciesProperties::appendValues( double porosity, //-------------------------------------------------------------------------------------------------- double RigFaciesProperties::getYoungsModulus( double porosity ) const { - return -1.0; + return RiaInterpolationTools::linear( m_porosity, m_youngsModulus, porosity ); } //-------------------------------------------------------------------------------------------------- @@ -121,7 +123,7 @@ double RigFaciesProperties::getYoungsModulus( double porosity ) const //-------------------------------------------------------------------------------------------------- double RigFaciesProperties::getPoissonsRatio( double porosity ) const { - return -1.0; + return RiaInterpolationTools::linear( m_porosity, m_poissonsRatio, porosity ); } //-------------------------------------------------------------------------------------------------- @@ -129,7 +131,7 @@ double RigFaciesProperties::getPoissonsRatio( double porosity ) const //-------------------------------------------------------------------------------------------------- double RigFaciesProperties::getK_Ic( double porosity ) const { - return -1.0; + return RiaInterpolationTools::linear( m_porosity, m_K_Ic, porosity ); } //-------------------------------------------------------------------------------------------------- @@ -137,5 +139,5 @@ double RigFaciesProperties::getK_Ic( double porosity ) const //-------------------------------------------------------------------------------------------------- double RigFaciesProperties::getProppantEmbedment( double porosity ) const { - return -1.0; + return RiaInterpolationTools::linear( m_porosity, m_proppantEmbedment, porosity ); }