Simulation Core
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

122 行
5.2 KiB

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