(#433) Using measured depth read from from well path files

This commit is contained in:
Pål Hagen
2015-09-10 15:11:31 +02:00
parent 615ac05970
commit 03aa8cc071

View File

@@ -46,7 +46,6 @@ void RigEclipseWellLogExtractor::calculateIntersection()
{ {
const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes(); const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes();
double globalMeasuredDepth = 0; // Where do we start ? z - of first well path point ?
bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards(); bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards();
if (!m_wellPath->m_wellPathPoints.size()) return ; if (!m_wellPath->m_wellPathPoints.size()) return ;
@@ -60,7 +59,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
bb.add(p1); bb.add(p1);
bb.add(p2); bb.add(p2);
std::vector<size_t> closeCells = findCloseCells(bb ); std::vector<size_t> closeCells = findCloseCells(bb);
std::vector<HexIntersectionInfo> intersections; std::vector<HexIntersectionInfo> intersections;
cvf::Vec3d hexCorners[8]; cvf::Vec3d hexCorners[8];
@@ -87,11 +86,25 @@ void RigEclipseWellLogExtractor::calculateIntersection()
// map <WellPathDepthPoint, (CellIdx, intersectionPoint)> // map <WellPathDepthPoint, (CellIdx, intersectionPoint)>
std::map<WellPathDepthPoint, HexIntersectionInfo > sortedIntersections; std::map<WellPathDepthPoint, HexIntersectionInfo > sortedIntersections;
double md1 = m_wellPath->m_measuredDepths[wpp];
double md2 = m_wellPath->m_measuredDepths[wpp+1];
for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx) for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx)
{ {
if (!isCellFaceNormalsOut) intersections[intIdx].m_isIntersectionEntering = !intersections[intIdx].m_isIntersectionEntering ; if (!isCellFaceNormalsOut) intersections[intIdx].m_isIntersectionEntering = !intersections[intIdx].m_isIntersectionEntering ;
double lenghtAlongLineSegment = (intersections[intIdx].m_intersectionPoint - p1).length(); double lenghtAlongLineSegment1 = (intersections[intIdx].m_intersectionPoint - p1).length();
double measuredDepthOfPoint = globalMeasuredDepth + lenghtAlongLineSegment; double lenghtAlongLineSegment2 = (p2 - intersections[intIdx].m_intersectionPoint).length();
double measuredDepthDiff = md2 - md1;
double lineLength = lenghtAlongLineSegment1 + lenghtAlongLineSegment2;
double measuredDepthOfPoint = 0.0;
if (lineLength > 0.00001)
{
measuredDepthOfPoint = md1 + measuredDepthDiff*lenghtAlongLineSegment1/(lineLength);
}
else
{
measuredDepthOfPoint = md1;
}
sortedIntersections.insert(std::make_pair(WellPathDepthPoint(measuredDepthOfPoint, intersections[intIdx].m_isIntersectionEntering), intersections[intIdx])); sortedIntersections.insert(std::make_pair(WellPathDepthPoint(measuredDepthOfPoint, intersections[intIdx].m_isIntersectionEntering), intersections[intIdx]));
} }
@@ -108,9 +121,6 @@ void RigEclipseWellLogExtractor::calculateIntersection()
m_intersectedCellFaces.push_back(it->second.m_face); m_intersectedCellFaces.push_back(it->second.m_face);
++it; ++it;
} }
// Increment the measured depth
globalMeasuredDepth += (p2-p1).length();
} }
} }