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.i90 7.0 KiB

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