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.
 
 
 
 
 
 

200 wiersze
10 KiB

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