Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

104 lines
7.0 KiB

  1. subroutine TD_WellReadData
  2. use SimulationVariables !@
  3. implicit none
  4. Integer :: i
  5. data%State%TD_WellGeneral%WellIntervalsCount = data%Configuration%Path%ItemCount + 1 ! +1 is belong to ROP hole
  6. if (Allocated(data%State%TD_WellGeo)) deAllocate (data%State%TD_WellGeo)
  7. Allocate (data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount))
  8. !====================================================
  9. ! Set Well Geometry Data
  10. !====================================================
  11. data%State%TD_WellGeo(1)%HoleType = data%Configuration%Path%Items(1)%HoleType
  12. data%State%TD_WellGeo(1)%StartAngle = 0.d0 ![rad]
  13. data%State%TD_WellGeo(1)%EndAngle = data%Configuration%Path%Items(1)%FinalAngle*(pi/180.d0) ![rad]
  14. data%State%TD_WellGeo(1)%IntervalLength= data%Configuration%Path%Items(1)%TotalLength ![ft]
  15. !data%State%TD_WellGeo(1)%VerticalDepth = PathGenerations(1)%TotalVerticalDepth
  16. data%State%TD_WellGeo(1)%TopDepth = 0.d0
  17. data%State%TD_WellGeo(1)%DownDepth = data%Configuration%Path%Items(1)%MeasuredDepth
  18. Do i=2,data%State%TD_WellGeneral%WellIntervalsCount-1
  19. data%State%TD_WellGeo(i)%HoleType = data%Configuration%Path%Items(i)%HoleType
  20. data%State%TD_WellGeo(i)%StartAngle = data%Configuration%Path%Items(i-1)%FinalAngle*(pi/180.d0)
  21. data%State%TD_WellGeo(i)%EndAngle = data%Configuration%Path%Items(i)%FinalAngle*(pi/180.d0)
  22. data%State%TD_WellGeo(i)%IntervalLength= data%Configuration%Path%Items(i)%TotalLength
  23. !data%State%TD_WellGeo(i)%VerticalDepth = data%Configuration%Path%Items(i)%TotalVerticalDepth
  24. data%State%TD_WellGeo(i)%TopDepth = data%Configuration%Path%Items(i-1)%MeasuredDepth
  25. data%State%TD_WellGeo(i)%DownDepth = data%Configuration%Path%Items(i)%MeasuredDepth
  26. !=====> Radius Of Curvature Calculation
  27. if (data%State%TD_WellGeo(i)%HoleType/=0) then
  28. data%State%TD_WellGeo(i)%RCurvature = ((data%State%TD_WellGeo(i)%IntervalLength)/abs(data%State%TD_WellGeo(i)%EndAngle-data%State%TD_WellGeo(i)%StartAngle))
  29. end if
  30. End Do
  31. !=====> Set ROP Hole Data
  32. data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%HoleType = 0 !Straight
  33. data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%StartAngle = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount-1)%EndAngle
  34. data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%EndAngle = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%StartAngle
  35. data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%IntervalLength= 0.d0
  36. !data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%VerticalDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount-1)%VerticalDepth
  37. data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%TopDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount-1)%DownDepth
  38. data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%DownDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%TopDepth+data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%IntervalLength
  39. !=====> Vertical Depth Calculation
  40. if ( data%State%TD_WellGeo(1)%HoleType==0 ) then
  41. data%State%TD_WellGeo(1)%VerticalDepth = data%State%TD_WellGeo(1)%IntervalLength*cos(data%State%TD_WellGeo(1)%StartAngle)
  42. else if ( data%State%TD_WellGeo(1)%HoleType==1 ) then
  43. data%State%TD_WellGeo(1)%VerticalDepth = (data%State%TD_WellGeo(1)%RCurvature*sin(abs(data%State%TD_WellGeo(1)%EndAngle)-abs(data%State%TD_WellGeo(1)%StartAngle))*cos(abs(data%State%TD_WellGeo(1)%StartAngle)))-(data%State%TD_WellGeo(1)%RCurvature*(1.-cos(abs(data%State%TD_WellGeo(1)%EndAngle)-abs(data%State%TD_WellGeo(1)%StartAngle)))*sin(abs(data%State%TD_WellGeo(1)%StartAngle)))
  44. else if ( data%State%TD_WellGeo(1)%HoleType==2 ) then
  45. data%State%TD_WellGeo(1)%VerticalDepth = (data%State%TD_WellGeo(1)%RCurvature*sin(abs(abs(data%State%TD_WellGeo(1)%EndAngle)-abs(data%State%TD_WellGeo(1)%StartAngle)))*cos(abs(data%State%TD_WellGeo(1)%StartAngle)))+(data%State%TD_WellGeo(1)%RCurvature*(1.-cos(abs(abs(data%State%TD_WellGeo(1)%EndAngle)-abs(data%State%TD_WellGeo(1)%StartAngle))))*sin(abs(data%State%TD_WellGeo(1)%StartAngle)))
  46. End if
  47. Do i= 2,data%State%TD_WellGeneral%WellIntervalsCount
  48. if ( data%State%TD_WellGeo(i)%HoleType==0 ) then
  49. data%State%TD_WellGeo(i)%VerticalDepth = data%State%TD_WellGeo(i-1)%VerticalDepth+data%State%TD_WellGeo(i)%IntervalLength*cos(data%State%TD_WellGeo(i)%StartAngle)
  50. else if ( data%State%TD_WellGeo(i)%HoleType==1 ) then
  51. data%State%TD_WellGeo(i)%VerticalDepth = data%State%TD_WellGeo(i-1)%VerticalDepth+(data%State%TD_WellGeo(i)%RCurvature*sin(abs(data%State%TD_WellGeo(i)%EndAngle)-abs(data%State%TD_WellGeo(i)%StartAngle))*cos(abs(data%State%TD_WellGeo(i)%StartAngle)))-(data%State%TD_WellGeo(i)%RCurvature*(1.-cos(abs(data%State%TD_WellGeo(i)%EndAngle)-abs(data%State%TD_WellGeo(i)%StartAngle)))*sin(abs(data%State%TD_WellGeo(i)%StartAngle)))
  52. else if ( data%State%TD_WellGeo(i)%HoleType==2 ) then
  53. data%State%TD_WellGeo(i)%VerticalDepth = data%State%TD_WellGeo(i-1)%VerticalDepth+(data%State%TD_WellGeo(i)%RCurvature*sin(abs(abs(data%State%TD_WellGeo(i)%EndAngle)-abs(data%State%TD_WellGeo(i)%StartAngle)))*cos(abs(data%State%TD_WellGeo(i)%StartAngle)))+(data%State%TD_WellGeo(i)%RCurvature*(1.-cos(abs(abs(data%State%TD_WellGeo(i)%EndAngle)-abs(data%State%TD_WellGeo(i)%StartAngle))))*sin(abs(data%State%TD_WellGeo(i)%StartAngle)))
  54. End if
  55. End Do
  56. !Do i=1,data%State%TD_WellGeneral%WellIntervalsCount
  57. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%TopDepth=' , i , data%State%TD_WellGeo(i)%TopDepth
  58. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%DownDepth=' , i , data%State%TD_WellGeo(i)%DownDepth
  59. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%HoleType=' , i , data%State%TD_WellGeo(i)%HoleType
  60. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%RCurvature=' , i , data%State%TD_WellGeo(i)%RCurvature
  61. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%EndAngle=' , i , data%State%TD_WellGeo(i)%EndAngle
  62. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%StartAngle=' , i , data%State%TD_WellGeo(i)%StartAngle
  63. ! if(print_log) print*, 'data%State%TD_WellGeo(i)%VerticalDepth=' , i , data%State%TD_WellGeo(i)%VerticalDepth
  64. !end do
  65. !=====> Well Total Length Calculation
  66. data%State%TD_WellGeneral%WellTotalLength = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%DownDepth
  67. data%State%TD_WellGeneral%WellTotalVerticalLength = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%VerticalDepth
  68. end subroutine