Chapter 3 : First Law of Thermodynamics

Example 3.1 Page No : 50

In [1]:
#Given
W = -((2*745.6*(10**-3)/4.18)*3600) #work added to the system in Kcal/hr
m = 10.0 #Amount of fluid in math.tank in Kg
Q = -378.0 #Heat losses from the system in Kcal/hr

#To calculate the change in internal energy
delE=(Q-W)/m # Change in internal energy in Kcal/hr kg
print "Change in Internal energy is ",
print "%.6f"%delE,
print "Kcal/hr Kg"
#end
Change in Internal energy is  90.628708 Kcal/hr Kg

Example 3.2 Page No : 53

In [2]:
import math 

#Given
n = 1.0 #kg moles of a gas
Cv = 5.0 #specific heat in Kcal/Kgmole
delT = 15.0 #increase in temperature in deg celsius

#To calculate the change in internal energy
Q = n*Cv*delT #heat given to the system in Kcal
W = 0 #work done
delE = Q-W #Change in internal energy
print "Change in internal energy is ",
print "%.6f"%delE,
print "Kcal"
#end
Change in internal energy is  75.000000 Kcal

Example 3.3 Page No : 55

In [3]:
import math 

#Given
P = 1.0 #consmath.tant pressure throughout the process in atm
T1 = 273.0 #Initial temperature in K
T2 = 373.0 #Final temperature in K
V1 = 0.0#Volume of liquid water or initial volume
V0 = 22.4 #volume of vapour at smath.radians(numpy.arcmath.tan(ard condition in cubic meter
Q = 9.7 #Heat of vapourisation in Kcal

#To calculate the work done by the expanding gas and increase in internal energy
#(i)Calculation of work done
V2 = 22.4*(T2/T1)*(P)*(10**-3) #Volume of final vapour in cubic meter
w = P*(V2-V1) #Work done in atm cubic meter
W = w*(1.03*10**4)/427 #Work done in Kcal
print "i)Work done by the expanding gas is ",
print "%.6f"%W,
print "Kcal"

#(ii)Calculation of change in internal energy
delE = Q-W
print " ii)Increase in internal energy is ",
print "%.6f"%delE,
print "Kcal"
#end
i)Work done by the expanding gas is  0.738250 Kcal
 ii)Increase in internal energy is  8.961750 Kcal

Example 3.4 Page No : 58

In [5]:
import math 

#Given
W = 0.0 #work done during the process
P1 = 1.0 #Initial pressure in atm
P2 = 10.0 #Final pressure in atm
#V2 = V1;#Initial & final volume are equal
Cv = 0.23#specific heat at consmath.tant volume in Kcal/Kg deg K
#(delQ/delT)=Q
Q = 1.3 #Rate of heat addition in Kcal/min
m = 2.5 #Weight of an ideal gas in Kg
T1 = 298.0 #Initial temperature in Kelvin

#To calculate the time taken for the gas to attain 10 atm
#Q = m*Cv*(delT/delt)=1.3
T2 = (P2*T1)/(P1) #Final temperature in Kelvin
t = ((m*Cv)/1.3)*(T2-T1) #time taken in minutes
print "The time taken to attain a pressure of 10 atm is ",
print "%.6f"%(t/60),
print "hours"
#end
The time taken to attain a pressure of 10 atm is  19.771154 hours

Example 3.6 Page No : 61

In [6]:
#Given
R = 1.98 #gas consmath.tant in kcal/Kgmole deg K
T = 293.0 #Temperature in K
M = 29.0 #Molecular weight of air

#To calculate the flow work per kg of air
#W=(P*V)=(R*T)
W = R*T #Flow work in Kcal/Kg mole
W1 = W/M 
print "Flow work is %f Kcal/Kg"%W1
#end
Flow work is 20.004828 Kcal/Kg

Example 3.7 Page No : 62

In [7]:
import math 

#Given
m = 5000.0 #Amount of steam recived per hour in Kg
H1 = 666.0 #Specific enthalpy when steam entered in the turbine in Kcal/Kg
H2 = 540.0 #Specific enthalpy when steam left the turbine in Kcal/Kg
u1 = 3000/60.0 #velocity at which steam entered in m/sec
u2 = 600/60.0 #velocity at which steam left in m/sec
Z1 = 5.0 #height at which steam entered in m
Z2 = 1.0#height at which steam left in m
Q = -4000.0 #heat lost in Kcal
g = 9.81

#To calculate the horsepuwer output of the turbine
delH = H2-H1#change in enthalpy in Kcal
delKE = ((u2**2)-(u1**2)/(2*g))/(9.8065*427) #change in kinetic energy in Kcal; 1kgf = 9.8065 N
delPE = ((Z2-Z1)*g)/(9.8065*427) #change in potential energy in Kcal
W = -(m*(delH+delKE+delPE))+Q #work delivered in Kcal/hr
W1 = W*(427/(3600*75.0))#work delivered by turbine in hp
print "Work delivered by turbine is %f hp"%W1
#end
Work delivered by turbine is 990.133290 hp

Example 3.8 Page No : 63

In [8]:
import math 

#Given
m = 183.0 #rate of water flow in Kg/min
H1 = 95.0 #enthalpy of storage math.tank 1 in Kcal/Kg
h = 15.0#height difference between two storage math.tanks in m
Q = -10100.0 #extraced heat from storage math.tank 1 in a heat exchanger in Kcal/min
W = -2.0 #work delivered by motor in hp

# To find out the  enthalpy of water math.tank2 and the temperature of water in the second math.tank
delPE = h/427.0 #change in potential energy in Kcal/Kg
delKE = 0.0 #change in kinetic energy
W1 = W*(75/427.0) #work delivered by motor in Kcal/sec
W2 = W1*60.0#work delivered by motor in Kcal/min
H2 = ((Q+W2)/m)-delKE-delPE+H1#enthalpy of storage math.tank 2 in Kcal/Kg
print "The enthalpy of storage tank 2 is %f Kcal/Kg"%(H2)

#The enthalpy H2=39.66 corresponds to the temperature T according to steam table
T=40 #Temperature is in deg celsius
print " The temperature of water in the second tank is %d deg celsius"%(T)
#end
The enthalpy of storage tank 2 is 39.658438 Kcal/Kg
 The temperature of water in the second tank is 40 deg celsius

Example 3.9 Page No : 68

In [9]:
import math 

#To calculate the mass of steam required
#Given
m2 = 100.0 #mass of water to be heated
#From diagram, 
#m3 = m1+m2;..(a)
#Hs = H1;..(b) math.since throttling is a consmath.tant enthalpy process
#m3*H3-(m1*H1+m2*H2)=0;..(c) math.since delH=0

#From steam tables, 
Hs = 681.7 #enthalpy of steam at 200 deg cel bleeded at the rate of 5Kgf/(cm**2) in Kcal/Kg
H2 = 5.03 #enthalpy of liquid water at 5 deg cel
H3 = 64.98 #enthalpy of liquid water at 65 deg cel
#from equn (a),(b)&(c);(page no 80)
m1 = ((H3-H2)/(Hs-H3))*m2 #mass of steam required in Kg  (page no 80)
print "The mass of steam required to heat 100 Kg of water is %f Kg"%(m1)
#end 
The mass of steam required to heat 100 Kg of water is 9.720781 Kg

Example 3.10 Page No : 69

In [10]:
import math 

#Given
V = 0.3 #Volume of the math.tank in m**3
P1 = 1.0 #Initial pressure of the math.tank in atm
P2 = 0.0 #Final pressure of the math.tank in atm
T = 298.0 #Temperature of the math.tank in K
t = 10.0 #evacuation time in min

#delN=(V/(R*T)*delP)..(a) change in moles as V and T are consmath.tant
#delW=delN*R*T*lnP..(b)pump work required
#From (a)&(b),delW=V*delP*lnP

#To calculate the pump work required
#On doing integration of dW we will get

W = V*(P1-P2);#pump work done in J/sec
W1=(W*(1.033*10**4))/(75*600.0);
print "The pump work required is %f hp"%(W1);
#end
The pump work required is 0.068867 hp

Example 3.11 Page No : 71

In [11]:
import math 

#Given
H1 = 680.6;#Enthalpy of entering steam at 6Kgf/cm**2 &200 deg cel in Kcal/Kg
u1 = 60.0;#velocity at which steam entered the nozzle in m/sec
u2 = 600.0;#velocity at which steam left the nozzle in m/sec
g = 9.8;
Hg = 642.8; Hlq = 110.2;#Enthalpy of saturated vapour & saturated liquid at 1.46 Kgf/cm**2 respectively

#To calculate the quality of exit steam
H2 = H1+((u1**2)-(u2**2))/(2*g*427);#enthalpy of leaving steam in Kcal/Kg
x = (H2-Hlq)/(Hg-Hlq);
print "The quality of exit steam is %f percent"%(x*100);
#end
The quality of exit steam is 99.101631 percent

Example 3.12 Page No : 73

In [12]:
import math 

#Given
W = 0.0;#pump work
Mi = 0.0;#chamber is initially evacuated
M2 = 0.0;#no exist stream
H1 = 684.2;#enthalpy of steam at 200 deg cel & 3 Kgf/cm**2

#To calculate the internal energy of the steam in the chamber
#Q=150*m1;.. (a) heat lost from the chamber in Kcal/Kg
#m1=mf;..(b) mass of steam added from large pipe is equal to steam in chamber
 #H1*M1-Q=Mf*Ef; umath.sing (a)&(b)
Ef = H1-150;
print "The internal energy of steam in chamber is %f Kcal"%(Ef);
#end
The internal energy of steam in chamber is 534.200000 Kcal

Example 3.13 Page No : 76

In [17]:
import math
import numpy

#Given
#Q=W=delPE=delKE=0;
#M2=0; no exit stream
Ti = 288.0;#initial temperature in K
H = 7*Ti;#enthalpy of air in Kcal/Kgmole
Ei = 5*Ti;# initial internal energy of air in Kcal/Kgmole
#Ef=5*Tf;Final internal energy of air in Kcal/Kgmole
Pi = 0.3;#initial pressure in atm
V = 0.57;#volume of the math.tank in m**3
R = 848.0;#gas consmath.tant in mKgf/Kg mole K
Pf = 1.0;#final prssure in atm

#To calculate the final weight and the final temperature of the air in the math.tank
Mi = (Pi*V*1.03*10**4)/(R*Ti);#initial quantity of air in math.tank in Kg mole
#Tf=(Pf*V*1.033*10**4)/(Mf*R)..(a) final temperature,Mf=final quantity of air in math.tank in Kg mole
#M1=Mf-Mi..(b) M1 is mass of steam added in Kg mole
#H*M1=(Ef*Mf)-(Ei*Mi)
#H*M1=((5*Pf*V*1.033*10**4)/(Tf*R))*Tf-(Ei*Mi)...(c)
A = [[1,-1],[0,-H]];
B = [Mi,((Ei*Mi)-((5*Pf*V*1.03*10**4)/R))];
x = numpy.divide(A,B)

Mf = x[0][0];
print  "The final weight of air in the tank is %f Kg"%Mf;

Tf = (Pf*V*1.03*10**4)/(Mf*R);
print " The final temperature of air in the tank is %f K"%(Tf);
#end
The final weight of air in the tank is 138.661216 Kg
 The final temperature of air in the tank is 0.049930 K