#initialisation of variables
h=50.0 #ft height
sg=1.0 #Density
#CALCULATIONS
p=sg*h*0.433 # pressure
#RESULTS
print('Pressure is = %.2f lbf/in^2' %p)
#initialisation of variables
p=1500.0 #lbf/in^2 pressure
Sg=0.78 #Density
p2=p*6895 #lbf/in^2 pressure
#CALCULATIONS
h=(p*2.31)/Sg
h2=(p2*1.02)/(10000*Sg) #In metric units
#RESULTS
print('Head in ft = %.2f ft' %h)
print('In metric units Head in ft = %.2f ft' %h2)
#initialisation of variables
p=13790000 #N/m^2 pressure
Sg=0.83 #Density
#CALCULATIONS
h=(p*1.02)/(Sg*10000)
#RESULTS
print('Head in ft = %.2f m' %h)
#initialisation of variables
Q=40 #Gal/min flow rate
a1=3.14 #in^2 area
a2=12.56 #in^2 area
#CALCULATIONS
#Part a
v1=Q/(a1*3.12) #fluid velocity in 2 in diameter
#Part b
v2=(a1*v1)/a2 #Fluid Velocity in 4 in diameter
#RESULTS
print('Fluid Velocity in 2 in diameter pipe is = %.2f ft/sec' %v1)
print('Fluid Velocity in 4 in diameter pipe is = %.2f ft/sec' %v2)
import math
#initialisation of variables
Q=18 #Gal/min flow rate
a=3.14 #in^2 area
v2=10 #ft/sec velocity
#CALCULATIONS
v=Q/(a*3.12)
D=math.sqrt((4*Q)/(math.pi*v2*3.12))
#RESULTS
print('Velocity is = %.2f in' %D)
#initialisation of variables
p=10.0 #lbf/in^2 pressure
Sg=0.87 #Density
#CALCULATIONS
h=p*2.31/Sg
#The value of h is actualy 26.55 but in book they have rounded off to 26.6
EPE=200*Sg*8.34*h #Elevation energy
#RESULTS
print('The height = %.1f ft' %h)
print('The energy of elevation = %.2f ft-lbf' %EPE)
#initialisation of variables
F=1000 #lbf force
A=3.14 #in^2 area
pe=10.0 #lbf/in^2 (Pressure of elevation)
#CALCULATIONS
p=F/A #Total pressure
P=p-pe
#RESULTS
print('The pressure is = %.2f lbf/in^2' %P)
import math
#initialisation of variables
Sg=0.87 #Density
a=0.785 #in^2 area
g=32.2 #ft/sec^2
#CALCULATIONS
w=25*Sg*231*62.4*1/1738
Q=25*231*1/12*1/60
v=Q/a
KE=(w*v*v)/(2*g)
#RESULTS
print('The Kinetic enegry is = %.2f ft-lbf' %KE)
#initialisation of variables
A1=7.065 #area in^2
A2=0.785 #area in^2
p1=1000 #pressure lbf/in^2
Q=500 #flow rate gal/min
g=32.2 #ft/sec^2
Sg=0.91 #density
#CALCULATIONS
v1=Q/(A1*3.12) #Velocity
v2=Q/(A2*3.12) #Velocity
temp1=(p1*2.31)/Sg
temp2=(v1*v1)/ (2*g)
temp3=(v2*v2)/(2*g)
p2=(temp1+temp2-temp3)*Sg/2.31
#RESULTS
print('The pressure is = %.2f lbf/in^2' %p2)
#initialisation of variables
p=1000 #pressure lbf/in^2
p1=350 #pressure lbf/in^2
Sg=0.85 #Specific gravity
#CALCULATIONS
Ha=p*2.31/Sg
H1=p1*2.31/Sg
He=Ha-H1-679.41
#RESULTS
print('The energy extracted from the fluid = %.2f lbf/in^2' %He)
import math
h=40 #height ft
g=32.2 #ft/sec^2
#CALCULATIONS
v=math.sqrt(2*g*h) #velocity
#RESULTS
print('The energy extracted from the fluid = %.2f lbf/in^2' %v)