diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h index 5ded0c29db..a421e6bc1f 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h @@ -95,6 +95,7 @@ public: virtual void updateAzimuthBasedOnWellAzimuthAngle() = 0; virtual double wellAzimuthAtFracturePosition() const = 0; + virtual double fractureMD() const = 0; protected: virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h index 959fcba9d3..c34b4c11c9 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h @@ -46,6 +46,8 @@ public: double wellAzimuthAtFracturePosition() const override; double wellDipAtFracturePosition(); + double fractureMD() const override { return m_location; } + int branchIndex() const { return m_branchIndex(); } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp index bda142d34f..7ff18d2e2d 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp @@ -47,14 +47,6 @@ RimWellPathFracture::RimWellPathFracture(void) RimWellPathFracture::~RimWellPathFracture() { } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RimWellPathFracture::measuredDepth() const -{ - return m_measuredDepth(); -} //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h index 69a259a2c0..2328ef5b1d 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h @@ -37,7 +37,7 @@ public: RimWellPathFracture(void); virtual ~RimWellPathFracture(void); - double measuredDepth() const; + double fractureMD() const override { return m_measuredDepth; } void setMeasuredDepth(double mdValue); virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; diff --git a/ApplicationCode/ReservoirDataModel/RigWellPath.cpp b/ApplicationCode/ReservoirDataModel/RigWellPath.cpp index e083dbaf4c..f0e155463f 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPath.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPath.cpp @@ -229,3 +229,38 @@ std::vector RigWellPath::clippedPointSubset(double startMD, double e return points; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigWellPath::wellPathPointsIncludingFractureIntersection(double fractureIntersectionMD) const +{ + std::vector points; + if (m_measuredDepths.empty()) return points; + + cvf::Vec3d fractureWellPathPpoint = interpolatedPointAlongWellPath(fractureIntersectionMD); + + for (size_t i = 0; i < m_measuredDepths.size()-1; i++) + { + if (m_measuredDepths[i] < fractureIntersectionMD) + { + points.push_back(m_wellPathPoints[i]); + if (m_measuredDepths[i + 1] > fractureIntersectionMD) + { + points.push_back(fractureWellPathPpoint); + } + } + else if (m_measuredDepths[i] < fractureIntersectionMD) + { + if (i == 0) + { + points.push_back(fractureWellPathPpoint); + } + points.push_back(m_wellPathPoints[i]); + } + } + points.push_back(m_wellPathPoints.back()); + + return points; + +} + diff --git a/ApplicationCode/ReservoirDataModel/RigWellPath.h b/ApplicationCode/ReservoirDataModel/RigWellPath.h index f09603fec8..4f563e612a 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPath.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPath.h @@ -45,6 +45,7 @@ public: void twoClosestPoints(const cvf::Vec3d& position, cvf::Vec3d* p1, cvf::Vec3d* p2) const; std::vector clippedPointSubset(double startMD, double endMD) const; + std::vector wellPathPointsIncludingFractureIntersection(double fractureIntersectionMD) const; private: bool m_hasDatumElevation; double m_datumElevation; diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp index c5d8248533..f79d197c80 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.cpp @@ -12,11 +12,12 @@ #include "cvfMath.h" #include +#include "RimSimWellFracture.h" -RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, const RimFracture* rimFracture) +RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, RimFracture* rimFracture) { - std::vector wellPathPoints = wellpathGeom->m_wellPathPoints; + std::vector wellPathPoints = wellpathGeom->wellPathPointsIncludingFractureIntersection(rimFracture->fractureMD()); cvf::Mat4d fractureXf = rimFracture->transformMatrix(); double wellRadius = rimFracture->wellRadius(rimFracture->fractureUnit()); std::vector fracturePolygonf ; diff --git a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.h b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.h index 640165279c..74f6af4bc2 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPathStimplanIntersector.h @@ -38,7 +38,7 @@ public: int endpointCount; }; - RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, const RimFracture * rimFracture); + RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, RimFracture * rimFracture); const std::map& intersections() { return m_stimPlanCellIdxToIntersectionInfoMap; }