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.

Pump1_MainSolver.f90 2.2 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. subroutine Pump1_MainSolver
  2. use SimulationVariables
  3. Implicit none
  4. if (data%State%Pump(1)%Throttle<=0.d0) then
  5. data%State%Pump(1)%K_throttle = 1
  6. end if
  7. if((any(data%State%Pump(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (data%State%Pump(1)%Switch==-1) .and. (data%State%Pump(1)%K_throttle==1) .and. (data%State%Pump(1)%PowerFailMalf==0) .and. (data%State%Pump(1)%Failure==0)) then
  8. data%State%Pump(1)%SoundBlower = .true.
  9. data%State%Pump(1)%BLWR = 1
  10. !========================== Pump 1 Rate limit ==========================
  11. if (((data%State%Pump(1)%N_new-data%State%Pump(1)%N_old)/data%State%Pump(1)%time_step)>data%State%Pump(1)%RateChange) then
  12. data%State%Pump(1)%Speed =(data%State%Pump(1)%RateChange*data%State%Pump(1)%time_step)+data%State%Pump(1)%N_old ![RPM]
  13. else if (((data%State%Pump(1)%N_old-data%State%Pump(1)%N_new)/data%State%Pump(1)%time_step)>data%State%Pump(1)%RateChange) then
  14. data%State%Pump(1)%Speed = (-data%State%Pump(1)%RateChange*data%State%Pump(1)%time_step)+data%State%Pump(1)%N_old
  15. else
  16. data%State%Pump(1)%Speed = data%State%Pump(1)%N_new
  17. end if
  18. !=======================================================================
  19. Call Pump_OnMode_Solver(1)
  20. else
  21. if ((any(data%State%Pump(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (data%State%Pump(1)%Switch==-1)) then
  22. data%State%Pump(1)%SoundBlower = .true.
  23. else
  24. data%State%Pump(1)%SoundBlower = .false.
  25. end if
  26. if ((any(data%State%Pump(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (data%State%Pump(1)%Switch==-1) .and. (data%State%Pump(1)%PowerFailMalf==0) .and. (data%State%Pump(1)%Failure==0)) then
  27. data%State%Pump(1)%BLWR = 1
  28. else
  29. data%State%Pump(1)%BLWR = 0
  30. end if
  31. Call Pump_OffMode_Solver(1)
  32. data%State%Pump(1)%K_throttle = 0
  33. end if
  34. data%State%Pump(1)%N_old = data%State%Pump(1)%Speed
  35. end subroutine Pump1_MainSolver