From bb3dfd538cc4cfc261fc76128dd9d765f8659626 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Mon, 12 Oct 2020 09:56:38 +0200 Subject: [PATCH] #6734 Fix segment order in MSW export and get well in error message * Fixing the order also ends up removing the wrong segment discussed in the bug --- ...sTransmissibilityCalculationFeatureImp.cpp | 2 ++ ...ellPathExportCompletionDataFeatureImpl.cpp | 3 ++- .../RicWellPathExportMswCompletionsImpl.cpp | 20 ++++++++++++++++--- .../RicWellPathExportMswCompletionsImpl.h | 1 + .../RicCreateMultipleFracturesUi.cpp | 1 + .../Completions/RimFractureModel.cpp | 1 + .../RigWellLogExtractionTools.h | 9 ++++++--- .../RigWellLogExtractor.cpp | 14 +++++++++++++ .../RigWellPathIntersectionTools.cpp | 7 ++++--- .../RigWellPathIntersectionTools.h | 3 +++ 10 files changed, 51 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index e228c5619e..c7e222e3ac 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -302,6 +302,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLate std::vector intersectedCells = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(), + wellPath->name(), fishbonesPath->coordinates(), fishbonesPath->measuredDepths() ); @@ -348,6 +349,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::appendMainWellBoreParts( std::vector intersectedCellsIntersectionInfo = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(), + wellPath->name(), fishbonePerfWellPathCoords.first, fishbonePerfWellPathCoords.second ); diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 5ac50b5e54..99ebe88379 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -1181,6 +1181,7 @@ std::vector RicWellPathExportCompletionDataFeatureImpl::gener std::vector intersectedCells = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(), + wellPath->name(), perforationPointsAndMD.first, perforationPointsAndMD.second ); @@ -1666,7 +1667,7 @@ std::pair CVF_ASSERT( !coords.empty() && !mds.empty() ); std::vector intersections = - RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData, coords, mds ); + RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData, wellPath->name(), coords, mds ); int gridId = 0; diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index 2973948d79..85980d993b 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -890,7 +890,12 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generateFishbonesMswExport QString label = QString( "Lateral %1" ).arg( lateralIndex ); segment->addCompletion( std::make_shared( label, lateralIndex ) ); } - assignFishbonesLateralIntersections( caseToApply, subs, segment, &foundSubGridIntersections, maxSegmentLength ); + assignFishbonesLateralIntersections( caseToApply, + wellPath, + subs, + segment, + &foundSubGridIntersections, + maxSegmentLength ); exportInfo.addSegment( segment ); } @@ -937,7 +942,10 @@ RicMswExportInfo CVF_ASSERT( !coords.empty() && !mds.empty() ); std::vector intersections = - RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseToApply->eclipseCaseData(), coords, mds ); + RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseToApply->eclipseCaseData(), + wellPath->name(), + coords, + mds ); double initialMD = 0.0; if ( wellPath->fractureCollection()->mswParameters()->referenceMDType() == @@ -1115,7 +1123,10 @@ std::vector const RigMainGrid* mainGrid = eclipseCase->mainGrid(); std::vector allIntersections = - RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCase->eclipseCaseData(), coords, mds ); + RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCase->eclipseCaseData(), + wellPath->name(), + coords, + mds ); std::vector continuousIntersections = RigWellPathIntersectionTools::buildContinuousIntersections( allIntersections, mainGrid ); @@ -1867,6 +1878,7 @@ void RicWellPathExportMswCompletionsImpl::moveIntersectionsToSuperICDsOrAICDs( M /// //-------------------------------------------------------------------------------------------------- void RicWellPathExportMswCompletionsImpl::assignFishbonesLateralIntersections( const RimEclipseCase* caseToApply, + const RimWellPath* wellPath, const RimFishbonesMultipleSubs* fishbonesSubs, std::shared_ptr segment, bool* foundSubGridIntersections, @@ -1905,6 +1917,7 @@ void RicWellPathExportMswCompletionsImpl::assignFishbonesLateralIntersections( c std::vector intersections = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseToApply->eclipseCaseData(), + wellPath->name(), lateralCoords, lateralMDs ); @@ -2006,6 +2019,7 @@ std::vector std::vector intersectedCells = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCase->eclipseCaseData(), + wellPath->name(), perforationPointsAndMD.first, perforationPointsAndMD.second ); diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h index 0eda14e9ae..61694c1247 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h @@ -169,6 +169,7 @@ private: static void moveIntersectionsToSuperICDsOrAICDs( MainBoreSegments mainBoreSegments ); static void assignFishbonesLateralIntersections( const RimEclipseCase* caseToApply, + const RimWellPath* wellPath, const RimFishbonesMultipleSubs* fishbonesSubs, std::shared_ptr segment, bool* foundSubGridIntersections, diff --git a/ApplicationCode/Commands/FractureCommands/RicCreateMultipleFracturesUi.cpp b/ApplicationCode/Commands/FractureCommands/RicCreateMultipleFracturesUi.cpp index e712c547c5..5f45b5b8c3 100644 --- a/ApplicationCode/Commands/FractureCommands/RicCreateMultipleFracturesUi.cpp +++ b/ApplicationCode/Commands/FractureCommands/RicCreateMultipleFracturesUi.cpp @@ -431,6 +431,7 @@ std::vector std::vector wellPathInfos = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData, + wellPath->name(), wellPathGeometry->wellPathPoints(), wellPathGeometry->measureDepths() ); std::reverse( wellPathInfos.begin(), wellPathInfos.end() ); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureModel.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFractureModel.cpp index 004a0665b9..6ab64d5b80 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFractureModel.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureModel.cpp @@ -690,6 +690,7 @@ std::vector RigSimulationWellCoordsAndMD helper( pathCoords ); return RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCaseData, + "", helper.wellPathPoints(), helper.measuredDepths() ); } diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h b/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h index e8edea78d4..235b31f0ff 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h +++ b/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h @@ -18,21 +18,24 @@ ///////////////////////////////////////////////////////////////////////////////// #pragma once + +#include + +#include #include //================================================================================================== /// +/// Default tolerance is 0.1 meters to handle inaccuracies across faults /// //================================================================================================== struct RigWellLogExtractionTools { - static bool isEqualDepth( double d1, double d2 ) + static bool isEqualDepth( double d1, double d2, const double tolerance = 0.1 ) { double depthDiff = d1 - d2; - const double tolerance = 0.1; // Meters To handle inaccuracies across faults - return ( fabs( depthDiff ) < tolerance ); // Equal depth } }; diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp index f3a5072418..19a221479a 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp @@ -311,6 +311,20 @@ void RigWellLogExtractor::populateReturnArrays( std::map RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( const RigEclipseCaseData* caseData, + const QString& wellPathName, const std::vector& pathCoords, const std::vector& pathMds ) { @@ -46,10 +47,10 @@ std::vector dummyWellPath->m_wellPathPoints = pathCoords; dummyWellPath->m_measuredDepths = pathMds; + std::string errorIdName = ( wellPathName + " " + caseData->ownerCase()->caseUserDescription() ).toStdString(); + cvf::ref extractor = - new RigEclipseWellLogExtractor( caseData, - dummyWellPath.p(), - caseData->ownerCase()->caseUserDescription().toStdString() ); + new RigEclipseWellLogExtractor( caseData, dummyWellPath.p(), errorIdName ); return extractor->cellIntersectionInfosAlongWellPath(); } diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathIntersectionTools.h b/ApplicationCode/ReservoirDataModel/RigWellPathIntersectionTools.h index bea8ce77f8..a20165e896 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathIntersectionTools.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPathIntersectionTools.h @@ -21,6 +21,8 @@ #include "cvfBoundingBox.h" #include "cvfVector3.h" +#include + #include class RigWellPath; @@ -42,6 +44,7 @@ class RigWellPathIntersectionTools public: static std::vector findCellIntersectionInfosAlongPath( const RigEclipseCaseData* caseData, + const QString& wellPathName, const std::vector& pathCoords, const std::vector& pathMds );