2015-10-14 01:08:13 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-10-14 01:08:13 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-10-14 01:08:13 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-10-14 01:08:13 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RigWellLogExtractor.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiaLogging.h"
|
2015-10-14 01:08:13 -05:00
|
|
|
#include "RigWellPath.h"
|
2015-10-14 01:35:05 -05:00
|
|
|
#include "cvfTrace.h"
|
2015-10-14 01:08:13 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-14 01:08:13 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-10-06 05:37:16 -05:00
|
|
|
RigWellLogExtractor::RigWellLogExtractor( gsl::not_null<const RigWellPath*> wellpath,
|
|
|
|
const std::string& wellCaseErrorMsgName )
|
|
|
|
: m_wellPathGeometry( wellpath )
|
2019-09-06 03:40:57 -05:00
|
|
|
, m_wellCaseErrorMsgName( wellCaseErrorMsgName )
|
2015-10-14 01:08:13 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-14 01:08:13 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RigWellLogExtractor::~RigWellLogExtractor()
|
|
|
|
{
|
|
|
|
}
|
2017-10-27 07:28:51 -05:00
|
|
|
|
2018-09-04 04:40:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-07 04:08:47 -06:00
|
|
|
const std::vector<double>& RigWellLogExtractor::cellIntersectionMDs() const
|
2018-09-04 04:40:21 -05:00
|
|
|
{
|
|
|
|
return m_intersectionMeasuredDepths;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-07 04:08:47 -06:00
|
|
|
const std::vector<double>& RigWellLogExtractor::cellIntersectionTVDs() const
|
2018-09-04 04:40:21 -05:00
|
|
|
{
|
|
|
|
return m_intersectionTVDs;
|
|
|
|
}
|
|
|
|
|
2017-10-27 07:28:51 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-27 07:28:51 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-12-12 09:32:57 -06:00
|
|
|
std::vector<WellPathCellIntersectionInfo> RigWellLogExtractor::cellIntersectionInfosAlongWellPath() const
|
2017-10-27 07:28:51 -05:00
|
|
|
{
|
2017-12-12 06:53:02 -06:00
|
|
|
std::vector<WellPathCellIntersectionInfo> infoVector;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_intersectedCellsGlobIdx.empty() ) return infoVector;
|
2017-10-27 07:28:51 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < m_intersectedCellsGlobIdx.size() - 1; i = i + 2 )
|
2017-10-27 07:28:51 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( m_intersectedCellsGlobIdx[i] == m_intersectedCellsGlobIdx[i + 1] );
|
2017-10-27 07:28:51 -05:00
|
|
|
|
2017-12-12 06:53:02 -06:00
|
|
|
WellPathCellIntersectionInfo cellInfo;
|
2017-10-27 07:28:51 -05:00
|
|
|
|
|
|
|
cellInfo.globCellIndex = m_intersectedCellsGlobIdx[i];
|
2019-09-06 03:40:57 -05:00
|
|
|
cellInfo.startPoint = m_intersections[i];
|
|
|
|
cellInfo.endPoint = m_intersections[i + 1];
|
|
|
|
cellInfo.startMD = m_intersectionMeasuredDepths[i];
|
|
|
|
cellInfo.endMD = m_intersectionMeasuredDepths[i + 1];
|
2017-11-06 15:21:42 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cellInfo.intersectedCellFaceIn = m_intersectedCellFaces[i];
|
|
|
|
cellInfo.intersectedCellFaceOut = m_intersectedCellFaces[i + 1];
|
2017-10-27 07:28:51 -05:00
|
|
|
|
2020-02-12 04:43:15 -06:00
|
|
|
cellInfo.intersectionLengthsInCellCS =
|
|
|
|
this->calculateLengthInCell( cellInfo.globCellIndex, cellInfo.startPoint, cellInfo.endPoint );
|
2017-12-12 07:49:10 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
infoVector.push_back( cellInfo );
|
2017-10-27 07:28:51 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2017-10-27 07:28:51 -05:00
|
|
|
return infoVector;
|
|
|
|
}
|
|
|
|
|
2017-12-12 08:00:14 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-12-12 08:00:14 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-07 04:08:47 -06:00
|
|
|
const std::vector<size_t>& RigWellLogExtractor::intersectedCellsGlobIdx() const
|
2017-12-12 08:00:14 -06:00
|
|
|
{
|
|
|
|
return m_intersectedCellsGlobIdx;
|
|
|
|
}
|
|
|
|
|
2018-09-04 04:40:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-10-06 05:37:16 -05:00
|
|
|
const RigWellPath* RigWellLogExtractor::wellPathGeometry() const
|
2018-09-04 04:40:21 -05:00
|
|
|
{
|
2020-10-06 05:37:16 -05:00
|
|
|
return m_wellPathGeometry.p();
|
2018-09-04 04:40:21 -05:00
|
|
|
}
|
|
|
|
|
2015-10-14 03:10:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-14 03:10:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:43:15 -06:00
|
|
|
void RigWellLogExtractor::insertIntersectionsInMap( const std::vector<HexIntersectionInfo>& intersections,
|
|
|
|
cvf::Vec3d p1,
|
|
|
|
double md1,
|
|
|
|
cvf::Vec3d p2,
|
|
|
|
double md2,
|
|
|
|
std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo>* uniqueIntersections )
|
2015-10-14 03:10:07 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t intIdx = 0; intIdx < intersections.size(); ++intIdx )
|
2015-10-14 03:10:07 -05:00
|
|
|
{
|
2020-06-03 15:31:58 -05:00
|
|
|
double lengthAlongLineSegment1 = ( intersections[intIdx].m_intersectionPoint - p1 ).length();
|
|
|
|
double lengthAlongLineSegment2 = ( p2 - intersections[intIdx].m_intersectionPoint ).length();
|
2015-10-14 03:10:07 -05:00
|
|
|
double measuredDepthDiff = md2 - md1;
|
2020-06-03 15:31:58 -05:00
|
|
|
double lineLength = lengthAlongLineSegment1 + lengthAlongLineSegment2;
|
2015-10-14 03:10:07 -05:00
|
|
|
double measuredDepthOfPoint = 0.0;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( lineLength > 0.00001 )
|
2015-10-14 03:10:07 -05:00
|
|
|
{
|
2020-06-03 15:31:58 -05:00
|
|
|
measuredDepthOfPoint = md1 + measuredDepthDiff * lengthAlongLineSegment1 / ( lineLength );
|
2015-10-14 03:10:07 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
measuredDepthOfPoint = md1;
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
uniqueIntersections->insert(
|
|
|
|
std::make_pair( RigMDCellIdxEnterLeaveKey( measuredDepthOfPoint,
|
|
|
|
intersections[intIdx].m_hexIndex,
|
|
|
|
intersections[intIdx].m_isIntersectionEntering ),
|
|
|
|
intersections[intIdx] ) );
|
2015-10-14 03:10:07 -05:00
|
|
|
}
|
|
|
|
}
|
2015-10-14 01:35:05 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-10-14 01:35:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RigWellLogExtractor::populateReturnArrays( std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo>& uniqueIntersections )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2020-10-22 01:17:25 -05:00
|
|
|
QStringList errorMessages;
|
2015-10-14 08:14:41 -05:00
|
|
|
// For same MD and same cell, remove enter/leave pairs, as they only touches the wellpath, and should not contribute.
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo>::iterator it1 = uniqueIntersections.begin();
|
|
|
|
std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo>::iterator it2 = uniqueIntersections.begin();
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo>::iterator> iteratorsToIntersectonsToErase;
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
while ( it2 != uniqueIntersections.end() )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
|
|
|
++it2;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( it2 != uniqueIntersections.end() )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( RigWellLogExtractionTools::isEqualDepth( it1->first.measuredDepth, it2->first.measuredDepth ) )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( it1->first.hexIndex == it2->first.hexIndex )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
|
|
|
// Remove the two from the map, as they just are a touch of the cell surface
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_TIGHT_ASSERT( !it1->first.isEnteringCell && it2->first.isEnteringCell );
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
iteratorsToIntersectonsToErase.push_back( it1 );
|
|
|
|
iteratorsToIntersectonsToErase.push_back( it2 );
|
2015-10-14 01:35:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
++it1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Erase all the intersections that is not needed
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t erItIdx = 0; erItIdx < iteratorsToIntersectonsToErase.size(); ++erItIdx )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
uniqueIntersections.erase( iteratorsToIntersectonsToErase[erItIdx] );
|
2015-10-14 01:35:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy the map into a different sorting regime, with enter leave more significant than cell index
|
2015-10-14 08:14:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo> sortedUniqueIntersections;
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<RigMDCellIdxEnterLeaveKey, HexIntersectionInfo>::iterator it = uniqueIntersections.begin();
|
|
|
|
while ( it != uniqueIntersections.end() )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
sortedUniqueIntersections.insert( std::make_pair( RigMDEnterLeaveCellIdxKey( it->first.measuredDepth,
|
|
|
|
it->first.isEnteringCell,
|
|
|
|
it->first.hexIndex ),
|
|
|
|
it->second ) );
|
2015-10-14 01:35:05 -05:00
|
|
|
++it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-14 08:14:41 -05:00
|
|
|
// Add points for the endpoint of the wellpath, if it starts/ends inside a cell
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
|
|
|
// Add an intersection for the well startpoint that is inside the first cell
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo>::iterator it = sortedUniqueIntersections.begin();
|
2020-02-12 04:43:15 -06:00
|
|
|
if ( it != sortedUniqueIntersections.end() && !it->first.isEnteringCell ) // Leaving a cell as first
|
|
|
|
// intersection. Well starts inside a
|
|
|
|
// cell.
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
|
|
|
// Needs wellpath start point in front
|
2019-09-06 03:40:57 -05:00
|
|
|
HexIntersectionInfo firstLeavingPoint = it->second;
|
2020-10-06 05:37:16 -05:00
|
|
|
firstLeavingPoint.m_intersectionPoint = m_wellPathGeometry->wellPathPoints()[0];
|
2019-09-06 03:40:57 -05:00
|
|
|
firstLeavingPoint.m_face = cvf::StructGridInterface::NO_FACE;
|
2017-12-12 09:34:42 -06:00
|
|
|
firstLeavingPoint.m_isIntersectionEntering = true;
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2020-10-06 05:37:16 -05:00
|
|
|
sortedUniqueIntersections.insert(
|
|
|
|
std::make_pair( RigMDEnterLeaveCellIdxKey( m_wellPathGeometry->measuredDepths()[0],
|
|
|
|
true,
|
|
|
|
firstLeavingPoint.m_hexIndex ),
|
|
|
|
firstLeavingPoint ) );
|
2015-10-14 01:35:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Add an intersection for the well endpoint possibly inside the last cell.
|
2020-02-12 04:43:15 -06:00
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo>::reverse_iterator rit =
|
|
|
|
sortedUniqueIntersections.rbegin();
|
|
|
|
if ( rit != sortedUniqueIntersections.rend() && rit->first.isEnteringCell ) // Entering a cell as last
|
|
|
|
// intersection. Well ends inside a
|
|
|
|
// cell.
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
|
|
|
// Needs wellpath end point at end
|
2019-09-06 03:40:57 -05:00
|
|
|
HexIntersectionInfo lastEnterPoint = rit->second;
|
2020-10-06 05:37:16 -05:00
|
|
|
lastEnterPoint.m_intersectionPoint = m_wellPathGeometry->wellPathPoints().back();
|
2015-10-14 08:07:48 -05:00
|
|
|
lastEnterPoint.m_isIntersectionEntering = false;
|
2019-09-06 03:40:57 -05:00
|
|
|
lastEnterPoint.m_face = cvf::StructGridInterface::NO_FACE;
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
sortedUniqueIntersections.insert(
|
2020-10-06 05:37:16 -05:00
|
|
|
std::make_pair( RigMDEnterLeaveCellIdxKey( m_wellPathGeometry->measuredDepths().back(),
|
|
|
|
false,
|
|
|
|
lastEnterPoint.m_hexIndex ),
|
2019-09-06 03:40:57 -05:00
|
|
|
lastEnterPoint ) );
|
2015-10-14 01:35:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
// Filter and store the intersections pairwise as cell enter-leave pairs
|
2015-10-14 08:14:41 -05:00
|
|
|
// Discard points that does not have a match .
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo>::iterator it1 = sortedUniqueIntersections.begin();
|
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo>::iterator it2;
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
while ( it1 != sortedUniqueIntersections.end() )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
|
|
|
it2 = it1;
|
|
|
|
++it2;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( it2 == sortedUniqueIntersections.end() ) break;
|
2015-10-14 01:35:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( RigMDEnterLeaveCellIdxKey::isProperCellEnterLeavePair( it1->first, it2->first ) )
|
2015-10-14 01:35:05 -05:00
|
|
|
{
|
2020-10-22 01:17:25 -05:00
|
|
|
appendIntersectionToArrays( it1->first.measuredDepth, it1->second, &errorMessages );
|
2015-10-14 01:35:05 -05:00
|
|
|
++it1;
|
2020-10-22 01:17:25 -05:00
|
|
|
appendIntersectionToArrays( it1->first.measuredDepth, it1->second, &errorMessages );
|
2015-10-14 01:35:05 -05:00
|
|
|
++it1;
|
|
|
|
}
|
2015-10-14 08:07:48 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// If we haven't a proper pair, try our best to recover these variants:
|
|
|
|
// 1-2 3 4 5 6 7 8 9 10 11-12
|
|
|
|
// +---+
|
|
|
|
// +---+
|
2019-09-06 03:40:57 -05:00
|
|
|
// +---+
|
|
|
|
|
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo>::iterator it11 = it1;
|
|
|
|
std::map<RigMDEnterLeaveCellIdxKey, HexIntersectionInfo>::iterator it21 = it2;
|
2015-10-14 08:07:48 -05:00
|
|
|
|
|
|
|
// Check if we have overlapping cells (typically at a fault)
|
|
|
|
++it21;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( it21 != sortedUniqueIntersections.end() &&
|
|
|
|
RigMDEnterLeaveCellIdxKey::isProperCellEnterLeavePair( it11->first, it21->first ) )
|
|
|
|
{
|
2015-10-14 08:07:48 -05:00
|
|
|
// Found 3 to 5 connection
|
2020-10-22 01:17:25 -05:00
|
|
|
appendIntersectionToArrays( it11->first.measuredDepth, it11->second, &errorMessages );
|
|
|
|
appendIntersectionToArrays( it21->first.measuredDepth, it21->second, &errorMessages );
|
2015-10-14 08:07:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
++it11;
|
|
|
|
++it21;
|
|
|
|
if ( it21 != sortedUniqueIntersections.end() &&
|
|
|
|
RigMDEnterLeaveCellIdxKey::isProperCellEnterLeavePair( it11->first, it21->first ) )
|
2015-10-14 08:07:48 -05:00
|
|
|
{
|
|
|
|
// Found a 4 to 6 connection
|
2020-10-22 01:17:25 -05:00
|
|
|
appendIntersectionToArrays( it11->first.measuredDepth, it11->second, &errorMessages );
|
|
|
|
appendIntersectionToArrays( it21->first.measuredDepth, it21->second, &errorMessages );
|
2015-10-14 08:07:48 -05:00
|
|
|
|
|
|
|
it1 = it21;
|
|
|
|
++it1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-22 01:17:25 -05:00
|
|
|
errorMessages +=
|
2019-09-06 03:40:57 -05:00
|
|
|
QString( "Well Log Extraction : " ) + QString::fromStdString( m_wellCaseErrorMsgName ) +
|
2020-10-22 01:17:25 -05:00
|
|
|
( " Discards a point at MD: " ) + QString::number( (double)( it1->first.measuredDepth ) );
|
2015-10-14 08:07:48 -05:00
|
|
|
|
|
|
|
// Found that 8 to 10 is not connected, after finding 7 to 9
|
|
|
|
it1 = it21; // Discard 8 by Jumping to 10
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-22 01:17:25 -05:00
|
|
|
errorMessages += QString( "Well Log Extraction : " ) +
|
|
|
|
QString::fromStdString( m_wellCaseErrorMsgName ) + ( " Discards a point at MD: " ) +
|
|
|
|
QString::number( (double)( it1->first.measuredDepth ) );
|
2015-10-14 08:07:48 -05:00
|
|
|
|
|
|
|
// Found that 10 to 11 is not connected, and not 10 to 12 either
|
2019-09-06 03:40:57 -05:00
|
|
|
++it1; // Discard 10 and jump to 11 and hope that recovers us
|
2015-10-14 08:07:48 -05:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2015-10-14 01:35:05 -05:00
|
|
|
}
|
|
|
|
}
|
2021-04-18 02:05:10 -05:00
|
|
|
|
|
|
|
bool reportErrorMessages = false;
|
|
|
|
if ( reportErrorMessages )
|
2020-10-22 01:17:25 -05:00
|
|
|
{
|
2021-04-18 02:05:10 -05:00
|
|
|
errorMessages.removeDuplicates();
|
|
|
|
for ( auto message : errorMessages )
|
|
|
|
{
|
|
|
|
RiaLogging::warning( message );
|
|
|
|
}
|
2020-10-22 01:17:25 -05:00
|
|
|
}
|
2015-10-14 01:35:05 -05:00
|
|
|
}
|
|
|
|
|
2020-10-22 01:52:45 -05:00
|
|
|
void RigWellLogExtractor::appendIntersectionToArrays( double measuredDepth,
|
|
|
|
const HexIntersectionInfo& intersection,
|
|
|
|
gsl::not_null<QStringList*> errorMessages )
|
2015-10-14 08:07:48 -05:00
|
|
|
{
|
2021-02-12 06:37:05 -06:00
|
|
|
QString errorMessage; // This error message is currently not displayed anywhere, as the output caused noise in
|
|
|
|
// several situations https://github.com/OPM/ResInsight/issues/7126
|
|
|
|
|
2020-10-12 02:56:38 -05:00
|
|
|
if ( !m_intersectionMeasuredDepths.empty() && measuredDepth < m_intersectionMeasuredDepths.back() )
|
|
|
|
{
|
2020-12-07 07:59:40 -06:00
|
|
|
const double warningLimit = 0.01;
|
|
|
|
double diff = std::fabs( measuredDepth - m_intersectionMeasuredDepths.back() );
|
|
|
|
if ( diff > warningLimit )
|
|
|
|
{
|
|
|
|
errorMessage +=
|
2021-04-29 03:53:52 -05:00
|
|
|
QString( "Well Log Extraction : %1 does not have a monotonically increasing measured depth." )
|
2020-12-07 07:59:40 -06:00
|
|
|
.arg( QString::fromStdString( m_wellCaseErrorMsgName ) );
|
|
|
|
}
|
|
|
|
|
2021-04-29 03:53:52 -05:00
|
|
|
// Allow alterations of up to 0.1 percent as long as we keep the measured depth monotonically increasing.
|
2020-10-12 02:56:38 -05:00
|
|
|
const double tolerance = std::max( 1.0, measuredDepth ) * 1.0e-3;
|
|
|
|
if ( RigWellLogExtractionTools::isEqualDepth( measuredDepth, m_intersectionMeasuredDepths.back(), tolerance ) )
|
|
|
|
{
|
2020-12-07 07:59:40 -06:00
|
|
|
if ( diff > warningLimit )
|
|
|
|
{
|
|
|
|
errorMessage += "The well path has been slightly adjusted";
|
|
|
|
}
|
2020-10-12 02:56:38 -05:00
|
|
|
measuredDepth = m_intersectionMeasuredDepths.back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_intersectionMeasuredDepths.push_back( measuredDepth );
|
|
|
|
m_intersectionTVDs.push_back( fabs( intersection.m_intersectionPoint[2] ) );
|
|
|
|
m_intersections.push_back( intersection.m_intersectionPoint );
|
|
|
|
m_intersectedCellsGlobIdx.push_back( intersection.m_hexIndex );
|
|
|
|
m_intersectedCellFaces.push_back( intersection.m_face );
|
2015-10-14 08:07:48 -05:00
|
|
|
}
|