In [1]:

```
# Aim:To find the discharge flow and pressure
# Given:
# high inlet flow-rate:
Q_high_inlet=20.0; #gpm
# low inlet pressure:
p_low_inlet=500.0; #psi
# Ratio of piston area to rod area:
Ratio=5/1;
# Solution:
# high discharge pressure,
p_high_discharge=Ratio*p_low_inlet; #psi
# low discharge flow-rate,
Q_low_discharge=Q_high_inlet/Ratio; #gpm
# Results:
print"\n Results: "
print"\n The high discharge pressure is psi.",p_high_discharge
print"\n The low discharge flow-rate is gpm.",Q_low_discharge
```

In [2]:

```
# Aim:To find the downstream oil temperature
# Given:
# temperature of oil flowing through pressure relief valve:
T_oil=120.0; #deg F
# pressure of oil flowing through pressure relief valve:
p=1000.0; #psi
# oil flow through pressure relief valve:
Q_gpm=10.0; #gpm
# Solution:
# heat generation rate,
HP=(p*Q_gpm)/1714; #HP
# heat generation rate in Btu/min,
HP_btu=HP*42.4; #Btu/min
# oil flow-rate in lb/min,
Q_lb=7.42*Q_gpm; #lb/min
# temperature increase,
T_increase=HP_btu/(0.42*Q_lb); #deg F
# downward oil temperature,
T_downward=T_oil+T_increase; #deg F
# Results:
print "\n Results: "
print "\n The downstream oil temperature is deg F.",round(T_downward,1)
```

In [3]:

```
# Aim:To find the downstream oil temperature in SI Unit
# Given:
# temperature of oil flowing through pressure relief valve:
T_oil=50.0; #deg C
# pressure of oil flowing through pressure relief valve:
p=70.0; #bar
# oil flow through pressure relief valve:
Q=0.000632; #m**3/s
# Solution:
# heat generation rate,
kW=((p*10**5)*Q)/1000; #kW
# oil flow-rate,
Q_kg_s=895*Q; #kg/s
# temperature increase,
T_increase=kW/(1.8*Q_kg_s); #deg C
# downward oil temperature,
T_downward=T_oil+T_increase; #deg C
# Results:
print "\n Results: "
print "\n The downstream oil temperature is deg C.",round(T_downward,1)
```

In [4]:

```
# Aim:To find the rating of heat exchanger required to dissipate generated heat
# Given:
# oil flow-rate:
Q=20.0; #gpm
# operating pressure:
p=1000.0; #psi
# overall efficiency of pump:
eff_overall=85.0; #%
# power lost due to friction:
HP_frict=10.0; #%
# Solution:
# pump power loss,
pump_HP_loss=((1/(eff_overall/100))-1)*((p*Q)/1714); #HP
# PRV average HP loss,
PRV_loss=0.5*((p*Q)/1714); #HP
# line average HP loss,
line_loss=(HP_frict/100)*PRV_loss; #HP
# total average loss,
total_loss=pump_HP_loss+PRV_loss+line_loss; #HP
# heat exchanger rating,
HEx_rating=total_loss*2544; #Btu/hr
# Results:
print"\n Results: "
print"\n The heat exchanger rating is Btu/hr.",round(HEx_rating)
print"\n The answer in the program does not match with that in the textbook due to roundoff error (standard ratings) in textbook"
```

In [5]:

```
# Aim:To find the rating of heat exchanger required to dissipate generated heat in SI unit
# Given:
# oil flow-rate:
Q=0.00126; #m**3/s
# operating pressure:
p=70.0; #bar
# overall efficiency of pump:
eff_overall=85.0; #%
# power lost due to friction:
HP_frict=10.0; #%
# Solution:
# pump power loss,
pump_loss=((1/(eff_overall/100))-1)*((p*10**5*Q)/1000); #kW
# PRV average HP loss,
PRV_loss=0.5*((p*10**5*Q)/1000); #kW
# line average HP loss,
line_loss=(HP_frict/100)*PRV_loss; #kW
# total average loss,
HEx_rating=pump_loss+PRV_loss+line_loss; #kW
# Results:
print"\n Results: "
print"\n The heat exchanger rating is kW.",round(HEx_rating,2)
```

In [ ]:

```
```