Simulation Core
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

vor 1 Jahr
vor 1 Jahr
vor 1 Jahr
vor 1 Jahr
vor 1 Jahr
vor 1 Jahr
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. module ChokeModule
  2. USE CHOKEVARIABLES
  3. use SimulationVariables !@
  4. !use CDataDisplayConsole
  5. ! !@use ConfigurationVariables, CasingPressureDataDisplay=>CasingPressure!, StandPipePressureDataDisplay=>StandPipePressure
  6. USE CChokeProblemsVariables
  7. !use CChokeControlPanelVariables
  8. ! !@use ConfigurationVariables, StandPipePressureChoke=>StandPipePressure
  9. USE MudSystemVARIABLES
  10. use SimulationVariables !@@@
  11. use CChokeManifold
  12. use SimulationVariables
  13. contains
  14. ! function CHOKE_MainBody1 result(CHNUMBER)
  15. ! implicit none
  16. ! INTEGER CHNUMBER
  17. ! IF(data%Equipments%ChokeControlPanel%ChokeSelectorSwitch== 1) THEN
  18. ! data%Equipments%ChokeControlPanel%Choke1LED=1
  19. ! data%Equipments%ChokeControlPanel%Choke2LED=0
  20. ! CHNUMBER=1
  21. ! ELSE
  22. ! data%Equipments%ChokeControlPanel%Choke2LED=1
  23. ! data%Equipments%ChokeControlPanel%Choke1LED=0
  24. ! CHNUMBER=2
  25. ! ENDIF
  26. ! end function CHOKE_MainBody1
  27. ! CALL PIPE_RAMS_CHOKE(CHNUMBER)
  28. ! subroutine Choke_innerLoop
  29. ! ! do while (ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0)
  30. ! if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then
  31. ! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true.
  32. ! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false.
  33. ! endif
  34. ! if (data%Equipments%ChokeControlPanel%ChokeControlLever == -1.0) then
  35. ! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .true.
  36. ! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .false.
  37. ! endif
  38. ! data%State%AirPumpLine%TIME=data%State%AirPumpLine%TIME+data%State%AirPumpLine%DeltaT_Choke !overal time (s)
  39. ! call airpump_code_CHOKE(CHNUMBER)
  40. ! ! call sleepqq(100)
  41. ! ! if (IsStopped == .true.) return
  42. ! ! enddo
  43. ! end if
  44. ! end subroutine Choke_innerLoop
  45. subroutine CHOKE_MainBody2
  46. IF (data%Equipments%ChokeControlPanel%Choke1LED==1) THEN
  47. data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(1)%PercentClose*10 ! display monitor
  48. ELSE ! Choke2LED==1
  49. data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(2)%PercentClose*10 ! display monitor
  50. ENDIF
  51. ! =================== calculating Area
  52. ! AreaChoke=0.5
  53. ! .91 >> 9 percent clearance
  54. data%State%CHOOKE(1)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)) !ft^2 0.01334635 is ChokeAreaFullyOpen (ft^2)
  55. data%State%CHOOKE(2)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(2)%PercentClose/ 0.91 , 1.0)) !ft^2
  56. !write(*,*) 'data%State%CHOOKE(1)%AreaChoke= ' , data%State%CHOOKE(1)%AreaChoke
  57. data%State%Choke%HydraulicChoke1WashoutCoef= data%State%Choke%HydraulicChoke1WashoutCoef * data%State%CHOOKE(1)%WashoutMalf
  58. data%State%Choke%HydraulicChoke1WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke1WashoutCoef+ data%State%CHOOKE(1)%WashoutMalf*(0.5/(180.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5 = maximum washout coef , 180.0 sec = 3 min duration time
  59. data%State%Choke%HydraulicChoke2WashoutCoef= data%State%Choke%HydraulicChoke2WashoutCoef * data%State%CHOOKE(2)%WashoutMalf
  60. data%State%Choke%HydraulicChoke2WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke2WashoutCoef+ data%State%CHOOKE(2)%WashoutMalf*(0.5/(180.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5 = maximum washout coef , 180.0 sec = 3 min duration time
  61. !write(*,*) 'HydraulicChoke1WashoutCoef=' , HydraulicChoke1WashoutCoef
  62. IF (data%State%CHOOKE(1)%PlugMalf == 1) THEN
  63. data%State%Choke%Present_HydraulicChoke1Plug= data%State%Choke%Present_HydraulicChoke1Plug * data%State%CHOOKE(1)%PlugMalf
  64. ! integer: HydraulicChoke1PluggedPercent,HydraulicChoke1PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay
  65. ! real: Present_HydraulicChoke1Plug,DeltaPlug1Percent
  66. !write(*,*) 'HydraulicChoke1PluggedPercent=' , HydraulicChoke1PluggedPercent
  67. if ( (data%problems%ChokeProblems%HydraulicChoke1PluggedPercent - data%State%Choke%HydraulicChoke1PluggedPercent_Old) /= 0) then
  68. data%State%Choke%DeltaPlug1Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke1Plug
  69. data%State%Choke%Plug1TimeCounter = 0
  70. !write(*,*) 'DeltaPlug1Percent, Present_HydraulicChoke1Plug = ' ,DeltaPlug1Percent , Present_HydraulicChoke1Plug
  71. endif
  72. data%State%Choke%Plug1TimeCounter= data%State%Choke%Plug1TimeCounter + 1
  73. data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent
  74. if (data%State%Choke%Plug1TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=1800
  75. data%State%Choke%Present_HydraulicChoke1Plug = data%State%Choke%Present_HydraulicChoke1Plug + data%State%CHOOKE(1)%PlugMalf* ((data%State%Choke%DeltaPlug1Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0
  76. endif
  77. !write(*,*) 'Present_HydraulicChoke1Plug=' , Present_HydraulicChoke1Plug
  78. ENDIF
  79. IF (data%State%CHOOKE(2)%PlugMalf == 1) THEN
  80. data%State%Choke%Present_HydraulicChoke2Plug= data%State%Choke%Present_HydraulicChoke2Plug * data%State%CHOOKE(2)%PlugMalf
  81. ! integer: HydraulicChoke2PluggedPercent,HydraulicChoke2PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay
  82. ! real: Present_HydraulicChoke2Plug,DeltaPlug2Percent
  83. if ( (data%problems%ChokeProblems%HydraulicChoke2PluggedPercent - data%State%Choke%HydraulicChoke2PluggedPercent_Old) /= 0 ) then
  84. data%State%Choke%DeltaPlug2Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke2Plug
  85. data%State%Choke%Plug2TimeCounter = 0
  86. endif
  87. data%State%Choke%Plug2TimeCounter= data%State%Choke%Plug2TimeCounter + 1
  88. data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent
  89. if (data%State%Choke%Plug2TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=1800
  90. data%State%Choke%Present_HydraulicChoke2Plug = data%State%Choke%Present_HydraulicChoke2Plug + data%State%CHOOKE(2)%PlugMalf *((data%State%Choke%DeltaPlug2Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 1800.0
  91. endif
  92. ENDIF
  93. ! fully open area is 123/64 in^2 = 0.01334635 ft^2
  94. data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke+(data%State%CHOOKE(1)%WashoutMalf*data%State%Choke%HydraulicChoke1WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup
  95. !write(*,*) 'data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke=' ,data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke
  96. data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke-(data%State%CHOOKE(1)%PlugMalf* data%State%Choke%Present_HydraulicChoke1Plug *data%State%CHOOKE(1)%AreaChoke) ! Initialised in Choke Startup
  97. data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke+(data%State%CHOOKE(2)%WashoutMalf*data%State%Choke%HydraulicChoke2WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup
  98. data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke-(data%State%CHOOKE(2)%PlugMalf* data%State%Choke%Present_HydraulicChoke2Plug *data%State%CHOOKE(2)%AreaChoke) ! Initialised in Choke Startup
  99. !write(*,*) 'data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke=' ,data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke
  100. data%State%CHOOKE(1)%AreaChokeFinal= data%State%CHOOKE(1)%AreaChoke
  101. data%State%CHOOKE(2)%AreaChokeFinal= data%State%CHOOKE(2)%AreaChoke
  102. ! 144: ft^2 to in^2
  103. CALL SetHydraulicChock1(100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve
  104. CALL SetHydraulicChock2(100 - nint((data%State%CHOOKE(2)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve
  105. !write(*,*) 'data%State%CHOOKE(1)%PercentClose=' , data%State%CHOOKE(1)%PercentClose ! close percent 0 to 100
  106. !write(*,*) 'ChokePosition=' , ChokePosition ! close position 0 to 10 for display
  107. !write(*,*) 'data%State%CHOOKE(1)%AreaChokeFinal=' , data%State%CHOOKE(1)%AreaChokeFinal ! Open Area (in^2) with clearance
  108. !write(*,*) '(ChokeAreaFullyOpen/144.)=' , (ChokeAreaFullyOpen/144.)
  109. !write(*,*) 'valve value=' , 100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(ChokeAreaFullyOpen/144.))*100) ! percent close 0 to 100 with clearance
  110. !write(*,*) 'Valve(33)%Status=' , Valve(33)%Status ! T : open , F: close
  111. ! =================== calculating Area
  112. !AreaChoke= data%State%CHOOKE(1)%AreaChoke !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< badan moteghayer 1 ya 2 shavad
  113. ! write(*,*) 'AreaChoke:',AreaChoke
  114. !===========================================================================
  115. ! MUD PUMP STROKES
  116. ! & TOTAL STROKE- CHOKE CONTROL PANEL
  117. !===========================================================================
  118. !************************* IN MUD SYSTEM MODULE*************************
  119. end subroutine CHOKE_MainBody2
  120. end module ChokeModule