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.
 
 
 
 
 
 

224 lines
7.1 KiB

  1. # 1 "/home/admin/SimulationCore2/Equipments/Pumps/PumpsMain.f90"
  2. module PumpsMain
  3. use SimulationVariables
  4. implicit none
  5. public
  6. contains
  7. ! ****************************************
  8. ! ***** subroutine Pump1MainBody *****
  9. ! ****************************
  10. ! subroutine Pump1_Setup()
  11. ! use CSimulationVariables
  12. ! implicit none
  13. ! call OnSimulationInitialization%Add(Pump1_Init)
  14. ! call OnSimulationStop%Add(Pump1_Init)
  15. ! call OnPump1Step%Add(Pump1_Step)
  16. ! call OnPump1Output%Add(Pump1_Output)
  17. ! call OnPump1Main%Add(Pump1MainBody)
  18. ! end subroutine
  19. subroutine Pump1_Init
  20. Call Pumps_StartUp
  21. end subroutine Pump1_Init
  22. subroutine Pump1_Step
  23. Call Pump1_MainSolver
  24. end subroutine Pump1_Step
  25. ! subroutine Pump1_Output
  26. ! implicit none
  27. ! end subroutine Pump1_Output
  28. ! subroutine Pump1MainBody
  29. ! use ifport
  30. ! use ifmt
  31. ! implicit none
  32. ! Call Pumps_StartUp
  33. ! loop1 : do
  34. ! Call Pumps_MainSolver
  35. ! end do loop1
  36. ! end subroutine Pump1MainBody
  37. ! ****************************************
  38. ! ***** subroutine Pump2MainBody *****
  39. ! ****************************
  40. ! subroutine Pump2_Setup()
  41. ! use CSimulationVariables
  42. ! implicit none
  43. ! call OnSimulationInitialization%Add(Pump2_Init)
  44. ! call OnSimulationStop%Add(Pump2_Init)
  45. ! call OnPump2Step%Add(Pump2_Step)
  46. ! call OnPump2Output%Add(Pump2_Output)
  47. ! call OnPump2Main%Add(Pump2MainBody)
  48. ! end subroutine
  49. !
  50. ! subroutine Pump2_Init
  51. ! implicit none
  52. ! end subroutine Pump2_Init
  53. !
  54. ! subroutine Pump2_Step
  55. ! call Pump2_MainSolver
  56. ! end subroutine Pump2_Step
  57. !
  58. ! subroutine Pump2_Output
  59. ! implicit none
  60. ! end subroutine Pump2_Output
  61. !
  62. ! subroutine Pump2MainBody
  63. ! use ifport
  64. ! use ifmt
  65. ! use CWarnings
  66. ! implicit none
  67. !
  68. ! integer,dimension(8) :: MP_START_TIME, MP_END_TIME
  69. ! INTEGER :: MP_SolDuration
  70. !
  71. ! Call Pump_StartUp
  72. !
  73. ! loop1 : do
  74. !
  75. ! Call DATE_AND_TIME(values=MP_START_TIME)
  76. !
  77. ! Call Pump2_MainSolver
  78. !
  79. ! Call DATE_AND_TIME(values=MP_END_TIME)
  80. ! MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8))
  81. ! if(MP_SolDuration > 0.0) then
  82. ! Call sleepqq(MP_SolDuration)
  83. ! end if
  84. !
  85. ! if (IsStopped == .true.) then
  86. ! exit loop1
  87. ! end if
  88. !
  89. ! end do loop1
  90. !
  91. !
  92. ! end subroutine Pump2MainBody
  93. !
  94. !
  95. !
  96. !
  97. !! ****************************************
  98. !! ***** subroutine Pump3MainBody *****
  99. !! ****************************
  100. ! subroutine Pump3_Setup()
  101. ! use CSimulationVariables
  102. ! implicit none
  103. ! call OnSimulationInitialization%Add(Pump3_Init)
  104. ! call OnSimulationStop%Add(Pump3_Init)
  105. ! call OnPump3Step%Add(Pump3_Step)
  106. ! call OnPump3Output%Add(Pump3_Output)
  107. ! call OnPump3Main%Add(Pump3MainBody)
  108. ! end subroutine
  109. !
  110. ! subroutine Pump3_Init
  111. ! implicit none
  112. ! end subroutine Pump3_Init
  113. !
  114. ! subroutine Pump3_Step
  115. ! implicit none
  116. ! end subroutine Pump3_Step
  117. !
  118. ! subroutine Pump3_Output
  119. ! implicit none
  120. ! end subroutine Pump3_Output
  121. !
  122. ! subroutine Pump3MainBody
  123. ! use ifport
  124. ! use ifmt
  125. ! implicit none
  126. !
  127. !
  128. ! integer,dimension(8) :: MP_START_TIME, MP_END_TIME
  129. ! INTEGER :: MP_SolDuration
  130. !
  131. ! !Call Pump_StartUp
  132. ! !loop1 : do
  133. ! !
  134. ! ! Call sleepqq(10)
  135. ! !
  136. ! ! !!! Pump3 Malfunction ----> Power Failure
  137. ! ! !!if (data%State%Pump(1)%PowerFailMalf==1) then
  138. ! ! !! !MP1BLWR=0
  139. ! ! !! Call Pump3_OffMode_Solver
  140. ! ! !! Call ClosePump1()
  141. ! ! !!end if
  142. ! !
  143. ! ! !if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (data%State%Pump(3)%PowerFailMalf==0) ) then
  144. ! !!
  145. ! !! loop2: do
  146. ! !!
  147. ! !! Call DATE_AND_TIME(values=MP_START_TIME)
  148. ! !!
  149. ! !!!! ! Pump3 Malfunction ----> Power Failure
  150. ! !!!! if (data%State%Pump(1)%PowerFailMalf==1) then
  151. ! !!!! !MP1BLWR=0
  152. ! !!!! Pump3_OffMode_Solver
  153. ! !!!! Call ClosePump1()
  154. ! !!!! exit loop2
  155. ! !!!! end if
  156. ! !!
  157. ! !! data%State%Pump(3)%N_new = MP1Throttle
  158. ! !! if (((data%State%Pump(3)%N_new-data%State%Pump(3)%N_old)/data%State%Pump(3)%time_step)>193.) then
  159. ! !! data%State%Pump(3)%N_ref =(193.*data%State%Pump(3)%time_step)+data%State%Pump(3)%N_old
  160. ! !! else if (((data%State%Pump(3)%N_old-data%State%Pump(3)%N_new)/data%State%Pump(3)%time_step)>193.) then
  161. ! !! data%State%Pump(3)%N_ref = (-193.*data%State%Pump(3)%time_step)+data%State%Pump(3)%N_old
  162. ! !! else
  163. ! !! data%State%Pump(3)%N_ref = data%State%Pump(3)%N_new
  164. ! !! end if
  165. ! !!
  166. ! !! Call Pump3_OnMode_Solver
  167. ! !!
  168. ! !! IF (data%State%Pump(3)%Flow_Rate>0.) Then
  169. ! !! Call OpenCementPump()
  170. ! !! Else
  171. ! !! Call CloseCementPump()
  172. ! !! End if
  173. ! !!
  174. ! !! data%State%Pump(3)%N_old = data%State%Pump(3)%N_ref
  175. ! !!
  176. ! !! Call DATE_AND_TIME(values=MP_END_TIME)
  177. ! !! MP_SolDuration = 100-(MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8))
  178. ! !! !print*, 'MPtime=', MP_SolDuration
  179. ! !! if(MP_SolDuration > 0.0) then
  180. ! !! Call sleepqq(MP_SolDuration)
  181. ! !! end if
  182. ! !!
  183. ! !! if ((MP1CPSwitch==0) .or. (IsStopped == .true.)) then
  184. ! !! Call Pump3_OffMode_Solver
  185. ! !! Call CloseCementPump()
  186. ! !! exit loop2
  187. ! !! end if
  188. ! !! end do loop2
  189. ! !
  190. ! ! else
  191. ! !
  192. ! ! !Call Pump3_OffMode_Solver
  193. ! ! !Call CloseCementPump()
  194. ! !
  195. ! ! end if
  196. ! !
  197. ! ! if (IsStopped == .true.) then
  198. ! ! exit loop1
  199. ! ! end if
  200. ! !
  201. ! !end do loop1
  202. !
  203. !
  204. ! end subroutine Pump3MainBody
  205. end module PumpsMain