import math
#(i)
#variable declaration
d=75.0*10**-3 # diameter of pipe
a=math.pi*d**2/4 # area of cross section of pipe
v=760.0*10**-3 # flow velocity
#calculation
Q=v*a
Q=Q*10**3
print('(i)\nVolume Flow Rate Q=%.3f *10^-3 m^3/sec' %Q)
rho=1000.0
W=rho*Q*10**-3
#result
print('\n(ii)\nMass Flow rate W=%.3f kg/sec' %W)
import math
#variable declaration
D=40.0 # Diameter of pipe
d=20.0 # Diameter of Orifice
mr=15.0 # Manometer reading
#calculation
h=(13.6-1)*15.0*10.0
B=d/D
M=1/math.sqrt(1-(B**4))
Cd=0.5999
x=math.sqrt(2*9.8*h*(10**-3))
Q=x*Cd*M*(math.pi*((20*(10**-3))**2))/4
Q=Q*3600.0
#result
print('Volumetric flow rate Q= %.4f m^3/hr' %Q)
#Answer slightly deviates from answer given in the book because of pi value.
#if pi=3.14, then answer is same as in textbook
import math
#variable declaration
Re=10.0**5 # Reynolds number
D=40.0*10**-3 # Diameter of pipe
v=10**-6 # Kinematic viscosity in m^2/sec
#calculation
V1=Re*v/D
A1=(math.pi*(40.0*10**-3)**2)/4
A2=(math.pi*(20.0*10**-3)**2)/4
V2=V1*A1/A2
#result
print('V2=%.1f m/sec' %V2)
import math
#variable declaration
Cd=0.61 # discharge coefficient
D=40.0*10**-3 # Diameter of pipe
d=20.0*10**-3 # Diameter of Orifice
#calculation
M=1/math.sqrt(1-(d/D)**4)
V2=10.0
rho=1000.0
g=9.8
X=V2*math.sqrt(rho/(2*g))/(Cd*M)
p_diff=X**2
p_diff=math.floor(p_diff/100)
p_diff=p_diff/100.0
#result
print('P1-P2 = %.2f kg/cm^2'%p_diff)
import math
#variable declaration
Cd=0.6 # discharge coefficient
D=150.0*10**-3 # Diameter of pipe
d=75.0*10**-3 # Diameter of Orifice
p=250.0 # pressure recorded
g=9.8 # acceleration due to gravity
rho=1000.0 # Water density
s=75.0*10**-3 # venturi tube size
#(a)
#calculation
Q=Cd*math.pi*s**2*math.sqrt(2*g*p/rho)/(4*math.sqrt(1-(d/D)**4))
#result
print('(a) For orifice plate\nQ=%f m^3/sec = %.3f litres/sec'%(Q,Q*1000))
#calculation
Cd1=0.99
Q2=Cd1*math.pi*s**2*math.sqrt(2*g*p/rho)/(4*math.sqrt(1-(d/D)**4))
#result
print('\n\n(b)For venturi tube\nQ=%f m^3/sec = %.2f litres/sec'%(Q2,Q2*1000))
#Answer slightly deviates from answer given in the book because of pi value.
#if pi=3.14, then answer is same as in textbook
import math
#(i)
#variable declaration
V=0.02 # volumetric flow rate
d=10*10**-2 # Diameter of pipe
#calculation
A=math.pi*d**2/4
v=V/A
rho=1000.0
Re=rho*v*d/10**-3
Re=Re/100000.0
#result
print('(i)\nReynolds number(Re) = %.3f * 10^5'%Re)
#(ii)
#variable declaration
Cd=0.98 # discharge coefficient
D=20*10**-2 # Diameter of pipe
d=10*10**-2 # Diameter of orifice
#calculation
M=1/math.sqrt(1-(d/D)**4)
a2=math.pi*d**2/4
Q=0.02
g=9.8
X=Q*math.sqrt(rho)/(M*Cd*a2*math.sqrt(2*g))
p_diff=math.ceil(X**2)
#result
print('\n(ii)\nPressur_difference = %d kg/m^2 = %.4f kg/cm^2'%(p_diff,p_diff/10000))
#Answer slightly deviates from answer given in the book because of pi value.
#if pi=3.14, then answer is same as in textbook
import math
#variable declaration
g=9.81 #acceleration due to gravity
h=20.0 #height
#calculation
v=math.sqrt(2*g*h)
d=300.0*10**-3
A=(math.pi*d**2)/4
A=math.floor(A*1000)
A=A/1000.0
Q=A*v
#result
print('Q = %.3f m^3/sec'%Q)
import math
#variable declaration
Cd=0.6 # coefficient of discharge
g=9.8 #acceleration due to gravity
h=400*10**-3 #height
#calculation
V=Cd*math.sqrt(2*g*h)
#result
print('V = %.2f m/sec' %V)
import math
#variable declaration
Cd=0.98 # coefficient of discharge
g=9.8 #acceleration due to gravity
h=900.0*10**-3 #height
#calculation
V=Cd*math.sqrt(2*g*h)
V=math.floor(V*100)
V=(V/100.0)
#result
print('V = %.2f m/sec' %V)
import math
#Variable declaration
del_p=20*10**3 #Pa
dens_water=1000 #kg/m^3
dens_air=1.29 #kg/m^3
#calculations
#(i)When flowing fluid is water
v=math.sqrt(2*del_p/dens_water)
#(ii)When flowing fluid is air
v1=math.sqrt(2*del_p/dens_air)
#result
print('\n(i)When flowing fluid is water\n\tV=%.3f m/sec'%v)
print('\n(ii)When flowing fluid is air\n\tV=%.0f m/sec'%v1)
import math
# variable declaration
dens=1026.0 # density of see water
p=25.0*10**3 # pressure difference in manometer
#calculation
V=math.sqrt(2*p/dens)
#result
print('V=%.2f m/sec =%.3f km/hr'%(V,V*18/5))
import math
# variable declaration
dens=1.29 # air density at height
#calculation
p=12.5*1000
V=math.sqrt(2*p/dens)
#result
print('V=%.2f m/sec =%.2f km/hr'%(V,V*18/5))
import math
#variable declaration
Cd=0.6 # discharge coefficient
Dp=0.05 # inside diameter of metering tube
Df=0.035 # diameter of rotameter
g=9.8 # acceleration due to gravity
rho_f=3.9*10**3 # density of cylindrical float
rho=1000.0 # water density
Vf=3.36*10**-5 # volume of the float
#calculation
Q=Cd*((Dp**2-Df**2)/Df)*math.sqrt(math.pi*g*Vf*(rho_f-rho)/(2*rho))
Q=Q*10000.0
#result
print('Volumetric flow Q=%.4f *10^-4 m^3/sec' %Q)
#Answer slightly deviates from answer given in the book because of pi value.
#if pi=3.14, then answer is same as in textbook
import math
# variable declaration
Cd=1 # discharge coefficient
Dp=0.018 # inside diameter of metering tube
Df=0.015 # diameter of rotameter
g=9.81 # acceleration due to gravity
rho_f=2.7 # density of cylindrical float
rho=0.8 # water density
Vf=520.0*10**-9 # volume of the float
#case 1
#caculation
Qmin=Cd*((Dp**2-Df**2)/Df)*math.sqrt(math.pi*g*Vf*(rho_f-rho)/(2*rho))
Qmin=Qmin*100000.0
#result
print('Case 1: When float is at the bottom\n Volumetric flow Qmin=%.3f *10^-5 m^3/sec'%Qmin)
#case 2
#calculation
Dp2=0.0617
Qmax=Cd*((Dp2**2-Df**2)/Df)*math.sqrt(math.pi*g*Vf*(rho_f-rho)/(2*rho))
Qmax=Qmax*100000
#result
print('\n\nCase 2: When float is at the bottom\n Volumetric flow Qmax=%.2f *10^-5 m^3/sec'%Qmax)
# variable declaration
W=165.0 # weight of material on section of length
R=328.0 # Conveyor speed m/min
L=16.0 # Length of weighting platform in m
#calculation
Q=W*R/L
#result
print('Flow Rate Q=%.2f kg/min =%.1f kg/hour'%(Q,Q/60))
import math
#variable declaration
f=100.0 # beat frequency
d=300.0*10**-3 # Sound path
a=45.0 #angle between transmeter and receiver in degrees
#calculation
a_rad=45.0*math.pi/180.0
v=f*d/(2*math.cos(a_rad))
#Result
print('Fluid Velocity V=%.1f m/sec'%v)
# variable declaration
r=150.0 # speed of rotation
v=120.0 # volume trapped between gears and casting
#clculation
Q=4.0*v*r
#result
print('Volume flow rate Q=%d cm^3/min = %d litres/min'%(Q,Q/1000))
import math
# variable declaration
Q=2500.0 # Quantitty flow rate
d=2.75 # inner diameter
#calculation
a=(math.pi*d**2)/4
v=Q/(60*a)
B=60.0
e=B*d*10**-2*v*10**-2
#result
print('Induced emf e =%.4f V=%.1f mV'%(e,e*1000))
# variable declaration
e=0.2*10**-3 # voltage of electromagnetic flow meter
B=0.08 # Flux density
l=10.0*10**-2 # Diameter of pipe
#calculation
v=e/(B*l)
#result
print('V = %.3f m/sec = %.2f cm/sec'%(v,v*100))
# variable declaration
ei=0.15*10**-3 # peak value
em=2*ei # p-p amplifier output
B=0.1 # flux density
l=60.0*10**-3 # diameter of the pipe
#calculation
v=em/(B*l)
#result
print('Velocity of flow V = %.2f m/sec = %.1f cm/sec'%(v,v*100))