In [1]:

```
# Variables
#Assume that properties of water can be used to substitute properties of solution
# Given
V = 1.673 ; # Volume of closed vessel-[cubic metre]
m = 1. ; # mass of saturated liquid vaporized-[kg]
Pi = 1. ; # Initial pressure -[atm]
Ti = 10. ; # Initial temperature -[degree C]
Pf = 1. ; # final pressure -[atm]
Tf = 100. ; # final temperature -[degree C]
# Use steam table to obtain additional information at given condition
Ui = 35. ; # Initial enthalpy-[kJ/kg]
Uf = 2506.0 ; # Final enthalpy -[kJ/kg]
# Calculations
# Use eqn. 22.2 after modifiying it using given conditions(W = 0,del_KE = 0 and del_PE = 0 )
Q = m*(Uf - Ui) ; # Heat transferred to the vessel - [kJ]
# Results
print 'Heat transferred to the vessel is %.1f kJ . '%Q
```

In [2]:

```
# Variables
# Given
T1 = 80. ; # Initial temperature -[degree F]
T1 = 40. ; # final temperature -[degree F]
# Additional data obtained from steam table at given temperatures and corresponding vapour pressures
p1 = 0.5067 ; # Initial saturation pressure-[psia]
p2 = 0.1217 ; # Final saturation pressure-[psia]
V1 = 0.01607 ; # Initial specific volume - [cubic feet/lb]
V2 = 0.01602 ; # Final specific volume - [cubic feet/lb]
H1 = 48.02 ; #Initial specific enthalpy -[Btu/lb]
H2 = 8.05 ; # Final specific enthalpy -[Btu/lb]
# Calculations
del_P = p2 - p1 ; # Change in pressure -[psia]
del_V = V2 - V1 ; # Change in specific volume -[cubic feet/lb]
del_H = H2 - H1 ; # Change in specific enthalpy -[Btu/lb]
del_pV = p2*144*V2/778. - p1*144*V1/778. ; # Change in pv-[Btu]
del_U = del_H - del_pV ; # Change in specific internal energy - [Btu/lb]
del_E = del_U ; # Change in specific total energy(since KE=0,PE=0 and W=0) -[Btu/lb]
# Results
print 'Change in pressure is %.3f psia . '%del_P
print 'Change in specific volume is %.5f cubic feet/lb (negligible value) . '%del_V
print 'Change in specific enthalpy is %.2f Btu/lb . '%del_H
print 'Change in specific internal energy is %.2f Btu/lb . '%del_U
print 'Change in specific total energy is %.2f Btu/lb . '%del_E
```

In [3]:

```
# Variables
#Lets take tank to be system
# Given
T = 600. ; # Temperature of steam -[K]
P = 1000. ; # Pressure of steam -[kPa]
# Calculations
# Additional data for steam obtained from CD database at T and P
U = 2837.73 ; # Specific internal energy-[kJ/kg]
H = 3109.44 ; # Specific enthalpy -[kJ/kg]
V = 0.271 ; # Specific volume -[cubic metre/kg]
# By the reduced equation
Ut2 = H ; # Internal energy at final temperature-[kJ/kg]
# Results
print 'The specific internal energy at final temperature is %.2f kJ/kg. Now use two properties\
of the steam (P = %i kPa and Ut2 = %.2f kJ/kg) to find final temperature (T) from steam table. \
From steam table we get T = 764 K.'%(Ut2,P,Ut2)
```

In [4]:

```
# Variables
# Take milk plus water in tank to be system
# Given
T1_water = 70. ; # Temperature of entering water -[degree C]
T2_water = 35. ; # Temperature of exiting water -[degree C]
T1_milk = 15. ; #Temperature of entering milk -[degree C]
T2_milk = 25. ; #Temperature of exiting milk -[degree C]
# Get additional data from steam table for water and milk,assuming milk to have same properties as that of water.
H_15 = 62.01 ; #Change in specific internal energy-[kJ/kg]
H_25 = 103.86 ; #Change in specific internal energy-[kJ/kg]
H_35 = 146.69 ; #Change in specific internal energy-[kJ/kg]
H_70 = 293.10 ; #Change in specific internal energy-[kJ/kg]
# Assumptions to simplify Equation 22.8 are:
print 'Assumptions to simplify Equation 22.8 are:'
print '1. Change in KE and PE of system = 0.'
print '2. Q = 0 ,because of way we picked the system,it is is well insulated.'
print '3. W = 0,work done by or on the system.'
# Calculations
#Basis m_milk = 1 kg/min , to directly get the answer .
m_milk = 1 ; # Mass flow rate of milk-[kg/min]
# By applying above assumtions eqn. 22.8 reduces to del_H = 0 .Using it get m_water-
m_water = (m_milk*(H_15 - H_25))/(H_35 - H_70) ; # Mass flow rate of water-[kg/min]
m_ratio = m_water/m_milk ; # Mass flow rate of water per kg/min of milk-[kg/min]
# Results
print 'Mass flow rate of water per kg/min of milk is %.2f (kg water/min )/(kg milk/min).'%m_ratio
```

In [5]:

```
# Variables
# Take pipe between initial and final level of water
# Given
h_in = -20. ; # Depth of water below ground-[ft]
h_out = 5. ; # Height of water level above ground-[ft]
h = h_out - h_in ; # Total height to which water is pumped-[ft]
V = 0.50 ; # Volume flow rate of water - [cubic feet/s]
ef = 100.; # Efficiency of pump - [%]
g = 32.2; # Acceleration due to gravity -[ft/square second]
gc = 32.2 ; #[(ft*lbm)/(second square*lbf)]
M = V * 62.4 ; # mass flow rate - [lbm/s]
PE_in = 0 ; # Treating initial water level to be reference level
# Calculations
PE_out = (M*g*h*1.055)/(gc*778.2) ; # PE of discharged water -[lbm*(square feet/square second)]
W = PE_out - PE_in ; #Work done on system = power delivered by pump, (since we are using mass flow rate and pump efficiency is 100 % , so W = Power) -[kW]
# Results
print 'The electric power required by the pump is %.2f kW. '%W
```

In [ ]:

```
```