mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5046 from OPM/bugfixes-wellpath-modelling
Bugfixes wellpath modeling
This commit is contained in:
commit
de6dab7d2e
@ -46,8 +46,10 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
|
||||
{!activeWellPathTargets[0].isTangentConstrained,
|
||||
0.0,
|
||||
0.0,
|
||||
false,
|
||||
true,
|
||||
std::numeric_limits<double>::infinity(),
|
||||
false,
|
||||
true,
|
||||
std::numeric_limits<double>::infinity()} );
|
||||
}
|
||||
@ -60,8 +62,10 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
|
||||
0.0,
|
||||
0.0,
|
||||
false,
|
||||
false,
|
||||
std::numeric_limits<double>::infinity(),
|
||||
false,
|
||||
false,
|
||||
std::numeric_limits<double>::infinity()} );
|
||||
|
||||
std::vector<WellTarget> adjustedWellPathTargets = activeWellPathTargets;
|
||||
@ -130,6 +134,8 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
|
||||
target1Status.hasDerivedTangent = true;
|
||||
target1Status.resultAzimuth = jCurve.endAzimuth() + M_PI;
|
||||
target1Status.resultInclination = M_PI - jCurve.endInclination();
|
||||
|
||||
target2Status.isRadius1Editable = true;
|
||||
}
|
||||
else // The complete wellpath is a straight line from target 1 to 2
|
||||
{
|
||||
@ -210,6 +216,9 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
|
||||
m_lineArcEndpoints.push_back( sCurveCalc.firstArcEndpoint() + referencePointXyz );
|
||||
m_lineArcEndpoints.push_back( sCurveCalc.secondArcStartpoint() + referencePointXyz );
|
||||
m_lineArcEndpoints.push_back( target2.targetPointXYZ + referencePointXyz );
|
||||
|
||||
target1Status.isRadius2Editable = true;
|
||||
target2Status.isRadius1Editable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -244,6 +253,8 @@ RiaLineArcWellPathCalculator::RiaLineArcWellPathCalculator( const cvf::Vec3d&
|
||||
|
||||
m_lineArcEndpoints.push_back( target2.targetPointXYZ + referencePointXyz );
|
||||
|
||||
target1Status.isRadius2Editable = true;
|
||||
|
||||
target2Status.hasDerivedTangent = true;
|
||||
target2Status.resultAzimuth = jCurve.endAzimuth();
|
||||
target2Status.resultInclination = jCurve.endInclination();
|
||||
|
@ -45,8 +45,11 @@ public:
|
||||
double resultAzimuth;
|
||||
double resultInclination;
|
||||
|
||||
bool isRadius1Editable;
|
||||
bool hasOverriddenRadius1;
|
||||
double resultRadius1;
|
||||
|
||||
bool isRadius2Editable;
|
||||
bool hasOverriddenRadius2;
|
||||
double resultRadius2;
|
||||
};
|
||||
|
@ -29,7 +29,7 @@ RiaPolyArcLineSampler::RiaPolyArcLineSampler( const cvf::Vec3d& sta
|
||||
const std::vector<cvf::Vec3d>& lineArcEndPoints )
|
||||
: m_startTangent( startTangent )
|
||||
, m_lineArcEndPoints( lineArcEndPoints )
|
||||
, m_samplingsInterval( 0.15 )
|
||||
, m_maxSamplingsInterval( 0.15 )
|
||||
, m_isResamplingLines( true )
|
||||
, m_totalMD( 0.0 )
|
||||
, m_points( nullptr )
|
||||
@ -48,7 +48,7 @@ void RiaPolyArcLineSampler::sampledPointsAndMDs( double sample
|
||||
{
|
||||
CVF_ASSERT( sampleInterval > 0.0 );
|
||||
|
||||
m_samplingsInterval = sampleInterval;
|
||||
m_maxSamplingsInterval = sampleInterval;
|
||||
m_isResamplingLines = isResamplingLines;
|
||||
|
||||
double startMD = 0.0;
|
||||
@ -126,18 +126,20 @@ void RiaPolyArcLineSampler::sampleLine( cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d
|
||||
cvf::Vec3d p1p2 = p2 - p1;
|
||||
|
||||
double p1p2Length = p1p2.length();
|
||||
if ( p1p2Length > m_samplingsInterval && m_isResamplingLines )
|
||||
|
||||
if ( m_isResamplingLines && p1p2Length > m_maxSamplingsInterval )
|
||||
{
|
||||
cvf::Vec3d tp1p2 = p1p2 / p1p2Length;
|
||||
double mdInc = m_samplingsInterval;
|
||||
double mdInc = m_maxSamplingsInterval;
|
||||
while ( mdInc < p1p2Length )
|
||||
{
|
||||
cvf::Vec3d ps = p1 + mdInc * tp1p2;
|
||||
m_points->push_back( ps );
|
||||
m_meshDs->push_back( m_totalMD + mdInc );
|
||||
mdInc += m_samplingsInterval;
|
||||
mdInc += m_maxSamplingsInterval;
|
||||
}
|
||||
}
|
||||
|
||||
m_totalMD += p1p2Length;
|
||||
m_points->push_back( p2 );
|
||||
m_meshDs->push_back( m_totalMD );
|
||||
@ -156,7 +158,9 @@ void RiaPolyArcLineSampler::sampleArc( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d
|
||||
double radius = CS_rad.radius();
|
||||
cvf::Mat4d arcCS = CS_rad.arcCS();
|
||||
|
||||
double angleInc = m_samplingsInterval / radius;
|
||||
double angleInc = m_maxSamplingsInterval / radius;
|
||||
|
||||
angleInc = angleInc < m_maxSamplingArcAngle ? angleInc: m_maxSamplingArcAngle; // Angle from 6 deg dogleg on 10 m
|
||||
|
||||
cvf::Vec3d C = CS_rad.center();
|
||||
cvf::Vec3d N = CS_rad.normal();
|
||||
@ -181,6 +185,7 @@ void RiaPolyArcLineSampler::sampleArc( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d
|
||||
m_points->push_back( C_to_incP );
|
||||
m_meshDs->push_back( m_totalMD + angle * radius );
|
||||
}
|
||||
|
||||
m_totalMD += arcAngle * radius;
|
||||
m_points->push_back( p2 );
|
||||
m_meshDs->push_back( m_totalMD );
|
||||
|
@ -27,7 +27,7 @@ class RiaPolyArcLineSampler
|
||||
public:
|
||||
RiaPolyArcLineSampler( const cvf::Vec3d& startTangent, const std::vector<cvf::Vec3d>& lineArcEndPoints );
|
||||
|
||||
void sampledPointsAndMDs( double sampleInterval,
|
||||
void sampledPointsAndMDs( double maxSampleInterval,
|
||||
bool isResamplingLines,
|
||||
std::vector<cvf::Vec3d>* points,
|
||||
std::vector<double>* mds );
|
||||
@ -42,7 +42,8 @@ private:
|
||||
std::vector<cvf::Vec3d>* m_points; // Internal temporary pointers to collections beeing filled.
|
||||
std::vector<double>* m_meshDs;
|
||||
|
||||
double m_samplingsInterval;
|
||||
double m_maxSamplingsInterval;
|
||||
const double m_maxSamplingArcAngle = 0.07310818;// Angle from 6 deg dogleg on 10 m
|
||||
bool m_isResamplingLines;
|
||||
double m_totalMD;
|
||||
|
||||
|
@ -159,6 +159,7 @@ cvf::ref<RigWellPath> RimWellPathGeometryDef::createWellPathGeometry()
|
||||
|
||||
RiaPolyArcLineSampler arcLineSampler( wellPathCalculator.startTangent(), wellPathCalculator.lineArcEndpoints() );
|
||||
|
||||
|
||||
arcLineSampler.sampledPointsAndMDs( 30,
|
||||
false,
|
||||
&( wellPathGeometry->m_wellPathPoints ),
|
||||
@ -562,8 +563,8 @@ RiaLineArcWellPathCalculator RimWellPathGeometryDef::lineArcWellPathCalculator()
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < wellTargets.size(); ++tIdx )
|
||||
{
|
||||
wellTargets[tIdx]->flagRadius1AsIncorrect( false, 0 );
|
||||
wellTargets[tIdx]->flagRadius2AsIncorrect( false, 0 );
|
||||
wellTargets[tIdx]->flagRadius1AsIncorrect(targetStatuses[tIdx].isRadius1Editable, false, 0 );
|
||||
wellTargets[tIdx]->flagRadius2AsIncorrect(targetStatuses[tIdx].isRadius2Editable, false, 0 );
|
||||
|
||||
if ( targetStatuses[tIdx].hasDerivedTangent )
|
||||
{
|
||||
@ -573,12 +574,12 @@ RiaLineArcWellPathCalculator RimWellPathGeometryDef::lineArcWellPathCalculator()
|
||||
|
||||
if ( targetStatuses[tIdx].hasOverriddenRadius1 )
|
||||
{
|
||||
wellTargets[tIdx]->flagRadius1AsIncorrect( true, targetStatuses[tIdx].resultRadius1 );
|
||||
wellTargets[tIdx]->flagRadius1AsIncorrect( targetStatuses[tIdx].isRadius1Editable, true, targetStatuses[tIdx].resultRadius1 );
|
||||
}
|
||||
|
||||
if ( targetStatuses[tIdx].hasOverriddenRadius2 )
|
||||
{
|
||||
wellTargets[tIdx]->flagRadius2AsIncorrect( true, targetStatuses[tIdx].resultRadius2 );
|
||||
wellTargets[tIdx]->flagRadius2AsIncorrect( targetStatuses[tIdx].isRadius2Editable, true, targetStatuses[tIdx].resultRadius2 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,37 +201,61 @@ double doglegFromRadius( double radius )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathTarget::flagRadius1AsIncorrect( bool isIncorrect, double actualRadius )
|
||||
void RimWellPathTarget::flagRadius1AsIncorrect( bool isEditable, bool isIncorrect, double actualRadius )
|
||||
{
|
||||
if ( isIncorrect )
|
||||
{
|
||||
m_dogleg1.uiCapability()->setUiContentTextColor( Qt::red );
|
||||
m_dogleg1.uiCapability()->setUiToolTip( "The dogleg constraint is not satisfied! Actual Dogleg: " +
|
||||
QString::number( doglegFromRadius( actualRadius ) ) );
|
||||
if ( actualRadius < radius1() )
|
||||
{
|
||||
m_dogleg1.uiCapability()->setUiContentTextColor( Qt::red );
|
||||
m_dogleg1.uiCapability()->setUiToolTip(
|
||||
"Actual Dogleg: " + QString::number( doglegFromRadius( actualRadius ) ) +
|
||||
"\nThe dogleg constraint is not satisfied!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dogleg1.uiCapability()->setUiContentTextColor( Qt::darkGreen );
|
||||
m_dogleg1.uiCapability()->setUiToolTip( "Actual Dogleg: " +
|
||||
QString::number( doglegFromRadius( actualRadius ) ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dogleg1.uiCapability()->setUiContentTextColor( QColor() );
|
||||
m_dogleg1.uiCapability()->setUiToolTip( "" );
|
||||
}
|
||||
|
||||
m_dogleg1.uiCapability()->setUiReadOnly( !isEditable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathTarget::flagRadius2AsIncorrect( bool isIncorrect, double actualRadius )
|
||||
void RimWellPathTarget::flagRadius2AsIncorrect( bool isEditable, bool isIncorrect, double actualRadius )
|
||||
{
|
||||
if ( isIncorrect )
|
||||
{
|
||||
m_dogleg2.uiCapability()->setUiContentTextColor( Qt::red );
|
||||
m_dogleg2.uiCapability()->setUiToolTip( "The dogleg constraint is not satisfied! Actual Dogleg: " +
|
||||
QString::number( doglegFromRadius( actualRadius ) ) );
|
||||
if ( actualRadius < radius2() )
|
||||
{
|
||||
m_dogleg2.uiCapability()->setUiContentTextColor( Qt::red );
|
||||
m_dogleg2.uiCapability()->setUiToolTip(
|
||||
"Actual Dogleg: " + QString::number( doglegFromRadius( actualRadius ) ) +
|
||||
"\nThe dogleg constraint is not satisfied!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dogleg2.uiCapability()->setUiContentTextColor( Qt::darkGreen );
|
||||
m_dogleg2.uiCapability()->setUiToolTip( "Actual Dogleg: " +
|
||||
QString::number( doglegFromRadius( actualRadius ) ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dogleg2.uiCapability()->setUiContentTextColor( QColor() );
|
||||
m_dogleg2.uiCapability()->setUiToolTip( "" );
|
||||
}
|
||||
|
||||
m_dogleg2.uiCapability()->setUiReadOnly( !isEditable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -296,33 +320,33 @@ void RimWellPathTarget::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
|
||||
m_hasTangentConstraintUiField.uiCapability()->setUiReadOnly( false );
|
||||
m_targetType.uiCapability()->setUiReadOnly( false );
|
||||
m_targetPoint.uiCapability()->setUiReadOnly( false );
|
||||
m_dogleg2.uiCapability()->setUiReadOnly( false );
|
||||
// m_dogleg2.uiCapability()->setUiReadOnly( false );
|
||||
|
||||
if ( m_targetType == POINT )
|
||||
{
|
||||
m_azimuth.uiCapability()->setUiReadOnly( true );
|
||||
m_inclination.uiCapability()->setUiReadOnly( true );
|
||||
m_dogleg1.uiCapability()->setUiReadOnly( true );
|
||||
// m_dogleg1.uiCapability()->setUiReadOnly( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_azimuth.uiCapability()->setUiReadOnly( false );
|
||||
m_inclination.uiCapability()->setUiReadOnly( false );
|
||||
m_dogleg1.uiCapability()->setUiReadOnly( false );
|
||||
// m_dogleg1.uiCapability()->setUiReadOnly( false );
|
||||
}
|
||||
|
||||
RimWellPathGeometryDef* geomDef = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( geomDef );
|
||||
|
||||
if ( this == geomDef->firstActiveTarget() )
|
||||
{
|
||||
m_dogleg1.uiCapability()->setUiReadOnly( true );
|
||||
}
|
||||
|
||||
if ( this == geomDef->lastActiveTarget() )
|
||||
{
|
||||
m_dogleg2.uiCapability()->setUiReadOnly( true );
|
||||
}
|
||||
// if ( this == geomDef->firstActiveTarget() )
|
||||
//{
|
||||
// m_dogleg1.uiCapability()->setUiReadOnly( true );
|
||||
//}
|
||||
//
|
||||
// if ( this == geomDef->lastActiveTarget() )
|
||||
//{
|
||||
// m_dogleg2.uiCapability()->setUiReadOnly( true );
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -53,8 +53,8 @@ public:
|
||||
cvf::Vec3d tangent() const;
|
||||
double radius1() const;
|
||||
double radius2() const;
|
||||
void flagRadius1AsIncorrect( bool isIncorrect, double actualRadius );
|
||||
void flagRadius2AsIncorrect( bool isIncorrect, double actualRadius );
|
||||
void flagRadius1AsIncorrect( bool isEditable, bool isIncorrect, double actualRadius );
|
||||
void flagRadius2AsIncorrect( bool isEditable, bool isIncorrect, double actualRadius );
|
||||
|
||||
private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
|
Loading…
Reference in New Issue
Block a user