# Chapter 10: Laminar and Turbulent Flows in Bounded System¶

## Example 10.1, Page 329¶

In :
from __future__ import division
import math
import sympy
from sympy import symbols,diff,solve

#Initializing  the  variables
mu  =  0.9;
rho  =  1260;
g  =  9.81;
x  =  45;                                                                  #theta  in  degrees
P1  =  250  *  10**3;
P2  =  80*  10**3;
Z1  =  1;
Z2  =  0;                                                                  #  datum
U  =  -1.5;
Y  =  0.01;

#Calculations
A  =  U/Y;                                                                #  Coefficient  U/Y  for  equation  10.6
B  =  DPstar/(2*mu)                                              #  Coefficient  dp*/dx  X(1/2mu)  for  equation  10.6
y  =  symbols('y')
v  =  round((A  +  B*Y),1)*y  -round(B)*y**2
duBYdy  =  diff(v,y);
tau  =  0.9*duBYdy;
stagPnts = solve(duBYdy,y)
ymax=stagPnts                                      #value  of  y  where  derivative  vanishes.;
umax  =  (A + B*Y)*ymax  +  B*ymax**2;              #  Check  the  value  there  is  slight  mistake  in  books  answer
def  u(y):
z  =  (A + B*Y)*y -B*y**2;
return diff(z,y)
def dif(y):
return round((A + B*Y)) -2*round(B)*y

taumax=abs(mu*dif(Y))

print "velocity distribution         :",v
print "shear stress distribution     :",mu*dif(y)
print "maximum flow velocity (m/s)   :",round(umax,2)
print "Maximum Shear Stress  (kN/m^2):",(round(taumax)/1000)

print

velocity distribution         : -71638.0*y**2 + 566.4*y
shear stress distribution     : -128948.4*y + 509.4
maximum flow velocity (m/s)   : 3.36
Maximum Shear Stress  (kN/m^2): 0.78



## Example 10.2, Page 335¶

In :
from __future__ import division
import math

#Initializing  the  variables
mu  =  0.9;
rho  =  1260;
d  =  0.01;
Q  =  1.8/60*10**-3;                                              #Flow  in  m**3  per  second
l  =  6.5;
ReCrit  =  2000;
#Calculations
A  =  (math.pi*d**2)/4;
MeanVel  =  Q/A;
Re  =  rho*MeanVel*d/mu/10;                                    #  Check  properly  the  answer  in  book  there  is  something  wrong
Dp  =  128*mu*l*Q/(math.pi*d**4)
Qcrit  =  Q*ReCrit/Re*10**3;

print "Pressure Loss        (kN/m2) :",round(Dp/1000,0)
print "Maximum Flow rate (litres/s) :",round(Qcrit,0)

Pressure Loss        (kN/m2) : 715.0
Maximum Flow rate (litres/s) : 112.0


## Example 10.3, Page 341¶

In :
from __future__ import division
import math

#Initializing  the  variables
mu  =  1.14*10**-3;
rho  =  1000;
d  =  0.04;
Q  =  4*10**-3/60;                                    #Flow  in  m**3  per  second
l  =  750;
ReCrit  =  2000;
g  =  9.81;
k  =  0.00008;                                       #  Absolute  Roughness

#Calculations
A  =  (math.pi*d**2)/4;
MeanVel  =  Q/A;
Re  =  rho*MeanVel*d/mu;
Dp  =  128*mu*l*Q/(math.pi*d**4);
hL  =  Dp/(rho*g);
f  =  16/Re;
hlDa  =  4*f*l*MeanVel**2/(2*d*g);                   #  By  Darcy  Equation
Pa  =  rho*g*hlDa*Q;

#Part(b)
Q  =  30*10**-3/60;                                  #Flow  in  m**3  per  second
MeanVel  =  Q/A;
Re  =  rho*MeanVel*d/mu;
RR  =  k/d;                                          #  relative  roughness
f  =  0.008                                          #by  Moody  diagram  for  Re  =    1.4  x  10**4    and  relative  roughness  =  0.002
hlDb  =  4*f*l*MeanVel**2/(2*d*g);                   #  By  Darcy  Equation
Pb  =  rho*g*hlDb*Q;

print "!---- Case (a) ----!\n","Head Loss(mm)      :",round(hlDa*1000,1)
print "Power Required (W) :",round(Pa,4)
print "\n!---- Case (b) ----!\n","Head Loss(m)       :",round(hlDb,2)
print "Power Required (W) :",round(Pb,0)

!---- Case (a) ----!
Power Required (W) : 0.0605

!---- Case (b) ----!
Power Required (W) : 24.0


## Example 10.4, Page 343¶

In :
from __future__ import division
import math

#Initializing  the  variables
w  =  4.5;
d  =  1.2  ;
C  =  49;
i  =  1/800;

#Calculations
A  =  d*w;
P  =  2*d  +  w;
m  =  A/P;
v  =  C*(m*i)**0.5;
Q  =  v*A;

print "Mean Velocity (m/s):",round(v,2)
print "Discharge (m3/s)   :",round(Q,2)

Mean Velocity (m/s): 1.53
Discharge (m3/s)   : 8.28


## Example 10.5, Page 348¶

In :
from __future__ import division
import sympy
from sympy import symbols

#Initializing  the  variables
r,R = symbols('r R')

#Calculations
rbyR=round((1-(49/60)**7),3)
r = (rbyR)*R

#Result
print "radius at which actual velocity is equal to mean velocity is",r

radius at which actual velocity is equal to mean velocity is 0.758*R


## Example 10.7, Page 355¶

In :
from __future__ import division
import math

#Initializing  the  variables
d1  =  0.140;
d2  =  0.250;
DpF_DpR  =  0.6;                                       #Difference  in  head  loss  when  in  forward  and  in  reverse  direction
K  =  0.33                                             #From  table
g  =  9.81;
#Calculations
ratA  =  (d1/d2)**2;
v =(DpF_DpR*2*g/((1-ratA)**2-K))**0.5;

print "Velocity (m/s):",round(v,2)

Velocity (m/s): 9.13