From c7d708e9d44c297f031d8a2c35ffb129681f4a5e Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Thu, 29 Jun 2017 15:06:44 +0200 Subject: [PATCH] #1658 Setting azimuth angle from fracture template if orientation type is Azimuth. Changing updateAzimuthFromFractureTemplate to updateAzimuthBasedOnWellAzimuthAngle and only using this function to update azimuth angles if orientation type is not azimuth. --- .../Completions/RimFracture.cpp | 9 ++++++- .../Completions/RimFracture.h | 5 ++-- .../Completions/RimFractureTemplate.cpp | 8 +++++-- .../Completions/RimSimWellFracture.cpp | 24 +++++++------------ .../Completions/RimSimWellFracture.h | 2 +- .../Completions/RimWellPathFracture.cpp | 20 ++++++---------- .../Completions/RimWellPathFracture.h | 2 +- 7 files changed, 34 insertions(+), 36 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp index e44245701c..2b98b4d3c4 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp @@ -581,7 +581,14 @@ void RimFracture::setFractureTemplate(RimFractureTemplate* fractureTemplate) stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex(); } - this->updateAzimuthFromFractureTemplate(); + if (fractureTemplate->orientationType == RimFractureTemplate::AZIMUTH) + { + azimuth = fractureTemplate->azimuthAngle; + } + else + { + this->updateAzimuthBasedOnWellAzimuthAngle(); + } this->wellDiameter = fractureTemplate->wellDiameterInFractureUnit(m_fractureUnit()); this->perforationLength = fractureTemplate->perforationLengthInFractureUnit(m_fractureUnit()); } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h index 9a9b593baa..5ded0c29db 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h @@ -93,10 +93,9 @@ public: virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; cvf::Vec3d fracturePosition() const; - virtual void updateAzimuthFromFractureTemplate() = 0; + virtual void updateAzimuthBasedOnWellAzimuthAngle() = 0; virtual double wellAzimuthAtFracturePosition() const = 0; - - + protected: virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp index b66aaca863..4ecb632ea7 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp @@ -122,13 +122,17 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie { if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5)) { - fracture->updateAzimuthFromFractureTemplate(); + fracture->azimuth = azimuthAngle; fracture->clearDisplayGeometryCache(); } if (changedField == &orientationType) { - fracture->updateAzimuthFromFractureTemplate(); + if (newValue == AZIMUTH) + { + fracture->azimuth = azimuthAngle; + } + else fracture->updateAzimuthBasedOnWellAzimuthAngle(); fracture->clearDisplayGeometryCache(); } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp index 1a7dd42264..e6c617b503 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp @@ -77,33 +77,27 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::updateAzimuthFromFractureTemplate() +void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle() { updateBranchGeometry(); - - RimFractureTemplate::FracOrientationEnum orientation; - if (fractureTemplate()) orientation = fractureTemplate()->orientationType(); - else orientation = RimFractureTemplate::AZIMUTH; - - if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation== RimFractureTemplate::TRANSVERSE_WELL_PATH) + + if (!fractureTemplate()) return; + if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH + || fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH) { double simWellAzimuth = wellAzimuthAtFracturePosition(); - if (orientation == RimFractureTemplate::ALONG_WELL_PATH ) + if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH ) { azimuth = simWellAzimuth; } - else if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH) + else if (fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH) { if (simWellAzimuth + 90 < 360) azimuth = simWellAzimuth + 90; else azimuth = simWellAzimuth - 90; } } - else //Azimuth value read from template - { - if (fractureTemplate()) azimuth = fractureTemplate()->azimuthAngle; - else azimuth = 0.0; - } + } //-------------------------------------------------------------------------------------------------- @@ -145,7 +139,7 @@ void RimSimWellFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel if (orientation != RimFractureTemplate::AZIMUTH) { - updateAzimuthFromFractureTemplate(); + updateAzimuthBasedOnWellAzimuthAngle(); } RimProject* proj; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h index 235c4bef15..959fcba9d3 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h @@ -42,7 +42,7 @@ public: void recomputeWellCenterlineCoordinates(); void updateFracturePositionFromLocation(); - void updateAzimuthFromFractureTemplate() override; + void updateAzimuthBasedOnWellAzimuthAngle() override; double wellAzimuthAtFracturePosition() const override; double wellDipAtFracturePosition(); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp index 1c95182c8c..bda142d34f 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp @@ -76,7 +76,7 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie if (changedField == &m_measuredDepth) { updatePositionFromMeasuredDepth(); - updateAzimuthFromFractureTemplate(); + updateAzimuthBasedOnWellAzimuthAngle(); RimProject* proj = nullptr; this->firstAncestorOrThisOfType(proj); @@ -87,32 +87,26 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellPathFracture::updateAzimuthFromFractureTemplate() +void RimWellPathFracture::updateAzimuthBasedOnWellAzimuthAngle() { - RimFractureTemplate::FracOrientationEnum orientation; - if (fractureTemplate()) orientation = fractureTemplate()->orientationType(); - else orientation = RimFractureTemplate::AZIMUTH; + if (!fractureTemplate()) return; - if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH) + if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH + || fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH) { double wellPathAzimuth = wellAzimuthAtFracturePosition(); - if (orientation == RimFractureTemplate::ALONG_WELL_PATH) + if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH) { azimuth = wellPathAzimuth; } - else if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH) + if (fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH) { if (wellPathAzimuth + 90 < 360) azimuth = wellPathAzimuth + 90; else azimuth = wellPathAzimuth - 90; } } - //TODO: Reset value if choosing azimuth in frac template! - // else //Azimuth value read from template -// { -// azimuth = attachedFractureTemplate()->azimuthAngle; -// } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h index 9d3c78103a..69a259a2c0 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h @@ -41,7 +41,7 @@ public: void setMeasuredDepth(double mdValue); virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; - virtual void updateAzimuthFromFractureTemplate() override; + virtual void updateAzimuthBasedOnWellAzimuthAngle() override; double wellAzimuthAtFracturePosition() const override;