From 10f749f356bfd4aaaff04232330f966d1f0e7145 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 8 Jan 2020 10:31:01 +0100 Subject: [PATCH] #5219 Implement support for TVDRKB for well log depth * Also show air gap in title when TVDRKB is selected and not otherwise --- ApplicationCode/Application/RiaDefines.cpp | 1 + ApplicationCode/Application/RiaDefines.h | 3 +- .../RicNewWellBoreStabilityPlotFeature.cpp | 2 +- .../Flow/RimWellFlowRateCurve.cpp | 4 +- .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 2 +- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 2 +- .../GridCrossPlots/RimGridCrossPlot.cpp | 2 +- .../Rim3dWellLogExtractionCurve.cpp | 1 - .../ProjectDataModel/RimMultiPlotWindow.cpp | 6 +-- .../ProjectDataModel/RimMultiPlotWindow.h | 2 +- .../ProjectDataModel/RimPlotWindow.cpp | 2 +- .../ProjectDataModel/RimPlotWindow.h | 2 +- .../RimWellBoreStabilityPlot.cpp | 17 ++++--- .../ProjectDataModel/RimWellLogCurve.cpp | 23 ++++++---- .../ProjectDataModel/RimWellLogCurve.h | 13 ++++-- .../RimWellLogExtractionCurve.cpp | 27 +++++------ .../RimWellLogExtractionCurve.h | 1 - .../ProjectDataModel/RimWellLogFileCurve.cpp | 46 +++++++++---------- .../ProjectDataModel/RimWellLogPlot.cpp | 37 +++++++++------ .../ProjectDataModel/RimWellLogPlot.h | 2 - .../RimWellLogPlotNameConfig.cpp | 10 ++-- .../ProjectDataModel/RimWellLogRftCurve.cpp | 20 ++++++-- .../ProjectDataModel/RimWellLogTrack.cpp | 35 +++++++++++--- .../ProjectDataModel/RimWellLogTrack.h | 2 + .../RimWellMeasurementCurve.cpp | 38 ++++++++------- .../RigGeoMechWellLogExtractor.cpp | 12 +---- .../RigGeoMechWellLogExtractor.h | 2 - .../ReservoirDataModel/RigLasFileExporter.cpp | 6 ++- .../RigWellLogCurveData.cpp | 38 +++++++++++---- .../ReservoirDataModel/RigWellLogCurveData.h | 3 ++ .../RigWellLogExtractor.cpp | 2 +- .../ReservoirDataModel/RigWellLogExtractor.h | 2 +- .../RiuWellPathComponentPlotItem.cpp | 7 ++- 33 files changed, 218 insertions(+), 154 deletions(-) diff --git a/ApplicationCode/Application/RiaDefines.cpp b/ApplicationCode/Application/RiaDefines.cpp index 82693095cf..2d15f8ab84 100644 --- a/ApplicationCode/Application/RiaDefines.cpp +++ b/ApplicationCode/Application/RiaDefines.cpp @@ -56,6 +56,7 @@ void caf::AppEnum::setUp() addItem( RiaDefines::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth (MSL)" ); addItem( RiaDefines::PSEUDO_LENGTH, "PSEUDO_LENGTH", "Pseudo Length" ); addItem( RiaDefines::CONNECTION_NUMBER, "CONNECTION_NUMBER", "Connection Number" ); + addItem( RiaDefines::TRUE_VERTICAL_DEPTH_RKB, "TRUE_VERTICAL_DEPTH_RKB", "True Vertical Depth (RKB)" ); setDefault( RiaDefines::MEASURED_DEPTH ); } diff --git a/ApplicationCode/Application/RiaDefines.h b/ApplicationCode/Application/RiaDefines.h index b51fd6d787..8dd8bd432c 100644 --- a/ApplicationCode/Application/RiaDefines.h +++ b/ApplicationCode/Application/RiaDefines.h @@ -146,7 +146,8 @@ enum DepthTypeEnum MEASURED_DEPTH, TRUE_VERTICAL_DEPTH, PSEUDO_LENGTH, - CONNECTION_NUMBER + CONNECTION_NUMBER, + TRUE_VERTICAL_DEPTH_RKB }; // Defines relate to plotting diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp index 92ccd3ef22..fa9fec2328 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp @@ -101,7 +101,7 @@ RimWellBoreStabilityPlot* { auto task = progInfo.task( "Updating all tracks", 5 ); - plot->enableAllAutoNameTags( true ); + plot->nameConfig()->setAutoNameTags( true, true, true, false, true ); plot->setMultiPlotTitleVisible( true ); plot->setLegendsVisible( true ); plot->setLegendsHorizontal( true ); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp index 267a73f97c..aa1795173c 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp @@ -290,7 +290,7 @@ void RimWellFlowRateCurve::updateStackedPlotData() } RigWellLogCurveData tempCurveData; - tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, displayUnit, false ); + tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, 0.0, displayUnit, false ); depthValues = tempCurveData.depthPlotValues( depthType, displayUnit ); stackedValues = tempCurveData.xPlotValues(); @@ -340,7 +340,7 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString& const std::vector& depthValues, const std::vector& flowRates ) { - this->setValuesAndDepths( flowRates, depthValues, depthType, RiaDefines::UNIT_NONE, false ); + this->setValuesAndDepths( flowRates, depthValues, depthType, 0.0, RiaDefines::UNIT_NONE, false ); m_curveAutoName = curveName; } diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index ee520b0c34..7d4b9f959a 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -1006,7 +1006,7 @@ void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" ); plotLayoutGroup->setCollapsedByDefault( true ); RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *plotLayoutGroup ); - RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *plotLayoutGroup ); + RimWellLogPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup ); } } diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index c63b179ec0..1e89572f5c 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -979,7 +979,7 @@ void RimWellRftPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" ); plotLayoutGroup->setCollapsedByDefault( true ); RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *plotLayoutGroup ); - RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *plotLayoutGroup ); + RimWellLogPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup ); } } diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index a7a4604534..3d1607e4a5 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -499,7 +499,7 @@ void RimGridCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin if ( isMdiWindow() ) { - RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, *generalGroup ); + RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *generalGroup ); } else { diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp index f37d232720..7865b73547 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp @@ -227,7 +227,6 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vectorloadResult(); - geomExtractor->setRkbDiff( rkbDiff() ); geomExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStep, values ); } } diff --git a/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.cpp b/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.cpp index 47fbad9239..52fc149dee 100644 --- a/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.cpp +++ b/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.cpp @@ -555,18 +555,18 @@ void RimMultiPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFie void RimMultiPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" ); - uiOrderingForPlotLayout( uiConfigName, *titleAndLegendsGroup ); + uiOrderingForMultiPlotLayout( uiConfigName, *titleAndLegendsGroup ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimMultiPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +void RimMultiPlotWindow::uiOrderingForMultiPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { uiOrdering.add( &m_showPlotWindowTitle ); uiOrdering.add( &m_plotWindowTitle ); uiOrdering.add( &m_showIndividualPlotTitles ); - RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, uiOrdering ); + RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, uiOrdering ); uiOrdering.add( &m_columnCount ); uiOrdering.add( &m_rowsPerPage ); } diff --git a/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.h b/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.h index 6aa6504245..128718b406 100644 --- a/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.h +++ b/ApplicationCode/ProjectDataModel/RimMultiPlotWindow.h @@ -118,7 +118,7 @@ protected: const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; - void uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); + void uiOrderingForMultiPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; diff --git a/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp b/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp index 073a0b523d..a24dfd3fe4 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp @@ -235,7 +235,7 @@ QList RimPlotWindow::calculateValueOptions( const caf::P //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimPlotWindow::uiOrderingForLegendSettings( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +void RimPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { uiOrdering.add( &m_showPlotLegends ); uiOrdering.add( &m_plotLegendsHorizontal ); diff --git a/ApplicationCode/ProjectDataModel/RimPlotWindow.h b/ApplicationCode/ProjectDataModel/RimPlotWindow.h index d119ddd7b2..eabb9106c7 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotWindow.h +++ b/ApplicationCode/ProjectDataModel/RimPlotWindow.h @@ -71,7 +71,7 @@ protected: QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; - void uiOrderingForLegendSettings( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); + void uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); private: virtual void doUpdateLayout() {} diff --git a/ApplicationCode/ProjectDataModel/RimWellBoreStabilityPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellBoreStabilityPlot.cpp index e8df82d9ec..4f09d5b488 100644 --- a/ApplicationCode/ProjectDataModel/RimWellBoreStabilityPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellBoreStabilityPlot.cpp @@ -82,7 +82,7 @@ RimWellBoreStabilityPlot::RimWellBoreStabilityPlot() "FG in shale = K0_FG * (OBG0-PP0)\nK0_FG = (FG-PP)/(OBG-PP)", "" ); - CAF_PDM_InitField( &m_userDefinedPPShale, "UserPPShale", 1.05, "User Defined Pore Pressure, Shale [bar]", "", "", "" ); + CAF_PDM_InitField( &m_userDefinedPPShale, "UserPPShale", 1.05, "Multiplier of hydrostatic PP", "", "", "" ); CAF_PDM_InitField( &m_userDefinedPoissionRatio, "UserPoissionRatio", @@ -226,10 +226,14 @@ void RimWellBoreStabilityPlot::defineUiOrdering( QString uiConfigName, caf::PdmU parameterSources->add( &m_userDefinedK0FG ); } - caf::PdmUiGroup* titleLegendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" ); - RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleLegendAndAxisGroup ); - RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *titleLegendAndAxisGroup ); - uiOrderingForDepthAxis( uiConfigName, *titleLegendAndAxisGroup ); + caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis" ); + RimWellLogPlot::uiOrderingForDepthAxis( uiConfigName, *depthGroup ); + + caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" ); + RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleGroup ); + + caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" ); + RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup ); uiOrdering.skipRemainingFields( true ); } @@ -252,7 +256,8 @@ QList std::vector sources = supportedSources( parameter ); for ( int i = 0; i < (int)sources.size(); ++i ) { - if ( parameter.exclusiveOptions() || i == (int)sources.size() - 1 ) + if ( parameter.exclusiveOptions() || i == (int)sources.size() - 1 || + sources[i] == RigWbsParameter::HYDROSTATIC ) { options.push_back( caf::PdmOptionItemInfo( ParameterSourceEnum::uiText( sources[i] ), sources[i] ) ); } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp index 6f578f9ac3..8006c9fc25 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp @@ -109,12 +109,13 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa /// //-------------------------------------------------------------------------------------------------- void RimWellLogCurve::setValuesAndDepths( const std::vector& xValues, - const std::vector& measuredDepths, + const std::vector& depths, RiaDefines::DepthTypeEnum depthType, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ) { - m_curveData->setValuesAndDepths( xValues, measuredDepths, depthType, depthUnit, isExtractionCurve ); + m_curveData->setValuesAndDepths( xValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve ); calculateCurveDataXRange(); } @@ -123,25 +124,27 @@ void RimWellLogCurve::setValuesAndDepths( const std::vector& xValues, //-------------------------------------------------------------------------------------------------- void RimWellLogCurve::setValuesAndDepths( const std::vector& xValues, const std::map>& depths, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ) { - m_curveData->setValuesAndDepths( xValues, depths, depthUnit, isExtractionCurve ); + m_curveData->setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve ); calculateCurveDataXRange(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::setValuesWithTVD( const std::vector& xValues, - const std::vector& measuredDepths, - const std::vector& tvDepths, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve ) +void RimWellLogCurve::setValuesWithMdAndTVD( const std::vector& xValues, + const std::vector& measuredDepths, + const std::vector& tvdMSL, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve ) { std::map> depths = {{RiaDefines::MEASURED_DEPTH, measuredDepths}, - {RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}}; - setValuesAndDepths( xValues, depths, depthUnit, isExtractionCurve ); + {RiaDefines::TRUE_VERTICAL_DEPTH, tvdMSL}}; + setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogCurve.h index d5034016ed..586f850a63 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogCurve.h @@ -45,15 +45,18 @@ public: void setValuesAndDepths( const std::vector& xValues, const std::vector& depths, RiaDefines::DepthTypeEnum depthType, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ); - void setValuesWithTVD( const std::vector& xValues, - const std::vector& measuredDepths, - const std::vector& tvDepths, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve ); + void setValuesWithMdAndTVD( const std::vector& xValues, + const std::vector& measuredDepths, + const std::vector& tvDepths, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve ); void setValuesAndDepths( const std::vector& xValues, const std::map>& depths, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 2d1a4e0056..ebb6db12f9 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -344,7 +344,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot ) RiaDefines::DepthTypeEnum depthType = wellLogPlot->depthType(); RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit(); - if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH ) + if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) { isUsingPseudoLength = false; } @@ -447,6 +447,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, std::vector values; std::vector measuredDepthValues; std::vector tvDepthValues; + double rkbDiff = 0.0; RiaDefines::DepthUnitType depthUnit = RiaDefines::UNIT_METER; @@ -454,6 +455,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, { measuredDepthValues = eclExtractor->cellIntersectionMDs(); tvDepthValues = eclExtractor->cellIntersectionTVDs(); + rkbDiff = eclExtractor->wellPathData()->rkbDiff(); m_eclipseResultDefinition->loadResult(); @@ -480,6 +482,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, { measuredDepthValues = geomExtractor->cellIntersectionMDs(); tvDepthValues = geomExtractor->cellIntersectionTVDs(); + rkbDiff = geomExtractor->wellPathData()->rkbDiff(); if ( measuredDepthValues.empty() ) { @@ -494,8 +497,6 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, wbsPlot->applyWbsParametersToExtractor( geomExtractor.p() ); } - geomExtractor->setRkbDiff( rkbDiff() ); - m_geomResultDefinition->loadResult(); geomExtractor->curveData( m_geomResultDefinition->resultAddress(), m_timeStep, &values ); if ( performDataSmoothing ) @@ -515,12 +516,18 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, this->setValuesAndDepths( values, measuredDepthValues, RiaDefines::MEASURED_DEPTH, + 0.0, depthUnit, !performDataSmoothing ); } else { - this->setValuesWithTVD( values, measuredDepthValues, tvDepthValues, depthUnit, !performDataSmoothing ); + this->setValuesWithMdAndTVD( values, + measuredDepthValues, + tvDepthValues, + rkbDiff, + depthUnit, + !performDataSmoothing ); } } } @@ -1036,18 +1043,6 @@ QString RimWellLogExtractionCurve::caseName() const return QString(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RimWellLogExtractionCurve::rkbDiff() const -{ - if ( m_wellPath && m_wellPath->wellPathGeometry() ) - { - return m_wellPath->wellPathGeometry()->rkbDiff(); - } - return HUGE_VAL; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h index 222f087117..27a9517b11 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h @@ -71,7 +71,6 @@ public: bool isEclipseCurve() const; QString caseName() const; - double rkbDiff() const; int currentTimeStep() const; void setCurrentTimeStep( int timeStep ); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp index 8750e82173..c2fa83673c 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp @@ -89,7 +89,8 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) std::vector values = wellLogFile->values( m_wellLogChannnelName ); std::vector measuredDepthValues = wellLogFile->depthValues(); - if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ) + if ( wellLogPlot && ( wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH || + wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) ) { bool canUseTvd = false; if ( wellLogFile->hasTvdChannel() ) @@ -98,11 +99,12 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( values.size() == measuredDepthValues.size() && values.size() == tvdMslValues.size() ) { - this->setValuesWithTVD( values, - measuredDepthValues, - tvdMslValues, - wellLogFile->depthUnit(), - false ); + this->setValuesWithMdAndTVD( values, + measuredDepthValues, + tvdMslValues, + m_wellPath->wellPathGeometry()->rkbDiff(), + wellLogFile->depthUnit(), + false ); canUseTvd = true; } } @@ -122,11 +124,12 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( values.size() == trueVerticalDepthValues.size() && values.size() == measuredDepthValues.size() ) { - this->setValuesWithTVD( values, - measuredDepthValues, - trueVerticalDepthValues, - wellLogFile->depthUnit(), - false ); + this->setValuesWithMdAndTVD( values, + measuredDepthValues, + trueVerticalDepthValues, + m_wellPath->wellPathGeometry()->rkbDiff(), + wellLogFile->depthUnit(), + false ); canUseTvd = true; } } @@ -153,6 +156,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) this->setValuesAndDepths( values, measuredDepthValues, RiaDefines::MEASURED_DEPTH, + 0.0, wellLogFile->depthUnit(), false ); } @@ -170,20 +174,16 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) { displayUnit = wellLogPlot->depthUnit(); } - if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH && - this->curveData()->availableDepthTypes().count( RiaDefines::TRUE_VERTICAL_DEPTH ) ) + + RiaDefines::DepthTypeEnum depthType = RiaDefines::MEASURED_DEPTH; + if ( wellLogPlot && this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) ) { - m_qwtPlotCurve - ->setSamples( this->curveData()->xPlotValues().data(), - this->curveData()->depthPlotValues( RiaDefines::TRUE_VERTICAL_DEPTH, displayUnit ).data(), - static_cast( this->curveData()->xPlotValues().size() ) ); - } - else - { - m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(), - this->curveData()->depthPlotValues( RiaDefines::MEASURED_DEPTH, displayUnit ).data(), - static_cast( this->curveData()->xPlotValues().size() ) ); + depthType = wellLogPlot->depthType(); } + + m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(), + this->curveData()->depthPlotValues( depthType, displayUnit ).data(), + static_cast( this->curveData()->xPlotValues().size() ) ); m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() ); if ( updateParentPlot ) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index ef781220ab..a488a0cf81 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -99,7 +99,9 @@ RimWellLogPlot::RimWellLogPlot() m_nameConfig = new RimWellLogPlotNameConfig(); m_availableDepthUnits = {RiaDefines::UNIT_METER, RiaDefines::UNIT_FEET}; - m_availableDepthTypes = {RiaDefines::MEASURED_DEPTH, RiaDefines::TRUE_VERTICAL_DEPTH}; + m_availableDepthTypes = {RiaDefines::MEASURED_DEPTH, + RiaDefines::TRUE_VERTICAL_DEPTH, + RiaDefines::TRUE_VERTICAL_DEPTH_RKB}; m_minAvailableDepth = HUGE_VAL; m_maxAvailableDepth = -HUGE_VAL; @@ -278,14 +280,6 @@ void RimWellLogPlot::visibleDepthRange( double* minimumDepth, double* maximumDep *maximumDepth = m_maxVisibleDepth; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellLogPlot::enableAllAutoNameTags( bool enable ) -{ - m_nameConfig->enableAllAutoNameTags( enable ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -313,7 +307,6 @@ void RimWellLogPlot::uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrde { uiOrdering.add( &m_showPlotWindowTitle ); m_nameConfig->uiOrdering( uiConfigName, uiOrdering ); - uiOrdering.add( &m_showIndividualPlotTitles ); } //-------------------------------------------------------------------------------------------------- @@ -579,7 +572,15 @@ void RimWellLogPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, } else if ( changedField == &m_depthType ) { - m_isAutoScaleDepthEnabled = true; + m_isAutoScaleDepthEnabled = true; + + bool isTVDRKB = m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB; + m_nameConfig->setAutoNameTags( m_nameConfig->addCaseName(), + m_nameConfig->addWellName(), + m_nameConfig->addTimeStep(), + isTVDRKB, + m_nameConfig->addWaterDepth() ); + RimWellAllocationPlot* parentWellAllocation = nullptr; this->firstAncestorOrThisOfType( parentWellAllocation ); if ( parentWellAllocation ) @@ -613,10 +614,12 @@ void RimWellLogPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Depth Axis" ); uiOrderingForDepthAxis( uiConfigName, *gridGroup ); - caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" ); - uiOrderingForAutoName( uiConfigName, *titleAndLegendsGroup ); - RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, *titleAndLegendsGroup ); - titleAndLegendsGroup->add( &m_columnCount ); + caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" ); + uiOrderingForAutoName( uiConfigName, *titleGroup ); + + caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" ); + RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup ); + plotLayoutGroup->add( &m_columnCount ); uiOrdering.skipRemainingFields( true ); } @@ -741,6 +744,10 @@ QString RimWellLogPlot::depthAxisTitle() const case RiaDefines::CONNECTION_NUMBER: depthTitle = "Connection"; break; + + case RiaDefines::TRUE_VERTICAL_DEPTH_RKB: + depthTitle = "TVDRKB"; + break; } if ( m_depthType() == RiaDefines::CONNECTION_NUMBER ) return depthTitle; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index a2c96c3edb..fc68441a17 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -86,8 +86,6 @@ public: void availableDepthRange( double* minimumDepth, double* maximumDepth ) const; void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const; - void enableAllAutoNameTags( bool enable ); - void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp index d2e9b52495..65bb5e2523 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp @@ -33,11 +33,11 @@ RimWellLogPlotNameConfig::RimWellLogPlotNameConfig() { CAF_PDM_InitObject( "Well Log Plot Name Generator", "", "", "" ); - CAF_PDM_InitField( &m_addCaseName, "AddCaseName", false, "Add Case Name", "", "", "" ); - CAF_PDM_InitField( &m_addWellName, "AddWellName", false, "Add Well Name", "", "", "" ); - CAF_PDM_InitField( &m_addTimestep, "AddTimeStep", false, "Add Time Step", "", "", "" ); - CAF_PDM_InitField( &m_addAirGap, "AddAirGap", false, "Add Air Gap", "", "", "" ); - CAF_PDM_InitField( &m_addWaterDepth, "AddWaterDepth", false, "Add Water Depth", "", "", "" ); + CAF_PDM_InitField( &m_addCaseName, "AddCaseName", false, "Show Case Name", "", "", "" ); + CAF_PDM_InitField( &m_addWellName, "AddWellName", false, "Show Well Name", "", "", "" ); + CAF_PDM_InitField( &m_addTimestep, "AddTimeStep", false, "Show Time Step", "", "", "" ); + CAF_PDM_InitField( &m_addAirGap, "AddAirGap", false, "Show Air Gap", "", "", "" ); + CAF_PDM_InitField( &m_addWaterDepth, "AddWaterDepth", false, "Show Water Depth", "", "", "" ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp index 99c37835df..829621e7a8 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp @@ -435,11 +435,21 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) measuredDepthVector = tvDepthVector; } - this->setValuesWithTVD( values, - measuredDepthVector, - tvDepthVector, - RiaEclipseUnitTools::depthUnit( unitSystem ), - false ); + RimProject* proj = RiaApplication::instance()->project(); + RimWellPath* wellPath = proj->wellPathByName( m_wellName ); + + double rkbDiff = 0.0; + if ( wellPath ) + { + rkbDiff = wellPath->wellPathGeometry()->rkbDiff(); + } + + this->setValuesWithMdAndTVD( values, + measuredDepthVector, + tvDepthVector, + rkbDiff, + RiaEclipseUnitTools::depthUnit( unitSystem ), + false ); RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_METER; if ( wellLogPlot ) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index fb81a16908..9d1971005d 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -795,7 +795,10 @@ QString RimWellLogTrack::asciiDataForPlotExport() const else if ( depthType == RiaDefines::PSEUDO_LENGTH ) out += "PL "; else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH ) - out += "TVD "; + out += "TVDMSL "; + else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) + out += "TVDRKB "; + for ( QString name : curveNames ) out += " \t" + name; out += "\n"; @@ -1925,8 +1928,9 @@ CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigEclipseWellLo { CurveSamplingPointData curveData; - curveData.md = extractor->cellIntersectionMDs(); - curveData.tvd = extractor->cellIntersectionTVDs(); + curveData.md = extractor->cellIntersectionMDs(); + curveData.tvd = extractor->cellIntersectionTVDs(); + curveData.rkbDiff = extractor->wellPathData()->rkbDiff(); extractor->curveData( resultAccessor, &curveData.data ); @@ -1941,8 +1945,9 @@ CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigGeoMechWellLo { CurveSamplingPointData curveData; - curveData.md = extractor->cellIntersectionMDs(); - curveData.tvd = extractor->cellIntersectionTVDs(); + curveData.md = extractor->cellIntersectionMDs(); + curveData.tvd = extractor->cellIntersectionTVDs(); + curveData.rkbDiff = extractor->wellPathData()->rkbDiff(); extractor->curveData( resultAddress, 0, &curveData.data ); return curveData; @@ -1981,9 +1986,16 @@ void RimWellLogTrack::findRegionNamesToPlot( const CurveSamplingPointData& { depthVector = curveData.md; } - else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH ) + else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) { depthVector = curveData.tvd; + if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) + { + for ( double& depthValue : depthVector ) + { + depthValue += curveData.rkbDiff; + } + } } if ( depthVector.empty() ) return; @@ -2171,7 +2183,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot() { if ( m_formationWellPathForSourceWellPath == nullptr ) return; - if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ) ) + if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH || + plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) ) { return; } @@ -2187,6 +2200,14 @@ void RimWellLogTrack::updateFormationNamesOnPlot() m_showformationFluids(), plot->depthType() ); + if ( plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) + { + for ( double& depthValue : yValues ) + { + depthValue += m_formationWellPathForSourceWellPath->wellPathGeometry()->rkbDiff(); + } + } + m_annotationTool->attachWellPicks( m_plotWidget, formationNamesToPlot, yValues ); } } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h index 99ce908080..c85bbb61ac 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h @@ -61,6 +61,8 @@ struct CurveSamplingPointData std::vector data; std::vector md; std::vector tvd; + + double rkbDiff; }; //================================================================================================== diff --git a/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp index b5a225f516..f5e06aec17 100644 --- a/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellMeasurementCurve.cpp @@ -110,12 +110,6 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( values.size() == measuredDepthValues.size() ) { - this->setValuesAndDepths( values, - measuredDepthValues, - RiaDefines::MEASURED_DEPTH, - RiaDefines::UNIT_METER, - false ); - RigWellPath* rigWellPath = m_wellPath->wellPathGeometry(); if ( rigWellPath ) { @@ -129,6 +123,16 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot ) this->setValuesAndDepths( values, measuredDepthValues, RiaDefines::TRUE_VERTICAL_DEPTH, + rigWellPath->rkbDiff(), + RiaDefines::UNIT_METER, + false ); + } + else + { + this->setValuesAndDepths( values, + measuredDepthValues, + RiaDefines::MEASURED_DEPTH, + 0.0, RiaDefines::UNIT_METER, false ); } @@ -148,22 +152,16 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot ) { displayUnit = wellLogPlot->depthUnit(); } - if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH && - this->curveData()->availableDepthTypes().count( RiaDefines::TRUE_VERTICAL_DEPTH ) ) + + RiaDefines::DepthTypeEnum depthType = RiaDefines::MEASURED_DEPTH; + if ( wellLogPlot && this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) ) { - m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(), - this->curveData() - ->depthPlotValues( RiaDefines::TRUE_VERTICAL_DEPTH, displayUnit ) - .data(), - static_cast( this->curveData()->xPlotValues().size() ) ); - } - else - { - m_qwtPlotCurve - ->setSamples( this->curveData()->xPlotValues().data(), - this->curveData()->depthPlotValues( RiaDefines::MEASURED_DEPTH, displayUnit ).data(), - static_cast( this->curveData()->xPlotValues().size() ) ); + depthType = wellLogPlot->depthType(); } + + m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(), + this->curveData()->depthPlotValues( depthType, displayUnit ).data(), + static_cast( this->curveData()->xPlotValues().size() ) ); m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() ); } diff --git a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp index fe2969613f..f26de6980b 100644 --- a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp @@ -98,7 +98,7 @@ void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int double trueVerticalDepth = -centroid.z(); - double effectiveDepthMeters = trueVerticalDepth + m_rkbDiff; + double effectiveDepthMeters = trueVerticalDepth + wellPathData()->rkbDiff(); double hydroStaticPorePressureBar = pascalToBar( effectiveDepthMeters * UNIT_WEIGHT_OF_WATER ); interfaceShValuesDbl[i] = interfaceShValues[i] / hydroStaticPorePressureBar; interfacePorePressuresDbl[i] = interfacePorePressures[i]; @@ -691,14 +691,6 @@ const RigGeoMechCaseData* RigGeoMechWellLogExtractor::caseData() return m_caseData.p(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigGeoMechWellLogExtractor::setRkbDiff( double rkbDiff ) -{ - m_rkbDiff = rkbDiff; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1408,7 +1400,7 @@ double RigGeoMechWellLogExtractor::hydroStaticPorePressureForSegment( size_t int { cvf::Vec3f centroid = cellCentroid( intersectionIdx ); double trueVerticalDepth = -centroid.z(); - double effectiveDepthMeters = trueVerticalDepth + m_rkbDiff; + double effectiveDepthMeters = trueVerticalDepth + wellPathData()->rkbDiff(); double hydroStaticPorePressurePascal = effectiveDepthMeters * UNIT_WEIGHT_OF_WATER; double hydroStaticPorePressureBar = pascalToBar( hydroStaticPorePressurePascal ); return hydroStaticPorePressureBar; diff --git a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h index c1a5c90236..6c277b344a 100644 --- a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h +++ b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h @@ -67,7 +67,6 @@ public: void curveData( const RigFemResultAddress& resAddr, int frameIndex, std::vector* values ); const RigGeoMechCaseData* caseData(); - void setRkbDiff( double rkbDiff ); void setWbsLasValues( const RigWbsParameter& parameter, const std::vector>& values ); void setWbsParametersSource( RigWbsParameter parameter, WbsParameterSource source ); @@ -160,7 +159,6 @@ private: private: cvf::ref m_caseData; - double m_rkbDiff; std::map>> m_lasFileValues; diff --git a/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp index 214d6b8a20..ef02303bbc 100644 --- a/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp +++ b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp @@ -20,9 +20,11 @@ #include "RiaDefines.h" #include "RigWellLogCurveData.h" +#include "RigWellPath.h" #include "RimCase.h" #include "RimWellLogCurve.h" #include "RimWellLogExtractionCurve.h" +#include "RimWellPath.h" #include "cafUtils.h" @@ -588,9 +590,9 @@ QString RigLasFileExporter::caseNameFromCurve( RimWellLogCurve* curve ) double RigLasFileExporter::rkbDiff( RimWellLogCurve* curve ) { RimWellLogExtractionCurve* extractionCurve = dynamic_cast( curve ); - if ( extractionCurve ) + if ( extractionCurve && extractionCurve->wellPath() ) { - return extractionCurve->rkbDiff(); + return extractionCurve->wellPath()->wellPathGeometry()->rkbDiff(); } return HUGE_VAL; diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp b/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp index 11aae2ea1d..eaf35d32c9 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp @@ -48,6 +48,7 @@ RigWellLogCurveData::~RigWellLogCurveData() {} void RigWellLogCurveData::setValuesAndDepths( const std::vector& xValues, const std::vector& depths, RiaDefines::DepthTypeEnum depthType, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ) { @@ -56,6 +57,7 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector& xValues m_xValues = xValues; m_depths[depthType] = depths; m_depthUnit = depthUnit; + m_rkbDiff = rkbDiff; // Disable depth value filtering is intended to be used for // extraction curve data @@ -69,6 +71,7 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector& xValues //-------------------------------------------------------------------------------------------------- void RigWellLogCurveData::setValuesAndDepths( const std::vector& xValues, const std::map>& depths, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ) { @@ -80,6 +83,7 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector& m_xValues = xValues; m_depths = depths; m_depthUnit = depthUnit; + m_rkbDiff = rkbDiff; // Disable depth value filtering is intended to be used for // extraction curve data @@ -101,8 +105,20 @@ const std::vector& RigWellLogCurveData::xValues() const //-------------------------------------------------------------------------------------------------- std::vector RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depthType ) const { - auto it = m_depths.find( depthType ); - return it != m_depths.end() ? it->second : std::vector(); + if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB && m_rkbDiff != 0.0 ) + { + std::vector tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH ); + for ( double& tvdValue : tvds ) + { + tvdValue += m_rkbDiff; + } + return tvds; + } + else + { + auto it = m_depths.find( depthType ); + return it != m_depths.end() ? it->second : std::vector(); + } } //-------------------------------------------------------------------------------------------------- @@ -115,6 +131,10 @@ std::set RigWellLogCurveData::availableDepthTypes() c for ( auto depthValuePair : m_depths ) { depthTypes.insert( depthValuePair.first ); + if ( depthValuePair.first == RiaDefines::TRUE_VERTICAL_DEPTH && m_rkbDiff != 0.0 ) + { + depthTypes.insert( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ); + } } return depthTypes; } @@ -171,13 +191,14 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( std::vector xValues; std::vector measuredDepths; - bool isTvDepthsAvailable = false; + bool isTVDAvailable = false; + bool isTVDRKBAvailable = false; std::vector tvDepths; auto mdIt = m_depths.find( RiaDefines::MEASURED_DEPTH ); auto tvdIt = m_depths.find( RiaDefines::TRUE_VERTICAL_DEPTH ); - if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTvDepthsAvailable = true; + if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTVDAvailable = true; if ( mdIt != m_depths.end() && !mdIt->second.empty() ) { @@ -193,7 +214,7 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( double segmentStartTvd = 0.0; double segmentEndTvd = 0.0; - if ( isTvDepthsAvailable ) + if ( isTVDAvailable ) { segmentStartTvd = tvdIt->second[segmentStartIdx]; segmentEndTvd = tvdIt->second[segmentStartIdx + 1]; @@ -208,7 +229,7 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( // The tvd calculation is a simplification. We should use the wellpath, as it might have a better // resolution, and have a none-linear shape This is much simpler, and possibly accurate enough ? - if ( isTvDepthsAvailable ) + if ( isTVDAvailable ) { tvDepths.push_back( ( 1.0 - endWeight ) * segmentStartTvd + endWeight * segmentEndTvd ); } @@ -222,17 +243,18 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( cvf::ref reSampledData = new RigWellLogCurveData; - if ( isTvDepthsAvailable ) + if ( isTVDAvailable ) { std::map> resampledDepths = {{RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}, {RiaDefines::MEASURED_DEPTH, measuredDepths}}; - reSampledData->setValuesAndDepths( xValues, resampledDepths, m_depthUnit, true ); + reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true ); } else { reSampledData->setValuesAndDepths( xValues, measuredDepths, RiaDefines::MEASURED_DEPTH, + 0.0, m_depthUnit, m_isExtractionCurve ); } diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.h b/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.h index 002e6699a1..aad33506ec 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.h +++ b/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.h @@ -41,10 +41,12 @@ public: void setValuesAndDepths( const std::vector& xValues, const std::vector& depths, RiaDefines::DepthTypeEnum depthType, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ); void setValuesAndDepths( const std::vector& xValues, const std::map>& depths, + double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve ); @@ -86,6 +88,7 @@ private: std::vector m_xValues; std::map> m_depths; bool m_isExtractionCurve; + double m_rkbDiff; std::vector> m_intervalsOfContinousValidValues; diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp index 5f59d71b61..fd42187233 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp @@ -96,7 +96,7 @@ const std::vector& RigWellLogExtractor::intersectedCellsGlobIdx() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const RigWellPath* RigWellLogExtractor::wellPathData() +const RigWellPath* RigWellLogExtractor::wellPathData() const { return m_wellPath.p(); } diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.h b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.h index 41182737f0..ff0bde4a9c 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.h +++ b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.h @@ -62,7 +62,7 @@ public: const std::vector& cellIntersectionTVDs(); const std::vector& intersectedCellsGlobIdx(); - const RigWellPath* wellPathData(); + const RigWellPath* wellPathData() const; std::vector cellIntersectionInfosAlongWellPath() const; diff --git a/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp b/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp index 718f82d810..6d4b1d08a4 100644 --- a/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp +++ b/ApplicationCode/UserInterface/RiuWellPathComponentPlotItem.cpp @@ -333,12 +333,17 @@ std::pair RiuWellPathComponentPlotItem::depthsOfDepthType() cons double startDepth = m_startMD; double endDepth = m_endMD; - if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH ) + if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH || m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) { cvf::Vec3d startPoint = m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_startMD ); cvf::Vec3d endPoint = m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_endMD ); startDepth = -startPoint.z(); endDepth = -endPoint.z(); + if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) + { + startDepth += m_wellPath->wellPathGeometry()->rkbDiff(); + endDepth += m_wellPath->wellPathGeometry()->rkbDiff(); + } } return std::make_pair( startDepth, endDepth ); }