Chapter 4:WORK AND HEAT

Example 4.1, Page No:114

In [1]:
import math
from __future__ import division

#Variable declaration
p1=5; # Pressure of Helium gas at initial state in bar
T1=222; # Temperature of Helium gas at initial state in K
V1=0.055; # Volume of Helium gas at initial state in m^3
n=1.5; # Index of expansion process
R=2.078;# Characteristic gas constant of Helium gas in kJ/kg K
p2=2; # Pressure of Helium gas at final state (after expansion) in bar

#Calculation for Method I
V2=V1*(p1/p2)**(1/n);# From Polytropic process relation for final volume
W=((p2*10**2*V2)-(p1*10**2*V1))/(n-1); # Work done from Polytropic process relation

#Result for Method I
print "Method I"
print "\nWork done =",round(W,2),"kJ"

#Calculation for Method II
m=(p1*10**2*V1)/(R*T1); # ideal gas equation
T2=T1*(p2/p1)**((n-1)/n); # From Polytropic process relation of final temperature
W=(m*R*(T1-T2))/(1-n); # Work done from Polytropic process relation

#Result for Method II
print "\n\nMethod II"
print "\nWork done =",round(W,2),"kJ"
Method I

Work done = -14.48 kJ


Method II

Work done = -14.48 kJ

Example 4.3, Page No:115

In [2]:
import math
from __future__ import division

#Variable declaration
p1=1.3; # Initial pressure of gas in bar
V1=0.03; # Initial volume of gas in m^3
V2=0.1; # Final volume of gas in m^3

#Calculation for (a)
W=p1*10**2*(V2-V1); # work done by gas

#Result for (a)
print "(a).Constant pressure process"
print "\nwork done by gas =",W,"kJ"

#Calculation for (b)
W=p1*10**2*V1*math.log(V2/V1);# Work done by gas

#Result for (b)
print "\n\n(b).Constant Temperature process"
print "\nwork done by gas =",W,"kJ"

#Calculation for (c)
n=1.3; #index of polytropic process 
p2=p1*(V1/V2)**n; # From Polytropic process relation for final pressure
W=((p2*10**2*V2)-(p1*10**2*V1))/(1-n); # Work done by gas

#Result for (c)
print "\n\n(c).polytropic process of index 1.3"
print "\nwork done by gas =",round(W,3),"kJ"
(a).Constant pressure process

work done by gas = 9.1 kJ


(b).Constant Temperature process

work done by gas = 4.69549393687 kJ


(c).polytropic process of index 1.3

work done by gas = 3.941 kJ

Example 4.4, Page No:120

In [3]:
import math
from __future__ import division

#Variable declaration
patm=1; # Atmospheric pressure in bar
V1=0.0135; # Volume of Freon 12 at initial state in m^3
D=9; # Diameter of the cylinder in cm
m=90; # Mass of the piston in kg
g=9.80665; # acceleration due to gravity in m/s^2

#Calculation for (a)
# (a). Determination of the final pressure and volume of the system
A=3.14/4 * (D*10**-2)**2; # Area of the cylinder
p1=0.7449; # Initial pressure of saturated vapour at 30 degree celcius in MPa
v1=0.023508; # Initial specific volume of saturated vapour at 30 degree celcius in m^3/kg
p2=(patm*10**5)+(m*g)/A; # Final pressure of Freon 12
v2=0.084022; # Final specific volume from superheated table at p2 and 30 degree celcius in m^3/kg
mf=V1/v1; # Mass of Freon 12
V2=mf*v2; # Final volume of Freon 12

#Result for (a)
print "(a)","\nFinal pressure = ",p2,"Pa","\nFinal volume = ",round(V2,5),"m^3   (round off error)"

#Calculation for (b)
# (b). Calculation of workdone by Freon 12 during this process
Wirrev=p2*(V2-V1);  # P dv Work done 

#Result for (b)
print "\n\n(b)","\nWork done = ",round(Wirrev/1000,3),"kJ   (round off error)"

#Calculation for (c)
# (c). Calculation of workdone by Freon 12 during reversible process
Wrev=p1*10**6*V1*math.log (V2/V1);#From reversible process relation for work done

#Result for (c)
print "\n\n(c)","\nWork done in reveersible process = ",round(Wrev/1000,2),"kJ   (round off error)"
(a) 
Final pressure =  238806.086341 Pa 
Final volume =  0.04825 m^3   (round off error)


(b) 
Work done =  8.299 kJ   (round off error)


(c) 
Work done in reveersible process =  12.81 kJ   (round off error)

Example 4.5, Page No:129

In [4]:
import math
from __future__ import division

#Variable declaration
p1=0.1; # Initial pressure (before compression) of air in MPa
T1=30; # Initial temperature (before compression) of air in degree celcius
p2=0.9; # Final pressure (after compression) of air in MPa
R=0.287; # Characteristic constant of air in kJ/kg k

# (i) Actual work in the flow process

#Calculation for (a)
# (a).Isothermal Process
w=-R*(T1+273)*math.log (p2/p1); # work done for isothermal process

#Result for (a)
print "(i) Actual work in the flow process","\n(a).Isothermal Process","\nwork done = ",round(w,1),"kJ/kg"

#Calculation for (b)
# (b).Polytropic process
n=1.4; # Index of polytropic process
T2=(T1+273)*(p2/p1)**((n-1)/n); # From Polytropic process relation for final temperature
w=(n/(1-n))*R*(T2-(T1+273)); # work done for polytropic process

#Result for (b)
print "\n\n(b).Polytropic process","\ncompression work = ",round(w,1),"kJ/kg"

# (ii).Nonflow work

#Calculation for (a)
# (a).Isothermal Process
w=-R*(T1+273)*math.log (p2/p1); # work done for isothermal process

#Result for (a)
print "\n\n\n(ii).Nonflow work","\n(a).Isothermal Process","\nwork done = ",round(w,1),"kJ/kg"

#Calculation for (b)
# (b).Polytropic process
w=(1/(1-n))*R*(T2-(T1+273));# work done for polytropic process

#Result for (b)
print "\n\n(b).Polytropic process","\ncompression work = ",round(w,1),"kJ/kg"
(i) Actual work in the flow process 
(a).Isothermal Process 
work done =  -191.1 kJ/kg


(b).Polytropic process 
compression work =  -265.8 kJ/kg



(ii).Nonflow work 
(a).Isothermal Process 
work done =  -191.1 kJ/kg


(b).Polytropic process 
compression work =  -189.9 kJ/kg

Example 4.6, Page No:135

In [5]:
#Variable declaration
p1=1; # Initial pressure (before compression) of air in bar
p2=8; # Final pressure (after compression) of air in bar
Vp=15; # Displacement volume of reciprocating air compressor in litres
Vc=0.05*Vp; # Clearance volume of reciprocating air compressor in litres
N=600; # Speed of compressor in rpm
V1=Vc+Vp; # Total volume of reciprocating air compressor in litres
p3=p2; # constant pressure process
p4=p1; # constant pressure process
V3=Vc;# Clearance volume of reciprocating air compressor in litres
n=1.3; # Index of reversible adiabatic compression process
m=1.4; # Index of reversible adiabatic expansion process
V4=V3*(p3/p4)**(1/m);

#Calculation for (a)
# (a).Work per machine cycle
Wcycle = ((n/(n-1))*p1*10**2*V1*10**-3*(1-(p2/p1)**((n-1)/n)))-((m/(m-1))*p4*10**2*V4*10**-3*(1-(p3/p4)**((m-1)/m)));
# Work per machine cycle
Wpower=abs (Wcycle)*(N/60); # Power consumption of the compressor

#Result for (a)
print "(a)","\nWork per machine cycle = ",round(Wcycle,3),"kJ   (Error in textbook)"
print "\nPower consumption of the compressor",round(Wpower,2),"kW"

#Calculation for (b)
# (b).Work of the cycle if m=n
m=n;
W_cycle=(n/(n-1))*p1*10**2*(V1-V4)*10**-3*(1-(p2/p1)**((n-1)/n)); # Work per machine cycle
er=((W_cycle-Wcycle)/Wcycle) * 100 # Error involved in calculating work if m=n

#Result for (b)
print "\n\n(b)","\nWork per machine cycle",round(W_cycle,3),"kJ  (round off error)"
print "\nError = ",round(er,3),"%   (Error in textbook)"

#Calculation for (c)
# (c).Clearance volumetric efficiency
C=Vc/Vp;
eff = 1+C+-C*(p2/p1)**(1/n); # Clearance volumetric efficiency

#Result for (c)
print "\n\n(c).","\nClearance volumetric efficiency = ",round(eff*100,0),"%"
(a) 
Work per machine cycle =  -3.263 kJ   (Error in textbook)

Power consumption of the compressor 32.63 kW


(b) 
Work per machine cycle -3.319 kJ  (round off error)

Error =  1.739 %   (Error in textbook)


(c). 
Clearance volumetric efficiency =  80.0 %

Example 4.7, Page No:137

In [6]:
import math

#Variable declaration
D=150; # Cylinder Diameter in mm
L=200; # Piston stroke in mm
C=0.05; # Clearance factor
p1=15; # Steam inlet conditions (saturated) in bar
p4=1; # Exhaust or back pressure in bar
p2=p1; # Constant pressure process
p5=p4; # Constant pressure process

#Calculation
Vp=(3.14*(D*10**-3)**2*L*10**-3)/4; # Swept volme of cylinder
Vc=C*Vp; # Clearance volume of cylinder
V3=Vc+Vp; # Total volume of cylinder
V1=Vc; # Clearance volume
V6=V1; # constant volume process
V4=V3; # constant volume process
V5=Vc+0.3*Vp; # Compression begins at 30% of stroke
V2=Vc+0.4*Vp; # Cut-off occurs at 40% of stroke
p6=p5*(V5/V6); # Pressure after compression
Wcycle=(p1*10**2*(V2-V1))+(p2*10**2*V2*math.log (V3/V2))-(p4*10**2*(V4-V5))-(p5*10**2*V5* math.log(V5/V6)); # Work per Cycle

#Result
print "Work per cycle =",round(Wcycle,3),"kJ"
Work per cycle = 3.652 kJ

Example 4.8, Page No:142

In [7]:
#Variable declaration
D=10; #Bore in cm
L=12.5; #Stroke length in cm
a=9.68; # Area of indicator card in cm^2
l=5.33; # Card length in cm
Ks=21.7; # Indicator spring constant per meter of card length

#Calculation
A=(3.14*(D*10**-2)**2)/4; # Area of pisaton
Pm=(a/l)*10**-2*Ks*10**6; # Mean effective pressure
W=Pm*A*L*10**-2; # Work done by cycle

#Result
print "Work done by cycle = ",round(W,0),"kJ"
Work done by cycle =  387.0 kJ

Example 4.9, Page No:142

In [8]:
import math
from __future__ import division

#Variable declaration
D=152; # Bore of steam engine in mm
l=89; # Stroke length of steam engine in mm
a1=8;a2=10; # area of indicatior diagram on two sides
Ks=50; # Indicator spring constant in lbf/in^2/in
N=310; # Engine speed in rpm
d=0.664; # Diameter of flywheel in m

#Calculation for (a)
# (a)
a=(a1+a2)/2; # Average area of indicator diagram
Ks=50*4.44822/(0.0254)**3; # Unit conversion from lbf/in^2/in to N/m^2
pm=(a/(l/10))*10**-2*Ks; # Mean effective pressure 
A=(3.14*(D*10**-3)**2)/4; # Area of the piston
IP=2*pm*l*10**-3*A*N/60; # Indicated power

#Result for (a)
print "(a)","\nIndicated power of Engine =",round(IP/1000,2),"kW"

#Calculation for (b)
# (b)
F=12-1.5; # Tangential force on the brake drum in kgf
BP=F*9.81*d/2*2*3.14*N/60; # Brake power of Engine
eff=BP/IP *100 ; # Mechanical efficiency 

#Result for (b)
print "\n\n(b)","\nBrake power of Engine = ",round(BP/1000,2),"kW","\nMechanical efficiency of Engine =",round(eff,2),"%"
(a) 
Indicated power of Engine = 2.29 kW


(b) 
Brake power of Engine =  1.11 kW 
Mechanical efficiency of Engine = 48.47 %

Example 4.10, Page No:156

In [9]:
import math
from __future__ import division

#Variable declaration
Tc1=10; # Feed water inlet temperature in degree celcius
Tc2=77; # Feed water outlet temperature in degree celcius
th1=166; # Initial temperature of flue gas in degree celcius
r=4; # Ratio of mass flow rates of flue gases and water
Ch=1.05; # The specific heat of flue gas in kJ/kg K
Cc=4.187; # The specific heat of feed water in kJ/kg K
U=114; # Overall heat transfer coefficient in W/m^2
mc=1; # massflowrate of feed water in kg/s

#Calculation for Parallel flow
th2=th1-((Cc*(Tc2-Tc1))/(r*Ch)); # Outlet temperature of flue gas in degree celcius
Q=mc/3600*Cc*(Tc2-Tc1); # Heat transfer rate per kg/h of water flow
# Parallel flow    
del_Tm=((th1-Tc1)-(th2-Tc2))/math.log ((th1-Tc1)/(th2-Tc2)); # Logarthamic Mean Temperature Difference in degree celcius
A=Q*10**3/(U*del_Tm); # Economiser surface area

#Result for Parallel flow
print " (a)Parallel flow","\nLogarthamic Mean Temperature Difference=",round(del_Tm,1),"degree celcius",
print "\nEconomiser surface area =",round(A,2),"m^2"

#Calculation for Counter flow
# Counter flow
del_Tm=((th1-Tc2)-(th2-Tc1))/math.log ((th1-Tc2)/(th2-Tc1)); # Logarthamic Mean Temperature Difference in degree celcius
A=Q*10**3/(U*del_Tm); # Economiser surface area

#Result for Counter flow
print" \n\n(b) Counter flow","\nLogarthamic Mean Temperature Difference=",round(del_Tm,1),"degree celcius",
print "\nEconomiser surface area =",round(A,5),"m^2"
 (a)Parallel flow 
Logarthamic Mean Temperature Difference= 68.6 degree celcius 
Economiser surface area = 0.01 m^2
 

(b) Counter flow 
Logarthamic Mean Temperature Difference= 89.1 degree celcius 
Economiser surface area = 0.00767 m^2