#5198 Export MSW : Add extra segment if user defined measured depth is above grid

This commit is contained in:
Magne Sjaastad 2019-12-06 13:14:42 +01:00
parent 3babbe675a
commit 312caa7568

View File

@ -1077,10 +1077,33 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generatePerforationsMswExp
} }
} }
// Skip all intersections before initialMD
std::vector<WellPathCellIntersectionInfo> filteredIntersections; std::vector<WellPathCellIntersectionInfo> filteredIntersections;
{ {
if ( !intersections.empty() && intersections[0].startMD > initialMD &&
wellPath->perforationIntervalCollection()->mswParameters()->referenceMDType() ==
RimMswCompletionParameters::MANUAL_REFERENCE_MD )
{
WellPathCellIntersectionInfo firstIntersection = intersections[0];
// Add a segment from user defined MD to start of grid
cvf::Vec3d intersectionPoint = wellPathGeometry->interpolatedPointAlongWellPath( initialMD );
WellPathCellIntersectionInfo extraIntersection;
extraIntersection.globCellIndex = std::numeric_limits<size_t>::max();
extraIntersection.startPoint = intersectionPoint;
extraIntersection.endPoint = firstIntersection.startPoint;
extraIntersection.startMD = initialMD;
extraIntersection.endMD = firstIntersection.startMD;
extraIntersection.intersectedCellFaceIn = cvf::StructGridInterface::NO_FACE;
extraIntersection.intersectedCellFaceOut = cvf::StructGridInterface::oppositeFace(
firstIntersection.intersectedCellFaceIn );
extraIntersection.intersectionLengthsInCellCS = cvf::Vec3d::ZERO;
filteredIntersections.push_back( extraIntersection );
}
const double epsilon = 0.001; const double epsilon = 0.001;
for ( const WellPathCellIntersectionInfo& intersection : intersections ) for ( const WellPathCellIntersectionInfo& intersection : intersections )
@ -1100,24 +1123,24 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generatePerforationsMswExp
cvf::Vec3d intersectionPoint = wellPathGeometry->interpolatedPointAlongWellPath( initialMD ); cvf::Vec3d intersectionPoint = wellPathGeometry->interpolatedPointAlongWellPath( initialMD );
WellPathCellIntersectionInfo smallerIntersection; WellPathCellIntersectionInfo extraIntersection;
smallerIntersection.globCellIndex = intersection.globCellIndex; extraIntersection.globCellIndex = intersection.globCellIndex;
smallerIntersection.startPoint = intersectionPoint; extraIntersection.startPoint = intersectionPoint;
smallerIntersection.endPoint = intersection.endPoint; extraIntersection.endPoint = intersection.endPoint;
smallerIntersection.startMD = initialMD; extraIntersection.startMD = initialMD;
smallerIntersection.endMD = intersection.endMD; extraIntersection.endMD = intersection.endMD;
smallerIntersection.intersectedCellFaceIn = cvf::StructGridInterface::NO_FACE; extraIntersection.intersectedCellFaceIn = cvf::StructGridInterface::NO_FACE;
smallerIntersection.intersectedCellFaceOut = intersection.intersectedCellFaceOut; extraIntersection.intersectedCellFaceOut = intersection.intersectedCellFaceOut;
const RigMainGrid* grid = eclipseCase->mainGrid(); const RigMainGrid* grid = eclipseCase->mainGrid();
smallerIntersection.intersectionLengthsInCellCS = extraIntersection.intersectionLengthsInCellCS =
RigWellPathIntersectionTools::calculateLengthInCell( grid, RigWellPathIntersectionTools::calculateLengthInCell( grid,
intersection.globCellIndex, intersection.globCellIndex,
intersectionPoint, intersectionPoint,
intersection.endPoint ); intersection.endPoint );
filteredIntersections.push_back( smallerIntersection ); filteredIntersections.push_back( extraIntersection );
} }
} }
} }