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.

TD_DrillStemReadData.f90 5.5 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. subroutine TD_DrillStemReadData
  2. Use CStringConfigurationVariables
  3. Use TD_DrillStemComponents
  4. Use TD_WellElements
  5. Use TD_WellGeometry
  6. Use TD_StringConnectionData
  7. Use Drawworks_VARIABLES, only: Drawworks
  8. implicit none
  9. Integer :: i
  10. Integer :: TD_FirstIndex , TD_LastIndex
  11. !====================================================
  12. ! Set Drill Stem Components Data
  13. !====================================================
  14. TD_StringConfigurationCount = StringConfigurationCount
  15. TD_DrillStemComponentsNumbs = 0
  16. !########## TD_DrillStem%ComponentType ::
  17. !#Bit_ComponentType = 0
  18. !#Stabilizer_ComponentType = 1
  19. !#Collar_ComponentType = 2
  20. !#DrillPipe_ComponentType = 3
  21. !#Heavyweight_ComponentType = 4
  22. !#IBOP = 5
  23. !#Kelly & SafetyValve (DrillMode) = 6
  24. !#SafetyValve (TripMode) = 7
  25. if (Allocated(TD_DrillStem)) deAllocate (TD_DrillStem)
  26. Allocate (TD_DrillStem(TD_StringConfigurationCount+100))
  27. Do i=1, TD_StringConfigurationCount
  28. TD_DrillStem(i)%ComponentType = StringConfigurations(i)%ComponentType
  29. TD_DrillStem(i)%Numbs = StringConfigurations(i)%NumberOfJoint
  30. TD_DrillStem(i)%Id = StringConfigurations(i)%NominalId/12.d0 ![ft]
  31. TD_DrillStem(i)%Od = StringConfigurations(i)%NominalOd/12.d0 ![ft]
  32. TD_DrillStem(i)%Length = StringConfigurations(i)%LengthPerJoint ![ft]
  33. TD_DrillStem(i)%WeightperLength = StringConfigurations(i)%WeightPerLength ![lb/ft]
  34. TD_DrillStem(i)%TotalLength = StringConfigurations(i)%ComponentLength
  35. TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength
  36. TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+StringConfigurations(i)%NumberOfJoint
  37. !!=========> Set Separated Drill Stem Components Data
  38. ! TD_LastIndex = TD_LastIndex+StringConfigurations(i)%NumberOfJoint
  39. !
  40. ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ComponentType = TD_DrillStem(i)%ComponentType
  41. ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Id = TD_DrillStem(i)%Id
  42. ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Od = TD_DrillStem(i)%Od
  43. ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Length = TD_DrillStem(i)%Length
  44. ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Weight = TD_DrillStem(i)%Weight
  45. !
  46. ! TD_FirstIndex = TD_LastIndex+1
  47. End Do
  48. !===> Initial Values of Removed-Volume Variables
  49. if (TD_DrillStem(1)%ComponentType==0) then
  50. TD_PreCount = TD_StringConfigurationCount-1
  51. else
  52. TD_PreCount = TD_StringConfigurationCount
  53. end if
  54. TD_PreElementVolume = TD_DrillStem(TD_StringConfigurationCount)%TotalLength*(((pi*((TD_DrillStem(TD_StringConfigurationCount)%Id)**2))/4.d0)) ![ft^3]
  55. TD_PreElementLength = TD_DrillStem(TD_StringConfigurationCount)%TotalLength
  56. !====================================================
  57. ! Set Separated Drill Stem Components Data
  58. !====================================================
  59. TD_FirstIndex = 1
  60. TD_LastIndex = 0
  61. if (Allocated(TD_DrillStems)) deAllocate (TD_DrillStems)
  62. Allocate (TD_DrillStems(TD_DrillStemComponentsNumbs+300)) ! +300: because of: Add or Remove DrillStem Components
  63. Call TD_DrillStemStartUp
  64. Do i=1, TD_StringConfigurationCount
  65. TD_LastIndex = TD_LastIndex+StringConfigurations(i)%NumberOfJoint
  66. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ComponentType = TD_DrillStem(i)%ComponentType
  67. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Id = TD_DrillStem(i)%Id
  68. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Od = TD_DrillStem(i)%Od
  69. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Area = (pi*((TD_DrillStem(i)%Od**2)-(TD_DrillStem(i)%Id**2)))/4.0d0
  70. if (TD_DrillStem(i)%ComponentType == 3 .or. TD_DrillStem(i)%ComponentType == 4) then
  71. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%RtoolJoint = TD_DrillStem(i)%Od*1.30d0/2.0d0
  72. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ToolJointRange = TD_ToolJointRange
  73. else if (TD_DrillStem(i)%ComponentType == 1 .or. TD_DrillStem(i)%ComponentType == 2) then
  74. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%RtoolJoint = TD_DrillStem(i)%Od/2.0d0
  75. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ToolJointRange = TD_ToolJointRange
  76. else if (TD_DrillStem(i)%ComponentType == 0) then
  77. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%RtoolJoint = TD_DrillStem(i)%Od
  78. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ToolJointRange = 0.0d0
  79. end if
  80. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Length = TD_DrillStem(i)%Length
  81. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%LengthIni = TD_DrillStem(i)%Length
  82. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%WeightperLength= TD_DrillStem(i)%WeightperLength
  83. TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Weight = TD_DrillStem(i)%WeightperLength*TD_DrillStem(i)%Length
  84. TD_FirstIndex = TD_LastIndex+1
  85. End Do
  86. !====================================================
  87. ! Set Hook Height Data
  88. !====================================================
  89. TD_HookHeightOld = Drawworks%Hook_Height_ini
  90. TD_HookHeight = TD_HookHeightOld
  91. end subroutine