#5780 #5795 Improve handling of air gap in modelled well paths + fix result instability.

* Stop using the auto generated target at sea level to generate the well path
* This is because the well path is used to generate the target at sea level.
* The alternative would be to iterate until the target and well path is stable, assuming it converges.
This commit is contained in:
Gaute Lindkvist
2020-04-15 08:40:12 +02:00
committed by Magne Sjaastad
parent 7b445a7fb7
commit 7bbbac8277
6 changed files with 50 additions and 49 deletions

View File

@@ -132,19 +132,17 @@ QString RimModeledWellPath::wellPlanText()
formatter.setTableRowLineAppendText( "" );
std::vector<RifTextDataTableColumn> tableHeader;
tableHeader.push_back( {"MDRKB"} );
tableHeader.push_back( {"CL"} );
tableHeader.push_back( {"Inc"} );
tableHeader.push_back( {"Azi"} );
tableHeader.push_back( {"TVDMSL"} );
tableHeader.push_back( {"NS"} );
tableHeader.push_back( {"EW"} );
tableHeader.push_back( {"Dogleg"} );
tableHeader.push_back( {"Build"} );
tableHeader.push_back( {"Turn"} );
std::vector<QString> columns = { "MDRKB", "CL", "Inc", "Azi", "TVDMSL", "NS", "EW", "Dogleg", "Build", "Turn" };
for ( QString column : columns )
{
tableHeader.push_back(
RifTextDataTableColumn( column,
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_FLOAT, 2 ) ) );
}
formatter.header( tableHeader );
double mdrkbAtFirstTarget = m_geometryDefinition->mdrkbAtFirstTarget();
double mdrkbAtFirstTarget = m_geometryDefinition->mdAtFirstTarget() + m_geometryDefinition->airGap();
if ( m_geometryDefinition )
{
std::vector<RiaWellPlanCalculator::WellPlanSegment> wellPlan = m_geometryDefinition->wellPlan();

View File

@@ -128,7 +128,7 @@ void RimWellPathGeometryDef::setAirGap( double airGap )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellPathGeometryDef::mdrkbAtFirstTarget() const
double RimWellPathGeometryDef::mdAtFirstTarget() const
{
return m_mdAtFirstTarget;
}
@@ -136,9 +136,9 @@ double RimWellPathGeometryDef::mdrkbAtFirstTarget() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathGeometryDef::setMdrkbAtFirstTarget( double mdrkb )
void RimWellPathGeometryDef::setMdAtFirstTarget( double md )
{
m_mdAtFirstTarget = mdrkb;
m_mdAtFirstTarget = md;
}
//--------------------------------------------------------------------------------------------------
@@ -148,8 +148,6 @@ cvf::ref<RigWellPath> RimWellPathGeometryDef::createWellPathGeometry()
{
cvf::ref<RigWellPath> wellPathGeometry = new RigWellPath;
updateTargetAtSeaLevel();
RiaLineArcWellPathCalculator wellPathCalculator = lineArcWellPathCalculator();
if ( wellPathCalculator.lineArcEndpoints().size() < 2 ) return wellPathGeometry;
@@ -165,6 +163,7 @@ cvf::ref<RigWellPath> RimWellPathGeometryDef::createWellPathGeometry()
{
wellPathGeometry->setDatumElevation( m_airGap );
}
updateTargetAtSeaLevel();
return wellPathGeometry;
}
@@ -212,7 +211,7 @@ std::pair<RimWellPathTarget*, RimWellPathTarget*>
if ( wt->isEnabled() && !foundTarget ) before = wt;
}
return {before, after};
return { before, after };
}
//--------------------------------------------------------------------------------------------------
@@ -364,7 +363,7 @@ std::vector<RimWellPathTarget*> RimWellPathGeometryDef::activeWellTargets() cons
{
std::vector<RimWellPathTarget*> active;
if ( m_useAutoGeneratedTargetAtSeaLevel() && !m_wellTargets.empty() )
if ( m_useAutoGeneratedTargetAtSeaLevel && !m_wellTargets.empty() && m_autoTargetAtSeaLevel )
{
active.push_back( m_autoTargetAtSeaLevel.get() );
}
@@ -385,42 +384,43 @@ std::vector<RimWellPathTarget*> RimWellPathGeometryDef::activeWellTargets() cons
//--------------------------------------------------------------------------------------------------
RiaLineArcWellPathCalculator RimWellPathGeometryDef::lineArcWellPathCalculator() const
{
std::vector<RimWellPathTarget*> wellTargets = activeWellTargets();
std::vector<RiaLineArcWellPathCalculator::WellTarget> targetDatas;
for ( auto wellTarget : wellTargets )
for ( auto wellTarget : m_wellTargets )
{
targetDatas.push_back( wellTarget->wellTargetData() );
if ( wellTarget->isEnabled() )
{
targetDatas.push_back( wellTarget->wellTargetData() );
}
}
RiaLineArcWellPathCalculator wellPathCalculator( referencePointXyz(), targetDatas );
const std::vector<RiaLineArcWellPathCalculator::WellTargetStatus>& targetStatuses =
wellPathCalculator.targetStatuses();
for ( size_t tIdx = 0; tIdx < wellTargets.size(); ++tIdx )
for ( size_t tIdx = 0; tIdx < m_wellTargets.size(); ++tIdx )
{
wellTargets[tIdx]->flagRadius1AsIncorrect( targetStatuses[tIdx].isRadius1Editable, false, 0 );
wellTargets[tIdx]->flagRadius2AsIncorrect( targetStatuses[tIdx].isRadius2Editable, false, 0 );
m_wellTargets[tIdx]->flagRadius1AsIncorrect( targetStatuses[tIdx].isRadius1Editable, false, 0 );
m_wellTargets[tIdx]->flagRadius2AsIncorrect( targetStatuses[tIdx].isRadius2Editable, false, 0 );
if ( targetStatuses[tIdx].hasDerivedTangent )
{
wellTargets[tIdx]->setDerivedTangent( targetStatuses[tIdx].resultAzimuth,
targetStatuses[tIdx].resultInclination );
m_wellTargets[tIdx]->setDerivedTangent( targetStatuses[tIdx].resultAzimuth,
targetStatuses[tIdx].resultInclination );
}
if ( targetStatuses[tIdx].hasOverriddenRadius1 )
{
wellTargets[tIdx]->flagRadius1AsIncorrect( targetStatuses[tIdx].isRadius1Editable,
true,
targetStatuses[tIdx].resultRadius1 );
m_wellTargets[tIdx]->flagRadius1AsIncorrect( targetStatuses[tIdx].isRadius1Editable,
true,
targetStatuses[tIdx].resultRadius1 );
}
if ( targetStatuses[tIdx].hasOverriddenRadius2 )
{
wellTargets[tIdx]->flagRadius2AsIncorrect( targetStatuses[tIdx].isRadius2Editable,
true,
targetStatuses[tIdx].resultRadius2 );
m_wellTargets[tIdx]->flagRadius2AsIncorrect( targetStatuses[tIdx].isRadius2Editable,
true,
targetStatuses[tIdx].resultRadius2 );
}
}
@@ -452,7 +452,7 @@ void RimWellPathGeometryDef::updateTargetAtSeaLevel()
newPos = firstTarget->targetPointXYZ() - horizontalLengthFromTarget * tangentInHorizontalPlane;
newPos.z() = -referencePointXyz().z();
m_autoTargetAtSeaLevel->setAsPointXYZAndTangentTarget( {newPos[0], newPos[1], newPos[2]}, 0, 0 );
m_autoTargetAtSeaLevel->setAsPointXYZAndTangentTarget( { newPos[0], newPos[1], newPos[2] }, 0, 0 );
}
}

View File

@@ -48,8 +48,8 @@ public:
double airGap() const;
void setAirGap( double airGap );
double mdrkbAtFirstTarget() const;
void setMdrkbAtFirstTarget( double mdrkb );
double mdAtFirstTarget() const;
void setMdAtFirstTarget( double mdrkb );
cvf::ref<RigWellPath> createWellPathGeometry();