### Example 5.1, Page No 82

In [1]:
import math

#initialisation of variables
Q=200       #gal/min flow rate
A=3.14      #area in^2
f=0.05      #friction factor
g=32.2      #ft/sec^2
L=800       #ft length
Sg=0.91     #density

#CALCULATIONS
v=Q/(A*3.12)    #velocity of fluid
D=(2*1.0)/12    #in
hps=0.433*Sg*hf

#RESULTS
print('The pressure drop is = %.2f lbf/in^2' %hps)

The pressure drop is = 611.99 lbf/in^2


### Example 5.2, Page No 84

In [2]:
import math

Q=15        #gal/min
A=0.785     #area
D=1         #diameter in
v1=0.08     #Viscocity Newts
L=400       #Length ft
g=32.2      #ft/sec^2
Sg=0.85     #density

#CALCULATIONS
v=Q/(A*3.12)
Nr=(12*v*D)/v1          #reynolds number
hps=0.433*Sg*hf

#RESULTS
print('The pressure drop is = %.2f lbf/in^2' %hps)

The pressure drop is = 71.68 lbf/in^2


### Example 5.3, Page No 87

In [3]:
import math

#initialisation of variables
Q=600       #gal/min flow rate
A=3.14      #area in^2
f=0.040     #force in^2
D=2         #diameter in
v1=0.30     #Viscocity in^2sec
L=500       #length ft
g=32.2      #ft/sec^2
Sg=0.85     #density

#CALCULATIONS
v=Q/(A*3.12)
Nr=(12*v*D)/v1     #reynolds number
D=(2*1.0)/12
hf=f*(L/D)*((v*v)/(2*g))
hps=0.433*Sg*hf     #Pressure drop

#RESULTS
print('The pressure drop is = %.2f lbf/in^2' %hps)

The pressure drop is = 2572.39 lbf/in^2


### Example 5.4, Page No 90

In [4]:
import math

#initialisation of variables
p=120       #pressure drop lbf/in^2
Sg=0.85     #density
Q=1000      #gal/min flow rate
A=3.14      #area

#CALCULATIONS
Cd=(1/38.06)*(Q/A)*(math.sqrt(Sg/p))    #discharge coefficient

#RESULTS
print('The discharge coefficient is = %.2f ' %Cd)

The discharge coefficient is = 0.70


### Example 5.5, Page No 94

In [5]:
import math

#initialisation of variables
Q=50        #gal/min flow rate
A=0.785     #area
D=1         #diameter in
f=1         #
v1=0.05     #Viscocity Newts
L=500       #length ft
g=32.2      #ft/sec^2
Sg=0.91     #Density

#CALCULATIONS
v=Q/(A*3.12)    #velocity
Nr=(12*v*D)/v1      #Reynolds
temp=((v*v)/(2*g))
hi=0.78*temp      #inward projection
ho=1.0*temp      #Outward projection
hg=10.0*temp      #Globe Valve
he=4*0.90*temp    # 4 std 90 degree elbow
hn=(3.0/4)*temp   #sudden enlargement
hc=0.5*3.0/4*temp  #Sudden contraction
hps=0.433*Sg*hff

#RESULTS
print('The pressure drop is = %.2f lbf/in^2' %hps)

The pressure drop is = 42.09 lbf/in^2


### Example 5.6, Page No 96

In [6]:
import math

#initialisation of variables
Q=150       #gal/min flow rate
A=0.785     #area in^2
D=1         #diameter in
f=0.045     #
v1=0.10     #Viscocity newts
Sg=0.91     #density
K=2.5

#CALCULATIONS
v=Q/(A*3.12)
Nr=(12*v*D)/v1   # Reynolds number
Le=(D*K)/(12*f)  #length

#RESULTS
print('The equivalent length is = %.2f ft' %Le)

The equivalent length is = 4.63 ft


### Example 5.7, Page No 97

In [1]:
import math

#initialisation of variables
Q=100        #gal/min flow rate
A1=3.14      #area in^2
A2=0.785     #area in^2
D=2          #Diameter in
k=12.4       #K-factor
g=32.2       #ft/sec^2
L=134.58     #Length ft
p=224.7      #Total pressure drop lbf/in^2
Q=100        #gal/min flow rate
L2=35.33     #ft length
#CALCULATIONS
v1=Q/(A1*3.12)           #velocity
v2=Q/(A2*3.12)           #velocity
v=0.001552*80            # kinematic viscosity from cSt to newts
Nr=(12*v1*D)/v           #Reynold number
D1=1
D2=1
k2=20
f2=0.05
Nr2=(12*v2*D1)/v         #Reynold number
f1=64/Nr
Le=(D*k)/(12*f1)         #length
hf=f1*((L*(v1*v1))/((2.0/12.0)*(2*g)))
hsif=0.433*0.88*hf      #pressure loss
Le2=(D2*k2)/(12*f2)
hf2=f2*((L2*(v2*v2))/((1.0/12.0)*(2*g)))
hsif2=0.433*0.88*hf2      #pressure loss
pd=hsif+hsif2
Fhp=(pd*Q)/1714
#RESULTS
print('The pressure drop is = %.2f lbf/in' %pd)
print('The fluid horsepwer is = %.2f hp' %Fhp)

The pressure drop is = 225.24 lbf/in
The fluid horsepwer is = 13.14 hp