Simulation Core
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. MODULE BopVariables
  2. use DynamicDoubleArray, only:DynamicDoubleArrayType
  3. IMPLICIT NONE
  4. !===========================================================================
  5. ! INPUT VARIABLES
  6. !===========================================================================
  7. type :: BopStackInputType
  8. REAL,ALLOCATABLE:: MINORS1(:,:),PIPINGS_RAMLINE(:,:),MINORS_ANNULAR(:,:),PIPINGS_ANNULAR(:,:),PIPINGS_AIRPUMP(:,:),MINORS_AIRPUMP(:,:)
  9. integer AnnularOpenLedMine,AnnularCloseLedMine,UpperRamsCloseLEDMine,UpperRamsOpenLEDMine,LowerRamsOpenLEDMine,LowerRamsCloseLEDMine
  10. integer MiddleRamsOpenLEDMine,MiddleRamsCloseLEDMine,KillLineOpenLedMine,KillLineCloseLedMine,ChokeLineOpenLEDMine,ChokeLineCloseLEDMine
  11. integer BOP_timeCounter
  12. end type BopStackInputType
  13. !===========================================================================
  14. ! ACC. VARIABLES
  15. !===========================================================================
  16. REAL,PARAMETER :: PressureDifferenceSteps = 20. ,BaseDifferenceP= 200. ! psi
  17. type::BopStackAccType
  18. REAL FVR_TOT,BOTTLE_CAPACITY,PRAMS_REGSET,acc_ChargedPressure,acc_MinPressure,ACC_PRECHARGE,ByPassOld
  19. REAL pram_reg,test1,test2,test3,test4,test5,test6,test7,test8,test9,ax,bx
  20. integer NOBOTTLES,AccPupmsFailMalf,AirSupplyPressureGaugeMalf,ManifoldPressureGaugeMalf,AccumulatorPressureGaugeMalf,RigAirMalf
  21. real Cumulative_AirVolume, PressureDifference
  22. integer SoundKoomeyAirPump
  23. end type BopStackAccType
  24. !===========================================================================
  25. ! RAM LINE COMPUTATIONAL VARIABLES
  26. !===========================================================================
  27. type:: RamLineType
  28. logical ShearRamIsClosing,ShearRamIsOpening
  29. REAL ShearRamsLeverOld,NoActiveRmas
  30. !REAL checkp,p_acccheck
  31. REAL P_ACC,FVR,DeltaT_BOP
  32. 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
  33. !REAL loss_before,pipe_loss2,minor_loss2,deltah,static_loss2,kinetic_loss2,loss_after
  34. integer AIRP_SWITCH,ELECP_SWITCH,ShearBop_closed,FINISHED_shear,EOF,NO_MINORSRAMLINE,NO_PIPINGSRAMLINE,NO_PIPINGS_AIRPLINE,NO_MINORS_AIRPLINE
  35. integer counter,iteration,ShearBop_Situation_forTD
  36. real BA1,BA2,BA3,BA4,BBA1,BBA2,BBA3,BBA4
  37. REAL B1,B2,B3,B4
  38. REAL,ALLOCATABLE:: Re_air(:),DIAM_AIR_MM(:),DIAM_AIR_INCH(:),AREA_AIR(:),REL_ROUGHAIR(:),LENGT_AIR(:),LF_AIR(:),CV_AIR(:),NOTE_AIR(:)
  39. REAL,ALLOCATABLE:: fric_air(:),fricloss_air(:),minlosspa_air(:),minloss_air(:)
  40. REAL,ALLOCATABLE:: MINORDIAM_AIR_INCH(:),MINORAREA_AIR(:)
  41. 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(:)
  42. !REAL,ALLOCATABLE:: Re_ramline(:),fric(:),fricloss(:)
  43. REAL,ALLOCATABLE:: MINORDIAMETER_RAMLINE(:)
  44. INTEGER,ALLOCATABLE:: ITEM(:),ITEM_PIPING(:),ITEM_PIPINGAIR(:),ITEM_MINORAIR(:)
  45. CHARACTER,ALLOCATABLE:: DECRIPTION(:),DECRIPTION2(:),DECRIPTION_RAM(:),DESCRIPTION_AIR1(:),DESCRIPTION_AIR2(:)
  46. real:: counter_airp,pacc_before
  47. integer Annular_active,ShearBop_active,PipeRam1_active,PipeRam2_active,ChokeLine_active,KillLine_active
  48. end type RamLineType
  49. !===========================================================================
  50. ! ANNULAR PREVENTER COMPUTATIONAL VARIABLES
  51. !===========================================================================
  52. type::AnnularComputationalType
  53. integer PannularTimeStepDelay
  54. type(DynamicDoubleArrayType) :: Pannular_regDelay
  55. logical AnnPressureRise
  56. integer NO_MinorsAnnularLine,NO_PipingsAnnularLine,RamsFirstSet
  57. REAL pa_annular,p_annular
  58. REAL,ALLOCATABLE:: MINORDIAMETER_ANNULARLINE(:),AREAMINOR_ANNULARLINE(:)
  59. !REAL,ALLOCATABLE:: REAL_PregAnnular(:),real_IDAnnular(:),real_pAnnular(:)
  60. REAL REAL_PregAnnular,real_IDAnnular,real_pAnnular
  61. REAL,ALLOCATABLE:: LF_ANNULARLINE(:),CV_ANNULARLINE(:),NOTE_ANNULARLINE(:),minlosspa_ANNULAR(:),minloss_ANNULAR(:)
  62. REAL,ALLOCATABLE:: DIAM_ANNULARLINE_INCH(:),DIAM_ANNULARLINE_MM(:),AREA_ANNULARLINE(:)
  63. REAL,ALLOCATABLE:: LENGT_ANNULARLINE(:),ROUGHNESS_ANNULARLINE(:),RELROUGH_ANNULARLINE(:),Re_ANNULARline(:),fricANNULAR(:),friclossANNULAR(:)
  64. INTEGER,ALLOCATABLE:: ITEMANNULAR(:),ITEM_PIPINGANNULAR(:)
  65. CHARACTER,ALLOCATABLE:: DECRIPTIONANNULAR(:),DECRIPTION2ANNULAR(:),DECRIPTION_ANNULAR(:)
  66. REAL WellBorePressure,acoef,Bcoef,const,AnnularSealingPressure,AnnularMovingPressure
  67. end type AnnularComputationalType
  68. !===========================================================================
  69. ! ANNULAR PREVENTER VARIABLES
  70. !===========================================================================
  71. type :: AnnularType
  72. REAL (8) Pannular_reg
  73. real Pannular_regset
  74. logical AnnularIsClosing,AnnularIsOpening
  75. REAL tolAnnular,tolzeroAnnular
  76. integer Annular_closed,finished_Annular,FirstSet,AnnularFailureMalf,AnnularLeakMalf,AnnularPressureGaugeMalf,Annular_Situation_forTD
  77. REAL AnnularLeverOld,H_AnnularBop,IDAnnular,AbopAnnular,ODDrillpipe_inAnnular,IDAnnularBase,ODDrillpipe_inAnnularBase
  78. REAL NeededVolumeAnnular
  79. end type AnnularType
  80. !===========================================================================
  81. ! PIPE RAMS 1 VARIABLES
  82. !===========================================================================
  83. type::PipeRams1Type
  84. logical IsClosing,IsOpening
  85. REAL PipeRams1DotLeverOld,H
  86. REAL NeededVolume,A,IDBase,ID,ODDrillpipe_in,ODDrillpipe_inBase
  87. integer closed,finished,UpperRamsFailureMalf,UpperRamsLeakMalf,Situation_forTD
  88. ! REAL real_ID
  89. end type PipeRams1Type
  90. !============================================================================
  91. ! SHEAR RAM BOP VARIABLES
  92. !============================================================================
  93. type:: ShearRamType
  94. REAL PA,PB,P_SHEAR,VA,VB,RAM_COURSE,H_REGRAM,H_ShearRamBop
  95. REAL,ALLOCATABLE:: ALPHA_QRAM(:),ALPHA_VDISRAM(:),ALPHA_PACC(:),ALPHA_PREGRAM(:),ALPHA_PBOP(:)
  96. !REAL,ALLOCATABLE:: REAL_TIME(:),REAL_QRAM(:),REAL_VDISRAM(:),REAL_PACC(:),REAL_PREGRAM(:),REAL_PBOP(:),real_IDshearBop(:)
  97. REAL REAL_TIME,REAL_QRAM,REAL_VDISRAM,REAL_PACC,REAL_PREGRAM,REAL_PBOP,real_IDshearBop
  98. REAL IDshearBopBase,IDshearBop,ODDrillpipe_inShearRam,AbopShearRam,NeededVolumeShearRams,ODDrillpipe_inShearRamBase
  99. Real IDshearBopFinal,IDPipeRam1Final,IDPipeRam2Final,IDAnnularFinal,OpenArea_shearBop,OpenArea_PipeRam1,OpenArea_PipeRam2,OpenArea_Annular
  100. Real MinimumOpenArea_InBOP
  101. integer MiddleRamsFailureMalf,MiddleRamsLeakMalf,ShearIsNotAllowed
  102. end type ShearRamType
  103. !===========================================================================
  104. ! PIPE RAMS 2 VARIABLES
  105. !===========================================================================
  106. type::PipeRam2Type
  107. logical IsClosing,IsOpening
  108. REAL LeverOld,H_Bop
  109. REAL NeededVolume,ID,ODDrillpipe_in,ODDrillpipe_inBase
  110. integer closed,finished,LowerRamsFailureMalf,LowerRamsLeakMalf,Situation_forTD
  111. !REAL,ALLOCATABLE:: real_IDPipeRam2(:)
  112. REAL real_ID
  113. end type PipeRam2Type
  114. !===========================================================================
  115. ! CHOKE LINE VARIABLES
  116. !===========================================================================
  117. type::ChokeLineType
  118. logical IsClosing,IsOpening
  119. REAL LeverOld,H_Bop
  120. REAL NeededVolume,Abop,ID,ODDrillpipe_in,IDBase,ODDrillpipe_inBase
  121. integer closed,finished
  122. !REAL,ALLOCATABLE:: real_IDPipeRam1(:)
  123. REAL real_ID
  124. end type ChokeLineType
  125. !===========================================================================
  126. ! KILL LINE VARIABLES
  127. !===========================================================================
  128. type::KillLineType
  129. logical IsClosing,IsOpening
  130. REAL LeverOld,H_Bop
  131. REAL NeededVolume,Abop,ID,ODDrillpipe_in,IDBase,ODDrillpipe_inBase
  132. integer closed,finished
  133. !REAL,ALLOCATABLE:: real_IDPipeRam1(:)
  134. REAL real_ID
  135. end type KillLineType
  136. !============================================================================
  137. ! OIL & ENVIRONMENT VARIABLES
  138. !============================================================================
  139. ! REAL:: SG=1.12,WDENS=1000,GRAVITY=9.81,RE_CR=2000
  140. !specific gravity of liquid
  141. !water density(kg/m^3)
  142. !============================================================================
  143. ! PUMP VARIABLES
  144. !============================================================================
  145. type::PumpsType
  146. REAL P_AIRP,DELTAV_AIR,TOL_AIR,DELTAV_ELECP,Qiter
  147. REAL ELECTRIC_ON,ELECTRIC_OFF,AIR_ON,AIR_OFF,QAIR,QELECTRIC
  148. !REAL,ALLOCATABLE:: alpha_Qair(:),alpha_timeair(:),alpha_paccair(:),alpha_pairp(:),alpha_diffpair(:),alpha_lossesair(:),alpha_fvrair(:)
  149. REAL alpha_Qair,alpha_timeair,alpha_paccair,alpha_pairp,alpha_diffpair,alpha_lossesair,alpha_fvrair
  150. logical SoundKoomeyElectric
  151. end type PumpsType
  152. !=================================================================================
  153. TYPE, PUBLIC :: BOP_TypeVars
  154. REAL vdis_tot,vdis_bottles,deltav_bottles,fvr_air,vdis_elecp,Qzero,Q,flow,tol,TIME,timecounter_ram,clock
  155. integer bop_type, SuccessionCounter, SuccessionCounterOld,First_CloseTimecheck,First_OpenTimecheck,FourwayValve ! FourwayValve 1: Open , 0: Close
  156. REAL loss_before,pipe_loss2,minor_loss2,deltah,static_loss2,kinetic_loss2,loss_after,TOLZERO,diffp_ram
  157. REAL checkp,p_acccheck,P_BOP,minor_loss1,static_loss1,kinetic_loss1,pipe_loss1
  158. Logical Bottles_Charged_MalfActive
  159. END TYPE BOP_TypeVars
  160. ! 1 : Annular (RNUMBER)
  161. ! 2 : PipeRam1 (RNUMBER)
  162. ! 3 : PipeRam2 (RNUMBER)
  163. ! 4 : ShearRam (RNUMBER)
  164. ! 5 : ChokeLine (RNUMBER)
  165. ! 6 : KillLine (RNUMBER)
  166. TYPE, PUBLIC :: BOP_TypeVars2D
  167. REAL, ALLOCATABLE:: minlosspa(:,:),minloss(:,:)
  168. REAL,ALLOCATABLE:: Re_ramline(:,:),fric(:,:),fricloss(:,:)
  169. END TYPE BOP_TypeVars2D
  170. END MODULE