#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.

This commit is contained in:
astridkbjorke 2017-06-29 15:06:44 +02:00
parent e7043db156
commit c7d708e9d4
7 changed files with 34 additions and 36 deletions

View File

@ -581,7 +581,14 @@ void RimFracture::setFractureTemplate(RimFractureTemplate* fractureTemplate)
stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex(); stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex();
} }
this->updateAzimuthFromFractureTemplate(); if (fractureTemplate->orientationType == RimFractureTemplate::AZIMUTH)
{
azimuth = fractureTemplate->azimuthAngle;
}
else
{
this->updateAzimuthBasedOnWellAzimuthAngle();
}
this->wellDiameter = fractureTemplate->wellDiameterInFractureUnit(m_fractureUnit()); this->wellDiameter = fractureTemplate->wellDiameterInFractureUnit(m_fractureUnit());
this->perforationLength = fractureTemplate->perforationLengthInFractureUnit(m_fractureUnit()); this->perforationLength = fractureTemplate->perforationLengthInFractureUnit(m_fractureUnit());
} }

View File

@ -93,10 +93,9 @@ public:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
cvf::Vec3d fracturePosition() const; cvf::Vec3d fracturePosition() const;
virtual void updateAzimuthFromFractureTemplate() = 0; virtual void updateAzimuthBasedOnWellAzimuthAngle() = 0;
virtual double wellAzimuthAtFracturePosition() const = 0; virtual double wellAzimuthAtFracturePosition() const = 0;
protected: protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;

View File

@ -122,13 +122,17 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
{ {
if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5)) if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
{ {
fracture->updateAzimuthFromFractureTemplate(); fracture->azimuth = azimuthAngle;
fracture->clearDisplayGeometryCache(); fracture->clearDisplayGeometryCache();
} }
if (changedField == &orientationType) if (changedField == &orientationType)
{ {
fracture->updateAzimuthFromFractureTemplate(); if (newValue == AZIMUTH)
{
fracture->azimuth = azimuthAngle;
}
else fracture->updateAzimuthBasedOnWellAzimuthAngle();
fracture->clearDisplayGeometryCache(); fracture->clearDisplayGeometryCache();
} }

View File

@ -77,33 +77,27 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateAzimuthFromFractureTemplate() void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle()
{ {
updateBranchGeometry(); updateBranchGeometry();
RimFractureTemplate::FracOrientationEnum orientation; if (!fractureTemplate()) return;
if (fractureTemplate()) orientation = fractureTemplate()->orientationType(); if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH
else orientation = RimFractureTemplate::AZIMUTH; || fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH)
if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation== RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
double simWellAzimuth = wellAzimuthAtFracturePosition(); double simWellAzimuth = wellAzimuthAtFracturePosition();
if (orientation == RimFractureTemplate::ALONG_WELL_PATH ) if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH )
{ {
azimuth = simWellAzimuth; azimuth = simWellAzimuth;
} }
else if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH) else if (fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
if (simWellAzimuth + 90 < 360) azimuth = simWellAzimuth + 90; if (simWellAzimuth + 90 < 360) azimuth = simWellAzimuth + 90;
else 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) if (orientation != RimFractureTemplate::AZIMUTH)
{ {
updateAzimuthFromFractureTemplate(); updateAzimuthBasedOnWellAzimuthAngle();
} }
RimProject* proj; RimProject* proj;

View File

@ -42,7 +42,7 @@ public:
void recomputeWellCenterlineCoordinates(); void recomputeWellCenterlineCoordinates();
void updateFracturePositionFromLocation(); void updateFracturePositionFromLocation();
void updateAzimuthFromFractureTemplate() override; void updateAzimuthBasedOnWellAzimuthAngle() override;
double wellAzimuthAtFracturePosition() const override; double wellAzimuthAtFracturePosition() const override;
double wellDipAtFracturePosition(); double wellDipAtFracturePosition();

View File

@ -76,7 +76,7 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
if (changedField == &m_measuredDepth) if (changedField == &m_measuredDepth)
{ {
updatePositionFromMeasuredDepth(); updatePositionFromMeasuredDepth();
updateAzimuthFromFractureTemplate(); updateAzimuthBasedOnWellAzimuthAngle();
RimProject* proj = nullptr; RimProject* proj = nullptr;
this->firstAncestorOrThisOfType(proj); 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()) return;
if (fractureTemplate()) orientation = fractureTemplate()->orientationType();
else orientation = RimFractureTemplate::AZIMUTH;
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(); double wellPathAzimuth = wellAzimuthAtFracturePosition();
if (orientation == RimFractureTemplate::ALONG_WELL_PATH) if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH)
{ {
azimuth = wellPathAzimuth; azimuth = wellPathAzimuth;
} }
else if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH) if (fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
if (wellPathAzimuth + 90 < 360) azimuth = wellPathAzimuth + 90; if (wellPathAzimuth + 90 < 360) azimuth = wellPathAzimuth + 90;
else 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;
// }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -41,7 +41,7 @@ public:
void setMeasuredDepth(double mdValue); void setMeasuredDepth(double mdValue);
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; 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; double wellAzimuthAtFracturePosition() const override;