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.
 
 
 
 
 
 

108 lines
3.1 KiB

  1. subroutine Pump2_OnMode_Solver(Pump_No)
  2. use Pump_VARIABLES
  3. use CPumpsVariables
  4. use CDrillingConsoleVariables
  5. use CDataDisplayConsoleVariables
  6. use CSimulationVariables
  7. use CDrillWatchVariables
  8. use equipments_PowerLimit
  9. use CSounds
  10. use CWarningsVariables
  11. IMPLICIT NONE
  12. INTEGER :: Pump_No
  13. Call Pump_INPUTS
  14. ! Torque unit = [in.lbf]
  15. PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency)
  16. !call PowerLimits
  17. Call Pump_Traction_Motor(Pump_No)
  18. if (PUMP(Pump_No)%N_ref<=0.) then
  19. PUMP(Pump_No)%w_ref = 0.
  20. PUMP(Pump_No)%w_old = 0.
  21. PUMP(Pump_No)%w = 0.
  22. PUMP(Pump_No)%w_new = 0.
  23. PUMP(Pump_No)%ia_old = 0.
  24. PUMP(Pump_No)%ia = 0.
  25. PUMP(Pump_No)%ia_new = 0.
  26. PUMP(Pump_No)%x_old = 0.
  27. PUMP(Pump_No)%x = 0.
  28. PUMP(Pump_No)%x_new = 0.
  29. end if
  30. if (Power_sigma>max_Power_sigma) then
  31. PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old
  32. else
  33. PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new)
  34. IF (PUMP(Pump_No)%Vt_old>810.) THEN
  35. PUMP(Pump_No)%Vt_old = 810.
  36. ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN
  37. PUMP(Pump_No)%Vt_old = 0.
  38. END IF
  39. end if
  40. !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new)
  41. !IF (PUMP(Pump_No)%Vt>810.) THEN
  42. ! PUMP(Pump_No)%Vt=810.
  43. !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN
  44. ! PUMP(Pump_No)%Vt=0.
  45. !END IF
  46. PUMP(Pump_No)%Speed = 30.*PUMP(Pump_No)%w_new/pi !Speed [RPM]
  47. if ( Pump2Failure == .true. ) then
  48. PUMP(2)%Speed = 0.d0
  49. PUMP(2)%w = 0.d0
  50. PUMP(2)%w_new = 0.d0
  51. PUMP(2)%w_old = 0.d0
  52. end if
  53. Call Pump_Solver(Pump_No)
  54. Call Pump_Total_Counts
  55. !Call Set_MP1SPMGauge( real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
  56. !SPM1 = MP1SPMGauge
  57. Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) )
  58. SPM2 = MP2SPMGauge
  59. PUMP(2)%SoundSPM = INT(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)
  60. Call SetSoundMP2( PUMP(2)%SoundSPM )
  61. !IF (PUMP(1)%Flow_Rate>0.) Then
  62. ! Call OpenPump1()
  63. !Else
  64. ! Call ClosePump1()
  65. !End if
  66. IF (PUMP(2)%Flow_Rate>0.) Then
  67. Call OpenPump2()
  68. Else
  69. Call ClosePump2()
  70. End if
  71. end subroutine Pump2_OnMode_Solver