|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- subroutine ON_mode_simulation(Pump_No)
-
- use Pump_VARIABLES
- use CPumpsVariables
- use CDrillingConsoleVariables
- use CDataDisplayConsoleVariables
- use CSimulationVariables
- use CDrillWatchVariables
- use equipments_PowerLimit
-
- 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
-
- Call Pump_Traction_Motor(Pump_No)
-
- 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.*PUMP(Pump_No)%w_new/pi !Speed [RPM]
-
- Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
- SPM1 = MP1SPMGauge
- Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) )
- SPM2 = MP2SPMGauge
-
- Call Pump_Solver(Pump_No)
- Call Pump_Total_Counts
- !print*, 'PUMP(1)%Flow_Rate=' , PUMP(1)%Flow_Rate
- IF (PUMP(1)%Flow_Rate>0.) Then
- Call OpenPump1()
- !print*, 'open pump 1'
- Else
- Call ClosePump1()
- !print*, 'close pump 1'
- End if
-
- IF (PUMP(2)%Flow_Rate>0.) Then
- Call OpenPump2()
- Else
- Call ClosePump2()
- End if
-
-
- end subroutine ON_mode_simulation
|