#3204, #2609 First somewhat working version of the editable wellpath with "complete" geometry

This commit is contained in:
Jacob Støren 2018-08-14 11:25:08 +02:00
parent 088dd61fd8
commit 319203b7fc
3 changed files with 112 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#include "RimModeledWellPath.h"
#include "RiaSCurveCalculator.h"
#include "RiaLogging.h"
#include "RiaJCurveCalculator.h"
namespace caf
{
@ -232,6 +233,9 @@ std::vector<RimWellPathTarget*> RimWellPathGeometryDef::activeWellTargets() cons
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
{
double prevSegmentEndAzi = 0;
double prevSegmentEndInc = 0;
std::vector<RimWellPathTarget*> activeWellPathTargets = activeWellTargets();
CVF_ASSERT(activeWellPathTargets.size() > 1);
@ -244,17 +248,17 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
RimWellPathTarget* target1 = activeWellPathTargets[tIdx];
RimWellPathTarget* target2 = activeWellPathTargets[tIdx+1];
if (target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
&& target2->targetType() == RimWellPathTarget::POINT_AND_TANGENT)
{
RiaSCurveCalculator sCurveCalc(target1->targetPointXYZ(),
target1->azimuth(),
target1->inclination(),
115,//30.0/cvf::Math::toRadians(12.0),
target1->radius2(),
target2->targetPointXYZ(),
target2->azimuth(),
target2->inclination(),
115);//30.0/cvf::Math::toRadians(12.0));
target2->radius1());
if (!sCurveCalc.isOk())
{
@ -270,11 +274,81 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
}
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePoint() );
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
}
else if ( target1->targetType() == RimWellPathTarget::POINT
&& target2->targetType() == RimWellPathTarget::POINT_AND_TANGENT)
{
RiaSCurveCalculator sCurveCalc(target1->targetPointXYZ(),
prevSegmentEndAzi,
prevSegmentEndInc,
target1->radius2(),
target2->targetPointXYZ(),
target2->azimuth(),
target2->inclination(),
target2->radius1());
if (!sCurveCalc.isOk())
{
double p1p2Length = (target2->targetPointXYZ() - target1->targetPointXYZ()).length();
sCurveCalc = RiaSCurveCalculator::fromTangentsAndLength(target1->targetPointXYZ(),
prevSegmentEndAzi,
prevSegmentEndInc,
0.2*p1p2Length,
target2->targetPointXYZ(),
target2->azimuth(),
target2->inclination(),
0.2*p1p2Length);
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
}
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePoint() );
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
}
else if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
&& target2->targetType() == RimWellPathTarget::POINT)
{
RiaJCurveCalculator jCurve(target1->targetPointXYZ(),
target1->azimuth(),
target1->inclination(),
target1->radius2(),
target2->targetPointXYZ());
if ( jCurve.isOk() )
{
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePoint());
}
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
prevSegmentEndAzi = jCurve.endAzimuth();
prevSegmentEndInc = jCurve.endInclination();
}
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
else if ( target1->targetType() == RimWellPathTarget::POINT
&& target2->targetType() == RimWellPathTarget::POINT)
{
RiaJCurveCalculator jCurve(target1->targetPointXYZ(),
prevSegmentEndAzi,
prevSegmentEndInc,
target1->radius2(),
target2->targetPointXYZ());
if ( jCurve.isOk() )
{
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePoint());
}
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
prevSegmentEndAzi = jCurve.endAzimuth();
prevSegmentEndInc = jCurve.endInclination();
}
else
{
CVF_ASSERT(false);
}
}
return endPoints;

View File

@ -28,9 +28,11 @@ RimWellPathTarget::RimWellPathTarget()
CAF_PDM_InitField(&m_isEnabled, "IsEnabled", true, "", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", "");
//m_targetType.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_dogleg1, "Dogleg1", 5.0, "DLS 1", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_targetPoint, "TargetPoint", "Point", "", "", "");
CAF_PDM_InitField(&m_azimuth, "Azimuth", 0.0, "Azi(deg)", "", "", "");
CAF_PDM_InitField(&m_inclination, "Inclination", 0.0, "Inc(deg)", "", "", "");
CAF_PDM_InitField(&m_dogleg2, "Dogleg2", 5.0, "DLS 2", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -145,6 +147,31 @@ cvf::Vec3d RimWellPathTarget::tangent() const
-cos(incRad));
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellPathTarget::radius1() const
{
// Needs to be aware of unit to select correct DLS conversion
// Degrees pr 100 ft
// Degrees pr 10m
// Degrees pr 30m
return 30.0/cvf::Math::toRadians(m_dogleg1);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellPathTarget::radius2() const
{
// Needs to be aware of unit to select correct DLS conversion
// Degrees pr 100 ft
// Degrees pr 10m
// Degrees pr 30m
return 30.0/cvf::Math::toRadians(m_dogleg2);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -178,10 +205,12 @@ void RimWellPathTarget::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
{
m_azimuth.uiCapability()->setUiReadOnly(true);
m_inclination.uiCapability()->setUiReadOnly(true);
m_dogleg1.uiCapability()->setUiReadOnly(true);
}
else
{
m_azimuth.uiCapability()->setUiReadOnly(false);
m_inclination.uiCapability()->setUiReadOnly(false);
m_dogleg1.uiCapability()->setUiReadOnly(false);
}
}

View File

@ -44,6 +44,8 @@ public:
double azimuth() const;
double inclination() const;
cvf::Vec3d tangent() const;
double radius1() const;
double radius2() const;
private:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
@ -56,5 +58,8 @@ private:
caf::PdmField<cvf::Vec3d> m_targetPoint;
caf::PdmField<double> m_azimuth;
caf::PdmField<double> m_inclination;
caf::PdmField<double> m_dogleg1;
caf::PdmField<double> m_dogleg2;
};