mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user