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.
 
 
 
 
 
 

111 lines
5.2 KiB

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