# Chapter 2,Continuity Momentum and Energy¶

## Example 2.1,Page 36¶

In [1]:
from math import pi

#variable decleration
Q1 =0.02; #m^3/ s
d1 =0.15; #m
d2 =0.05; #m
d3 =0.1; #m
v2 =3; #m/ s

#calculation
Q2=pi*d2 **2/4* v2;
v3 =(4* Q1/pi -d2 **2* v2)/d3 **2;
Q3=pi*d3 **2/4* v3;
v1 =4*( Q2+Q3)/pi/d1 **2;

#result
print" Flow rate at pipe 3(m^3/s) =",round(Q3,4)
print" Flow rate at pipe 2(m^3/s)= ",round(Q2,4)
print" Flow rate at pipe 1(m^3/s)= ",round(Q1,4)
print" Velocity at pipe 1(m/s) =",round(v1,3)
print" Velocity at pipe 2(m/s) =",round(v2,3)
print" Velocity at pipe 3(m/s) =",round(v3,3)

 Flow rate at pipe 3(m^3/s) = 0.0141
Flow rate at pipe 2(m^3/s)=  0.0059
Flow rate at pipe 1(m^3/s)=  0.02
Velocity at pipe 1(m/s) = 1.132
Velocity at pipe 2(m/s) = 3.0
Velocity at pipe 3(m/s) = 1.796


## Example 2.2,Page 38¶

In [12]:
#variable decleration
import math
from math import pi
d1 =0.2; #m
d2=d1;
p1 =1*10**5; #N/m^2
p2 =80*10**3; #N/m^2
Q =150.0; #m^3/h
rho =900; #kg /m^3
theta1 =0; # r a d i a n s
theta2 =pi; # r a d i a n s

#calculation
a1=pi*d1 **2/4;
a2=pi*d2 **2/4;
F1=p1*a1; # Upstream f o r c e
F2=p2*a2; # Downstream f o r c e
v1 =4*Q /3600/ pi/d1 **2;
v2=v1;
flux =rho*Q /3600* v2; #Momentum f l u x
Fx=F1* math.cos ( theta1 )-F2* math.cos ( theta2 )+ flux *( math.cos ( theta2 ) -
math.cos ( theta1 ));
Fy=F1* math.sin ( theta1 )-F2* math.sin ( theta2 )-flux *( math.sin ( theta2 )-
math.sin ( theta1 ));
F= math.sqrt (Fx **2+ Fy **2);

#result
print" Force exerted by liquid (kN) =",round(F,2)

 Force exerted by liquid (kN) = 5552.47608322


## Example 2.3,Page 40¶

In [6]:
from math import pi

#variable decleration
rho =1000; # kg /m^3
d =0.05; #m
L =500; #m
v =1.7; #m/ s

#calculation
a= pi *d **2/4;
F= rho *a*L*v;
P=F/a /10**3;

#result
print"Average pressure(kN/m^2) =",round(P)

Average pressure(kN/m^2) = 850.0


## Example 2.4,Page 42¶

In [2]:
#variable decleration
import math
g =9.8; #m/ s ^2
dz =0.2; #m ; dz1=z1-z2=z1-z2
rho =1000; # kg /m^3
dz1 =2; #m ; dz1=z1-z A
dz2 =0; #m ; dz2=z1-z B
dz3 = -1.5; #m ; dz3=z1-z C

#calculation
v2= math.sqrt (2* g*dz);
v_A =v2;
v_B =v2;
v_C =v2;
p_A = rho *g*( dz1 - v_A **2/2/ g);
p_B = rho *g*( dz2 - v_B **2/2/ g);
p_C = rho *g*( dz3 - v_C **2/2/ g);

#result
print" Velocity at pt . A(m/s) =",round(v_A,2);
print" Velocity at pt . B(m/s) =",round(v_B,2);
print" Velocity at pt . C(m/s) =",round(v_C,2);
print" Pressure at pt . A(kN/m^2) =",round(p_A)
print" Pressure at pt . B (kN/m^2)=",round(p_B)
print" Pressure at pt . C (kN/m^2)=",round(p_C)

 Velocity at pt . A(m/s) = 1.98
Velocity at pt . B(m/s) = 1.98
Velocity at pt . C(m/s) = 1.98
Pressure at pt . A(kN/m^2) = 17640.0
Pressure at pt . B (kN/m^2)= -1960.0
Pressure at pt . C (kN/m^2)= -16660.0


## Example 2.5,Page 44¶

In [7]:
from math import pi

#variable decleration
Q =10.0; # m^3/ hr
d1 =0.05; #m
d2 =0.1; #m
rho =1000.0; #kg /m^3
g=9.81;

#calculation
a1=pi*d1 **2/4;
a2=pi*d2 **2/4;
v1=Q /3600/ a1;
v2 =( d1/d2) **2* v1;
PD=rho*0.057*g;

#results
print" Presure drop (N/m^2)=",round(PD,3)

 Presure drop (N/m^2)= 375.26364312


## Example 2.7,Page 48¶

In [17]:
#variable decleration
Q =100; #m^3/ hr
d1 =0.2; #m
d2 =0.15; #m
p1 =80*10**3; #N/m^2
rho =1000; # kg /m^3
g =9.8; #m/ s ^2
pi=3.14;

#calculation
a1=pi*d1 **2/4;
a2=pi*d2 **2/4;
v1=Q /3600/ a1;
v2=Q /3600/ a2;
H_L =0.2* v2 **2/2/ g;
p2=p1+ rho /2*( v1 **2- v2 **2) -rho*g* H_L ;
F_u =p1*a1; # Upstream f o r c e
F_d =p2*a2; # Downstream f o r c e
F_x = rho *Q /3600*( v2 -v1)-F_u +F_d;

#results
print" Force required (N) =",round(F_x)

 Force required (N) = -1099.0


## Example 2.9,Page 53¶

In [3]:
#variable decleration
N =60; #rpm
r2 =0.25; #m
g =9.8; #m/ s ^2
pi=3.14;

w =2* pi*N /60;
dz_12 =(w*r2) **2/2/ g; # dz 1 2=z2-z1
c=w*r2 **2;
dz_23 =c **2/2/ g/r2 **2; # dz 2 3=z3-z2
dz_13 = dz_23 + dz_12 ;

#results
print" Total depression(m) =",round(dz_13,3)

 Total depression(m) = 0.252

In [ ]: