#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"
#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"
#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"
#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"
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
#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
#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
#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
#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