#13651 Fix formation dip sign issue when fracture normal is rotated 180 deg

Rename calculateFormationDip to calculateAngleFromVertical to better reflect what the function computes. Add calculateFormationDipFromHorizontal which applies the -90 deg adjustment and std::abs, fixing the wrong sign when the fracture direction normal is flipped.
This commit is contained in:
Magne Sjaastad
2026-02-24 13:46:15 +01:00
parent d3d1c1a148
commit 71b734efec
4 changed files with 19 additions and 9 deletions
@@ -652,12 +652,11 @@ void RimStimPlanModel::updateDistanceToBarrierAndDip()
cvf::Vec3d fractureDirectionNormal = computeFractureDirectionNormal( wellPath(), position );
// Update formation dip. The direction for the barrier search follows the
// inclination of the formation, and is in effect the formation dip in the
// fracture plane. -90 to convert from horizontal to vertical.
// Update formation dip. The direction for the barrier search follows the inclination of the formation, and is in effect the formation
// dip in the fracture plane.
cvf::Vec3d formationDirection = projectVectorIntoFracturePlane( position, fractureDirectionNormal, m_originalThicknessDirection );
if ( formationDirection.isUndefined() ) return;
m_formationDip = std::abs( RigStimPlanModelTools::calculateFormationDip( formationDirection ) - 90.0 );
m_formationDip = RigStimPlanModelTools::calculateFormationDipFromHorizontal( formationDirection );
cvf::Vec3d directionToBarrier = projectVectorIntoFracturePlane( position, fractureDirectionNormal, m_thicknessDirection );
if ( directionToBarrier.isUndefined() ) return;