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.
 
 
 
 
 
 

145 lines
6.0 KiB

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