#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
This commit is contained in:
Gaute Lindkvist 2020-10-12 09:56:38 +02:00
parent 50a7052756
commit bb3dfd538c
10 changed files with 51 additions and 10 deletions

View File

@ -302,6 +302,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLate
std::vector<WellPathCellIntersectionInfo> intersectedCells =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(),
wellPath->name(),
fishbonesPath->coordinates(),
fishbonesPath->measuredDepths() );
@ -348,6 +349,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::appendMainWellBoreParts(
std::vector<WellPathCellIntersectionInfo> intersectedCellsIntersectionInfo =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(),
wellPath->name(),
fishbonePerfWellPathCoords.first,
fishbonePerfWellPathCoords.second );

View File

@ -1181,6 +1181,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
std::vector<WellPathCellIntersectionInfo> intersectedCells =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(),
wellPath->name(),
perforationPointsAndMD.first,
perforationPointsAndMD.second );
@ -1666,7 +1667,7 @@ std::pair<double, cvf::Vec2i>
CVF_ASSERT( !coords.empty() && !mds.empty() );
std::vector<WellPathCellIntersectionInfo> intersections =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData, coords, mds );
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData, wellPath->name(), coords, mds );
int gridId = 0;

View File

@ -890,7 +890,12 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generateFishbonesMswExport
QString label = QString( "Lateral %1" ).arg( lateralIndex );
segment->addCompletion( std::make_shared<RicMswFishbones>( 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<WellPathCellIntersectionInfo> 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<WellPathCellIntersectionInfo>
const RigMainGrid* mainGrid = eclipseCase->mainGrid();
std::vector<WellPathCellIntersectionInfo> allIntersections =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCase->eclipseCaseData(), coords, mds );
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCase->eclipseCaseData(),
wellPath->name(),
coords,
mds );
std::vector<WellPathCellIntersectionInfo> 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<RicMswSegment> segment,
bool* foundSubGridIntersections,
@ -1905,6 +1917,7 @@ void RicWellPathExportMswCompletionsImpl::assignFishbonesLateralIntersections( c
std::vector<WellPathCellIntersectionInfo> intersections =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseToApply->eclipseCaseData(),
wellPath->name(),
lateralCoords,
lateralMDs );
@ -2006,6 +2019,7 @@ std::vector<RigCompletionData>
std::vector<WellPathCellIntersectionInfo> intersectedCells =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCase->eclipseCaseData(),
wellPath->name(),
perforationPointsAndMD.first,
perforationPointsAndMD.second );

View File

@ -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<RicMswSegment> segment,
bool* foundSubGridIntersections,

View File

@ -431,6 +431,7 @@ std::vector<MultipleFracturesOption>
std::vector<WellPathCellIntersectionInfo> wellPathInfos =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData,
wellPath->name(),
wellPathGeometry->wellPathPoints(),
wellPathGeometry->measureDepths() );
std::reverse( wellPathInfos.begin(), wellPathInfos.end() );

View File

@ -690,6 +690,7 @@ std::vector<WellPathCellIntersectionInfo>
RigSimulationWellCoordsAndMD helper( pathCoords );
return RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( eclipseCaseData,
"",
helper.wellPathPoints(),
helper.measuredDepths() );
}

View File

@ -18,21 +18,24 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QDebug>
#include <algorithm>
#include <cmath>
//==================================================================================================
///
/// 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
}
};

View File

@ -311,6 +311,20 @@ void RigWellLogExtractor::populateReturnArrays( std::map<RigMDCellIdxEnterLeaveK
void RigWellLogExtractor::appendIntersectionToArrays( double measuredDepth, const HexIntersectionInfo& intersection )
{
if ( !m_intersectionMeasuredDepths.empty() && measuredDepth < m_intersectionMeasuredDepths.back() )
{
RiaLogging::warning(
QString( "Well Log Extraction : %1 does not have a monotonously increasing measured depth." )
.arg( QString::fromStdString( m_wellCaseErrorMsgName ) ) );
// Allow alterations of up to 0.1 percent as long as we keep the measured depth monotonously increasing.
const double tolerance = std::max( 1.0, measuredDepth ) * 1.0e-3;
if ( RigWellLogExtractionTools::isEqualDepth( measuredDepth, m_intersectionMeasuredDepths.back(), tolerance ) )
{
RiaLogging::warning( "The well path has been slightly adjusted" );
measuredDepth = m_intersectionMeasuredDepths.back();
}
}
m_intersectionMeasuredDepths.push_back( measuredDepth );
m_intersectionTVDs.push_back( fabs( intersection.m_intersectionPoint[2] ) );
m_intersections.push_back( intersection.m_intersectionPoint );

View File

@ -35,6 +35,7 @@
//--------------------------------------------------------------------------------------------------
std::vector<WellPathCellIntersectionInfo>
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( const RigEclipseCaseData* caseData,
const QString& wellPathName,
const std::vector<cvf::Vec3d>& pathCoords,
const std::vector<double>& pathMds )
{
@ -46,10 +47,10 @@ std::vector<WellPathCellIntersectionInfo>
dummyWellPath->m_wellPathPoints = pathCoords;
dummyWellPath->m_measuredDepths = pathMds;
std::string errorIdName = ( wellPathName + " " + caseData->ownerCase()->caseUserDescription() ).toStdString();
cvf::ref<RigEclipseWellLogExtractor> extractor =
new RigEclipseWellLogExtractor( caseData,
dummyWellPath.p(),
caseData->ownerCase()->caseUserDescription().toStdString() );
new RigEclipseWellLogExtractor( caseData, dummyWellPath.p(), errorIdName );
return extractor->cellIntersectionInfosAlongWellPath();
}

View File

@ -21,6 +21,8 @@
#include "cvfBoundingBox.h"
#include "cvfVector3.h"
#include <QString>
#include <array>
class RigWellPath;
@ -42,6 +44,7 @@ class RigWellPathIntersectionTools
public:
static std::vector<WellPathCellIntersectionInfo>
findCellIntersectionInfosAlongPath( const RigEclipseCaseData* caseData,
const QString& wellPathName,
const std::vector<cvf::Vec3d>& pathCoords,
const std::vector<double>& pathMds );