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.
 
 
 
 
 
 

308 lines
11 KiB

  1. SUBROUTINE KILL_LINE
  2. USE VARIABLES
  3. USE CAccumulatorVariables
  4. USE CBopStackVariables
  5. USE CBopControlPanelVariables
  6. USE CEquipmentsConstants
  7. ! use CSimulationVariables
  8. implicit none
  9. !=====================================================================
  10. ! KILL LINE 1- BOP CAMERON Type U 5000
  11. ! START CONDITIONS FOR KILL LINE 1
  12. !=====================================================================
  13. RAM(6)%SuccessionCounter = RAM(6)%SuccessionCounter + 1
  14. if (BopControlPanel%KillLineValve == -1.0 .and. BopStackAcc%RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. RamLine%P_ACC>BopStackAcc%acc_MinPressure) then
  15. if ( RAM(6)%SuccessionCounter /= RAM(6)%SuccessionCounterOld+1 ) then
  16. RAM(6)%SuccessionCounter = 0 ! also in starup
  17. RAM(6)%SuccessionCounterOld = 0 ! also in starup
  18. return
  19. else
  20. RAM(6)%SuccessionCounterOld= RAM(6)%SuccessionCounter
  21. endif
  22. if ( RAM(6)%SuccessionCounter < int(2.5/RamLine%DeltaT_BOP) ) then
  23. return
  24. endif
  25. RAM(6)%First_CloseTimecheck= 1
  26. if (BopStackInput%KillLineOpenLedMine == LedOn) then
  27. RETURN
  28. end if
  29. KillLine%closed=0
  30. RAM(6)%vdis_tot=0
  31. RAM(6)%vdis_bottles=0.
  32. RAM(6)%fvr_air=0.
  33. RAM(6)%vdis_elecp=0.
  34. Pumps%Qiter=7
  35. RAM(6)%Qzero=70
  36. RAM(6)%Q=RAM(6)%Qzero
  37. RAM(6)%flow=70
  38. RAM(6)%tol=0.0037
  39. if (KillLine%finished==1) then
  40. KillLine%LeverOld= 1.0
  41. else
  42. KillLine%LeverOld=BopControlPanel%KillLineValve
  43. endif
  44. KillLine%finished=0
  45. KillLine%IsOpening = .true.
  46. BopControlPanel%KillLineCloseLED = LedOff
  47. BopStackInput%KillLineCloseLedMine = LedOff
  48. BopControlPanel%KillLineOpenLED = LedOn !LedBlinking
  49. RAM(6)%bop_type = 3
  50. !AbopKillLine=196.67
  51. KillLine%Abop=(BopStackSpecification%KillClose*231)/((KillLine%IDBase-KillLine%ODDrillpipe_inBase)/2.)
  52. KillLine%NeededVolume=KillLine%Abop*(KillLine%IDBase-max(KillLine%ODDrillpipe_in,KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP
  53. endif
  54. if (BopControlPanel%KillLineValve == 1.0 .and. BopStackAcc%RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. RamLine%P_ACC>BopStackAcc%acc_MinPressure) then
  55. if ( RAM(6)%SuccessionCounter /= RAM(6)%SuccessionCounterOld+1 ) then
  56. RAM(6)%SuccessionCounter = 0 ! also in starup
  57. RAM(6)%SuccessionCounterOld = 0 ! also in starup
  58. return
  59. else
  60. RAM(6)%SuccessionCounterOld= RAM(6)%SuccessionCounter
  61. endif
  62. if ( RAM(6)%SuccessionCounter < int(2.5/RamLine%DeltaT_BOP) ) then
  63. return
  64. endif
  65. RAM(6)%First_OpenTimecheck= 1
  66. if (BopStackInput%KillLineCloseLedMine == LedOn) then
  67. RETURN
  68. end if
  69. KillLine%closed=0
  70. RAM(6)%vdis_tot=0
  71. RAM(6)%vdis_bottles=0.
  72. RAM(6)%fvr_air=0.
  73. RAM(6)%vdis_elecp=0.
  74. Pumps%Qiter=7
  75. RAM(6)%Qzero=70
  76. RAM(6)%Q=RAM(6)%Qzero
  77. RAM(6)%flow=70
  78. RAM(6)%tol=0.0037
  79. if (KillLine%finished==1) then
  80. KillLine%LeverOld= -1.0
  81. else
  82. KillLine%LeverOld=BopControlPanel%KillLineValve
  83. endif
  84. KillLine%finished=0
  85. KillLine%IsClosing = .true.
  86. !if (KillLineCloseLed == LedOn) then
  87. ! RETURN
  88. !end if
  89. BopControlPanel%KillLineCloseLED = LedOff !new
  90. BopStackInput%KillLineCloseLedMine = LedOff !new
  91. BopControlPanel%KillLineCloseLED = LedOn !LedBlinking
  92. RAM(6)%bop_type = 3
  93. !AbopKillLine=196.67
  94. KillLine%Abop=(BopStackSpecification%KillOpen*231)/((KillLine%IDBase-KillLine%ODDrillpipe_inBase)/2.)
  95. KillLine%NeededVolume=KillLine%Abop*(KillLine%IDBase-max(KillLine%ODDrillpipe_in,KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP
  96. endif
  97. !==========================================================================
  98. if (KillLine%IsOpening .or. KillLine%IsClosing) then
  99. CALL KILL_LINE_SUB
  100. end if
  101. END SUBROUTINE KILL_LINE
  102. SUBROUTINE KILL_LINE_SUB
  103. USE VARIABLES
  104. USE CAccumulatorVariables
  105. USE CBopStackVariables
  106. USE CBopControlPanelVariables
  107. USE CEquipmentsConstants
  108. ! use CSimulationVariables
  109. implicit none
  110. Annular%FirstSet= 0
  111. AnnularComputational%RamsFirstSet= 0
  112. ! loop6: do while (finished_KillLine==0)
  113. RAM(6)%SuccessionCounter = RAM(6)%SuccessionCounter + 1
  114. if (BopControlPanel%KillLineValve == 1.0 .and. KillLine%LeverOld == -1.0 .and. BopStackAcc%RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. RamLine%P_ACC>BopStackAcc%acc_MinPressure) then
  115. if ( RAM(6)%First_CloseTimecheck == 0 ) then
  116. if ( RAM(6)%SuccessionCounter /= RAM(6)%SuccessionCounterOld+1 ) then
  117. RAM(6)%SuccessionCounter = 0 ! also in starup
  118. RAM(6)%SuccessionCounterOld = 0 ! also in starup
  119. return
  120. else
  121. RAM(6)%SuccessionCounterOld= RAM(6)%SuccessionCounter
  122. endif
  123. if ( RAM(6)%SuccessionCounter < int(2.5/RamLine%DeltaT_BOP) ) then
  124. return
  125. endif
  126. endif
  127. KillLine%closed=0
  128. RAM(6)%p_bop=ShearRam%PA
  129. KillLine%LeverOld = BopControlPanel%KillLineValve
  130. BopControlPanel%KillLineOpenLED = LedOff
  131. BopStackInput%KillLineOpenLedMine = LedOff
  132. BopControlPanel%KillLineCloseLED = LedOn !LedBlinking
  133. CALL OpenKillLine
  134. RAM(6)%bop_type = 3
  135. !AbopKillLine=196.67
  136. KillLine%Abop=(BopStackSpecification%KillClose*231)/((KillLine%IDBase-KillLine%ODDrillpipe_inBase)/2.)
  137. KillLine%NeededVolume=KillLine%Abop*(KillLine%ID-max(KillLine%ODDrillpipe_in,KillLine%ODDrillpipe_inBase))/(2.*231)
  138. RAM(6)%vdis_bottles=0.
  139. RAM(6)%fvr_air=0.
  140. RAM(6)%vdis_elecp=0.
  141. KillLine%IsClosing = .true.
  142. KillLine%IsOpening = .false.
  143. endif
  144. if (BopControlPanel%KillLineValve == -1.0 .and. KillLine%LeverOld == 1.0 .and. RamLine%P_ACC>BopStackAcc%acc_MinPressure .and. BopStackAcc%RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then
  145. if ( RAM(6)%First_OpenTimecheck == 0 ) then
  146. if ( RAM(6)%SuccessionCounter /= RAM(6)%SuccessionCounterOld+1 ) then
  147. RAM(6)%SuccessionCounter = 0 ! also in starup
  148. RAM(6)%SuccessionCounterOld = 0 ! also in starup
  149. return
  150. else
  151. RAM(6)%SuccessionCounterOld= RAM(6)%SuccessionCounter
  152. endif
  153. if ( RAM(6)%SuccessionCounter < int(2.5/RamLine%DeltaT_BOP) ) then
  154. return
  155. endif
  156. endif
  157. KillLine%closed=0
  158. RAM(6)%p_bop=ShearRam%PA
  159. KillLine%LeverOld = BopControlPanel%KillLineValve
  160. BopControlPanel%KillLineCloseLED = LedOff
  161. BopStackInput%KillLineCloseLedMine = LedOff
  162. BopControlPanel%KillLineOpenLED = LedOn !LedBlinking
  163. CALL OpenKillLine
  164. RAM(6)%bop_type = 3
  165. !AbopKillLine=196.67
  166. KillLine%Abop=(BopStackSpecification%KillOpen*231)/((KillLine%IDBase-KillLine%ODDrillpipe_inBase)/2.)
  167. KillLine%NeededVolume=KillLine%Abop*(KillLine%IDBase-KillLine%ID)/(2.*231)
  168. RAM(6)%vdis_bottles=0.
  169. RAM(6)%fvr_air=0.
  170. RAM(6)%vdis_elecp=0.
  171. KillLine%IsOpening = .true.
  172. KillLine%IsClosing = .false.
  173. endif
  174. RAM(6)%First_CloseTimecheck = 0
  175. RAM(6)%First_OpenTimecheck = 0
  176. RAM(6)%time=RAM(6)%time+RamLine%DeltaT_BOP !overal time (s)
  177. !===================================================
  178. ! BOP
  179. !===================================================
  180. if (KillLine%closed==0) then !bop closing
  181. call bop_code(5,KillLine%H_Bop,6) !ramtype=5 6=RNUMBER
  182. endif !bop is closing
  183. !================================================================
  184. if (KillLine%closed==1) then
  185. RAM(6)%Q=0
  186. !p_bop=pram_reg
  187. RAM(6)%p_bop=ShearRam%PA
  188. RAMS%minloss(6,17)=0. !RNUMBER=6
  189. endif
  190. RAM(6)%timecounter_ram=RAM(6)%timecounter_ram+1
  191. ! MiddleRamsStatus = IDshearBop
  192. ! UpperRamsStatus = IDPipeRam1
  193. ! LowerRamsStatus = IDPipeRam2
  194. ! AnnularStatus = IDAnnular
  195. ! AccumulatorPressureGauge = p_acc
  196. ! ManifoldPressureGauge= pram_reg
  197. ! AnnularPressureGauge=Pannular_reg
  198. !
  199. !
  200. !
  201. ! WRITE(60,60) RAM(6)%time,RAM(6)%Q,RAM(6)%vdis_tot,p_acc, &
  202. ! pram_reg,Pannular_reg,RAM(6)%p_bop,IDshearBop, &
  203. ! IDPipeRam1,IDPipeRam2,IDAnnular
  204. !60 FORMAT(11(f18.5))
  205. ! call sleepqq(100)
  206. if (KillLine%closed==1) then
  207. ! if ((UpperRamsValve==1. .and. UpperRamsFailureMalf==0) .or. (UpperRamsValve==-1.0 .and. UpperRamsFailureMalf==0) .or. (MiddleRamsValve==1. .and. MiddleRamsFailureMalf==0) .or. (MiddleRamsValve==-1.0 .and. MiddleRamsFailureMalf==0) .or. (LowerRamsValve==1. .and. LowerRamsFailureMalf==0) .or. (LowerRamsValve==-1.0 .and. LowerRamsFailureMalf==0) .or. (AnnularValve==1. .and. AnnularFailureMalf==0) .or. (AnnularValve==-1.0 .and. AnnularFailureMalf==0) .or. ChokeLineValve==1. .or. ChokeLineValve==-1.0) then
  208. KillLine%finished=1
  209. ! endif
  210. endif
  211. ! if (IsStopped == .true.) return
  212. ! end do loop6 !while finished_KillLine==0
  213. END SUBROUTINE KILL_LINE_SUB