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.
 
 
 
 
 
 

52 lines
2.2 KiB

  1. subroutine Pump_OffMode_Solver(Pump_No)
  2. use Pumps_VARIABLES
  3. !use CPumpsVariables
  4. !use CDrillingConsoleVariables
  5. !use CDataDisplayConsoleVariables
  6. !use CSimulationVariables
  7. !use CDrillWatchVariables
  8. !use CSounds
  9. IMPLICIT NONE
  10. INTEGER :: Pump_No
  11. PUMP(1)%N_new = 0.e0
  12. !========================== Pump 1 Rate limit ==========================
  13. if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>PUMP(1)%RateChange) then
  14. PUMP(1)%Speed =(PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old
  15. else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>PUMP(1)%RateChange) then
  16. PUMP(1)%Speed = (-PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old
  17. else
  18. PUMP(1)%Speed = PUMP(1)%N_new
  19. end if
  20. !=======================================================================
  21. PUMP(Pump_No)%Flow_Rate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm]
  22. PUMP(Pump_No)%Hydraulic_HorsePower = ( (PUMP(Pump_No)%Flow_Rate/0.01e0)*PUMP(Pump_No)%Max_Pressure)/(168067.e0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
  23. if ( PUMP(Pump_No)%StandPipe_Pressure>=PUMP(Pump_No)%Max_Pressure ) then
  24. !print*, 'pumps critical'
  25. PUMP(Pump_No)%Flow_Rate = (1714.e0*PUMP(Pump_No)%Hydraulic_HorsePower)/PUMP(Pump_No)%Max_Pressure ![gpm]
  26. PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0) )*PUMP(Pump_No)%Trans_Ratio ![rpm]
  27. end if
  28. total_pumps%Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate
  29. total_pumps%Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio)
  30. !Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
  31. !SPM1 = MP1SPMGauge
  32. !PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio)
  33. !Call SetSoundMP1( PUMP(1)%SoundSPM )
  34. end subroutine Pump_OffMode_Solver