# Chapter 2 : Fluid Statics¶

## Example 2.1 Page No : 44¶

In [1]:
import math

#Initialization of variables
h1 = 1.5 			#m
h2 = 2. 			#m
g1 = 800. 			#kg/m**3
g2 = 1000. 			#kg/m**3
g = 9.81

#calculations
P = h1*g*g1 + h2*g*g2

#results
print "Pressure at the bottom of the vessel  =  %.2f kN/m**2"%(P/1000)

Pressure at the bottom of the vessel  =  31.39 kN/m**2


## Example 2.2 Page No : 44¶

In [1]:
import math

#Initialization of variables
depth = 8000. 			#m
sw = 10.06 			#kN/m**3
BM = 2.05*10**9 			#N/m**2

#calculations
g = sw*10**3 /(1- sw*10**3 *depth/BM)
Ph = 2.3*BM*math.log10(BM/(BM-depth*9.81*1025))

#results
print "Specific weight  =  %.2f kN/m**2"%(g/1000)
print " Pressure at depth h  =  %.2f MN/m**2"%(Ph/10**6)

# note : rounding off error.

Specific weight  =  10.47 kN/m**2
Pressure at depth h  =  81.97 MN/m**2


## Example 2.3 Page No : 55¶

In [6]:
import math

#Initialization of variables
Patm = 101.3/9.81 			#m of water
x1 = 0.45 			#m
x2 = 0.3 			#m
s1 = 920. 			#Kg/m**3
s2 = 13.6 			#Kg/m**3
g = 9.81 			#m/s**2

#calculations
Pa = (s1*x1*g + s2*x2*g)/1000
Pa2 = Pa*10**3/(1000*g)
Pa3 = Pa/(s2)

#results
print "Pressure at A  =  %.1f kPa"%Pa
print " Pressure at A  =  %.3f m of water"%(Pa2)
print " Pressure at A  =  %.3f m of mercury"%(Pa3)
print " Pressure at A  =  %.1f m of water absolute"%(Pa/1000 +101.3)
print " Pressure at A  =  %.3f m of mercury"%(Pa2+10.3)

Pressure at A  =  4.1 kPa
Pressure at A  =  0.418 m of water
Pressure at A  =  0.302 m of mercury
Pressure at A  =  101.3 m of water absolute
Pressure at A  =  10.718 m of mercury


## Example 2.4 Page No : 55¶

In [3]:
import math

#Initialization of variables
sg = 1.25           # gravity
d = 0.5 			#m
d2 = 13.5*10**-2	#m
sw = 9.81 			#specific weight of water - kN/m**2

#calculations
sl = sg*sw          #specific weight of liquid
sm = 13.6*sw        #specfic weight of mercury
Pa = sl*d - sm*d2

#results
print "Pressure at A  =  %.2f kN/m**2 vacuum "%(-Pa)

Pressure at A  =  11.88 kN/m**2 vacuum


## Example 2.5 Page No : 56¶

In [7]:
import math

#Initialization of variables
#Following values are ontained from the figure 2.17
s1 = 0.85
s2 = 13.6
z1 = 30
z2 = 15
z3 = 20
z4 = 35
z5 = 60

#calculations
dHa = s1*(z1+z5+z3-z4) +s2*z4 -z3+s2*z2-s1*(z1+z2)        #Ha-Hb
Pd = 1000*9.81*dHa/100                                    #Pa-Pb

#results
print "Pressure difference  =  %.2f kN/m**2"%(Pd/1000)

Pressure difference  =  67.25 kN/m**2


## Example 2.6 Page No : 57¶

In [8]:
import math

#Initialization of variables
P = 450 			#pressure - kN/m**2
alt = 2000 			#altitude - m
r = 610 			#atmospheric pressure - mm of mercury

#calculations
Pat = 760-r
Pat2 = Pat*13.6*9.81*10**-3
Pg = Pat2+P

#results
print "Gauge reading  =  %.2f kN/m**2"%(Pg)

Gauge reading  =  470.01 kN/m**2


## Example 2.7 Page No : 62¶

In [10]:
import math

#Initialization of variables
g = 9.81 			#kN/m**2
hc = 16.25 			#m
w = 1.5 			#width - m
b = 2.5 			#depth - m
f = 0.3             #coefficient of friction
Pi = 50. 			#weight of gate - kN

#calculations
P = g*hc*w*b
Preq = Pi+f*P

#results
print "Force required to lift the gate  =  %.2f kN"%(Preq)

Force required to lift the gate  =  229.34 kN


## Example 2.8 Page No : 62¶

In [13]:
import math

#Initialization of variables
a = 6. 			#m
b = 8. 			#m

#calculations
Ixy = 9./32 *b**4 /4
xp =  Ixy/(2./3 *b *1./2 *a*b)
ICG = 1./36 *a*b**3
yp = 2./3*b + ICG/(2./3 *b* 1./2 *a*b )

#results
print "The coordinates of centre of pressure are %.2f,%d"%(xp,yp)

The coordinates of centre of pressure are 2.25,6


## Example 2.9 Page No : 63¶

In [14]:
import math

#Initialization of variables
z = 1.2 			#m
y = 1. 			#m

#calculations
hp = 0.6 + 1./12 *y*z**3 /(0.6*y*z)

#results
print "Position of hinge  =  %.1f m"%(hp)

Position of hinge  =  0.8 m


## Example 2.10 Page No : 64¶

In [1]:
import math
from sympy import *

#Initialization of variables
r = 0.75 			#radius of plane - m
gam = 8. 			#specific weight of fluid - kN/m**3

#calculations
P = gam*2./3 *r**3
hp = Symbol('hp')
hp = 4*r/(3*math.pi) + (math.pi/gam - gam/(9*math.pi)) * r**4/(4*r/(3*math.pi) * 1./2*math.pi*r**3)

#results
print " Total pressure  =  %.2f kN"%(P)
print "Total pressure location  =  %.3f m"%(hp)

# note : answer is slightly different because of rounding off error. please check.

 Total pressure  =  2.25 kN
Total pressure location  =  0.483 m


## Example 2.11 Page No : 65¶

In [4]:
import math

#Initialization of variables
B = 3. 			#m
b = 2. 			#m
h1 = 0.75 			#m
h2 = 1. 			#m
sg = 0.9        #specific gravity

#calculations
IP = sg*9.81*h2
F1 = 0.5*IP*h2
F2 = IP*h1
F3 = 0.5*(9.81*h1)*h1
F = B*(F1+F2+F3)
ybar =  (F1*(h1+ 1./3) + F2* h1/2 + F3* h1/3)/(F1+F2+F3)

#results
print "Total force  =  %.2f kN"%(F)
print "Location  =  %.3f m  from the base"%(ybar)

# note : rounding off error.

Total force  =  41.39 kN
Location  =  0.577 m  from the base


## Example 2.12 Page No : 67¶

In [17]:
import math

#Initialization of variables
g = 1000*9.81 			#kg/m**3
hc = 20. 			#m
Ax = 40.*1 			#m**2
y1 = 0. 			#m
y2 = 40. 			#m

#calculations
Fx = g*hc*Ax
def fy(y):
return (12*y)**(1./3)

Fy = g*Fy[0]
F = math.sqrt(Fx**2 +Fy**2)

#results
print "Net force  =  %d kN"%(F/1000)
#The answer is a bit different due to rounding off error in the textbook

Net force  =  8179 kN


## Example 2.13 Page No : 68¶

In [7]:
import math

#Initialization of variables
g = 9.81 			#kN/m**2
hc = 1. 			#m
l = 3.   			#m
b = 0.5 			#m

#calculations
Ax = l*b 			#m**2
Fx = g*hc*Ax
Fz = g*(0.5* math.pi/4 *b**2)*l
F = math.sqrt(Fx**2 + Fz**2)
theta = math.degrees(math.atan(Fz/Fx))

#results
print "Magintude of resultant force  =  %.3f kN"%(F)
print " Direction of the resultant force  =  %.1f deg"%(theta)

Magintude of resultant force  =  14.996 kN
Direction of the resultant force  =  11.1 deg


## Example 2.14 Page No : 71¶

In [19]:
import math

#Initialization of variables
r1 = 920. 			#density of ice - kg/m**3
r2 = 1030. 			#density of sea water - kg/m**3

#calculations
VtbyV2 = r2/r1
V1byV2 = VtbyV2-1
V1byVt = 1./(1+1/V1byV2)

#results
print "fraction  =  %.3f "%(V1byVt)

fraction  =  0.107


## Example 2.15 Page No : 72¶

In [20]:
import math

#Initialization of variables
d = 3. 			    #diameter of balloon - m
rh1 = 1.19 			#density of air - kg/m**3
rh2 = 0.17 			#density of helium - kg/m**3
g = 9.81 			#m/s**2

#calculations
pay = (rh1-rh2)*g*math.pi/6 *d**3

#results
print " Pay load  =  %.2f N"%(pay)

 Pay load  =  141.46 N


## Example 2.16 Page No : 76¶

In [12]:
from numpy import roots
#calculations
y = [6,-6,1]
z = roots(y)

#results
print "For stability, s must be greater than %.2f and less than %.2f and must be less than 1"%(z[0],z[1])

For stability, s must be greater than 0.79 and less than 0.21 and must be less than 1


## Example 2.17 Page No : 81¶

In [14]:
import math

#Initialization of variables
ax = 1.5 			#m/s**2
g = 9.81 			#m/s**2

#calculations
alpha = math.degrees(math.atan(ax/g))

#results
print "The interface is inclined at %.f degrees with the horizontal"%(alpha)

The interface is inclined at 9 degrees with the horizontal


## Example 2.18 Page No : 81¶

In [24]:
import math

#Initialization of variables
d = 10. 			#diameter - cm
h = 25. 			#height - cm
hw = 15. 			#cm
g = 9.81 			#m/s**2

#calculations
z = d**2 *d*2/d**2
w = math.sqrt(z*2*g/(d/2)**2 *100)
N = w/(2*math.pi) *60

#results
print "Speed of rotation  =  %d rpm"%(N)

Speed of rotation  =  378 rpm


## Example 2.19 Page No : 82¶

In [15]:
import math

#Initialization of variables
dia = 1. 			#diameter - m
h = 3. 			    #height - m
rho = 1000. 		#kg/m**3
N = 80. 			#rpm
g = 9.81 			#m/s**2

#calculation
w = 2*math.pi*N/60
def  fun(r):
return 0.5*rho*w**2 *r**3 *2*math.pi


Total pressure on base  =  18.85 kN