Simulation Core
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

250 рядки
14 KiB

  1. subroutine Drawworks_INPUTS
  2. Use CDrillingConsoleVariables
  3. Use CDataDisplayConsoleVariables
  4. Use CHoistingVariables
  5. Use CSimulationVariables
  6. Use CSlipsEnumVariables
  7. Use CKellyConnectionEnumVariables
  8. Use CElevatorConnectionEnumVariables
  9. Use COperationConditionEnumVariables
  10. Use COperationScenariosVariables
  11. Use CSwingEnumVariables
  12. Use CUnityInputs
  13. Use CTdsConnectionModesEnumVariables
  14. Use CTdsElevatorModesEnumVariables
  15. Use CTdsSwingEnumVariables
  16. Use VARIABLES
  17. Use Drawworks_VARIABLES
  18. Use TD_StringConnectionData
  19. Use TD_DrillStemComponents
  20. IMPLICIT NONE
  21. Call DWMalfunction_ClutchEngage
  22. Drawworks%TransMode = DWTransmisionLever
  23. Drawworks%Direction_Var = DWSwitch
  24. if (IsPortable) then
  25. if (Drawworks%Direction_Var==-1 .and. Clutch==1) then !in FWD mode
  26. Drawworks%Conv_Ratio = Drawworks%FWD_Conv_Ratio(Drawworks%ClutchMode,Drawworks%TransMode)
  27. else
  28. Drawworks%Conv_Ratio = 1.d0
  29. end if
  30. else
  31. if (Drawworks%Direction_Var==-1) then !in FWD mode
  32. Drawworks%Conv_Ratio = Drawworks%FWD_Conv_Ratio(Drawworks%ClutchMode,Drawworks%TransMode)
  33. else if (Drawworks%Direction_Var==+1) then !in REV mode
  34. Drawworks%Conv_Ratio = 1.d0
  35. else if (Drawworks%Direction_Var==0) then !in OFF mode
  36. Drawworks%Conv_Ratio = 1.d0
  37. end if
  38. end if
  39. !===> Main Brake and Eddy Brake
  40. Drawworks%EddyBreak = EddyBreakLever*0.5 !0<EddyBreakLever<100 *0.5= 50% of EddyBreakLever
  41. Drawworks%BrakeLeverCoefficient = BrakeLeverCoefficient !0<BrakeLeverCoefficient<100
  42. if ( Drawworks%BrakeLeverCoefficient<10.d0 ) then
  43. Drawworks%BrakeLeverCoefficient = 10.d0
  44. end if
  45. Drawworks%ManualBreak = 100.d0-((100.d0-DWBreak)*(100.d0/Drawworks%BrakeLeverCoefficient)) !0<DWBrake<100 20
  46. if ( Drawworks%ManualBreak<0.d0 ) then
  47. Drawworks%ManualBreak = 0.d0
  48. end if
  49. if ( IsPortable .and. ParkingBrakeBtn==1 ) then
  50. Drawworks%ManualBreak = 100.d0
  51. ParkingBrakeLed = 1
  52. else
  53. ParkingBrakeLed = 0
  54. end if
  55. !===> Brake Load (Main Brake)
  56. Drawworks%BreakLoad = DrillingLineBreakingLoad ![Lbf]
  57. Drawworks%BreakLoad = 4.448221619*Drawworks%BreakLoad ![N]
  58. !===> F_fastline
  59. Drawworks%F_fastline = real(TD_DrawworksLoadInput) ![Lbf]
  60. Drawworks%F_fastline = 4.448221619*Drawworks%F_fastline ![N]
  61. !===> min&max Hook Height
  62. if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL ) then
  63. if ( Get_Swing()==SWING_WELL_END .and. Get_KellyConnection()==KELLY_CONNECTION_NOTHING ) then
  64. DW_DrillModeCond = 1
  65. Drawworks%min_Hook_Height = TD_TopJointHeight+HKL-RE ![ft] HKL=63.76=Kelly Ass. Height , RE=Release
  66. Drawworks%max_Hook_Height = 120.d0 ![ft]
  67. else if ( Get_Swing()==SWING_WELL_END .and. Get_KellyConnection()==KELLY_CONNECTION_SINGLE ) then
  68. DW_DrillModeCond = 2
  69. Drawworks%min_Hook_Height = TD_TopJointHeight+HKL+PL-RE ![ft] PL=30=Pipe Lenght
  70. Drawworks%max_Hook_Height = 120.d0 ![ft]
  71. else if ( Get_Swing()==SWING_WELL_END .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then
  72. DW_DrillModeCond = 3
  73. Drawworks%min_Hook_Height = 21.44d0-RE ![ft] ?????????? check 21.44=(TD_KellyConst-TD_KellyElementConst)
  74. Drawworks%max_Hook_Height = 120.d0 ![ft]
  75. else if ( Get_Swing()==SWING_MOUSE_HOLE_END .and. Get_KellyConnection()==KELLY_CONNECTION_NOTHING ) then
  76. DW_DrillModeCond = 4
  77. Drawworks%min_Hook_Height = 66.d0-RE ![ft]
  78. Drawworks%max_Hook_Height = 120.d0 ![ft]
  79. else if ( Get_Swing()==SWING_MOUSE_HOLE_END .and. Get_KellyConnection()==KELLY_CONNECTION_SINGLE ) then
  80. DW_DrillModeCond = 5
  81. Drawworks%min_Hook_Height = 65.1d0-RE ![ft]
  82. Drawworks%max_Hook_Height = 120.d0 ![ft]
  83. else if ( Get_Swing()==SWING_RAT_HOLE_END ) then
  84. DW_DrillModeCond = 6
  85. Drawworks%min_Hook_Height = 66.d0-RE ![ft]
  86. Drawworks%max_Hook_Height = 120.d0 ![ft]
  87. end if
  88. else if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_TRIP ) then
  89. if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING ) then
  90. DW_DrillModeCond = 7
  91. Drawworks%min_Hook_Height = 18.38d0 ![ft]
  92. Drawworks%max_Hook_Height = 140.d0 ![ft]
  93. else if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND ) then
  94. DW_DrillModeCond = 8
  95. Drawworks%min_Hook_Height = TD_TopJointHeight+HL+SL-(3.d0*RE) ![ft] HL=17.81=Hook Assy , SL=90=Stand Length , 3: chon meghdari az toole loole(tool joint) dakhele elevator gharar migirad
  96. Drawworks%max_Hook_Height = 140.d0 ![ft]
  97. else if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE ) then
  98. DW_DrillModeCond = 9
  99. Drawworks%min_Hook_Height = TD_TopJointHeight+HL+PL-(3.d0*RE) ![ft] 3: chon meghdari az toole loole(tool joint) balaye elevator mimanad
  100. Drawworks%max_Hook_Height = 140.d0 ![ft]
  101. else if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING ) then
  102. DW_DrillModeCond = 10
  103. Drawworks%min_Hook_Height = 18.5d0-RE ![ft]
  104. Drawworks%max_Hook_Height = 140.d0 ![ft]
  105. else if ( Get_Swing()==SWING_MOUSE_HOLE_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING ) then
  106. DW_DrillModeCond = 11
  107. Drawworks%min_Hook_Height = 19.38d0-RE ![ft]
  108. Drawworks%max_Hook_Height = 140.d0 ![ft]
  109. else if ( Get_Swing()==SWING_MOUSE_HOLE_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE ) then
  110. DW_DrillModeCond = 12
  111. Drawworks%min_Hook_Height = 17.73d0-RE ![ft]
  112. Drawworks%max_Hook_Height = 140.d0 ![ft]
  113. else if ( Get_Swing()==SWING_RAT_HOLE_END ) then
  114. DW_DrillModeCond = 13
  115. Drawworks%min_Hook_Height = 27.41d0-RE ![ft]
  116. Drawworks%max_Hook_Height = 140.d0 ![ft]
  117. else if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING ) then
  118. DW_DrillModeCond = 14
  119. Drawworks%min_Hook_Height = 18.38d0 ![ft]
  120. Drawworks%max_Hook_Height = 140.d0 ![ft]
  121. else if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_LATCH_SINGLE ) then
  122. DW_DrillModeCond = 25 !warning & collision
  123. Drawworks%min_Hook_Height = 18.38d0 !????????????????? ![ft]
  124. Drawworks%max_Hook_Height = 140.d0 ![ft]
  125. else if ( Get_Swing()==SWING_MOUSE_HOLE_END .and. Get_ElevatorConnection() == ELEVATOR_LATCH_SINGLE ) then
  126. DW_DrillModeCond = 26
  127. Drawworks%min_Hook_Height = 10.38d0 !????????????????? ![ft]
  128. Drawworks%max_Hook_Height = 140.d0 ![ft]
  129. else if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_LATCH_STAND ) then
  130. DW_DrillModeCond = 27
  131. Drawworks%min_Hook_Height = 18.38d0 !????????????????? ![ft]
  132. Drawworks%max_Hook_Height = 140.d0 ![ft]
  133. end if
  134. else if ( DriveType==0 ) then
  135. if ( Get_TdsSwing()==TDS_SWING_TILT_END ) then
  136. if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_SINGLE ) then
  137. DW_DrillModeCond = 15
  138. Drawworks%min_Hook_Height = 15.0d0 ![ft]
  139. Drawworks%max_Hook_Height = 140.d0 ![ft]
  140. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_SINGLE ) then
  141. DW_DrillModeCond = 16
  142. Drawworks%min_Hook_Height = 15.0d0 ![ft]
  143. Drawworks%max_Hook_Height = 140.d0 ![ft]
  144. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
  145. DW_DrillModeCond = 17
  146. Drawworks%min_Hook_Height = 15.0d0 ![ft]
  147. Drawworks%max_Hook_Height = 140.d0 ![ft]
  148. end if
  149. else if ( Get_TdsSwing()==TDS_SWING_OFF_END ) then
  150. if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_STRING ) then
  151. DW_DrillModeCond = 18
  152. Drawworks%min_Hook_Height = max(16.0d0,TD_TopJointHeight) ![ft]
  153. Drawworks%max_Hook_Height = 140.d0 ![ft]
  154. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING ) then
  155. DW_DrillModeCond = 19
  156. Drawworks%min_Hook_Height = TD_TopJointHeight ![ft]
  157. Drawworks%max_Hook_Height = 140.d0 ![ft]
  158. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_STRING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
  159. DW_DrillModeCond = 20
  160. Drawworks%min_Hook_Height = TD_TopJointHeight ![ft]
  161. Drawworks%max_Hook_Height = 140.d0 ![ft]
  162. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
  163. DW_DrillModeCond = 21
  164. Drawworks%min_Hook_Height = max(16.0d0,TD_TopJointHeight) ![ft]
  165. Drawworks%max_Hook_Height = 140.d0 ![ft]
  166. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_STAND ) then
  167. DW_DrillModeCond = 22
  168. Drawworks%min_Hook_Height = max(16.0d0,TD_TopJointHeight) ![ft]
  169. Drawworks%max_Hook_Height = 140.d0 ![ft]
  170. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STAND ) then
  171. DW_DrillModeCond = 23
  172. Drawworks%min_Hook_Height = max(16.0d0,TD_TopJointHeight) ![ft]
  173. Drawworks%max_Hook_Height = 140.d0 ![ft]
  174. else if ( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
  175. DW_DrillModeCond = 24
  176. Drawworks%min_Hook_Height = TD_TopJointHeight ![ft]
  177. Drawworks%max_Hook_Height = 140.d0 ![ft]
  178. end if
  179. end if
  180. end if
  181. !print* , 'DW_DrillModeCond=' , DW_DrillModeCond
  182. !!print* , 'Drawworks%min_Hook_Height=' , Drawworks%min_Hook_Height
  183. !!print* , 'Drawworks%max_Hook_Height=' , Drawworks%max_Hook_Height
  184. !print* , 'Drawworks%Hook_Height_final=' , Drawworks%Hook_Height_final
  185. !print*, 'TD_DrillStemComponentsNumbs2=' , TD_DrillStemComponentsNumbs
  186. !print*, 'TD_TopJointHeight2=' , TD_TopJointHeight
  187. !print*, 'TD_DrillStemTotalLength2=', TD_DrillStemTotalLength
  188. !===> SLIPS SET , No Motion
  189. if ( DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then
  190. Drawworks%ManualBreak = 100.d0
  191. Drawworks%N_ref = 0.d0
  192. end if
  193. if ( DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_SPINE .or. Get_TdsConnectionModes()==TDS_CONNECTION_STRING) ) then
  194. Drawworks%ManualBreak = 100.d0
  195. Drawworks%N_ref = 0.d0
  196. end if
  197. !if ( Get_Slips() == SLIPS_SET_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and. Drawworks%motion==+1 ) then
  198. ! Drawworks%ManualBreak = 100.d0
  199. ! Drawworks%N_ref = 0.d0
  200. !!else if ( Get_Slips() == SLIPS_SET_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and. Drawworks%motion/=+1 ) then
  201. !! Drawworks%N_ref = 0.d0
  202. !! !Call DWFixModeMotion
  203. !! !print*, 'ELEVATOR_CONNECTION_STRING'
  204. !end if
  205. !===> Closed BOP Rams , No Motion
  206. !if ( PipeRam1_Situation_forTD==1 .or. PipeRam2_Situation_forTD==1 .or. ShearBop_Situation_forTD==1 ) then
  207. if ( ShearBop_Situation_forTD==1 .and. (any(DW_DrillModeCond==(/3,10,19,20,24/))) ) then
  208. Drawworks%ManualBreak = 100.d0
  209. Drawworks%N_ref = 0.d0
  210. end if
  211. end subroutine Drawworks_INPUTS