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.

пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. MODULE VARIABLES
  2. use DynamicDoubleArray
  3. IMPLICIT NONE
  4. !===========================================================================
  5. ! INPUT VARIABLES
  6. !===========================================================================
  7. REAL,ALLOCATABLE:: MINORS1(:,:),PIPINGS_RAMLINE(:,:),MINORS_ANNULAR(:,:),PIPINGS_ANNULAR(:,:),PIPINGS_AIRPUMP(:,:),MINORS_AIRPUMP(:,:)
  8. integer AnnularOpenLedMine,AnnularCloseLedMine,UpperRamsCloseLEDMine,UpperRamsOpenLEDMine,LowerRamsOpenLEDMine,LowerRamsCloseLEDMine
  9. integer MiddleRamsOpenLEDMine,MiddleRamsCloseLEDMine,KillLineOpenLedMine,KillLineCloseLedMine,ChokeLineOpenLEDMine,ChokeLineCloseLEDMine
  10. integer BOP_timeCounter
  11. !===========================================================================
  12. ! ACC. VARIABLES
  13. !===========================================================================
  14. REAL,PARAMETER :: PI=3.141593 ,PressureDifferenceSteps = 20. ,BaseDifferenceP= 200. ! psi
  15. REAL FVR_TOT,BOTTLE_CAPACITY,PRAMS_REGSET,acc_ChargedPressure,acc_MinPressure,ACC_PRECHARGE,ByPassOld
  16. REAL pram_reg,test1,test2,test3,test4,test5,test6,test7,test8,test9,ax,bx
  17. integer NOBOTTLES,AccPupmsFailMalf,AirSupplyPressureGaugeMalf,ManifoldPressureGaugeMalf,AccumulatorPressureGaugeMalf,RigAirMalf
  18. real Cumulative_AirVolume, PressureDifference
  19. integer SoundKoomeyAirPump
  20. !===========================================================================
  21. ! RAM LINE COMPUTATIONAL VARIABLES
  22. !===========================================================================
  23. logical ShearRamIsClosing,ShearRamIsOpening
  24. REAL ShearRamsLeverOld,NoActiveRmas
  25. !REAL checkp,p_acccheck
  26. REAL P_ACC,FVR,DeltaT_BOP
  27. REAL diffp_air,losses_air,Qup,kinetic_air,pipe_loss1air,minor_loss1air,static_loss1air!,pipe_loss1_before,minor_loss1,static_loss1,kinetic_loss1,pipe_loss1
  28. !REAL loss_before,pipe_loss2,minor_loss2,deltah,static_loss2,kinetic_loss2,loss_after
  29. integer AIRP_SWITCH,ELECP_SWITCH,ShearBop_closed,FINISHED_shear,EOF,NO_MINORSRAMLINE,NO_PIPINGSRAMLINE,NO_PIPINGS_AIRPLINE,NO_MINORS_AIRPLINE
  30. integer counter,iteration,ShearBop_Situation_forTD
  31. real BA1,BA2,BA3,BA4,BBA1,BBA2,BBA3,BBA4
  32. REAL B1,B2,B3,B4
  33. REAL,ALLOCATABLE:: Re_air(:),DIAM_AIR_MM(:),DIAM_AIR_INCH(:),AREA_AIR(:),REL_ROUGHAIR(:),LENGT_AIR(:),LF_AIR(:),CV_AIR(:),NOTE_AIR(:)
  34. REAL,ALLOCATABLE:: fric_air(:),fricloss_air(:),minlosspa_air(:),minloss_air(:)
  35. REAL,ALLOCATABLE:: MINORDIAM_AIR_INCH(:),MINORAREA_AIR(:)
  36. REAL,ALLOCATABLE:: DIAM_RAMLINE_INCH(:),DIAM_RAMLINE_MM(:),AREA_RAMLINE(:),ROUGHNESS_AIRPLINE(:),ROUGHNESS_RAMLINE(:),RELROUGH_RAMLINE(:),LENGT_RAMLINE(:),LF_RAMLINE(:),CV_RAMLINE(:),NOTE_RAMLINE(:),AREAMINOR_RAMLINE(:)
  37. !REAL,ALLOCATABLE:: Re_ramline(:),fric(:),fricloss(:)
  38. REAL,ALLOCATABLE:: MINORDIAMETER_RAMLINE(:)
  39. INTEGER,ALLOCATABLE:: ITEM(:),ITEM_PIPING(:),ITEM_PIPINGAIR(:),ITEM_MINORAIR(:)
  40. CHARACTER,ALLOCATABLE:: DECRIPTION(:),DECRIPTION2(:),DECRIPTION_RAM(:),DESCRIPTION_AIR1(:),DESCRIPTION_AIR2(:)
  41. real:: counter_airp,pacc_before
  42. integer Annular_active,ShearBop_active,PipeRam1_active,PipeRam2_active,ChokeLine_active,KillLine_active
  43. !===========================================================================
  44. ! ANNULAR PREVENTER COMPUTATIONAL VARIABLES
  45. !===========================================================================
  46. integer PannularTimeStepDelay
  47. type(DynamicDoubleArrayType) :: Pannular_regDelay
  48. logical AnnPressureRise
  49. integer NO_MinorsAnnularLine,NO_PipingsAnnularLine,RamsFirstSet
  50. REAL pa_annular,p_annular
  51. REAL,ALLOCATABLE:: MINORDIAMETER_ANNULARLINE(:),AREAMINOR_ANNULARLINE(:)
  52. !REAL,ALLOCATABLE:: REAL_PregAnnular(:),real_IDAnnular(:),real_pAnnular(:)
  53. REAL REAL_PregAnnular,real_IDAnnular,real_pAnnular
  54. REAL,ALLOCATABLE:: LF_ANNULARLINE(:),CV_ANNULARLINE(:),NOTE_ANNULARLINE(:),minlosspa_ANNULAR(:),minloss_ANNULAR(:)
  55. REAL,ALLOCATABLE:: DIAM_ANNULARLINE_INCH(:),DIAM_ANNULARLINE_MM(:),AREA_ANNULARLINE(:)
  56. REAL,ALLOCATABLE:: LENGT_ANNULARLINE(:),ROUGHNESS_ANNULARLINE(:),RELROUGH_ANNULARLINE(:),Re_ANNULARline(:),fricANNULAR(:),friclossANNULAR(:)
  57. INTEGER,ALLOCATABLE:: ITEMANNULAR(:),ITEM_PIPINGANNULAR(:)
  58. CHARACTER,ALLOCATABLE:: DECRIPTIONANNULAR(:),DECRIPTION2ANNULAR(:),DECRIPTION_ANNULAR(:)
  59. REAL WellBorePressure,acoef,Bcoef,const,AnnularSealingPressure,AnnularMovingPressure
  60. !===========================================================================
  61. ! ANNULAR PREVENTER VARIABLES
  62. !===========================================================================
  63. REAL (8) Pannular_reg
  64. real Pannular_regset
  65. logical AnnularIsClosing,AnnularIsOpening
  66. REAL tolAnnular,tolzeroAnnular
  67. integer Annular_closed,finished_Annular,FirstSet,AnnularFailureMalf,AnnularLeakMalf,AnnularPressureGaugeMalf,Annular_Situation_forTD
  68. REAL AnnularLeverOld,H_AnnularBop,IDAnnular,AbopAnnular,ODDrillpipe_inAnnular,IDAnnularBase,ODDrillpipe_inAnnularBase
  69. REAL NeededVolumeAnnular
  70. !===========================================================================
  71. ! PIPE RAMS 1 VARIABLES
  72. !===========================================================================
  73. logical PipeRam1IsClosing,PipeRam1IsOpening
  74. REAL PipeRams1LeverOld,H_PipeRam1Bop
  75. REAL NeededVolumePipeRams1,AbopPipeRam,IDPipeRamBase,IDPipeRam1,ODDrillpipe_inPipeRam1,ODDrillpipe_inPipeRam1Base
  76. integer PipeRam1_closed,finished_pipe1,UpperRamsFailureMalf,UpperRamsLeakMalf,PipeRam1_Situation_forTD
  77. REAL real_IDPipeRam1
  78. !============================================================================
  79. ! SHEAR RAM BOP VARIABLES
  80. !============================================================================
  81. REAL PA,PB,P_SHEAR,VA,VB,RAM_COURSE,H_REGRAM,H_ShearRamBop
  82. REAL,ALLOCATABLE:: ALPHA_QRAM(:),ALPHA_VDISRAM(:),ALPHA_PACC(:),ALPHA_PREGRAM(:),ALPHA_PBOP(:)
  83. !REAL,ALLOCATABLE:: REAL_TIME(:),REAL_QRAM(:),REAL_VDISRAM(:),REAL_PACC(:),REAL_PREGRAM(:),REAL_PBOP(:),real_IDshearBop(:)
  84. REAL REAL_TIME,REAL_QRAM,REAL_VDISRAM,REAL_PACC,REAL_PREGRAM,REAL_PBOP,real_IDshearBop
  85. REAL IDshearBopBase,IDshearBop,ODDrillpipe_inShearRam,AbopShearRam,NeededVolumeShearRams,ODDrillpipe_inShearRamBase
  86. Real IDshearBopFinal,IDPipeRam1Final,IDPipeRam2Final,IDAnnularFinal,OpenArea_shearBop,OpenArea_PipeRam1,OpenArea_PipeRam2,OpenArea_Annular
  87. Real MinimumOpenArea_InBOP
  88. integer MiddleRamsFailureMalf,MiddleRamsLeakMalf,ShearIsNotAllowed
  89. !===========================================================================
  90. ! PIPE RAMS 2 VARIABLES
  91. !===========================================================================
  92. logical PipeRam2IsClosing,PipeRam2IsOpening
  93. REAL PipeRams2LeverOld,H_PipeRam2Bop
  94. REAL NeededVolumePipeRams2,IDPipeRam2,ODDrillpipe_inPipeRam2,ODDrillpipe_inPipeRam2Base
  95. integer PipeRam2_closed,finished_pipe2,LowerRamsFailureMalf,LowerRamsLeakMalf,PipeRam2_Situation_forTD
  96. !REAL,ALLOCATABLE:: real_IDPipeRam2(:)
  97. REAL real_IDPipeRam2
  98. !===========================================================================
  99. ! CHOKE LINE VARIABLES
  100. !===========================================================================
  101. logical ChokeLineIsClosing,ChokeLineIsOpening
  102. REAL ChokeLineLeverOld,H_ChokeLineBop
  103. REAL NeededVolumeChokeLine,AbopChokeLine,IDChokeLine,ODDrillpipe_inChokeLine,IDChokeLineBase,ODDrillpipe_inChokeLineBase
  104. integer ChokeLine_closed,finished_ChokeLine
  105. !REAL,ALLOCATABLE:: real_IDPipeRam1(:)
  106. REAL real_IDChokeLine
  107. !===========================================================================
  108. ! KILL LINE VARIABLES
  109. !===========================================================================
  110. logical KillLineIsClosing,KillLineIsOpening
  111. REAL KillLineLeverOld,H_KillLineBop
  112. REAL NeededVolumeKillLine,AbopKillLine,IDKillLine,ODDrillpipe_inKillLine,IDKillLineBase,ODDrillpipe_inKillLineBase
  113. integer KillLine_closed,finished_KillLine
  114. !REAL,ALLOCATABLE:: real_IDPipeRam1(:)
  115. REAL real_IDKillLine
  116. !============================================================================
  117. ! OIL & ENVIRONMENT VARIABLES
  118. !============================================================================
  119. REAL:: SG=1.12,WDENS=1000,GRAVITY=9.81,RE_CR=2000,NU=9e-6
  120. !specific gravity of liquid
  121. !water density(kg/m^3)
  122. !============================================================================
  123. ! PUMP VARIABLES
  124. !============================================================================
  125. REAL P_AIRP,DELTAV_AIR,TOL_AIR,DELTAV_ELECP,Qiter
  126. REAL ELECTRIC_PUMPON,ELECTRIC_PUMPOFF,AIR_PUMPON,AIR_PUMPOFF,QAIR_PUMP,QELECTRIC_PUMP
  127. !REAL,ALLOCATABLE:: alpha_Qair(:),alpha_timeair(:),alpha_paccair(:),alpha_pairp(:),alpha_diffpair(:),alpha_lossesair(:),alpha_fvrair(:)
  128. REAL alpha_Qair,alpha_timeair,alpha_paccair,alpha_pairp,alpha_diffpair,alpha_lossesair,alpha_fvrair
  129. logical SoundKoomeyElectricPump
  130. !=================================================================================
  131. TYPE, PUBLIC :: BOP_TypeVars
  132. REAL vdis_tot,vdis_bottles,deltav_bottles,fvr_air,vdis_elecp,Qzero,Q,flow,tol,TIME,timecounter_ram,clock
  133. integer bop_type, SuccessionCounter, SuccessionCounterOld,First_CloseTimecheck,First_OpenTimecheck,FourwayValve ! FourwayValve 1: Open , 0: Close
  134. REAL loss_before,pipe_loss2,minor_loss2,deltah,static_loss2,kinetic_loss2,loss_after,TOLZERO,diffp_ram
  135. REAL checkp,p_acccheck,P_BOP,minor_loss1,static_loss1,kinetic_loss1,pipe_loss1
  136. Logical Bottles_Charged_MalfActive
  137. END TYPE BOP_TypeVars
  138. TYPE(BOP_TypeVars), DIMENSION(1:6) :: RAM
  139. TYPE, PUBLIC :: BOP_TypeVars2D
  140. REAL, ALLOCATABLE:: minlosspa(:,:),minloss(:,:)
  141. REAL,ALLOCATABLE:: Re_ramline(:,:),fric(:,:),fricloss(:,:)
  142. END TYPE BOP_TypeVars2D
  143. TYPE(BOP_TypeVars2D) :: RAMS
  144. ! 1 : Annular (RNUMBER)
  145. ! 2 : PipeRam1 (RNUMBER)
  146. ! 3 : PipeRam2 (RNUMBER)
  147. ! 4 : ShearRam (RNUMBER)
  148. ! 5 : ChokeLine (RNUMBER)
  149. ! 6 : KillLine (RNUMBER)
  150. END MODULE