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.
 
 
 
 
 
 

125 lines
5.0 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. Theta300Refrence = 37.2
  23. Theta600Refrence = 60.2
  24. KickSinglePocket = Reservoir%MakeKickSinglePacket
  25. IF (KickSinglePocket) THEN
  26. MaxGasPocket = 1
  27. ELSE
  28. MaxGasPocket = 4
  29. END IF
  30. MaxChokeDensityChange = 25.0 ! [ppg/min]
  31. ChokeMinDensity = 2.0
  32. ChokeDensity = data%Configuration%Mud%ActiveDensity
  33. MinKickVol = 0.5 ! USGal
  34. SecondaryKickVol = 0.0
  35. SecondaryKickWeight = 0.0
  36. NoGasPocket = 0 ! No Kick
  37. WellHeadOpen = .TRUE.
  38. WellHeadWasOpen = .TRUE.
  39. data%State%FricPressDrop%BackPressure = 0.0
  40. GasKickPumpFlowRate = 0.0
  41. data%Equipments%DownHole%KickVolume = 0.0
  42. data%Equipments%DownHole%InfluxRate = 0.0
  43. ExitMass = 0.0
  44. MinAllowableKickVol = 1.0 * (42.0 / Convft3toUSgal) ! 1 bbl * 42 gal/bbl / 7.48 gal/ft^3 = ... ft^3
  45. data%State%FricPressDrop%StCompressedMudVol = 0.0
  46. data%State%FricPressDrop%AnnCompressedMudVol = 0.0
  47. KickFlux = .FALSE.
  48. KickOffBottom = .FALSE.
  49. KickWasExitingThroughChoke = .FALSE.
  50. data%State%FricPressDrop%FloatValveOpen = .TRUE.
  51. data%State%Choke%ChokeAreaFullyOpen = 123.0 / 64.0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2
  52. data%State%FricPressDrop%ChokeBypassArea = PI / 4.0 * data%Configuration%BopStack%ChokeLineId**2
  53. data%State%FricPressDrop%BHPSafetyMargin = 150.0
  54. data%State%FricPressDrop%AChBHPTol = 15.0
  55. data%State%FricPressDrop%ManChoke1Plug = 0
  56. data%State%FricPressDrop%ManChoke2Plug = 0
  57. data%State%FricPressDrop%ManChoke1Washout = 0
  58. data%State%FricPressDrop%ManChoke2Washout = 0
  59. data%State%FricPressDrop%BitJetsPlugged = 0
  60. data%State%FricPressDrop%BitJetsWashedOut = 0
  61. data%State%FricPressDrop%CasingPressure_DataDisplayMalF = 0
  62. SoundSpeed = 1530.0 / Convfttom
  63. data%State%PressureDisplay%PressureTimeStepDelay(1) = INT(2.0 * SUM(data%Configuration%StringConfiguration%StringConfigurations(2:)%ComponentLength) / SoundSpeed / dt)
  64. data%State%PressureDisplay%PressureTimeStepDelay(2) = INT(data%Configuration%Path%Items(SIZE(data%Configuration%Path%Items))%MeasuredDepth / SoundSpeed / dt)
  65. data%State%PressureDisplay%PressureTimeStepDelay(3) = INT(data%Configuration%Shoe%ShoeDepth / SoundSpeed / dt)
  66. !WRITE (*,*) SUM(StringConfigurations(2:)%ComponentLength), PathGenerations(SIZE(PathGenerations))%TotalVerticalDepth!, WellSurveyData(SIZE(WellSurveyData))%TotalVerticalDepth
  67. !WRITE (*,*) PathGenerations(SIZE(PathGenerations))%MeasuredDepth!, WellSurveyData(SIZE(WellSurveyData))%MeasuredDepth
  68. WRITE (*,*) 'time step delay', data%State%PressureDisplay%PressureTimeStepDelay
  69. DO i = 1 , data%State%PressureDisplay%PressureTimeStepDelay(1)
  70. CALL PumpPressureDelay%AddToFirst(0.0)
  71. END DO
  72. DO i = 1 , data%State%PressureDisplay%PressureTimeStepDelay(2)
  73. CALL BottomHolePressureDelay%AddToFirst(REAL(0.052 * data%Configuration%Mud%ActiveDensity * data%Configuration%Path%Items(SIZE(data%Configuration%Path%Items))%TotalVerticalDepth))
  74. END DO
  75. DO i = 1 , data%State%PressureDisplay%PressureTimeStepDelay(3)
  76. CALL ShoePressureDelay%AddToFirst(REAL(0.052 * data%Configuration%Mud%ActiveDensity * data%Configuration%Shoe%ShoeDepth))
  77. END DO
  78. !!!!!!! Methane Information
  79. data%State%GasType(1)%CritPress = 673.0
  80. data%State%GasType(1)%CritTemp = 344.0
  81. data%State%GasType(1)%MolarWt = 16.04
  82. data%State%GasType(1)%StDensity = 0.04238
  83. data%State%GasType(1)%GasConstant = RUniversal / data%State%GasType(1)%MolarWt
  84. !!!!!!!! H2S Information
  85. data%State%GasType(2)%CritPress = 1306.0
  86. data%State%GasType(2)%CritTemp = 673.0
  87. data%State%GasType(2)%MolarWt = 34.08
  88. data%State%GasType(2)%StDensity = 0.09087
  89. data%State%GasType(2)%GasConstant = RUniversal / data%State%GasType(2)%MolarWt
  90. !!!!!!!! CO2 Information
  91. data%State%GasType(3)%CritPress = 1072.0
  92. data%State%GasType(3)%CritTemp = 548.0
  93. data%State%GasType(3)%MolarWt = 44.01
  94. !data%State%GasType(3)%StDensity = 00
  95. data%State%GasType(3)%GasConstant = RUniversal / data%State%GasType(2)%MolarWt
  96. !!!!!!!! Mud density and viscosity
  97. ! Theta600Refrence = data%Configuration%Mud%ActiveThetaSixHundred
  98. ! Theta300Refrence = data%Configuration%Mud%ActiveThetaThreeHundred
  99. DensityRefrence = data%Configuration%Mud%ActiveDensity
  100. END SUBROUTINE