From 42563ac81327f64e49483530db5599d5a1a51ade Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 8 Jun 2017 11:37:23 +0200 Subject: [PATCH] #1571 Using circle instead of square to find relevant part of well path based on perforation length. --- .../RigWellPathStimplanIntersector.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp index d3cfc814e0..e66bb07f38 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp @@ -9,6 +9,8 @@ #include "RimStimPlanFractureTemplate.h" #include "RigFractureGrid.h" +#include "cvfMath.h" + #include @@ -47,10 +49,14 @@ void RigWellPathStimplanIntersector::calculate(const cvf::Mat4f &fractureXf, cvf::Mat4d toFractureXf = cvf::Mat4d(fractureXf.getInverted()); std::vector perforationLengthBoundingBoxPolygon; - perforationLengthBoundingBoxPolygon.push_back(cvf::Vec3d(-perforationLength / 2, -perforationLength / 2, 0)); - perforationLengthBoundingBoxPolygon.push_back(cvf::Vec3d( perforationLength / 2, -perforationLength / 2, 0)); - perforationLengthBoundingBoxPolygon.push_back(cvf::Vec3d( perforationLength / 2, perforationLength / 2, 0)); - perforationLengthBoundingBoxPolygon.push_back(cvf::Vec3d(-perforationLength / 2, perforationLength / 2, 0)); + double cicleRadius = perforationLength / 2; + int pointsInCirclePolygon = 20; + for (int i = 0; i < pointsInCirclePolygon; i++) + { + double x = cicleRadius * cvf::Math::cos(i * (2 * cvf::PI_D / pointsInCirclePolygon)); + double y = cicleRadius * cvf::Math::sin(i * (2 * cvf::PI_D / pointsInCirclePolygon)); + perforationLengthBoundingBoxPolygon.push_back(cvf::Vec3d(x, y, 0)); + } // Convert well path to fracture template system