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.
 
 
 
 
 
 

120 lines
3.7 KiB

  1. subroutine Pump1_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. !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque
  18. Call Pump_Traction_Motor(Pump_No)
  19. !print*, 'PUMP(1)%w_new=', PUMP(1)%w_new
  20. if (PUMP(Pump_No)%N_ref<=0.) then
  21. PUMP(Pump_No)%w_ref = 0.
  22. PUMP(Pump_No)%w_old = 0.
  23. PUMP(Pump_No)%w = 0.
  24. PUMP(Pump_No)%w_new = 0.
  25. PUMP(Pump_No)%ia_old = 0.
  26. PUMP(Pump_No)%ia = 0.
  27. PUMP(Pump_No)%ia_new = 0.
  28. PUMP(Pump_No)%x_old = 0.
  29. PUMP(Pump_No)%x = 0.
  30. PUMP(Pump_No)%x_new = 0.
  31. end if
  32. if (Power_sigma>max_Power_sigma) then
  33. PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old
  34. else
  35. 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)
  36. IF (PUMP(Pump_No)%Vt_old>810.) THEN
  37. PUMP(Pump_No)%Vt_old = 810.
  38. ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN
  39. PUMP(Pump_No)%Vt_old = 0.
  40. END IF
  41. end if
  42. !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)
  43. !IF (PUMP(Pump_No)%Vt>810.) THEN
  44. ! PUMP(Pump_No)%Vt=810.
  45. !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN
  46. ! PUMP(Pump_No)%Vt=0.
  47. !END IF
  48. PUMP(Pump_No)%Speed = 30.d0*PUMP(Pump_No)%w_new/pi !Speed [RPM]
  49. if ( Pump1Failure == .true. ) then
  50. PUMP(1)%Speed = 0.d0
  51. PUMP(1)%w = 0.d0
  52. PUMP(1)%w_new = 0.d0
  53. PUMP(1)%w_old = 0.d0
  54. end if
  55. Call Pump_Solver(Pump_No)
  56. Call Pump_Total_Counts
  57. Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
  58. SPM1 = MP1SPMGauge
  59. PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio)
  60. Call SetSoundMP1( PUMP(1)%SoundSPM )
  61. !Call Set_MP2SPMGauge( real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) )
  62. !SPM2 = MP2SPMGauge
  63. IF (PUMP(1)%Flow_Rate>0.) Then
  64. Call OpenPump1()
  65. Else
  66. Call ClosePump1()
  67. End if
  68. !IF (PUMP(2)%Flow_Rate>0.) Then
  69. ! Call OpenPump2()
  70. !Else
  71. ! Call ClosePump2()
  72. !End if
  73. !print*, 'PUMP(1)%Speed=', PUMP(1)%Speed
  74. !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque
  75. !print*, 'Power_sigma=', Power_sigma
  76. !print*, 'power_num_of_Jenerators=', power_num_of_Jenerators
  77. !print*, 'drilling_num_of_Jenerators=', drilling_num_of_Jenerators
  78. !print*, 'max_Power_sigma=', max_Power_sigma
  79. !print*, 'PUMP(1)%Vt=', PUMP(1)%Vt
  80. !print*, 'PUMP(1)%SoundSPM=', PUMP(1)%SoundSPM
  81. !print*, 'PUMP(1)%ia_new=', PUMP(1)%ia_new
  82. end subroutine Pump1_OnMode_Solver