subroutine Pump1_OnMode_Solver(Pump_No) use Pump_VARIABLES use CPumpsVariables use CDrillingConsoleVariables use CDataDisplayConsoleVariables use CSimulationVariables use CDrillWatchVariables use equipments_PowerLimit use CSounds use CWarningsVariables IMPLICIT NONE INTEGER :: Pump_No Call Pump_INPUTS ! Torque unit = [in.lbf] 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) !call PowerLimits !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque Call Pump_Traction_Motor(Pump_No) !print*, 'PUMP(1)%w_new=', PUMP(1)%w_new if (PUMP(Pump_No)%N_ref<=0.) then PUMP(Pump_No)%w_ref = 0. PUMP(Pump_No)%w_old = 0. PUMP(Pump_No)%w = 0. PUMP(Pump_No)%w_new = 0. PUMP(Pump_No)%ia_old = 0. PUMP(Pump_No)%ia = 0. PUMP(Pump_No)%ia_new = 0. PUMP(Pump_No)%x_old = 0. PUMP(Pump_No)%x = 0. PUMP(Pump_No)%x_new = 0. end if if (Power_sigma>max_Power_sigma) then PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old else 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) IF (PUMP(Pump_No)%Vt_old>810.) THEN PUMP(Pump_No)%Vt_old = 810. ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN PUMP(Pump_No)%Vt_old = 0. END IF end if !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) !IF (PUMP(Pump_No)%Vt>810.) THEN ! PUMP(Pump_No)%Vt=810. !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN ! PUMP(Pump_No)%Vt=0. !END IF PUMP(Pump_No)%Speed = 30.d0*PUMP(Pump_No)%w_new/pi !Speed [RPM] if ( Pump1Failure == .true. ) then PUMP(1)%Speed = 0.d0 PUMP(1)%w = 0.d0 PUMP(1)%w_new = 0.d0 PUMP(1)%w_old = 0.d0 end if Call Pump_Solver(Pump_No) Call Pump_Total_Counts Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) SPM1 = MP1SPMGauge PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) Call SetSoundMP1( PUMP(1)%SoundSPM ) !Call Set_MP2SPMGauge( real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) !SPM2 = MP2SPMGauge IF (PUMP(1)%Flow_Rate>0.) Then Call OpenPump1() Else Call ClosePump1() End if !IF (PUMP(2)%Flow_Rate>0.) Then ! Call OpenPump2() !Else ! Call ClosePump2() !End if !print*, 'PUMP(1)%Speed=', PUMP(1)%Speed !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque !print*, 'Power_sigma=', Power_sigma !print*, 'power_num_of_Jenerators=', power_num_of_Jenerators !print*, 'drilling_num_of_Jenerators=', drilling_num_of_Jenerators !print*, 'max_Power_sigma=', max_Power_sigma !print*, 'PUMP(1)%Vt=', PUMP(1)%Vt !print*, 'PUMP(1)%SoundSPM=', PUMP(1)%SoundSPM !print*, 'PUMP(1)%ia_new=', PUMP(1)%ia_new end subroutine Pump1_OnMode_Solver