# Chapter 7 Fluid Mechanics¶

## Example 1 Page No:113¶

In :
#Input data
V=5            #volume of the liquid in m**3
W=45*10**3     #weight of the liquid in KN
g=9.81         #acceleration due to gravity in m/s**2
rhow=1000      #constant value

#Calculation
m=((W)/(g))    #mass in Kg
rho=(m/V)      #Mass density in kg/m**3
w=(W/V)        #Weight Density in N/m**3
v=(V/m)        #Specific volume in m**3/kg
S=rho/rhow     #Specific gravity

#Output
print("mass= ",round(m,2),"Kg")
print("Mass density= ",round(rho,2),"kg/m**3")
print("Weight Density= ",w,"N/m**3")
print("Specific volume= ",v,"m**3/kg")
print("Specific gravity= ",round(S,4),)

mass=  4587.16 Kg
Mass density=  917.43 kg/m**3
Weight Density=  9000.0 N/m**3
Specific volume=  0.00109 m**3/kg
Specific gravity=  0.9174


## Example 2 Page No:114¶

In :
#Input data
V=3*10**-3      #3l of oil in m**3
W=24            #Weight of oil in N
g=9.81          #Gravity in m/s**2
rohw=1000       #Constant value

#Calculation
m=((W)/(g))     #Mass in Kg
rho=(m/V)       #Mass density in kg/m**3
w=(W/V)         #Weight Density in N/m**3
v=(V/m)         #Specific volume in m**3/kg
S=rho/rhow      #Specific gravity

#Output
print("mass= ",round(m,3),"Kg")
print("Mass density= ",round(rho,1),"kg/m**3")
print("Weight Density= ",w,"N/m**3")
print("Specific volume= ",round(v,7),"m**3/kg")
print("Specific gravity= ",round(S,4),)


mass=  2.446 Kg
Mass density=  815.5 kg/m**3
Weight Density=  8000.0 N/m**3
Specific volume=  0.0012263 m**3/kg
Specific gravity=  0.8155


## Example 3 Page No:114¶

In :
#Input data
S=0.85             #Specific gravity of a liquid
g=9.81             #Acceleration due to gravity in m/s**2(constant)
rhow=1000          #Constant value

#Calculation
#Specific gravity S=roh/rohw
rho=S*rhow         #Mass density in Kg/m**3
w=rho*g            #Weight Density in N/m**3
v=(1/rho)          #Specific volume in m**3/kg

#Output
print("Mass densit=  ",rho,"Kg/m**3")
print("Weight Density= ",w,"N/m**3")
print("Specific volume= ",round(v,6),"m**3/kg")

Mass densit=   850.0 Kg/m**3
Weight Density=  8338.5 N/m**3
Specific volume=  0.001176 m**3/kg


## Example 4 Page No:116¶

In :
#Input data
dy=21*10**-3      #Horizontal plates in mm
du=1.4            #Relative velocity between the plates in m/s
mu=0.6            #Oil of viscosity 6 poise in Ns/m**2

#Calculation
tau=(mu*(du/dy))  #Shear in the oil in N/m**2

#Output
print("shear in the oil= ",round(tau,),"N/m**2")

shear in the oil=  40 N/m**2


## Example 5 Page No:116¶

In :
#Input data
v=4*10**-4    #kinematic viscosity is 4 stoke inm**2/s
S=1.2         #specific gravity
dow=1000      #density of water Kg/m**3

#Calculation
rho=S*dow
vol=rho*v     #viscosity of the liquid in Ns/m**2 or poise

#Output
print("viscosity of the liquid= ",round(vol,2),"Ns/m**2 ")

viscosity of the liquid=  0.48 Ns/m**2


## Example 6 Page No:6¶

In :
#Input data
S=0.9          #Specific gravity
tau=2.4        #shear stress in N/m**2
(vg)=0.125     #velocitty gradientin per s
dow=1000       #density of water Kg/m**3

#Calculation
mu=(tau)/(vg)  #newton's law of viscosity in shear stress in Ns/m**2
rho=S*dow      #Density of oil in Kg/m**3
v=(mu/rho)     #Kinematic viscosity in m**2/s or stoke

#Output
print("newton's law of viscosity in shear stress= ",mu,"Ns/m**2")
print("Density of oil= ",rho,"Kg/m**3")
print("Kinematic viscosity= ",round(v,5),"m**2/s or stoke")

newton's law of viscosity in shear stress=  19.2 Ns/m**2
Density of oil=  900.0 Kg/m**3
Kinematic viscosity=  0.02133 m**2/s or stoke


## Example 7 Page No:117¶

In :
#Input data
A=6*10**-2           #Space between two square plates in mm
dy=8*10**-3          #Thickness of fluid in mm
u1=0                 #Lower pate is stationary
u2=2.4               #Upper plate in m/s
F=5                  #Speed of force in N
s=1.6                #Specific gravity of the liquid
dow=1000             #Density of water Kg/m**3

#(1)Calculation
du=u2-u1             #change in velocity in m/s
tau=(F/((A)**2))     #shear stress N/m**2
mu=(tau/(du/dy))     #Newton's law of viscosity in Ns/m**2 or poise
rho=s*dow            #Density of oil in kg/m**3
v=(mu/rho)           #kinematic viscosity is given by m**2/s or stoke

#Output
print("change in velocity= ",du,"m/s")
print("shear stress=  ",round(tau,2),"N/m**2")
print("Newton's law of viscosity=  ",round(mu,1),"Ns/m**2 ")
print("Density of oil= ",rho," kg/m**3")
print("kinematic viscosity= ",round(v,4),"m**2/s ")

change in velocity=  2.4 m/s
shear stress=   1388.89 N/m**2
Newton's law of viscosity=   4.6 Ns/m**2
Density of oil=  1600.0  kg/m**3
kinematic viscosity=  0.0029 m**2/s


## Example 8 Page No:118¶

In :
#Input data
dy=1.5*10**-4      #Two horizontal plates are placed in m
mu=0.12            #Space between plates  Ns/m**2
A=2.5              #Upper area is required to move in m**2
du=0.6             #Speed rerlated to lower plate in m/s

#(1)Calculation
tau=(mu*(du/dy))   #Shear stress N/m**2
F=tau*A            #Force in N
P=F*du             #Power required to maintain the speed of upper plate in W

#Output
print("Shear stress= ",round(tau,),"N/m**2")
print("Force= ",round(F,),"N")
print("Power required to maintain the speed of upper plate= ",round(P,),"W")

Shear stress=  480 N/m**2
Force=  1200 N
Power required to maintain the speed of upper plate=  720 W


## Example 9 Page No 118¶

In :
#Input data
mu=0.1                 #Oil of viscosity used for lubricant in poise or Ns/m**2
D=0.15                 #Clearance between the shaft of diameter in m
dy=3*10**-4            #Clearance in m
N=90                   #Shaft rorates in rpm
pi=3.14

#Calculation
du=((pi*D*N)/60)       #Tangential speed of shaft in m/s
tau=(mu*(du/dy))       #The shear force in N/m**2

#Output
print("Tangential speed of shaft= ",du,"m/s")
print("The shear force= ",tau,"N/m**2")

Tangential speed of shaft=  0.7065 m/s
The shear force=  235.5 N/m**2


## Example 10 Page No:119¶

In :
#Input data
import math
A=120*10**-3        #Side of square plate in mm
W=30                #Side weight in N
du=3.75             #Uniform velocity in m/s
theta=30            #Lubricated inclined plane making an angle in degree at horizontal
dy=6*10**-3         #Thickness lubricating oil film in mm
rho=800             #Lubricating oil film density in Kg/m**3

#Calculation
sin30=0.5
F=W*sin30            #Component of force in N
tau=(F/(A**2))       #Shear stress in Ns/m**2
mu=(tau/(du/dy))     #From Newton's law of Shear stress in Ns/m**2
V=(mu/rho)*10**3     #Kinematic viscosity in m**2/s

#Output
print("Component of force= ",F,"N")
print("Shear stress= ",round(tau,2)," Ns/m**2 ")
print("From Newton's law of Shear stress= ",round(mu,3),"Ns/m**2")
print("Kinematic viscosity= ",round(V,3),"m**2/s")

Component of force=  15.0 N
Shear stress=  1041.67  Ns/m**2
From Newton's law of Shear stress=  1.667 Ns/m**2
Kinematic viscosity=  2.083 m**2/s


## Example 11 Page No 121¶

In :
#Input data
Z=15            #Pressure due to column in m
S=0.85          #Oil of specific gravity
g=9.81          #Gravity

#Calculation
rho=S*10**3     #Density of oil in kg/m**3
P=rho*g*Z       #Pressure in N/m**2 or kPa

#Output
print("Density of oil= ",rho,"kg/m**3")
print("Pressure= ",P,"N/m**2")

Density of oil=  850.0 kg/m**3
Pressure=  125077.5 N/m**2


## Example 12 Page No 122¶

In :
#Input data
Z1=1.5                   #open tank contain water in m
Z2=2.5                   #oil of specific gravity for depth in m
S=0.9                    #oil of specific gravity
rho1=1000                #density of water in Kg/m**3
rho2=S*10**3             #density of oil in Kg/m**3
g=9.81                   #gravity

#calculation
P=rho1*g*Z1+rho2*g*Z2    #intensity of pressure in kPa

#output
print("intensity of pressure=",P,"N/m**2")

intensity of pressure= 36787.5 N/m**2


## Example 13 Page No:124¶

In :
#Input data
D1=0.2                      #Diameter of pipe section 1 in m
D2=0.3                      #Diameter of pipe section 2 in m
V1=15                       #Velocity of water in m/s
pi=3.14

#calculation
Q=((3.14/4)*(0.2)**2)*15    #Discharge through pipe in m**3/s
V2=(((3.14/4)*(0.2)**2)*15)/((3.14/4)*(0.3)**2) #velocity of section2 in m/s

#Output
print("Discharge through pipe= ",round(Q,2),"m**3/s")
print("velocity of section2= ",round(V2,2),"m/s")

Discharge through pipe=  0.47 m**3/s
velocity of section2=  6.67 m/s


## Example 14 Page No:126¶

In :
#Input data
V=13                #Velocity of water flowing throgh pipe in m/s
P=200*10**3         #Pressure of water in Kpa
Z=25                #Height above the datum in m
g=9.81
rho=1000

#Calculation
E=(P/(rho*g))+((V**2)/(2*g))+(Z) #Total energy per unit weight in m

#Output
print("Total energy per unit weight=",round(E,),"m")

Total energy per unit weight= 54 m


## Example 15 Page No:127¶

In :
#Input data
import math
S=0.85              #Specific gravity of oil
D=0.08              #Diameter of pipe in m
P=1*10**5           #Intenity of presssure in N/m**2
Z=15                #Total energy bead in m
E=45                #Datum plane in m
Mdw=1*10**3         #Mass density of water constant
g=9.81              #Gravity constant
rho=S*Mdw           #Mass density of oil
pi=3.14

#calculation
rho=S*Mdw           #Mass density of oil
#E=(P/(rho*g))+((V**2)/(2*g))+(Z)
V=math.sqrt((E-((P/(rho*g))+Z))*(2*g))  #Total energy per unit weight in m/s
Q=(pi/4)*D**2*V                         #Discharge in m**3/Kg"

#output
print("mass density of oil= ",rho,"Kg/m**3")
print("Total energy per unit weight= ",round(V,1),"m/s")
print("discharge=",round(Q,4),"m**3/Kg")

mass density of oil=  850.0 Kg/m**3
Total energy per unit weight=  18.8 m/s
discharge= 0.0944 m**3/Kg


# Example 16 Page No:127¶

In :
#input data
#refer figure 11
ZA=2                   #water flows section A-A in m
DA=0.3                 #datum pipe diameter at section A-A in m
PA=550*10**3           #pressure in kPa
VA=6                   #flow velocity in m/s
ZB=18                  #water flows at section B-B in m
DB=0.15                #datum pipe diameter at section B-B in m
pi=3.14                #constant
rho=1000               #constant
g=9.81                 #constant
Aa=(pi/4)*(DA)**2
Ab=(pi/4)*(DB)**2
pi=3.14

#calculation
VB=((Aa*VA)/Ab)         #continuity discharge equation in m/s
#bernoulli's equation Kpa
#(PA/rho*g)+(VA**2/2*g)+ZA=(PB/rho*g)+(VB**2/2*g)+ZB
PB=(((PA/(rho*g))+(VA**2/(2*g))+ZA)-((VB**2/(2*g))+ZB))*(rho*g)

#output
print("continuity discharge equation= ",VB,"m/s")
print("bernoulli's equation= ",round(PB,1),"pa")

continuity discharge equation=  24.0 m/s
bernoulli's equation=  123040.0 pa


# Example 17 Page No:128¶

In :
#input data
#refer figure 12
Q=0.04             #Water flows at rate in m**2/s
DA=0.22            #Pipe diameter at section A in m
DB=0.12            #Pipe diameter at section B in m
PA=400*10**3       #Intensity of pressure at setion A in kPa
PB=150*10**3       #Intensity of pressure at setion B in kPa
pi=3.14            #Pi constant
g=9.81             #Gravity constant
rho=1000

#calculation
VA=Q/(pi/4*(DA)**2) #contuity equation for discharge
VB=Q/(pi/4*(DB)**2) #bernoulli's equation for discharge
#Z=ZB-ZA
Z=(PA/(rho*g))+(VA**2/(2*g))-(PB/(rho*g))-(VB**2/(2*g))

#output
print("contuity equation for discharge= ",round(VA,3),"m**3")
print("contuity equation for discharge= ",round(VB,3),"m**3")
print("bernoulli's equation for discharge= ",round(Z,2),"m")

contuity equation for discharge=  1.053 m**3
contuity equation for discharge=  3.539 m**3
bernoulli's equation for discharge=  24.9 m


# Example 18 Page No:129¶

In :
#Input data
L=200               #length of pipe in m
D1=1                #Diameter at high end in m
D2=0.4              #Diameter at low end in m
P1=50*10**3         #Pressure at high end  in kPa
Q=4000              #Rate of water flow l/min
S=1                 #Slope of pipe 1 in 100
Z2=0                #Datum line is passing through the center of the low end,therefore
pi=3.14

#calculation
Q=(4000*10**-3)/60   #rate of water flow l/min in m**3/s
Z1=1/100*L           #slope of pipe 1 in 100 is in m
#Q=A1*V1=A2V2        #continuity eqation ,discharge
V1=Q/((pi/4)*(D1**2))#in m**3
V2=Q/((pi/4)*(D2**2))#in m**3
#bernoulli's equation
P2=(((((P1/(rho*g))+(V1**2/(2*g))+Z1)-(V2**2/(2*g))-Z2))*(rho*g))*10**-3

#output
print("rate of water flow= ",round(Q,4),"m**3/s")
print("slope of pipe= ",Z1,"m")
print("continuity eqation ,discharge= ",round(V1,5),"m**3")
print("continuity eqation ,discharge= ",round(V2,4),"m**3")
print("bernoulli's equation for discharge= ",round(P2,2)," Kpa")

rate of water flow=  0.0667 m**3/s
slope of pipe=  2.0 m
continuity eqation ,discharge=  0.08493 m**3
continuity eqation ,discharge=  0.5308 m**3
bernoulli's equation for discharge=  69.48  Kpa


# Example 19 Page No:130¶

In :
#Input data
import math
L=36                    #Length of pipe in m
D1=0.15                 #Diameter at upper side in m
D2=0.3                  #Diameter at lower side in m
sin30=0.5
theta=math.sin(30)      #Pipe slope upward at angle in degree
V1=2                    #Velocity of water at smaller section in m/s
pi=3.14                 #Pi constant
rho=1000                #Roh constant
g=9.81                  #Gravity constant

#calculation
#datum line is passing through the center of the low end,therefore
Z1=0
Z2=Z1+L*(0.5)           #pipe inclined 30 degree,therefore in m
#Q=A1*V1=A2*V2  continuity eqation ,discharge
V2=(pi/4*(D1**2)*2)/(pi/4*(D2**2))
#Z=P1-P2 bernoulli's equation
Z=((((-V1**2)/(2*g))+((V2**2)/(2*g))-Z1+Z2)*(rho*g))*10**-3

#output
print("pipe inclined 30 degree,therefore Z2=",Z2,"m")
print("continuity eqation ,discharge V2=",V2,"m/s")
print("#bernoulli's equation Z=",round(Z,1),"Kpa")

pipe inclined 30 degree,therefore Z2= 18.0 m
continuity eqation ,discharge V2= 0.5 m/s
#bernoulli's equation Z= 174.7 Kpa


# Example 20 Page No:130-131¶

In :
#Input data
D1=0.25                    #Diameter at inlet in m
D2=0.175                   #Diameter at outlet in m
P1=450*10**3               #Intensity of pressure at inlet in kPa
P2=200*10**3               #Intensity of pressure at outlet in kPa
pi=3.14                    #pi constant
rho=1000                   #Roh constant
g=9.81                     #Gravity constant
Z1=Z2

#Calculation
#A1*V1=A2*V2               Continuity eqation in V1
V2=((pi/4)*(D1**2))/((pi/4)*(D2**2))
#Z=V2**2-V1**2             Bernoulli's equation in m/s
Z=-(((P2/(rho*g))-(P1/(rho*g)))*(2*g))
X=Z/((V2**2)-1)
V1=math.sqrt(X)
Q=(pi/4)*(D1**2)*V1         #Flow rate Water in m**3/Kg

#Output
print("Continuity eqation= ",round(V2,2),"V1")
print("Bernoulli's equation= ",Z,"m/s")
print("V1=",round(V1,2),"")
print("Flow rate Water= ",round(Q,3),"m**3/Kg")

Continuity eqation=  2.04 V1
Bernoulli's equation=  500.0 m/s
V1= 12.57
Flow rate Water=  0.617 m**3/Kg


# Example 21 Page No:131-132¶

In :
#Input data
L=300                  #Length of pipe in m
D1=0.9                 #Diameter at higher end in m
D2=0.6                 #Diameter at lower end in m
S=0.85                 #Specific gravity
Q=0.08                 #Flow in l/s
P1=40*10**3            #Pressure at higher end in kPa
pi=3.14                #pi constant
rho=1000               #Roh constant
g=9.81                 #Gravity constant
slop=1/50              #1 in 50

#Calculation
#Datum line is passing through the center of the low end,therefore
Z2=0
Z1=slop*L
#Q=A1*V1=A2*V2        Continuity eqation
V1=Q/((pi/4)*(D1**2)) #Frome continuity eqation, discharge
V2=Q/((pi/4)*(D2**2)) #Frome continuity eqation, discharge
#Bernoulli's equation
P2=(((((P1/(rho*S*g))+(V1**2/(2*g))+Z1)-(V2**2/(2*g))+Z2))*(S*rho*g))*10**-3

#Output
print("Z1=",Z1,"m")
print("continuity eqation, discharge V1=",round(V1,5),"m**3")
print("continuity eqation, discharge V2=",round(V2,5),"m**3")
print("bernoulli's equation= ",round(P2,),"KPa")

Z1= 6.0 m
continuity eqation, discharge V1= 0.12582 m**3
continuity eqation, discharge V2= 0.28309 m**3
bernoulli's equation=  90 KPa