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.
 
 
 
 
 
 

118 wiersze
4.6 KiB

  1. SUBROUTINE FlowStartup
  2. USE Fluid_Flow_Startup_Vars
  3. USE CStringConfigurationVariables
  4. USE CMudPropertiesVariables
  5. USE FricPressDropVarsModule
  6. use KickVARIABLESModule
  7. USE MudSystemVARIABLES
  8. use PressureDisplayVARIABLESModule
  9. USE CShoeVariables
  10. USE TD_DrillStemComponents
  11. USE TD_WellGeometry, pi3 => pi
  12. USE CPathGenerationVariables
  13. USE CWellSurveyDataVariables
  14. Use CHOKEVARIABLES, pi4 => pi
  15. use ConfigurationVariables
  16. IMPLICIT NONE
  17. INTEGER :: i
  18. PressureDisplayVARIABLES%PressureGauges(:) = 0.0
  19. KickVARIABLES%KickSinglePocket = Reservoir%MakeKickSinglePacket
  20. IF (KickVARIABLES%KickSinglePocket) THEN
  21. KickVARIABLES%MaxGasPocket = 1
  22. ELSE
  23. KickVARIABLES%MaxGasPocket = 4
  24. END IF
  25. KickVARIABLES%MaxChokeDensityChange = 25.0 ! [ppg/min]
  26. KickVARIABLES%ChokeMinDensity = 2.0
  27. KickVARIABLES%ChokeDensity = MudProperties%ActiveDensity
  28. KickVARIABLES%MinKickVol = 0.5 ! USGal
  29. KickVARIABLES%SecondaryKickVol = 0.0
  30. KickVARIABLES%SecondaryKickWeight = 0.0
  31. KickVARIABLES%NoGasPocket = 0 ! No Kick
  32. KickVARIABLES%WellHeadOpen = .TRUE.
  33. KickVARIABLES%WellHeadWasOpen = .TRUE.
  34. FricPressDropVars%BackPressure = 0.0
  35. KickVARIABLES%GasKickPumpFlowRate = 0.0
  36. DownHole%KickVolume = 0.0
  37. DownHole%InfluxRate = 0.0
  38. KickVARIABLES%ExitMass = 0.0
  39. KickVARIABLES%MinAllowableKickVol = 1.0 * (42.0 / Convft3toUSgal) ! 1 bbl * 42 gal/bbl / 7.48 gal/ft^3 = ... ft^3
  40. FricPressDropVars%StCompressedMudVol = 0.0
  41. FricPressDropVars%AnnCompressedMudVol = 0.0
  42. KickVARIABLES%KickFlux = .FALSE.
  43. KickVARIABLES%KickOffBottom = .FALSE.
  44. KickVARIABLES%KickWasExitingThroughChoke = .FALSE.
  45. FricPressDropVars%FloatValveOpen = .TRUE.
  46. Choke%ChokeAreaFullyOpen = 123.0 / 64.0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2
  47. FricPressDropVars%ChokeBypassArea = PI / 4.0 * BopStackSpecification%ChokeLineId**2
  48. FricPressDropVars%BHPSafetyMargin = 150.0
  49. FricPressDropVars%AChBHPTol = 15.0
  50. FricPressDropVars%ManChoke1Plug = 0
  51. FricPressDropVars%ManChoke2Plug = 0
  52. FricPressDropVars%ManChoke1Washout = 0
  53. FricPressDropVars%ManChoke2Washout = 0
  54. FricPressDropVars%BitJetsPlugged = 0
  55. FricPressDropVars%BitJetsWashedOut = 0
  56. FricPressDropVars%CasingPressure_DataDisplayMalF = 0
  57. SoundSpeed = 1530.0 / Convfttom
  58. PressureDisplayVARIABLES%PressureTimeStepDelay(1) = INT(2.0 * SUM(Configuration%StringConfiguration%StringConfigurations(2:)%ComponentLength) / SoundSpeed / dt)
  59. PressureDisplayVARIABLES%PressureTimeStepDelay(2) = INT(PathGeneration%Items(SIZE(PathGeneration%Items))%MeasuredDepth / SoundSpeed / dt)
  60. PressureDisplayVARIABLES%PressureTimeStepDelay(3) = INT(Shoe%ShoeDepth / SoundSpeed / dt)
  61. !WRITE (*,*) SUM(StringConfigurations(2:)%ComponentLength), PathGenerations(SIZE(PathGenerations))%TotalVerticalDepth!, WellSurveyData(SIZE(WellSurveyData))%TotalVerticalDepth
  62. !WRITE (*,*) PathGenerations(SIZE(PathGenerations))%MeasuredDepth!, WellSurveyData(SIZE(WellSurveyData))%MeasuredDepth
  63. WRITE (*,*) 'time step delay', PressureDisplayVARIABLES%PressureTimeStepDelay
  64. DO i = 1 , PressureDisplayVARIABLES%PressureTimeStepDelay(1)
  65. CALL PumpPressureDelay%AddToFirst(0.0)
  66. END DO
  67. DO i = 1 , PressureDisplayVARIABLES%PressureTimeStepDelay(2)
  68. CALL BottomHolePressureDelay%AddToFirst(REAL(0.052 * MudProperties%ActiveDensity * PathGeneration%Items(SIZE(PathGeneration%Items))%TotalVerticalDepth))
  69. END DO
  70. DO i = 1 , PressureDisplayVARIABLES%PressureTimeStepDelay(3)
  71. CALL ShoePressureDelay%AddToFirst(REAL(0.052 * MudProperties%ActiveDensity * Shoe%ShoeDepth))
  72. END DO
  73. !!!!!!! Methane Information
  74. GasType(1)%CritPress = 673.0
  75. GasType(1)%CritTemp = 344.0
  76. GasType(1)%MolarWt = 16.04
  77. GasType(1)%StDensity = 0.04238
  78. GasType(1)%GasConstant = RUniversal / GasType(1)%MolarWt
  79. !!!!!!!! H2S Information
  80. GasType(2)%CritPress = 1306.0
  81. GasType(2)%CritTemp = 673.0
  82. GasType(2)%MolarWt = 34.08
  83. GasType(2)%StDensity = 0.09087
  84. GasType(2)%GasConstant = RUniversal / GasType(2)%MolarWt
  85. !!!!!!!! CO2 Information
  86. GasType(3)%CritPress = 1072.0
  87. GasType(3)%CritTemp = 548.0
  88. GasType(3)%MolarWt = 44.01
  89. !GasType(3)%StDensity = 00
  90. GasType(3)%GasConstant = RUniversal / GasType(2)%MolarWt
  91. !!!!!!!! Mud density and viscosity
  92. Theta600Refrence = MudProperties%ActiveThetaSixHundred
  93. Theta300Refrence = MudProperties%ActiveThetaThreeHundred
  94. DensityRefrence = MudProperties%ActiveDensity
  95. END SUBROUTINE