Chapter 4: The First Law of Thermodynamics

Example 4.1, page no. 55

In [1]:
#initilisation
m = 0.5                               #mass rate of flow(lbm/sec)
Pi = 14.0                             #inlet pressure(lb/in^2)
SVi = 13.0                            #inlet specific volume(ft^3/lbm)
Vi = 100.0                            #inlet velocity(ft/sec)
P = 75.5                              #power input(hp)
Hr = 8.65                             #heat rejected(zB/sec)
Pd = 150.0                            #discharge pressure(lb/in^2)
SVd = 2.1                             #discharge specific volume(ft^3/lb)
Vd = 200.0                            #discharge velocity(ft/sec)
z1 = 3.0                              #distance(ft)
z2 = 10.0                             #distance(ft)

#calculation
WbyJ=P*550/(m*778)
Q=Hr/m
Wi=144*Pi*SVi/(778)
Wo=144*Pd*SVd/(778)
PEi=z1/778
PEf=z2/778
KEi=Vi**2 /(2*32.2*778)
KEf=Vd**2 /(2*32.2*778)
du=-Q+WbyJ+PEi-PEf+KEi-KEf+Wi-Wo

#result
print "Increase in internal energy = ", round(du,1) ,"B/lbm" 
Increase in internal energy =  64.2 B/lbm

Example 4.2, page no. 57

In [2]:
#initilisation
d = 500.0                                 #depth of well(ft)
Pi = 14.0                                 #pump inlet pressure(lb/in^2)
Pd = 15.0                                 #discharge pressure(lb/in^2)
Sv = 0.016                                #specific volume of water(ft^3 /lb)

#calculation
Wi = 144*Pi*Sv
Wf = 144*Pd*Sv
PEi = 0
PEf = d
Winput = Wf-Wi+PEf-PEi

#result
print "Input work = ", round(Winput, 1), "ft-lb/lbm"
Input work =  502.3 ft-lb/lbm

Example 4.3, page no. 61

In [3]:
#initilisation
T1 = 70    #temperature(F)
T2 = 140   #temperature(F)
m = 10     #mass of water(lb)
Cp = 1     #specific volume for water(B/lbm F)

#calculation
Q = Cp*(T2-T1)
Qdot = m*Q
w = 0   #since no change in pressure

#result
print "Work done = ", w
print "Change in enthalpy= ", Qdot, "B"
print "Heat added per pound = ", Q, "B/lbm"
Work done =  0
Change in enthalpy=  700 B
Heat added per pound =  70 B/lbm

Example 4.4, page no. 63

In [12]:
#initilisation
W = 64000.0                         #ft-lbm/lb
P = 14.0                            #pressure(lb/in^2)
W2 = 48500.0                        #work input(ft-lbm/lb)

#calculation
dh1 = W/778.0
dh2 = W2/778.0

#result
print "For the actual process = %.1f B/lbm" %dh1
print "For the frictionless process = ", round(dh2, 1), "B/lbm"
For the actual process = 82.3 B/lbm
For the frictionless process =  62.3 B/lbm

Example 4.5, page no. 66

In [5]:
import math

#initilisation
ht = 308                        #B/lbm
h = 298                         #B/lbm

#calculation
V = math.sqrt(2*32.2*778*(ht-h))

#result
print "Velocity of tha gas= %d ft/sec" %V
Velocity of tha gas= 707 ft/sec

Example 4.6, page no. 69

In [6]:
#initilisation
hp = 10000                          #hp
v = 100.0                           #lbm/sec

#calculation
W = hp*550/v
enthalpy = W/778.0

#result
print "Decrease in stagnation enthalpy= %.1f B/lbm" %enthalpy
Decrease in stagnation enthalpy= 70.7 B/lbm

Example 4.7, page no. 69

In [13]:
#initilisation

w1 = 100                        #lbm
w2 = 2                          #lbm
h1 = 127                        #B/lbm
h2 = 125                        #B/lbm
hc = 401                        #B/lbm

#calculation
ht1=w1*h1
ht2=w2*h2
ht3=(w1+w2)*hc
Q=ht3-ht1-ht2

#result
print "Heat liberated = %d B/sec" %Q
Heat liberated = 27952 B/sec

Example 4.8, page no. 72

In [14]:
#initilisation

du=75                       #B/lbm
m=0.01                      #lbm

#calculation
W=778*du
Wdot=m*W

#result
print "Work for the process = %d ft-lb" %Wdot
Work for the process = 583 ft-lb

Example 4.9, page no. 72

In [15]:
#initilisation
m = 0.5                         #lbm

#calculation
#From tables
h1 = 48.02                        #B/lbm
hf = 180.07                       #B/lbm
hfg = 970.3                       #B/lbm
h2 = hf+m*hfg
Q = h2-h1

#result
print "Heat added = %.1f B" %Q
Heat added = 617.2 B