# Variables
Rn = 1700.
v = 0.744*(10**-4)
d = 0.05
# Calculations
V = (Rn*v)/d
Vmax = 2*V
x = 0.00625
r = (d/2)-x
V1 = Vmax*(1-(2*r/d)**2)
# Results
print "velocity at the point 6.25 mm from the wall in m/sec",V1
import math
# Variables
d = 0.3
p = 787.
v = 1.6*(10**-6)
Rn = 2000.
# Calculations
V = Rn*v/d
a = math.pi*d*d/4
Q = a*V
# Results
print "maximum flow rate for which the flow is maximium %.3e"%Q,"m**3/s"
# Variables
vd = 8*(10**-3)*0.1
p = 996.
# Calculations
vk = vd/p
# Results
print "kinematic vismath.cosity in m2/sec %.3e"%vk
import math
# Variables
u = 1.5/98.1
s = 0.81
d = 0.14
Q = 0.03
g = 9.81
# Calculations
p = s*1000/g
a = math.pi*d*d/4
V = Q/a
Rn = V*p*d/u
# Results
print "Rn less than 2000, flow is laminar",round(Rn,2)
# Variables
d = 0.2
Q = 0.088
l = 5.
vd = 0.01
p = 1000.
# Calculations
v = vd/(p*10)
a = 3.142*d*d/4
g = 9.81
V = Q/a
Re = V*d/v
f = 0.0018+(0.092/(3*(Re**0.5)))
Hf = (4*f*l*V*V)/(d*2*g)
# Results
print "head lost due to friction in m",round(Hf,5)
import math
# Variables
s = 0.75
d = 0.2
l = 1000.
Q = 3/60.
f = 0.01
a = math.pi*d*d/4
V = Q/a
g = 9.81
# Calculations
Hf = (4*f*l*V*V)/(d*2*g)
w = g*s*1000
dp = w*Hf
# Results
print "pressure drop along its entire lenght in N/m2 %.2f"%dp
# Variables
d = 0.3
g = 9.81
l = 400
Q = 0.3
f = 0.032
# Calculations
a = 3.142*d*d/4
V = Q/a
Lentrance = (0.5*V*V)/(2*g)
Hf = (4*f*l*V*V)/(d*2*g)
Lexit = (V*V)/(2*g)
Totalloss = Lentrance+Hf+Lexit
# Results
print "diffrenc in elevation in m",round(Totalloss,2)
# Variables
l = 40.
l1 = 20.
l2 = 20.
d1 = 0.15
d2 = 0.3
H = 8.
f = 0.01
# Calculations
h1 = (2*d2*d2)/(d1*d1)
h2 = 4*f*l1*16/d1
h3 = 9
h4 = 4*f*l2/d2
g = 9.81
ht = h1+h2+h3+h4+1
V2 = (H*2*g/ht)**0.5
a2 = 3.142*d2*d2/4
Q = V2*a2
# Results
print "rate of low in litres/sec",round((Q*1000),0)
# Variables
l = 2000.
d = 0.2
V = 0.8
f = 0.01
g = 9.81
# Calculations
hf = (4*f*l*V*V)/(d*2*g)
# Results
print "Head loss due to friction in pipeline",round(hf,4)
import math
# Variables
d1 = 0.15
d2 = 0.1
Q = 0.03
a1 = math.pi*d1*d1/4
a2 = math.pi*d2*d2/4
V1 = Q/a1
V2 = Q/a2
c = 0.6
g = 9.81
# Calculations
dz = (V2*V2/(2*g))-(V1*V1/(2*g))+(V2*V2/(2*g))*((1/c-1)**2)
w = 9810
dp = dz*w
# Results
print "pressure loss across the contraction in N/m2",round(dp,1)
# note : rounding off error
import math
# Variables
d1 = 0.5
d2 = 0.25
p1 = 103005.
p2 = 67689.
p3 = p2
w = 9810.
g = 9.81
c = 0.65
# Calculations and Results
z = 1-(1./16)+((1/c-1)**2)
dp = p1-p2
v2 = ((dp*2*g)/(w*z))**0.5
a2 = math.pi*d2*d2/4
Q = v2*a2
print "rate of flow in m3/sec",round((Q*1000),2)
v3 = v2
v1 = v3/4
v4 = v1
he = (v3-v4)**2/(2*g)
p4 = w*((p3/w)+((v3*v3-v4*v4)/(2*g))-he)
print "pressure at the 50 cm enlarge section in N/m2",round(p4,3)
# note : rouding off error.
# Variables
d = 0.04
v = 2.
dp = 20000.
l = 8.
w = 9810.
# Calculations
u = (dp*d*d)/(32*l*v)
# Results
print "viscosity of the flowing oil",u,"N/m**2"
import math
# Variables
d = 0.25
l = 12.*1000
w = 9320.
i = 1./300
v = 20.*(10**-4)
a = math.pi*d*d/4
q = 0.015
# Calculations
V = q/a
g = 9.81
Rn = V*d/v
f = 16/Rn
hf = (4*f*l*V*V)/(2*d*g)
H = hf+(i*l)
p = (w*q*H)/1000
# Results
print "power required to pump the oil",round(p,4),"kW"
# note : rounding off error.
# Variables
l = 600.
H = 160.
p = 1200.*1000
n = 0.85
f = 0.005
# Calculations
hf = H/3
w = 9810
H1 = H-hf
q = p/(w*H1*n)
d = ((f*l*q*q)/(3*hf))**0.2
# Results
print "minimium diameter of the pipe in cm",round((d*100),2)
import math
# Variables
d = 0.25
l = 500.
a = math.pi*d*d/4
f = 0.006
q = 0.04
g = 9.81
p2 = 250.*1000
# Calculations
V = q/a
hf = (4*f*l*V*V)/(d*2*g)
z1 = 0
z2 = 25
w = 9810
p1 = ((p2/w)+z2+hf)*w
# Results
print "pressure at point A is N/m2",round(p1,2),"N/m**2"
# Variables
q = 0.15/(2.5*60)
d = 0.03
p1 = 9810.
p2 = 6867.
l = 2.
w = 9810.
# Calculations
hf = (p1-p2)/w
a = 3.142*d*d/4
V = q/a
g = 9.81
f = (hf*2*g*d)/(4*l*V*V)
C = V*((4*l)/(d*hf))**0.5
# Results
print "darcy co-efficient",round(f,3)
print "Chezy formula",round(C,3)
# Variables
a = 90.
H1 = 10.
d = 0.15
l = 400.
H2 = 7.
g = 9.81
f = 0.008
# Calculations
z = 3.142*d*d*((2*g)**0.5)
z1 = (1.5+(4*f*l/d))**0.5
T = (8*a*z1*(H1**0.5-H2**0.5))/z
# Results
print "time to lower the level from 10m to 7m in hr",round((T/3600),4)
import math
# Variables
q = 0.08
d1 = 0.25
d2 = 1.
l1 = 1500.
l2 = 1500.
# Calculations
a1 = math.pi*d1*d1/4
a2 = math.pi*d2*d2/4
v2 = q*4/(math.pi*((1./32)+1))
v1 = v2*0.5
q1 = v1*a1
q2 = v2*a2
# Results
print "disharge through pipe in m3/sec",round((q2*1000),2),round((q1*1000),4)