import math
# Variables
d1 = 0.3
d2 = 0.1
z1 = 6.
z2 = 3.
p1 = 200.*1000
q1 = 0.07
a1 = math.pi*d1*d1/4
a2 = math.pi*d2*d2/4
v1 = q1/a1
v2 = q1/a2
w = 9810.
g = 9.81
# Calculations
#applying bernoulli equation
p2 = ((z1-z2)+(((v1**2)-(v2**2))/(2*g))+(p1/w))*w
# Results
print "pressure at point B in N/m2",round(p2,2),"N/m**2"
# note : rounding off error.
import math
# Variables
d1 = 1.
d2 = 0.5
q = 0.1
p1 = 70.*1000
l = 60.
z2 = 0.
z1 = l/20
a1 = math.pi*d1*d1/4
a2 = math.pi*d2*d2/4
v1 = q/a1
v2 = q/a2
w = 9810.
g = 9.91
# Calculations
# applying bernoulli equation
p2 = ((z1-z2)+(((v1**2)-(v2**2))/(2*g))+(p1/w))*w
# Results
print "presssure at lower end in N/m2 %d"%round(p2,3),"N/m**2"
# note : rounding off error.
import math
d1 = 0.2
d2 = 0.1
l = 4.
x = 30.
p1 = 392.4*1000
q = 0.035
z1 = 0
# Calculations
z2 = l*math.sin(math.radians(x))
a1 = math.pi*d1*d1/4
a2 = math.pi*d2*d2/4
v1 = q/a1
v2 = q/a2
w = 9810.
g = 9.81
p2 = ((z1-z2)+(((v1**2)-(v2**2))/(2*g))+(p1/w))*w
# Results
print "pressure intensity at outlet in N/m2",round(p2,2),"N/m**2"
# note : rounding off error.
# Variables
d1 = 0.2
d2 = 0.1
d3 = 0.15
v1 = 4
g = 9.81
# Calculations
vh1 = (v1**2)/(2*g)
a1 = 3.142*d1*d1/4
a2 = 3.142*d2*d2/4
a3 = 3.142*d3*d3/4
v2 = (a1*v1)/a2
vh2 = (v2**2)/(2*g)
v3 = (a1*v1)/a3
vh3 = (v3**2)/(2*g)
q = a1*v1
mf = q*1000
# Results
print "velocity head at point 1",round(vh1,3),"m"
print "velocity head at point 2",round(vh2,3),"m"
print "velocity head at point 3",round(vh3,3),"m"
print "mass flow rate in kg/sec",mf
# Variables
d1 = 0.2
d2 = 0.5
p1 = 98.1*1000
p2 = 58.86*1000
q = 0.2
z1 = 0
z2 = 4.
g = 9.81
s = 0.87
# Calculations
a1 = 3.142*d1*d1/4
a2 = 3.142*d2*d2/4
v1 = q/a1
v2 = q/a2
w = 9810
ph1 = p1/(w*s)
ph2 = p2/(w*s)
vh1 = (v1**2)/(2*g)
vh2 = (v2**2)/(2*g)
th1 = vh1+ph1+z1
th2 = vh2+ph2+z2
tl = th1-th2
# Results
print "loss of head in m,flow from 1 to 2",round(tl,3),"m"
# Variables
d1 = 0.3
d2 = 0.15
a1 = 3.142*d1*d1/4
a2 = 3.142*d2*d2/4
H = 0.18
Cd = 0.85
s2 = 13.6
s1 = 1.
w = 9810.
# Calculations
h = H*((s2/s1)-1)
g = 9.81
q = (Cd*a1*a2*((2*g*h)**0.5))/(((a1**2)-(a2**2))**0.5)
q1 = q*1000
# Results
print "rate of flow in litres/sec",round(q1,2)
import math
# Variables
q = 0.1
d1 = 0.2
Cd = 0.9
H = 0.4
s1 = 1.
s2 = 13.6
g = 9.8
# Calculations
h = H*((s2/s1)-1)
a1 = math.pi*d1*d1/4
z = 1+(((Cd*a1*((2*g*h)**0.5))/q)**2)
a2 = ((a1**2)/z)**0.5
d2 = (4*a2/3.1)**0.5
# Results
print "diameter of throat in m",round(d2,3)
# note : rounding off error.
# Variables
q = 0.08
d1 = 0.3
d2 = 0.15
a1 = 3.142*d1*d1/4
a2 = 3.142*d2*d2/4
h = 1.5
g = 9.81
# Calculations
z = (a1*a2*((2*g*h)**0.5))/(((a1**2)-(a2**2))**0.5)
Cd = q/z
# Results
print "co-efficient of meter",round(Cd,3)
# Variables
s2 = 13.6
s1 = 0.9
H = 0.25
h = H*((s2/s1)-1)
Cd = 0.98
w = 9810*s1
d1 = 0.3
d2 = 0.15
# Calculations
a1 = 3.142*d1*d1/4
a2 = 3.142*d2*d2/4
dz = 0.3
g = 9.81
q = (Cd*a1*a2*((2*g*h)**0.5))/(((a1**2)-(a2**2))**0.5)
dp = (h+dz)*w
# Results
print "discharge of the oil in m3/sec",round(q,4)
print "pressure diffrence in entrance and throat section ",dp,"N/m**2"
# Variables
H = 0.1
w = 9810.
sw = 12.
# Calculations
h = H*(w/sw)
Cv = 0.96
g = 9.81
v = Cv*((2*g*h)**0.5)
v1 = v*18/5
# Results
print "speed of the plane",round(v1,2),"Km/hr"
import math
# Variables
d1 = 0.05
d2 = 0.025
# Calculations
a1 = math.pi*d1*d1/4
a2 = math.pi*d2*d2/4
Cd = 0.94
g = 9.81
k = ((((a1**2)/(a2**2))-1)*(1-(Cd**2)))/(2*g*(a1**2)*(Cd**2))
# Results
print "venturimeter constant m-5/s2",round(k,3)
import math
# Variables
d0 = 0.05
d1 = 0.1
H = 0.09
s2 = 13.6
s1 = 1
g = 9.81
# Calculations
h = H*((s2/s1)-1)
Cd = 0.65
a1 = math.pi*d1*d1/4
a0 = math.pi*d0*d0/4
q = (Cd*a1*a0*((2*g*h)**0.5))/(((a1**2)-(a0**2))**0.5)
q1 = q*(10**6)
# Results
print "actual flow rate in cm3/sec",round(q1,3),"cm**3/s"