Chapter 14:Unsteady Flow

Example 14.11 Page No358

In [4]:
import math

#variable initialization

#bulk modulus of elasticity for water in MPa

k_w=2.22E+3 

k_c=1.50E+3

k_g=9.58E+2

rho=998       #density in kg/m^3

RD_c=0.8      #relative density of crude oil

RD_g=0.68     #relative density of gasolene

#solution

C=math.sqrt((k_w*10**6)/rho)         #for water

print "C=",round(C,1),"m/s"

C=math.sqrt((k_c*10**6)/(RD_c*rho))  #for crude oil

print "C=",round(C,1),"m/s"

C=math.sqrt((k_g*10**6)/(RD_g*rho))  #for gasolene

print "C=",int(C),"m/s"
C= 1491.5 m/s
C= 1370.7 m/s
C= 1188 m/s

Example 14.12 Page No358

In [7]:
import math

#variable initialization

E=2.07E+5               #pressure in steel pipe

K=1.43E+3               #Bulk modulus in MPa

t=2                     #thickness in cm

D=2.5                   #diameter in m

RD=0.80                 #relative density

rho=998                 #density in m/s^2

#solution

D=D*100                 #converting D to cm

E=E*(10**6)             #converting MPa to Pa

K=K*(10**6)             #converting MPa to Pa

#velocity of pressure wave

C=(math.sqrt(K/(rho*RD)))*(math.pow(1/(1+((D/t)*(K/E))),1/2))

print "C=",round(C,1),"m/s"
C= 980.4 m/s

Example 14.13 Page No358

In [8]:
#variable initialisation

k=2.2E9                        #Bulk modulus in MPa

rho=998                        #relative density

V2=1.0                         #velocity in m/s

V1=4.0                         #Decreased velocity in m/s

#calculation

del_V=-(V2-V1) 

C=(k/rho)**(1/2)              #change of pressure surge

delP_h=(rho*C*del_V)

print "delP_h="'%4.3E' % delP_h,"which is ",round(delP_h/1000000,3),"MPa"
delP_h=4.445E+06 which is  4.445 MPa

Example 14.14 Page No358

In [9]:
import math

#variable initialization

E=1.0E+11                   #modulus of elasticity

K=2.0E+9                    #Bulk modulus in Pa

t=1.25                      #thickness in mm

D=0.9                       #diameter in m

rho=998                     #density in kg/m^3

L=1000                      #length in m

V=2.60                      #velocity in m/s

g=9.81                      #gravity in m/s^2

#solution

D=D*100                     #converting D to cm

#velocity of pressure wave

C=(math.sqrt(K/(rho)))*(math.pow(1/(1+((D/t)*(K/E))),1/2))

#with Pressure rise,

del_V=0-V                   #calculating del_V

h_h=-(C*del_V)/g            #Water Wammer Head

print "h_W=",round(h_h,1),"m"
h_W= 240.2 m

Example 14.15 Page No358

In [10]:
#variable initialisation

k=2.1E9                        #Bulk modulus in MPa

rho=998                        #relative density

V2=0                           #velocity in m/s

V1=2.1                         #Decreased velocity in m/s

D=60                           #Diameter in cm

t=1.2                          #thickness in cm

E=2.1E11                       #modulus of elasticity

#calculation

del_V=-(V2-V1) 

c=(k/rho)**(1/2)              #By neglecting the elasticity of pipe material velocity,

delP_h=(rho*c*del_V)          #water hammer pressure rise

print "delP_h="'%4.3E' % delP_h,"which is ",round(delP_h/1000000,3),"MPa"

#By considering the elasticity of pressure material,

C=(((1/(1+(D/t)*(k/E))))**(1/2))*c

delP_h=(rho*C*del_V)

print "delP_h="'%4.3E' % delP_h,"which is ",round(delP_h/1000000,3),"MPa"
delP_h=3.040E+06 which is  3.04 MPa
delP_h=2.482E+06 which is  2.482 MPa

Example 14.16 Page No359

In [11]:
import math

#variable initialization

E=2.10E+11                #modulus of elasticity

K=1.43E+9                 #Bulk modulus in Pa

t=80                      #thickness in mm

D=80                      #diameter in cm

RD=0.8                    #relative density for kerosene

rho=998                   #density in m/s^2

L=1000                    #length in m

#solution

D=D*10                    #converting D to mm

#velocity of pressure wave

C=(math.sqrt(K/(rho*RD)))*(math.pow(1/(1+((D/t)*(K/E))),1/2))

To=(2*L)/C

print "Hence maximum time for a sudden closure is",round(To,3),"s"
Hence maximum time for a sudden closure is 1.544 s

Example 14.17 Page No359

In [12]:
import math

#variable initialisation

L=100                             #length in m

C=1430                            #Sonic velocity in m/s

v=0.5                             #Velocity in m/s

D=0.5                             #Diameter in m

rho=998                           #relative density 

T=1                               #time in second

#Calculation

T0=round((2*L)/C,2)               #Critical time

V=round(v/((math.pi/.4)*(D**2)),4)

Ph=rho*C*V

print "Ph=",round(Ph/1000,2),"kPa"

Pvsc=rho*L*V/T                    #P|ressure rise

print "Pvsc=",round(Pvsc/1000,2),"kPa"
Ph= 363.35 kPa
Pvsc= 25.41 kPa

Example 14.18 Page No359

In [13]:
import math

#variable initialisation

k=2.11E9                       #Bulk modulus in MPa

rho=998                        #relative density

V2=0                           #velocity in m/s

V1=2.1                         #Decreased velocity in m/s

D=60                           #Diameter in cm

t=1.5                          #thickness in cm

E=1.041E11                     #modulus pf elasticity

del_V=-3.0                     #change in volume

T=2.00                         #pressure rise

L=800                          #length

#calculation

c=int((k/rho)**(1/2))

C=round((((1/(1+(D/t)*(k/E))))**(1/2))*c,3)           #Velocity of pressure wave

T0=round((2*L)/C,2)

Ph=-rho*C*del_V                                       #T=1.25,Hence,water hammer pressure

print "(a)Ph=",round(Ph/1000000,3),"MPa"

Phs=(T0/T)*Ph                                         #Pressure rise at the valve

print "(b)Phs=",round(Phs/1000000,3),"MPa"

print "(c)Ph=",round(Ph/1000000,3),"MPa"
(a)Ph= 3.235 MPa
(b)Phs= 2.394 MPa
(c)Ph= 3.235 MPa

Example 14.19 Page No359

In [14]:
import math

#variable initialisation

k=2.10E9                       #Bulk modulus in Pa

rho=998                        #relative density

D=400                          #Diameter in cm

t=10                           #thickness in cm

E=2.11E11                      #modulus pf elasticity

V2=0.5                         #Volume 1

V1=3.0                         #Volume 2

T=5.00                         #pressure rise

L=2500                         #length

Pstatic=9.79*250               #Pressure  

#calculation

c=((k/rho)**(1/2))

C=round((((1/(1+(D/t)*(k/E))))**(1/2))*c,4)           #Velocity of pressure wave

T0=round((2*L)/C,3)

del_V=V2-V1                                           #change in volume

Ph=-rho*C*del_V                                       #T=1.25,Hence,water hammer pressure


Phs=((T0/T)*Ph)/1000                                  #Pressure rise at the valve

Pt=Pstatic+Phs

print "Pt=",int(round(Pt,0)),"kPa"                    #Total pressure at the valve end
Pt= 4943 kPa

Example 14.20 Page No360

In [15]:
import math

#variable initialization

K=2.2E+3             #bulk modulus in MPa

rho=998              #density in kg/m^3

L=3500               #length in m

Vo=0.8               #velocity in m/s

T=4.0                #closure in s

#solution

C=round(math.sqrt((K*10**6)/rho),1)   #velocity of pressure wave

To=(2*L)/C                            #critical time

#T=4.0 s,the closure is rapid.

Ph=(rho*C*Vo)/(10**6)                #water hammer pressure

print "Ph=",round(Ph,3),"MPa"

#length of the pipe affected by peak pressure

Xo=L-((C*T)/2)

print "Xo=",Xo,"m"
Ph= 1.185 MPa
Xo= 530.6 m

Example 14.23 Page No362

In [16]:
import math

#variable initialisation

k=1.52E9                       #Bulk modulus in Pa

rho=998                        #relative density

D=200                          #Diameter in cm

t=10                           #thickness in cm

E=2.11E11                      #modulus pf elasticity

T=1.25                         #pressure rise

L=1000                         #length

Pstatic=9.79*250               #Pressure

Rd=0.8                         #Relative density

Q=0.040                        #discharge 

#calculation

c=((k/(Rd*rho))**(1/2))

C=round((((1/(1+(D/t)*(k/E))))**(1/2))*c,4)          #Velocity of pressure wave

V0=Q/((math.pi/4)*((D/1000)**2))

T0=round((2*L)/C,3)

Ph=rho*Rd*C*V0                                       #T=1.25,Hence,water hammer pressure

alpha_a=(Ph*D/(2*t))/1000

print "alpha_a=",round(alpha_a/1000000,4),"kN/mm^2"  #Convert into mm
alpha_a= 0.0131 kN/mm^2

Example 14.24 Page No362

In [17]:
import math

#variable initialisation

k=1E9                          #Bulk modulus in Pa

rho=998                        #relative density

D=300                          #Diameter in cm

t=3                            #thickness in cm

E=2.14E11                      #modulus pf elasticity

T=1.25                         #pressure rise

L=1000                         #length

Pstatic=9.79*250               #Pressure

Rd=0.82                        #Relative density

Q=0.100                        #discharge 

Sh=160                         #Static head in m

alpha_w=1.0E5                  #stress value

#calculation

c=((k/(Rd*rho))**(1/2))

C=round((((1/(1+(D/t)*(k/E))))**(1/2))*c,4)          #Velocity of pressure wave

V0=round(Q/((math.pi/4)*((D/1000)**2)),2)

T0=round((2*L)/C,3)

Ph=round((rho*Rd*C*V0)/1000,2)                       #water hammer pressure

Ps=Sh*(9.79*Rd)                                      #Static pressure

P=Ps+Ph                                              #Total pressure

alpha_a=(Ph*D/(2*t))/1000

#As working stress is lower than alpha_w value,valve must be closed with time T>T0

Pt=alpha_w*2*t/(D)

Phw=Pt-Ps                                            #Allowable hammer pressure in the closure

T=T0*(Ph/Phw)

#Since this value <1.5,the assumption of slow closure is O.K.

print "Minimum time of closure Tm=",round(T,2),"s"
Minimum time of closure Tm= 3.23 s