From 99c40df08e7c8fd72afef95301987047a1df1d54 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 22 Jun 2020 10:14:31 +0200 Subject: [PATCH] #6074 MSW: Add helper function to compute TVD --- .../RicWellPathExportMswCompletionsImpl.cpp | 18 +++++++++++++++--- .../RicWellPathExportMswCompletionsImpl.h | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index 0c86af6f23..a6fa478841 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -849,17 +849,17 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generateFishbonesMswExport for ( auto& sub : subs->installedLateralIndices() ) { double subEndMD = subs->measuredDepth( sub.subIndex ); - double subEndTVD = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( subEndMD ).z(); + double subEndTVD = RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( wellPath, subEndMD ); int subSegCount = SubSegmentIntersectionInfo::numberOfSplittedSegments( subStartMD, subEndMD, maxSegmentLength ); double subSegLen = ( subEndMD - subStartMD ) / subSegCount; double startMd = subStartMD; - double startTvd = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( startMd ).z(); + double startTvd = RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( wellPath, startMd ); for ( int ssi = 0; ssi < subSegCount; ssi++ ) { double endMd = startMd + subSegLen; - double endTvd = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( endMd ).z(); + double endTvd = RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( wellPath, endMd ); std::shared_ptr location( new RicMswSegment( subs->generatedName(), startMd, endMd, startTvd, endTvd, sub.subIndex ) ); @@ -1905,6 +1905,18 @@ void RicWellPathExportMswCompletionsImpl::assignBranchAndSegmentNumbers( const R } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( const RimWellPath* wellPath, double measuredDepth ) +{ + CVF_ASSERT( wellPath && wellPath->wellPathGeometry() ); + + double tvdValue = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( measuredDepth ).z(); + + return tvdValue; +} + SubSegmentIntersectionInfo::SubSegmentIntersectionInfo( size_t globCellIndex, double startTVD, double endTVD, diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h index ad343b1f44..f2e7211022 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h @@ -163,4 +163,6 @@ private: int* branchNum, int* segmentNum ); static void assignBranchAndSegmentNumbers( const RimEclipseCase* caseToApply, RicMswExportInfo* exportInfo ); + + static double tvdFromMeasuredDepth( const RimWellPath* wellPath, double measuredDepth ); };