Anda di halaman 1dari 98

Scilab Textbook Companion for

Fluid Mechanics
by A. K. Choudhary and Om Prakash1
Created by
Priyanka Saini
B.Tech
Electronics Engineering
Uttarakhand Technical University
College Teacher
Mr. Naresh Kumar
Cross-Checked by
K. V. P. Pradeep
May 8, 2014

1 Funded

by a grant from the National Mission on Education through ICT,


http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab
codes written in it can be downloaded from the Textbook Companion Project
section at the website http://scilab.in

Book Description
Title: Fluid Mechanics
Author: A. K. Choudhary and Om Prakash
Publisher: S. K. Kataria & Sons, New Delhi
Edition: 2
Year: 2009
ISBN: 81-85749-65-5

Scilab numbering policy used in this document and the relation to the
above book.
Exa Example (Solved example)
Eqn Equation (Particular equation of the above book)
AP Appendix to Example(Scilab Code that is an Appednix to a particular
Example of the above book)
For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means
a scilab code whose theory is explained in Section 2.3 of the book.

Contents
List of Scilab Codes

2 Properties of Fluids

3 Hydro Static Pressure

13

4 Measurement of Pressure

31

5 Fundamentals of Flow

40

6 Orifices

58

7 Flow through pipes

71

11 Flow Measurement

89

List of Scilab Codes


Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

2.1
2.2
2.3
2.4
2.5
2.6
2.7
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.15
3.16
3.17
3.18
3.19
3.20
3.21

Sp Weight Mass density Sp Gravity . .


Bulk modulus of elesticity . . . . . . . .
Increase of pressure . . . . . . . . . . .
Force and power required . . . . . . . .
Kinematic Viscosity . . . . . . . . . . .
Calculate capillary rise . . . . . . . . . .
Intensity of Pressure . . . . . . . . . . .
Intensity of pressure . . . . . . . . . . .
Intensity of pressure . . . . . . . . . . .
Depth of alcohol . . . . . . . . . . . . .
Convert pressure head . . . . . . . . . .
Calculate total pressure . . . . . . . . .
Calculate force on vertical wall . . . . .
Find force and depth . . . . . . . . . . .
Total pressure and centre of pressure . .
Total pressure and centre of pressure . .
Total pressure and centre of pressure . .
Total pressure and centre of pressure . .
Determine total pressure . . . . . . . . .
Total pressure and centre of pressure . .
Force and reaction at hinge . . . . . . .
Horizontal force . . . . . . . . . . . . .
Total pressure and centre of pfressure .
Total pressure and centre of pressure . .
Total Pressure and centre of pressure . .
Total pressure and centre of pressure . .
Total hydro static pressure and centre of
Resultant pressure and direction . . . .
4

. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
pressure
. . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

8
9
9
10
10
11
11
13
13
14
15
15
16
17
18
18
19
20
21
21
22
23
24
24
25
26
26
27

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

3.22
3.23
3.24
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10
4.11
4.12
4.13
4.14
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.10
5.11
5.12
5.13
5.14
5.15
5.16
5.17
5.18
5.19
5.20
5.21

Resultant pressure and angle of pressure . . . .


Gorizontal and vertical components of pressure
Maximum and minimum stress . . . . . . . . .
Gauge units and absolute units . . . . . . . . .
Pressure intensity and tube reading . . . . . .
Convert pressure head . . . . . . . . . . . . . .
Pressure in the tribe . . . . . . . . . . . . . . .
Pressure intensity of liquid . . . . . . . . . . .
calculate Pressure intensity . . . . . . . . . . .
Calculate pressure intensity . . . . . . . . . . .
Difference of pressure head . . . . . . . . . . .
Difference of Pressure . . . . . . . . . . . . . .
Pressure difference between two vessels . . . . .
Difference of pressure between two vessels . . .
Pressure difference between vessels . . . . . . .
Reading of manometer . . . . . . . . . . . . . .
Difference of pressure . . . . . . . . . . . . . .
Find Power required . . . . . . . . . . . . . . .
Discharge and velocity of flow . . . . . . . . . .
Datum Velocity Head Pressure head . . . . . .
Calculate total energy . . . . . . . . . . . . . .
Direction of flow . . . . . . . . . . . . . . . . .
Pressure at the low end . . . . . . . . . . . . .
Loss of head and direction of flow . . . . . . . .
Find Loss of head . . . . . . . . . . . . . . . .
Head Loss and direction of flow . . . . . . . . .
Determine pressure intensity . . . . . . . . . .
Intensity of pressure and discharge . . . . . . .
Find discharge of oil . . . . . . . . . . . . . . .
Coefficient of meter . . . . . . . . . . . . . . .
Deflection in manometer . . . . . . . . . . . . .
Find pressure difference . . . . . . . . . . . . .
Deflection of oil mercury gauge . . . . . . . . .
Rate of flow . . . . . . . . . . . . . . . . . . . .
Calculate flow water . . . . . . . . . . . . . . .
Flow rate of water . . . . . . . . . . . . . . . .
Velocity and flow rate . . . . . . . . . . . . . .
Flow rate of oil . . . . . . . . . . . . . . . . . .
5

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

28
29
29
31
32
33
33
34
35
35
36
36
37
37
38
38
39
40
40
41
42
42
43
44
46
46
47
48
49
50
51
51
52
53
53
54
55
55

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

5.22
5.23
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
6.10
6.11
6.12
6.13
6.14
6.15
6.16
6.17
6.18
6.19
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11.a
7.11
7.12
7.13
7.14.a
7.14
7.15.a

Find Z . . . . . . . . . . . . . . . . . . .
Discharge in the pipe . . . . . . . . . . .
Calculate Coefficients . . . . . . . . . . .
Calculate various Coefficients . . . . . . .
Coefficient of velocity . . . . . . . . . . .
Coefficient of velocity . . . . . . . . . . .
Various hydraulic coefficients . . . . . . .
Various hydraulic coefficients . . . . . . .
Coefficient of discharge . . . . . . . . . .
Coefficients of orifice . . . . . . . . . . . .
Various hydraulic coefficients . . . . . . .
Meeting point of two jets . . . . . . . . .
Discharge through the orifice . . . . . . .
Discharge through orifice . . . . . . . . .
Calculate percentage error . . . . . . . . .
Discharge through orifice . . . . . . . . .
Discharge through orifice . . . . . . . . .
Find time taken . . . . . . . . . . . . . .
Time of emptying the tank . . . . . . . .
Time required to bring down the level . .
Time required to empty the tank . . . . .
Relation between CGS and MKS unit . .
Kinematic viscosity and Reynolds number
Calculate reynolds number . . . . . . . .
Head Lost due to friction . . . . . . . . .
Difference in elevations . . . . . . . . . .
Head Lost due to friction . . . . . . . . .
Loss of head due to friction . . . . . . . .
Various losses . . . . . . . . . . . . . . . .
Intensity of pressure . . . . . . . . . . . .
Diameter of pipe . . . . . . . . . . . . . .
Discharge and velocity . . . . . . . . . . .
Calculate the pressure . . . . . . . . . . .
Discharge through 300mm pipe . . . . . .
Discharge in pipe line . . . . . . . . . . .
Diameter of pipe line . . . . . . . . . . . .
Discharge in pipe line . . . . . . . . . . .
Difference in water level . . . . . . . . . .
6

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

56
57
58
59
59
60
60
61
62
62
63
64
65
65
66
66
67
68
68
69
70
71
72
73
73
74
74
75
75
77
77
78
79
80
81
81
82
83

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

7.15
7.16
7.17
7.18
7.19.a
7.19
11.1
11.2
11.3
11.4
11.5
11.6
11.7
11.8
11.9
11.10
11.11
11.12
11.13
11.14

Rate of flow and diameter . . . . .


Discharge through pipe . . . . . .
Velocity discharge rate and energy
Discharge in pipe and pressure . .
Maximum Power . . . . . . . . . .
Increase in pressure Intensity . . .
Velocity of flow . . . . . . . . . . .
calculate Velocity . . . . . . . . .
Rate of discharge of steam . . . . .
Find the discharge . . . . . . . . .
Find the discharge . . . . . . . . .
Discharge over the notch . . . . .
Position of apex of notch . . . . .
calculate time taken . . . . . . . .
Discharge flowing over the weir . .
Find the discharge . . . . . . . . .
Discharge over cipoletti weir . . .
Find the maximum discharge . . .
Number of spillway . . . . . . . . .
Calculate the discharge . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

84
84
85
86
87
87
89
89
90
91
91
92
92
93
93
94
95
95
96
96

Chapter 2
Properties of Fluids

Scilab code Exa 2.1 Sp Weight Mass density Sp Gravity


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 2 . 1
clc ;
clear ;
close ;

// Given d a t a :
V =10; // i n m3
W =80; // i n kN
g =9.81; // g r a v i t y a c c e l e r a t
w_water =9.81; // s p e c i f i c w e i g h t o f w a t e r
format ( v ,6) ;
w = W / V ; // s p e c i f i c w e i g h t i n kN/m3
disp (w , S p e c i f i c w e i g h t o f l i q u i d i n kN/m3 : ) ;
mass_density = w *1000/ g ; // kg /m3
disp ( mass_density , Mass d e n s i t y o f l i q u i d i n kg /m3
: );
16 specific_gravity = w / w_water ; // u n i t l e s s
17 disp ( specific_gravity , S p e c i f i c g r a v i t y : ) ;

Scilab code Exa 2.2 Bulk modulus of elesticity


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Example 2 . 2
clc ;
clear ;
close ;
// Given d a t a :
p1 =750; //N/cm2
p2 =1400; //N/cm2
dvBYV = -0.150; // i n %
format ( v ,9) ;
dp = p2 - p1 ; // i n N/cm2
dp = dp *10^4; // i n N/m2
K = - dp /( dvBYV /100) ; //N/m2
disp (K , Bulk modulus (N/m 2 ) : ) ;

Scilab code Exa 2.3 Increase of pressure


1 // Example 2 . 3
2 clc ;
3 clear ;
4 close ;
5
6 // Given d a t a :
7 Kwater =2.10*10^6; //kN/m2
8 Kair =140; //kN/m2
9 dvBYV = -1; // i n %
10 format ( v ,9) ;
11 // For Water :
12 dp = - Kwater * dvBYV /100; //kN/m2
13 disp ( dp , I n c r e a s e o f p r e s s u r e i n w a t e r i n kN/m2 ) ;
14 // For A i r :
15 dp = - Kair * dvBYV /100; //kN/m2
16 disp ( dp , I n c r e a s e o f p r e s s u r e i n a i r i n kN/m2 ) ;

Scilab code Exa 2.4 Force and power required


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 2 . 4
clc ;
clear ;
close ;
// Given d a t a :
A =0.2; //m2
dy =0.02/100; //m
du =20/100; //cm/ s
mu =0.001; // Ns /m2
tau = mu * du / dy ; // i n N/m2
F = tau * A ; //N
disp (F , F o r c e r e q u i r e d i n N : ) ;
Power = F * du ; // Watts
disp ( Power , Power r e q u i r e d i n W : ) ;

Scilab code Exa 2.5 Kinematic Viscosity


1
2
3
4
5
6
7
8
9
10
11

// Example 2 . 5
clc ;
clear ;
close ;
// Given d a t a :
format ( e ,10) ;
mu =0.1; // Ns /m2
Sp_gravity_liquid =2.1;
mass_density_water =1000; // i n kg /m3
rho = Sp_gravity_liquid * mass_density_water ; // kg /m3
v = mu / rho ; //m2/ s e c
10

12

disp (v , K i n e m a t i c v i s c o s i t y o f l i q u i d i n m2/ s e c :
);

Scilab code Exa 2.6 Calculate capillary rise


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// Example 2 . 6
clc ;
clear ;
close ;
// Given d a t a :
format ( v ,6) ;
d =2; // i n mm
d = d /1000; // i n m
sigma_water =0.073; //N/m
sigma_mercury =0.510; //N/m
// Waterg l a s s c o n t a c t
w1 =9.81; //kN/m 3 ( s p e c i f i c w e i g h t o f w a t e r )
w1 = w1 *10^3; //N/m3
theta =0; // i n d e g r e e
h =4* sigma_water * cosd ( theta ) / w1 / d ; // i n mm
disp ( h *1000 , c a p i l l a r y r i s e f o r w a t e r g l a s s c o n t a c t
i n mm : ) ;
// Mercuryg l a s s c o n t a c t
w2 =13.6*9.81; //kN/m 3 ( s p e c i f i c w e i g h t o f m e r c u r y )
w2 = w2 *10^3; //N/m3
theta =130; // i n d e g r e e
h =4* sigma_mercury * cosd ( theta ) / w2 / d ; // i n mm
disp ( h *1000 , c a p i l l a r y r i s e f o r m e r c u r y g l a s s
c o n t a c t i n mm: ) ;

Scilab code Exa 2.7 Intensity of Pressure


1

// Example 2 . 7
11

2
3
4
5
6
7
8
9
10
11
12
13
14

clc ;
clear ;
close ;
// Given d a t a :
format ( v ,5) ;
d =6; // i n mm
d = d /1000; // i n m
sigma =0.0755; //N/m
// At e q u i l l i b r i u m : p %pi r 2= s i g m a 2 %pi r
r = d /2; // i n m
p =2* sigma / r ; //N/m2
disp (p , I n t e n s i t y o f p r e s s u r e i n N/m2 o r P a s c a l s :
);

12

Chapter 3
Hydro Static Pressure

Scilab code Exa 3.1 Intensity of pressure


1
2
3
4
5
6
7
8
9
10
11
12

// Example 3 . 1
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
D =30*10^ -2; // i n m
F =9810; // i n N
A = %pi * D ^2/4; // i n m2
p = F / A ; // i n N/m2 o r Pa
p = p /1000; // kPa
disp (p , I n t e n s i t y o f p r e s s u r e a t t h e bottom o f
c o n t a i n e r i n kPa : ) ;

Scilab code Exa 3.2 Intensity of pressure


1 // Example 3 . 2
2 clc ;

13

3
4
5
6
7
8
9
10
11
12
13
14
15
16

clear ;
close ;
format ( v ,7) ;
// Given d a t a :
h =1.5; // i n m
w_w =9.81; // i n kN/m3
w_g =1.26; // i n kN/m3
w_m =13.6; // i n kN/m3
f = h * w_w ; //kN/m2
disp (f , I n t e n s i t y o f
column i n kN/m2 :
f = h * w_w * w_g ; //kN/m2
disp (f , I n t e n s i t y o f
column i n kN/m2 :
f = h * w_w * w_m ; //kN/m2
disp (f , I n t e n s i t y o f
column i n kN/m2 :

p r e s s u r e e x e r t e d by w a t e r
);
p r e s s u r e e x e r t e d by g l y c e r i n e
);
p r e s s u r e e x e r t e d by m e r c u r y
);

Scilab code Exa 3.3 Depth of alcohol


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Example 3 . 3
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
p =2; // i n kN/m2
w_w =9.81; // i n kN/m3
w_alcohol = w_w *0.789; // i n kN/m3
w_m =13.6; // i n kN/m3
H = p / w_alcohol ; // i n m
disp (H , Depth o f a l c o h o l i n m e t e r : ) ;
P_head_w = p / w_w ; //m
disp ( P_head_w , P r e s s u r e head i n t e r m s o f w a t e r i n
meter : );
14

15
16

P_head_m = p / w_w / w_m ; //m


disp ( P_head_m , P r e s s u r e head i n t e r m s o f m e r c u r y i n
meter : );

Scilab code Exa 3.4 Convert pressure head


1 // Example 3 . 4
2 clc ;
3 clear ;
4 close ;
5 format ( v ,7) ;
6 // Given d a t a :
7 Hwater =6; //m( P r e s s u r e head o f w a t e r )
8 S_oil =0.70; // ( s p e c i f i c g r a v i t y o f o i l )
9 H_oil = Hwater / S_oil ; // i n m( P r e s s u r e head i n t e r m s o f
10
11
12
13
14
15

oil )
disp ( H_oil , P r e s s u r e head o f w a t e r i n t e r m s o f o i l
i n meter : );
S_oil =0.825; // ( s p e c i f i c g r a v i t y o f o i l )
S_mercury =13.6; // ( s p e c i f i c g r a v i t y o f m e r c u r y )
Hmercury =70/100; //m( P r e s s u r e head o f m e r c u r y )
H_oil = S_mercury / S_oil * Hmercury ; // i n m( P r e s s u r e head
in terms of o i l )
disp ( H_oil , P r e s s u r e head o f m e r c u r y i n t e r m s o f o i l
i n meter : );

Scilab code Exa 3.5 Calculate total pressure


1 // Example 3 . 5
2 clc ;
3 clear ;
4 close ;
5 format ( v ,7) ;

15

6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Given d a t a :
w =9.81; // i n kN/m3
l =3; // i n m
b =2; // i n m
h =1; // i n m
f_bottom = w * h ; // i n kN/m 2 ( P r e s s u r e i n t e n s i t y a t
bottom )
p_bottom = f_bottom * l * b ; //kN
disp ( p_bottom , T o t a l p r e s s u r e on t h e bottom i n kN :
);
f_long_vertical = f_bottom /2; //kN
p_long_vertical = f_long_vertical * l * h ; //kN
disp ( p_long_vertical , T o t a l p r e s s u r e on l o n g
v e r t i c a l w a l l i n kN : ) ;
f_short_vertical = f_bottom /2; //kN
p_short_vertical = f_short_vertical * b * h ; //kN
disp ( p_short_vertical , T o t a l p r e s s u r e on s h o r t
v e r t i c a l w a l l i n kN : ) ;

Scilab code Exa 3.6 Calculate force on vertical wall


// Example 3 . 6
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
p_water =1000; // i n kg /m3
p_liquid =800; // i n kg /m3
g =9.81; // g r a v i t y c o n s t a n t
h1 =1.5; //m
px1 = p_liquid * g * h1 /1000; //kN/m2
disp ( px1 , P r e s s u r e a t a p o i n t 1 . 5 m e t e r b e l o w f r e e
s u r f a c e i n kN/m2 : ) ;
13 h2 =2; //m
1
2
3
4
5
6
7
8
9
10
11
12

16

14 px2 = p_liquid * g * h2 /1000; //kN/m2


15 disp ( px2 , P r e s s u r e a t a p o i n t 2 m e t e r b e l o w f r e e
16
17
18
19
20
21
22
23
24
25
26
27
28
29

s u r f a c e i n kN/m2 : ) ;
h31 =2; //m( f o r l i q u i d )
h32 =0.5; //m( f o r w a t e r )
px1 = p_liquid * g * h31 /1000; //kN/m2
px2 = p_water * g * h32 /1000; //kN/m2
px3 =( px1 + px2 ) ; //kN/m2
disp ( px3 , P r e s s u r e a t a p o i n t 2 . 5 m e t e r b e l o w f r e e
s u r f a c e i n kN/m2 : ) ;
h =2; // m e t e r ( w a t e r l e v e l )
b =8; // m e t e r ( w i d t h o f w a l l )
p_bottom = px1 +( p_water * g * h ) /1000; //kN/m2
p_avg1 =( px1 +0) /2; //kN/m 2 ( t o p 2m l i q u i d l a y e r )
p_avg2 =( px1 + p_bottom ) /2; //kN/m 2 ( t o p 2m w a t e r l a y e r )
F_per_meter = p_avg1 * h *1+ p_avg2 * h *1; //kN
Fwall = F_per_meter * b ; //kN
disp ( Fwall , F o r c e on t h e w a l l i n kN : ) ;

Scilab code Exa 3.7 Find force and depth


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Example 3 . 7
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
b =3; // i n m e t e r
h =3; // i n m e t e r
S_oil =0.8; // ( s p e c i f i c g r a v i t y o f o i l )
A =1/2* h * b ; // i n m2
x_bar =2/3*3; // i n m e t e r
SW_water =9.81*1000; // i n N/m3
SW_oil = SW_water * S_oil ; // i n N/m3
F_surface = SW_oil * A * x_bar ; // i n kN
17

15 IG = b * h ^3/36; // i n m3
16 h_bar = IG / A / x_bar + x_bar ; // i n m e t e r
17 disp ( h_bar , F o r c e s h a l l a c t a t d e p t h o f

centre of
p r e s s u r e . This depth i n meter i s : );

Scilab code Exa 3.8 Total pressure and centre of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Example 3 . 8
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
l =3; // i n m e t e r
b =2; // i n m e t e r
p =2*10^6; // i n Pa
g =9.81; // g r a v i t y c o n s t a n t
w = g *1000; // i n N/m3
h = p / w ; // i n m e t e r
xbar =h -1.5; // i n m e t e r
A = l * b ; // i n m2
p_gate = w * A * xbar /10^6; // i n MN
disp ( p_gate , T o t a l p r e s s u r e on t h e g a t e i n MN : ) ;
IG = b * l ^3/12; // i n m3
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( P o s i t i o n o f c e n t r e o f p r e s s u r e i s + string (
h_bar - xbar ) + m e t e r b e l o w t h e c e n t r o i d o f g a t e . )
;

Scilab code Exa 3.9 Total pressure and centre of pressure


1 // Example 3 . 9
2 clc ;

18

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

clear ;
close ;
format ( v ,9) ;
// Given d a t a :
g =9.81; // g r a v i t y
GH =4; // m e t e r
IJ =4; // m e t e r
IC =2; // m e t e r
GC =3; // m e t e r
AG =(10 -4) /2; // m e t e r
BH =(10 -4) /2; // m e t e r
EI = AG * IC / GC ; // m e t e r
JF = AG * IC / GC ; // m e t e r
EF = EI + IJ + JF ; // m e t e r
A =(8+4) /2*2; // i n m2
a =4; // m e t e r
b =8; // m e t e r
d =2; // m e t e r
xbar =(2* a + b ) /( a + b ) * d /3; // i n m e t e r
w = g *1000; // i n N/m3
p_gate = w * A * xbar /10^3; // i n kN
disp ( p_gate , T o t a l p r e s s u r e i n kN : ) ;
IG =( a ^2+4* a * b + b ^2) /( a + b ) * d ^3/36; // i n m3
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( Depth o f c e n t r e o f p r e s s u r e i s + string ( h_bar )
+ meter . );

Scilab code Exa 3.10 Total pressure and centre of pressure


1 // Example 3 . 1 0
2 clc ;
3 clear ;
4 close ;
5 format ( v ,9) ;
6 // Given d a t a :

19

g =9.81; // g r a v i t y
xbar =8; // m e t e r
D =4; // m e t e r
A = %pi * D ^2/4; // m e t e r 2
w = g *1000; // i n N/m3
p = w * A * xbar /10^3; // i n kN
disp (p , T o t a l p r e s s u r e i n kN : ) ;
IG = %pi * D ^4/64; // i n m4
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( Depth o f c e n t r e o f p r e s s u r e i s + string ( h_bar )
+ meter . );
17 // Answer o f t o t a l p r e s s u r e i s wrong i n t h e book .
7
8
9
10
11
12
13
14
15
16

Scilab code Exa 3.11 Total pressure and centre of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Example 3 . 1 1
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y
D =4; // m e t e r
xbar =(10+7) /2; // m e t e r
A = %pi * D ^2/4; // m e t e r 2
w = g *1000; // i n N/m3
p = w * A * xbar /10^6; // i n MN
disp (p , T o t a l p r e s s u r e i n MN : ) ;
BC =3; // m e t e r
AB =4; // mete
sin_theta = BC / AB ;
IG = %pi * D ^4/64; // i n m4
h_bar = IG / A / xbar * sin_theta ^2+ xbar ; // i n m e t e r
disp ( P o s i t i o n o f c e n t r e o f p r e s s u r e i s + string (
h_bar ) + m e t e r . ) ;
20

Scilab code Exa 3.12 Determine total pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// Example 3 . 1 2
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
a =3; // m e t e r
b =4; // m e t e r ( a l t i t u d e )
S =1.2; // s p e c i f i c g r a v i t y
theta =30; // d e g r e e
d =2.5; // m e t e r
g =9.81; // g r a v i t y
AG = b /3; // m e t e r
xbar = d + AG * sind ( theta ) ; // m e t e r
A =1/2* a * b ; // m e t e r 2
w = S * g *1000; // i n N/m3
p = w * A * xbar /10^3; // i n kN
disp (p , T o t a l p r e s s u r e i n kN : ) ;
IG = a * b ^3/36; // i n m4
h_bar = IG / A / xbar *( sind ( theta ) ) ^2+ xbar ; // i n m e t e r
disp ( Depth o f c e n t r e o f p r e s s u r e i s + string ( h_bar )
+ meter . );

Scilab code Exa 3.13 Total pressure and centre of pressure


1 // Example 3 . 1 3
2 clc ;
3 clear ;
4 close ;

21

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

format ( v ,6) ;
// Given d a t a :
a =8; // m e t e r
b =6; // m e t e r
h =3; // m e t e r
CD =2; // m e t e r
theta =30; // d e g r e e
A =( a + b ) /2* h ; // m e t e r 2
AB =( a +2* b ) /( a + b ) * h /3; // m e t e r
x1bar = AB ; // m e t e r
BC = AB * sind ( theta ) ; // m e t e r
BD = BC + CD ; // m e t e r
xbar = BD ; // m e t e r
g =9.81; // g r a v i t y
w = g *1000; // i n N/m3
p = w * A * xbar /10^3; // i n kN
disp (p , T o t a l p r e s s u r e i n kN : ) ;
IG =( a ^2+ b ^2+4* a * b ) /( a + b ) * h ^3/36; // i n m4
h_bar = IG / A / xbar *( sind ( theta ) ) ^2+ xbar ; // i n m e t e r
disp ( Depth o f c e n t r e o f p r e s s u r e i s + string ( h_bar )
+ meter . );

Scilab code Exa 3.14 Force and reaction at hinge


1
2
3
4
5
6
7
8
9
10
11

// Example 3 . 1 4
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
l =2; // m e t e r
b =2; // m e t e r
p_i =98.1; //kN/m 3 ( P r e s s u r e i n t e n s i t y )
w =9.81; //kN/m2
BC =1; // m e t e r
22

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

AB =2; // m e t e r
theta =30; // d e g r e e
B = p_i / w ; //m
BD = BC * sind ( theta ) ; //m
xbar =10+0.5; // m e t e r
A = l * b ; //m2
p = w * A * xbar ; //kN
IG =(2* l ^3) /12; // i n m4
h_bar = IG / A / xbar *( sind ( theta ) ) ^2+ xbar ; // i n m e t e r
DI = h_bar - xbar ; //m
FC = DI / sind ( theta ) ; //m
FB = FC + BC ; // m e t e r
P = p * FB / AB ; //kN
disp (P , F o r c e i n kN : ) ;
RB =p - P ; //kN
disp ( RB , R e a c t i o n a t h i n g e B i n kN : ) ;
// Answer i n t h e book i s s l i g h t l y d i f f e r due t o
l i m i t e d a c c u r a c y u s e d i n t h e book a s compared t o
SCILAB .

Scilab code Exa 3.15 Horizontal force


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 3 . 1 5
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
l =4; // m e t e r
b =2; // m e t e r
h =1.8; // m e t e r
w =9.81; //kN/m2
xbar =6 -2 // m e t e r
A = l * b ; //m2
P = w * A * xbar ; //kN
23

14 IG =(2* l ^3) /12; // i n m4


15 h_bar = IG / A / xbar + xbar ; // i n m e t e r
16 // As P a c t s a t h b a r x b a r :
17 F = P *(( h_bar - xbar ) -(b - h ) ) / h ; //kN
18 disp (F , H o r i z o n t a l F o r c e i n kN : ) ;

Scilab code Exa 3.16 Total pressure and centre of pfressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 3 . 1 6
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
b =2; // m e t e r
d =3; // m e t e r
h =2; // m e t e r
w =9.81; //kN/m2
xbar =2+3/2; // m e t e r
A = b * d ; //m2
P = w * A * xbar ; //kN
disp (P , T o t a l P r e s s u r e i n kN : ) ;
IG =( b * d ^3) /12; // i n m4
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( h_bar , P o s i t i o n o f c e n t r e o f p r e s s u r e i n m e t e r
: );

Scilab code Exa 3.17 Total pressure and centre of pressure


1 // Example 3 . 1 7
2 clc ;
3 clear ;
4 close ;

24

5
6
7
8
9
10
11
12
13
14
15
16
17

format ( v ,7) ;
// Given d a t a :
b =4; // m e t e r
d =4; // m e t e r
h =8; // m e t e r
w =9.81; //kN/m2
xbar =8; // m e t e r
A = b * d ; //m2
P = w * A * xbar ; //kN
disp (P , T o t a l P r e s s u r e i n kN : ) ;
IG =( b * d ^3) /12; // i n m4
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( h_bar , P o s i t i o n o f c e n t r e o f p r e s s u r e i n m e t e r
: );

Scilab code Exa 3.18 Total Pressure and centre of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Example 3 . 1 8
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
D =1.5; // m e t e r
BE =2; // m e t e r
AD =0.75; // m e t e r
CE = AD ; // m e t e r
BC = BE - AD ; // m e t e r
FG = CE + BC /2; // m e t e r
xbar = FG ; // m e t e r
w =9.81; //kN/m2
A = %pi * D ^2/4; //m2
AB = D ; // m e t e r
sin_theta = BC / AB ;
P = w * A * xbar ; //kN
25

19 disp (P , T o t a l P r e s s u r e i n kN : ) ;
20 IG =( %pi /64* D ^4) ; // i n m4
21 h_bar = IG / A / xbar * sin_theta ^2+ xbar ; // i n m e t e r
22 disp ( h_bar , P o s i t i o n o f c e n t r e o f p r e s s u r e i n m e t e r

: );

Scilab code Exa 3.19 Total pressure and centre of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 3 . 1 9
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
b =3; // m e t e r
a =3; // m e t e r
S_oil =0.8; // s p e c i f i c g r a v i t y o f o i l
w =9.81* S_oil ; //kN/m2
xbar =1/3* b ; // m e t e r
A =1/2* a * b ; //m2
P = w * A * xbar ; //kN
disp (P , T o t a l P r e s s u r e i n kN : ) ;
IG =( a * b ^3) /36; // i n m4
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( h_bar , C e n t r e o f p r e s s u r e i n m e t e r : ) ;

Scilab code Exa 3.20 Total hydro static pressure and centre of pressure
1 // Example 3 . 2 0
2 clc ;
3 clear ;
4 close ;
5 format ( v ,7) ;

26

6
7
8
9
10
11
12
13
14
15
16
17

// Given d a t a :
a =2; // m e t e r
b =1; // m e t e r
d =2; // m e t e r
w =9.81; //kN/m2
xbar =2+ a /2; // m e t e r
A = a * b ; //m2
P = w * A * xbar ; //kN
disp (P , T o t a l P r e s s u r e i n kN : ) ;
IG =( b * d ^3) /12; // i n m4
h_bar = IG / A / xbar + xbar ; // i n m e t e r
disp ( h_bar , P o s i t i o n o f c e n t r e o f p r e s s u r e i n m e t e r
: );

Scilab code Exa 3.21 Resultant pressure and direction


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 3 . 2 1
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
r =2; // m e t e r
l =4; // m e t e r
A = r * l ; //m2
xbar =2+ r /2; // m e t e r
w =9.81; //kN/m2
PH = w * A * xbar ; //kN
disp ( PH , H o r i z o n t a l component o f r e s u l t i n g P r e s s u r e
i n kN : ) ;
PV =2* r * l * w + %pi * r ^2/4* l * w ; //kN
disp ( PV , V e r t i c a l a l component o f r e s u l t i n g P r e s s u r e
i n kN : ) ;
IG =( l * r ^3) /12; // i n m4
h_bar = IG / A / xbar + xbar ; // i n m e t e r
27

18
19
20
21
22
23

disp ( h_bar , P o s i t i o n o f c e n t r e o f h o r i z o n t a l
component o f p r e s s u r e i n m e t e r : ) ;
x =(2* r + %pi * r ^2/4*(4* r /3/ %pi ) ) /(2* r + %pi * r ^2/4) ; //
meter
P = sqrt ( PH ^2+ PV ^2) ; //kN
disp (P , R e s u l t a n t p r e s s u r e i n kN : ) ;
theta = atand ( PV / PH ) ; // d e g r e e
disp ( theta , D i r e c t i o n o f r e s u l t a n t p r e s s u r e i n
d e g r e e : );

Scilab code Exa 3.22 Resultant pressure and angle of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 3 . 2 2
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
A =2*1; //m2
xbar =2+2/2; // m e t e r
w =9.81; //kN/m2
PH = w * A * xbar ; //kN
disp ( PH , H o r i z o n t a l component o f r e s u l t a n t P r e s s u r e
i n kN : ) ;
PV = w *[2*2+2*2 - %pi *2^2/4]*1; //kN
disp ( PV , V e r t i c a l a l component o f r e s u l t a n t P r e s s u r e
i n kN : ) ;
P = sqrt ( PH ^2+ PV ^2) ; //kN
disp (P , R e s u l t a n t p r e s s u r e i n kN : ) ;
theta = atand ( PV / PH ) ; // d e g r e e
disp ( theta , D i r e c t i o n o f r e s u l t a n t p r e s s u r e i n
d e g r e e : );

28

Scilab code Exa 3.23 Gorizontal and vertical components of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16

// Example 3 . 2 3
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
ABbar = sqrt (2) *4; // m e t e r
xbar = ABbar /2; // m e t e r
A = ABbar *1; //m2
w =9.81; //kN/m2
PH = w * A * xbar ; //kN
disp ( PH , H o r i z o n t a l component o f r e s u l t a n t P r e s s u r e
i n kN : ) ;
hbar =2/3* ABbar ; // m e t e r
disp ( P o s i t i o n o f h o r i z o n t a l component o f p r e s s u r e
i s + string ( hbar ) + m e t e r b e l o w f r e e w a t e r
s u r f a c e . );
PV = w *[ %pi *4^2/4 -4*4/2]*1; //kN
disp ( PV , V e r t i c a l a l component o f r e s u l t a n t P r e s s u r e
i n kN : ) ;

Scilab code Exa 3.24 Maximum and minimum stress


1
2
3
4
5
6
7
8
9
10

// Example 3 . 2 4
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
h =24; // m e t e r
b =15; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
Wm =2000* g ; //N/m3
29

11
12
13
14
15
16
17
18
19
20

W = b * h /2* Wm ; //N
w =9.81; //kN/m2
PH = w *20^2/2*1000; //N
y = PH / W *20/3+5; // m e t e r
e =y - b /2; // m e t e r
MaxStress = W / b *(1+6* e / b ) ; //N/m2
disp ( MaxStress , Maximum s t r e s s i n N/m2
MinStress = W / b *(1 -6* e / b ) ; //N/m2
disp ( MinStress , Minimum s t r e s s i n N/m2
// Answer i n t h e book i s s l i g h t l y d i f f e r
l i m i t e d a c c u r a c y u s e d i n t h e book a s
SCILAB .

30

: );
: );
due t o
compared t o

Chapter 4
Measurement of Pressure

Scilab code Exa 4.1 Gauge units and absolute units


// Example 4 . 1
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
p =5; // kg /cm2
disp ( Gauge u n i t s : ) ;
disp ( p /10^ -4 , P r e s s u r e I n t e n s i t y i n kg /m2 : ) ;
g =9.81; // g r a v i t y c o n s t a n t
disp ( p * g /10^ -4 , P r e s s u r e I n t e n s i t y i n N/m2 : ) ;
disp ( p * g /10^ -4 , P r e s s u r e I n t e n s i t y i n Pa : ) ;
disp ( p * g /10^3/10^ -4 , P r e s s u r e I n t e n s i t y i n kPa : ) ;
disp ( p * g /10^6/10^ -4 , P r e s s u r e I n t e n s i t y i n MPa : ) ;
disp ( I n t e r m s o f head : ) ;
w =1000; // kg /m3 f o r w a t e r
h = p *10^4/ w ; // m e t e r o f w a t e r
disp ( P r e s s u r e i s
: + string ( h ) + m e t e r o f w a t e r . )
;
19 w =13.6*1000; // kg /m3 f o r m e r c u r y
20 h = p *10^4/ w ; // m e t e r o f m e r c u r y

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

31

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

disp ( P r e s s u r e i s
: + string ( h ) + m e t e r o f m e r c u r y .
);
disp ( A b s o l u t e u n i t s : ) ;
Patm =760; //mm o f m e r c u r y
Patm =760*13.6/1000; //m o f w a t e r
Patm = Patm *1000; // kg /m2
Pabs = p + Patm ; // kg /m2
disp ( Pabs , A b s o l u t e p r e s s u r e i n kg /m2 : ) ;
disp ( Pabs *10^4 , A b s o l u t e p r e s s u r e i n kg /cm2 : ) ;
disp ( Pabs *10^4* g , A b s o l u t e p r e s s u r e i n N/m2 : ) ;
disp ( Pabs *10^4* g , A b s o l u t e p r e s s u r e i n Pa : ) ;
disp ( Pabs *10^5/10^3 , A b s o l u t e p r e s s u r e i n kPa : ) ;
disp ( Pabs *10^5/10^6 , A b s o l u t e p r e s s u r e i n MPa : ) ;
h1 = p *10^4/ w ; // m e t e r o f w a t e r
h2 = p *10^4/1000; // m e t e r o f w a t e r
h = h1 + h2 ; // // m e t e r o f w a t e r
disp (h , A b s o l u t e p r e s s u r e head i n t e r m s o f w a t e r i n
meter : );
w =13.6*1000; // kg /m3 f o r m e r c u r y
h = p *10^4/ w +760/1000; // m e t e r o f m e r c u r y
disp (h , A b s o l u t e p r e s s u r e head i n t e r m s o f m e r c u r y
i n meter : );

Scilab code Exa 4.2 Pressure intensity and tube reading


1
2
3
4
5
6
7
8
9
10

// Example 4 . 2
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
w =1000; // kg /m3
h =50/1000; //m
p = w * h ; // kg /m2
p = p *9.81; //N/m2 o r Pa
32

11 disp (p , P r e s s u r e I n t e n s i t y i n Pa : ) ;
12 alfa =30; // d e g r e e
13 h =50; //mm
14 l = h / sind ( alfa ) ; //mm
15 disp (l , R e a d i n g i n t u b e i n mm : ) ;

Scilab code Exa 4.3 Convert pressure head


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Example 4 . 3
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
S1 =13.6; // s p . g r a v i t y o f m e r c u r y
S2 =1; // s p . g r a v i t y o f w a t e r
H1 =5; //m
H2 = S1 * H1 / S2 ; //m
disp ( ( i ) P r e s s u r e i s + string ( H2 ) + m e t e r o f w a t e r .
);
S2 =0.79; // s p . g r a v i t y o f k e r p s e n e
H1 =5; //m
H2 = S1 * H1 / S2 ; //m
disp ( ( i i ) P r e s s u r e i s + string ( H2 ) + m e t e r o f
k e r o s e n e . );
S2 =1.7; // s p . g r a v i t y o f f l u i d
H1 =5; //m
H2 = S1 * H1 / S2 ; //m
disp ( ( i i i ) P r e s s u r e i s + string ( H2 ) + m e t e r o f
f l u i d . );

Scilab code Exa 4.4 Pressure in the tribe


33

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 4 . 4
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
S =0.9; // s p . g r a v i t y o f l i q u i d
Sm =13.6; // s p . g r a v i t y o f m e r c u r y
S1 = Sm / S ; // s p . g r a v i t y
w = S *9.81; //kN/m3
h2 =500/1000; //m
h1 =300/1000; //m
a_BY_A =1/80; // r a t i o o f a r e a
pa = w *( h2 *[( S1 -1) * a_BY_A + S1 ] - h1 ) ; // kPa
disp ( pa , P r e s s u r e i n t h e p i p e i n kPa : ) ;

Scilab code Exa 4.5 Pressure intensity of liquid


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Example 4 . 5
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
S1 =1.2; // s p . g r a v i t y
S2 =13.6; // s p . g r a v i t y
w =1000; // kg /m3
h2 =50/1000; //m
h1 =200/1000; //m
pa = w *( S2 * h1 - S1 * h2 ) ; // kg /m2
disp ( pa , P r e s s u r e i n t h e p i p e i n kg /m 2 : ) ;
disp ( pa *9.81 , P r e s s u r e i n t h e p i p e i n Pa : ) ;

34

Scilab code Exa 4.6 calculate Pressure intensity


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 4 . 6
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
S =1; // s p . g r a v i t y
w =1000; // kg /m3
h2 =50/1000; //m
h1 =200/1000; //m
pa = w * S *( h1 - h2 ) ; // kg /m2
disp ( pa , P r e s s u r e i n t h e p i p e i n kg /m 2 : ) ;
disp ( pa *9.81 , P r e s s u r e i n t h e p i p e i n Pa : ) ;

Scilab code Exa 4.7 Calculate pressure intensity


// Example 4 . 7
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
S1 =0.005; // s p . g r a v i t y
S2 =1; // s p . g r a v i t y
Patm =1.014*10^5; // Pa
h =50/1000; //m
w =1000; // kg /m3
pa = - w * S2 * h ; // kg /m2
Pabs = pa *9.81+ Patm ; //
disp ( abs ( pa *9.81) , P r e s s u r e i n t e n s i t y o f g a s i n Pa (
Vaccum ) : ) ;
15 disp ( Pabs , A b s o l u t e p r e s s u r e i n t h e p i p e i n Pa : ) ;
1
2
3
4
5
6
7
8
9
10
11
12
13
14

35

Scilab code Exa 4.8 Difference of pressure head


// Example 4 . 8
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
S1 =0.9; // s p . g r a v i t y
S2 =13.6; // s p . g r a v i t y
h1 =12.5/100; //m
P_AB = h1 *( S2 - S1 ) ; // m e t e r o f w a t e r
disp ( D i f f e r e n c e i n p r e s s u r e head a t t h e p o i n t s A &
B i s + string ( P_AB ) + m e t e r o f w a t e r ) ;
12 w =1000; // kg /m3
13 P_diff = P_AB * w *9.81; // Pa o r Nm2
14 disp ( P_diff , I n t e r m s A p r e s s u r e e n t i r e l y , t h e
d i f f e r e n c e o f p r e s s u r e i n N/m2 : ) ;

1
2
3
4
5
6
7
8
9
10
11

Scilab code Exa 4.9 Difference of Pressure


1
2
3
4
5
6
7
8
9
10

// Example 4 . 9
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
S1 =1; // s p . g r a v i t y
S2 =13.6; // s p . g r a v i t y
h1 =120/1000; //m
P_diff = h1 *( S2 - S1 ) ; // m e t e r o f w a t e r

36

disp ( D i f f e r e n c e i n p r e s s u r e head i s + string ( P_diff


)+ meter o f water );
12 w =1000; // kg /m3
13 P_diff = P_diff * w *9.81; // Pa o r Nm2
14 disp ( P_diff , I n t e r m s o f p r e s s u r e i n t e n s i t y , t h e
d i f f e r e n c e o f p r e s s u r e i n N/m2 : ) ;
11

Scilab code Exa 4.10 Pressure difference between two vessels


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 4 . 1 0
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
S1 =0.81; // s p . g r a v i t y
S2 =1.2; // s p . g r a v i t y
S3 =13.6; // s p . g r a v i t y
h3 =200/1000; //m
h2 =50/1000; //m
h1 =100/1000; //m
w =1000; // kg /m3
pAB =(( h1 *( S2 - S1 ) + h2 *( S3 - S1 ) - h3 * S1 ) ) * w ; //Kg/m2
disp ( pAB , P r e s s u r e d i f f e r e n c e b e t w e e n t h e two v e s s e l
i n kg /m 2 : ) ;

Scilab code Exa 4.11 Difference of pressure between two vessels


1 // Example 4 . 1 1
2 clc ;
3 clear ;
4 close ;
5 format ( v ,9) ;

37

6
7
8
9
10
11
12
13
14
15

// Given d a t a :
S1 =1.9; // s p . g r a v i t y
S2 =1.2; // s p . g r a v i t y
S3 =0.79; // s p . g r a v i t y
h2 =545/1000; //m
h1 =750/1000; //m
h3 = h1 - h2 ; //m
w =1000*9.81; //N/m3
pAB =( h1 * S1 - h2 * S2 - h3 * S3 ) * w ; //N/m2
disp ( pAB , P r e s s u r e d i f f e r e n c e b e t w e e n t h e two v e s s e l
i n N/m 2 : ) ;

Scilab code Exa 4.12 Pressure difference between vessels


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 4 . 1 2
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
S1 =0.005; // s p . g r a v i t y
S2 =0.79; // s p . g r a v i t y
S3 =13.6; // s p . g r a v i t y
h =30/1000; //m
w =1000*9.81; //N/m3
pAB = h *( S3 - S2 ) * w ; //N/m2
disp ( pAB , P r e s s u r e d i f f e r e n c e b e t w e e n t h e two v e s s e l
i n N/m 2 : ) ;

Scilab code Exa 4.13 Reading of manometer


1 // Example 4 . 1 3
2 clc ;

38

3
4
5
6
7
8
9
10
11
12
13
14
15

clear ;
close ;
format ( v ,4) ;
// Given d a t a :
S1 =1.25; // s p . g r a v i t y
S2 =1.05; // s p . g r a v i t y
S3 =0.79; // s p . g r a v i t y
h =30/1000; //m
w =1000; // kg /m3
//pA=pB
h =(0.15* w * S2 - S1 * w *0.15) /( S3 *w - w * S2 ) ; //m
h = h *1000; //mm
disp (h , R e a d i n g o f manometer i n mm : ) ;

Scilab code Exa 4.14 Difference of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 4 . 1 4
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
S1 =1; // s p . g r a v i t y o f w a t e r
S2 =1; // s p . g r a v i t y o f w a t e r
S3 =0.9; // s p . g r a v i t y o f o i l
h3 =100/1000; // m e t e r
w =9.81*1000; //N/m3
pAB = w *( h3 - h3 * S3 ) ; //N/m2
disp ( pAB , D i f f e r e n c e o f p r e s s u r e i n N/m2 o r Pa : )
;

39

Chapter 5
Fundamentals of Flow

Scilab code Exa 5.1 Find Power required


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 5 . 1
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
m =2000; // l i t r e o r kg ( 1 l i t r e w a t e r =1kg )
M = m /60; // kg / s
p =4.5; // b a r
p = p *10^5; //N/m2
g =9.81; // c o n s t a n t
w = g *1000; //N/m3
H = p / w ; //m
Power = M * g * H /1000; //kW
disp ( Power , Power r e q u i r e d i n kW : ) ;

Scilab code Exa 5.2 Discharge and velocity of flow

40

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// Example 5 . 2
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
v1 =400*10^ -3; //m/ s
d1 =300/1000; // m e t e r
d2 =450/1000; // m e t e r
A1 = %pi * d1 ^2/4; //m2
A2 = %pi * d2 ^2/4; //m2
Q1 = A1 * v1 *1000; // l i t r e s / s e c ( 1m3=1000 l i t r e s )
disp ( Q1 , D i s c h a r g e o f p i p e i n l i t r e s / s e c : ) ;
v2 =( Q1 /1000) / A2 ; //m/ s ( Q1=Q2 )
disp ( v2 , Mean v e l o c i t y o f f l o w i n m/ s : ) ;
// Answer o f d i s c h a r g e i s wrong i n t h e book .

Scilab code Exa 5.3 Datum Velocity Head Pressure head


1 // Example 5 . 3
2 clc ;
3 clear ;
4 close ;
5 format ( v ,7) ;
6 // Given d a t a :
7 PotentialHead =2; // m e t e r o f f l u i d
8 disp ( P o t e n t i a l Head i s + string ( PotentialHead ) +
9
10
11
12
13
14

meter o f f l u i d . );
v =5; //m/ s
g =9.81; // c o n s t a n t
VelocityHead = v ^2/2/ g ; //m
disp ( V e l o c i t y Head i s + string ( VelocityHead ) +
meter o f f l u i d . );
w = g *1000; //N/m3
S =0.8; // s p . g r a v i t y o f f l u i d
41

15 p =200; // kPa
16 PressureHead = p *10^3/ w / S ; // m e t e r o f f l u i d
17 disp ( P r e s s u r e Head i s + string ( PressureHead ) +

meter o f f l u i d . );
TotalHead = PotentialHead + VelocityHead + PressureHead ; //
meter o f f l u i d
19 disp ( T o t a l Head i s + string ( TotalHead ) + m e t e r o f
f l u i d . );
18

Scilab code Exa 5.4 Calculate total energy


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 5 . 4
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
p =0.8/10^ -4; // kg /m2
datumH =4; // m e t e r
v =0.8; //m/ s
g =9.81; // c o n s t a n t
VelocityH = v ^2/2/ g ; //m
w =1000; // kg /m3
PressureH = p / w ; // m e t e r o f f l u i d
TotalH = datumH + VelocityH + PressureH ; // m e t e r o f f l u i d
disp ( T o t a l Energy i s + string ( TotalH ) + m e t e r . ) ;

Scilab code Exa 5.5 Direction of flow


1 // Example 5 . 5
2 clc ;
3 clear ;
4 close ;

42

format ( v ,7) ;
// Given d a t a :
D1 =800/1000; //m2
D2 =600/1000; //m2
p1 =100; // kPa
p2 =40; // kPa
v1 =4000*10^ -3; //m/ s
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
Z1 =4; // m e t e r
Z2 =7; // m e t e r
rho =1; // s p . g r a v i t y
g =9.81; // c o n s t a n t
PHeadA = p1 / rho / g ; // m e t e r o f f l u i d
PHeadB = p2 / rho / g ; // m e t e r o f f l u i d
v2 = A1 * v1 / A2 ; //m/ s
VHeadA = v1 ^2/2/ g ; // m e t e r
VHeadB = v2 ^2/2/ g ; // m e t e r
E1 = Z1 + PHeadA + VHeadA ; // m e t e r
E2 = Z2 + PHeadB + VHeadB ; // m e t e r
if E1 > E2 then
disp ( T o t a l Energy a t A( + string ( E1 ) + m e t e r ) i s
g r e a t e r t h a n t o t a l e n e r g y a t B( + string ( E2 ) +
m e t e r ) . Flow o f w a t e r i s from A t o B . ) ;
27 else
28
disp ( T o t a l Energy a t B( + string ( E2 ) + m e t e r
) i s g r e a t e r t h a n t o t a l e n e r g y a t A( +
string ( E1 ) + m e t e r ) . Flow o f w a t e r i s
from B t o A . ) ;
29 end

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

Scilab code Exa 5.6 Pressure at the low end


1 // Example 5 . 6
2 clc ;

43

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

clear ;
close ;
format ( v ,8) ;
// Given d a t a :
D1 =1.25; // m e t e r
D2 =0.625; // m e t e r
slope =100;
L =300; // / m e t e r
g =9.81; // c o n s t a n t
Z12 = L / slope ; // m e t e r
Q =100; // l i t r e s / s e c
Q = Q *10^ -3; //m3/ s e c
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
v1 = Q / A1 ; //m/ s
v2 = Q / A2 ; //m/ s
p1 =100; //kN/m2
// H i g h e r End :
w =9.81; //kN/m3
Phead = p1 / w ; // m e t e r
Vhead = v1 ^2/2/ g ; // m e t e r
// Lower End :
w =9.81; //kN/m3
// Phead=p1 /w ; / / m e t e r
Vhead = v2 ^2/2/ g ; // m e t e r
p2 =( Z12 + v1 ^2/2/ g + p1 /w - v2 ^2/2/ g ) * w ; //kN/m 2 ( By
B e r n o u l l i s theorem )
29 disp ( p2 , P r e s s u r e a t t h e l o w e r end i n kN p e r m2 :
);

Scilab code Exa 5.7 Loss of head and direction of flow


1 // Example 5 . 7
2 clc ;
3 clear ;

44

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30

31
32
33

close ;
format ( v ,8) ;
// Given d a t a :
Z1 =0; // m e t e r
Z2 =5; // m e t e r
Q =300*10^ -3; //m/ s
D1 =0.3; // m e t e r
D2 =0.6; // m e t e r
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
v1 = Q / A1 ; //m/ s
v2 = Q / A2 ; //m/ s
p1 =100; //kN/m2
p2 =600; //kN/m2
g =9.81; // c o n s t a n t
Vhead11 = v1 ^2/2/ g ; // m e t e r
Vhead22 = v2 ^2/2/ g ; // m e t e r
Phead11 = p1 / g ; // m e t e r
Phead22 = p2 / g ; // m e t e r
E1_11 = Z1 + Vhead11 + Phead11 ; // m e t e r
E2_22 = Z2 + Vhead22 + Phead22 ; // m e t e r
if E1_11 > E2_22 then
disp ( Energy a t s e c t i o n 1 1( + string ( E1_11 ) +
m e t e r ) i s g r e a t e r t h a n e n e r g y a t s e c t i o n 2 2(
+ string ( E2_22 ) + m e t e r ) . Flow o f w a t e r i s
from s e c t i o n 11 t o 2 2. ) ;
HeadLoss = E1_11 - E2_22 ; // m e t e r
disp ( HeadLoss , Head L o s s i n m e t e r : ) ;
else
disp ( Energy a t s e c t i o n 2 2( + string ( E2_22 ) +
meter ) i s g r e a t e r than energy at
s e c t i o n 1 1( + string ( E1_11 ) + m e t e r ) .
Flow o f w a t e r i s from s e c t i o n 22 t o 1 1.
);
HeadLoss = E2_22 - E1_11 ; // m e t e r
disp ( HeadLoss , Head L o s s i n m e t e r : ) ;
end

45

Scilab code Exa 5.8 Find Loss of head


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// Example 5 . 8
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
D =400/1000; // m e t e r
v1 =20; //m/ s
Z1 =28; // m e t e r
Z2 =31; // m e t e r
p1 =4/10^ -4; // kg /m2
p2 =3/10^ -4; // kg /m2
g =9.81; // c o n s t a n t
w =1000; // kg /m3
Vhead1 = v1 ^2/2/ g ; // m e t e r
Phead1 = p1 / w ; // m e t e r
Vhead2 = Vhead1 ; // m e t e r
Phead2 = p2 / w ; // m e t e r
E1 = Z1 + Vhead1 + Phead1 ; // m e t e r
E2 = Z2 + Vhead2 + Phead2 ; // m e t e r
HL = E1 - E2 ; // m e t e r
disp ( HL , L o s s o f head b e t w e e n P & Q i n m e t e r : ) ;

Scilab code Exa 5.9 Head Loss and direction of flow


1 // Example 5 . 9
2 clc ;
3 clear ;
4 close ;
5 format ( v ,8) ;

46

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

29
30
31
32

33
34

// Given d a t a :
Z1 =0; // m e t e r
Z2 =4; // m e t e r
rho =0.8; // s p . g r a v i t y
Q =250*10^ -3; //m/ s o r cumec
D1 =250/1000; // m e t e r
D2 =500/1000; // m e t e r
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
v1 = Q / A1 ; //m/ s
v2 = Q / A2 ; //m/ s
p1 =0.1*10^3; //N/m2
p2 =0.06*10^3; //N/m2
g =9.81; // c o n s t a n t
Vhead1 = v1 ^2/2/ g ; // m e t e r
Phead1 = p1 / rho / g ; // m e t e r
Vhead2 = v2 ^2/2/ g ; // m e t e r
Phead2 = p2 / rho / g ; // m e t e r
H1 = Z1 + Vhead1 + Phead1 ; // m e t e r
H2 = Z2 + Vhead2 + Phead2 ; // m e t e r
if H1 > H2 then
disp ( T o t a l head a t A( + string ( H1 ) + m e t e r ) i s
g r e a t e r t h a n t o t a l head a t B( + string ( H2 ) +
m e t e r ) . Flow w i l l t a k e p l a c e from AB . ) ;
HeadLoss = H1 - H2 ; // m e t e r
disp ( HeadLoss , Head L o s s i n m e t e r : ) ;
else
disp ( T o t a l head a t B( + string ( H2 ) + m e t e r ) i s
g r e a t e r t h a n t o t a l head a t A( + string ( H1 ) +
m e t e r ) . Flow w i l l t a k e p l a c e from BA . ) ;
HeadLoss = H2 - H1 ; // m e t e r
disp ( HeadLoss , Head L o s s i n m e t e r : ) ; end

Scilab code Exa 5.10 Determine pressure intensity


47

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

// Example 5 . 1 0
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
Q =200*10^ -3; //m3/ s
D1 =250/1000; // m e t e r
D2 =200/1000; // m e t e r
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
v1 = Q / A1 ; //m/ s
v2 = Q / A2 ; //m/ s
Z1 =2; // m e t e r
Z2 =8; // m e t e r
g =9.81; // c o n s t a n t
w =1000; // kg /m3
p1 = w *( Z1 - v1 ^2/2/ g ) ; // kg /m2
p2 = v1 ^2/2/ g * w + p1 + Z2 *w - v2 ^2/2/ g *w -4* w ; // kg /m 2 ( by
B e r n o l l i s theorem )
p1 = p1 * g ; //N/m2
p2 = p2 * g ; //N/m2
disp ( p1 , P r e s s u r e i n t e n s i t y a t p o i n t P i n N/m2 : )
;
disp ( p2 , P r e s s u r e i n t e n s i t y a t p o i n t Q i n N/m2 : )
;
// Answer i n t h e book i s n o t a c c u r a t e .

Scilab code Exa 5.11 Intensity of pressure and discharge


1 // Example 5 . 1 1
2 clc ;
3 clear ;
4 close ;
5 format ( v ,8) ;

48

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// Given d a t a :
slope =1/10;
Z1 =0; // m e t e r
Z2 =40* slope ; // m e t e r
p1 =1.5/10^ -4; // kg /cm2
v2 =4.1; //m/ s
D1 =600/1000; // m e t e r
D2 =300/1000; // m e t e r
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
v1 = A2 * v2 / A1 ; //m/ s
g =9.81; // c o n s t a n t
w =1000; // kg /m3
p2 =( p1 / w + v1 ^2/2/ g + Z1 - v2 ^2/2/ g - Z2 ) * w ; // kg /m 2 ( by
B e r n o l l i s theorem )
p2 = p2 *10^ -4; // kg /cm2
Q1 = A1 * v1 ; //m3/ s e c
Q1 = Q1 *1000; // l i t r e / s e c
disp ( p2 , P r e s s u r e i n t e n s i t y a t p o i n t Q i n kg /cm2 :
);
disp ( Q1 , D i s c h a r g e o f p i p e i n l i t r e s / s e c : ) ;
// Answer i n t h e book i s n o t a c c u r a t e . c a l c u l a t i o n
f o r A1 & A2 i s wrong .

Scilab code Exa 5.12 Find discharge of oil


1
2
3
4
5
6
7
8
9

// Example 5 . 1 2
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D1 =180/1000; // m e t e r
D2 =90/1000; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
49

10
11
12
13
14
15
16
17
18
19
20

S =0.8; // s p . g r a v i t y o f o i l
Sm =13.6; // s p . g r a v i t y o f m e r c u r y
x =300/1000; // m e t e r
K =0.97; // c o e f f . o f m e t e r
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
C = A1 * A2 * sqrt (2* g ) / sqrt ( A1 ^2 - A2 ^2)
h = x *( Sm /S -1) ; // m e t e r o f o i l
Q = K * C * sqrt ( h ) ; //m3/ s e c
Q = Q *1000; // l i t r e / s e c
disp (Q , D i s c h a r g e o f o i l i n l i t r e s / s e c : ) ;

Scilab code Exa 5.13 Coefficient of meter


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Example 5 . 1 3
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
D1byD2 =1/0.7;
D1 =320/1000; // m e t e r
D2 =320*0.7/1000; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
Q =30.6/60; //m3/ s e c
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
C = A1 * sqrt (2* g ) / sqrt (( D1byD2 ) ^4 -1) ;
h =1.2; // m e t e r o f w a t e r
K = Q / C / sqrt ( h ) ; // C o e f f . o f m e t e r
disp (K , C o e f f i c i e n t o f m e t e r : ) ;
// Answer i n t h e book i s wrong .

50

Scilab code Exa 5.14 Deflection in manometer


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Example 5 . 1 4
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
D1 =320/1000; // m e t e r
D2 =224/1000; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
Q =25000/1000/60; //m3/ s e c
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
C =0.4984; // v e n t u r i c o n s t a n t
K =0.92; // C o e f f . o f m e t e r
h =( Q / K / C ) ^2
S =1; // s p . g r a v i t y
Sm =13.6; // s p . g r a v i t y
x = h /( Sm /S -1) ; // m e t e r o f w a t e r
disp ( x *1000 , D e f l e c t i o n i n manometer (mm) : ) ;

Scilab code Exa 5.15 Find pressure difference


1
2
3
4
5
6
7
8
9
10
11

// Example 5 . 1 5
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D1 =120/1000; // m e t e r
D2 =120*0.55/1000; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
51

12
13
14
15
16
17
18
19
20
21
22
23

Q =30/1000; //m3/ s e c
C = A1 * sqrt (2* g ) / sqrt (( D1 / D2 ) ^4 -1) ; // v e n t u r i c o n s t a n t
K =0.94; // C o e f f . o f m e t e r
h =( Q / K / C ) ^2; // m e t e r
Z1 =0; // m e t e r
Z2 =0.3; // m e t e r
S =0.79; // s p . g r a v i t y
w =1000* S ; // kg /m3
delta_p =( h + Z1 - Z2 ) * w ; // kg /m2
delta_p = delta_p * g ; //N/m2
disp ( delta_p , P r e s s u r e d i f f e r e n c e i n N/m2 : ) ;
// a n s w e r i s wrong i n t h e book .

Scilab code Exa 5.16 Deflection of oil mercury gauge


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Example 5 . 1 6
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D1 =160/1000; // m e t e r
D2 =60/1000; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
S =0.8; // s p . g r a v i t y
Sm =13.6; // s p . g r a v i t y o f m e r c u r y
Q =0.05; //m3/ s e c
K =0.98; // C o e f f . o f m e t e r
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
C = A1 * sqrt (2* g ) / sqrt (( A1 / A2 ) ^2 -1) ; // v e n t u r i c o n s t a n t
h =( Q / K / C ) ^2; // m e t e r
x = h /( Sm /S -1) ; // m e t e r
disp (x , D e f l e c t i o n i n m e t e r : ) ;

52

Scilab code Exa 5.17 Rate of flow


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Example 5 . 1 7
clc ;
clear ;
close ;
format ( v ,4) ;
// Given d a t a :
D1 =200/1000; // m e t e r
D2 =100/1000; // m e t e r
x =220/1000; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
K =0.98; // C o e f f . o f m e t e r
S =1; // s p . g r a v i t y
Sm =13.6; // s p . g r a v i t y o f m e r c u r y
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
C = A1 * sqrt (2* g ) / sqrt (( A1 / A2 ) ^2 -1) ; // v e n t u r i c o n s t a n t
h = x *( Sm /S -1) ; // m e t e r
Q = K * C * sqrt ( h ) ; //m3/ s e c
Q = Q *1000; // l i t r e s / s e c
disp (Q , Rate o f f l o w i n l i t r e s / s e c : ) ;

Scilab code Exa 5.18 Calculate flow water


1 // Example 5 . 1 8
2 clc ;
3 clear ;
4 close ;
5 format ( v ,8) ;
6 // Given d a t a :
7 D1 =40/100; // m e t e r

53

8
9
10
11
12
13
14
15
16
17
18
19
20
21

D2 =15/100; // m e t e r
x =25/100; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
K =0.98; // C o e f f . o f m e t e r
S =1; // s p . g r a v i t y
Sm =13.6; // s p . g r a v i t y o f m e r c u r y
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
C = A1 * A2 * sqrt (2* g ) / sqrt ( A1 ^2 - A2 ^2) ; // v e n t u r i c o n s t a n t
h = x *( Sm /S -1) ; // m e t e r
Q = K * C * sqrt ( h ) ; //m3/ s e c
Q = Q *1000*3600; // l i t r e s / h o u r
disp (Q , Flow o f w a t e r i n l i t r e s / h o u r : ) ;
// Answer i n t h e book i s wrong .

Scilab code Exa 5.19 Flow rate of water


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Example 5 . 1 9
clc ;
clear ;
close ;
format ( v ,4) ;
// Given d a t a :
D1 =15/100; // m e t e r
D2 =7.5/100; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
p1 =4* g *10^4; //N/m2
p2 =1.5* g *10^4; // kg /cm2
w =9.81; // kg /m2
A1 = %pi * D1 ^2/4; //m2
A2 = %pi * D2 ^2/4; //m2
v1BYv2 = A2 / A1 ;
// v1 2 / 2 / g+p1 /w=v2 2 / 2 / g+p2 /w
// v1 2= v2 2 50 g
v2 = sqrt (50* g /(1 - v1BYv2 ^2) ) ; //m/ s
54

19 Q = A2 * v2 ; //m3/ s e c
20 Q = Q *1000; // l i t r e s / s e c
21 disp (Q , Flow o f w a t e r i n l i t r e s / s e c
22 // Answer i s wrong i n t h e book .

: );

Scilab code Exa 5.20 Velocity and flow rate


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 5 . 2 0
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D1 =20/100; // m e t e r
D2 =15/100; // m e t e r
A1 = %pi /4* D1 ^2; //m2
A2 = %pi /4* D2 ^2; //m2
v1 =2; //m/ s
v2 = A1 * v1 / A2 ; //m/ s
disp ( v2 , V e l o c i t y a t a n o t h e r s e c t i o n i n m/ s : ) ;
FlowRate = A1 * v1 ; //m3/ s
FlowRate = FlowRate *1000; // l i t r e s / s
disp ( FlowRate , Flow Rate i n l i t r e s / s e c : ) ;
// Answer o f v e l o c i t y i n t h e book i s n o t a c c u r a t e .

Scilab code Exa 5.21 Flow rate of oil


1 // Example 5 . 2 1
2 clc ;
3 clear ;
4 close ;
5 format ( v ,4) ;
6 // Given d a t a :

55

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

rd =0.75; // r e l a t i v e d e n s i t y
D =12.5/100; // m e t e r
p =1; // b a r
p = p *1.02; // kg /cm2
p = p *9.81*10^4/1000; // kPa
g =9.81; // g r a v i t y c o n s t a n t
w = g * rd ; //N/m3
pH = p / w ; // m e t e r
Z =2.5; // m e t e r
Et =20; //Nm
v = sqrt (( Et - p /w - Z ) *2* g ) ; //m/ s
A = %pi /4* D ^2; //m2
Q = A * v ; //m3/ s e c
Q = A * v *1000; // l i t r e s / s e c
disp (Q , Flow Rate o f o i l i n l i t r e s / s e c : ) ;

Scilab code Exa 5.22 Find Z


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 5 . 2 2
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
rd =0.75; // r e l a t i v e d e n s i t y
d1 =0.3; // m e t e r
d2 =0.1; // m e t e r
Q =50/1000; //m3/ s e c
A1 = %pi /4* d1 ^2; //m2
A2 = %pi /4* d2 ^2; //m2
v1 = Q / A1 ; //m/ s
v2 = A1 * v1 / A2 ; //m/ s
p1 =200; //kN/m2
p2 =100; //kN/m2
w =9.81; //kN/m3
56

18 g =9.81; // g r a v i t y c o n s t a n t
19 Z1 =0; // m e t e r
20 Z2 = Z1 + p1 / w + v1 ^2/2/ g - p2 /w - v2 ^2/2/ g ; // m e t e r
21 disp ( Z2 , Z i n m e t e r : ) ;

Scilab code Exa 5.23 Discharge in the pipe


// Example 5 . 2 3
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D1 =300/1000; // m e t e r
D2 =150/1000; // m e t e r
Q =50/1000; //m3/ s e c
A1 = %pi /4* D1 ^2; //m2
A2 = %pi /4* D2 ^2; //m2
delpBYw =3; // p1 /wp2 /w=3;//m
v1BYv2 = A2 / A1 ;
Z1 =0; // m e t e r
Z2 =0; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t
// HeadLoss =1/8 v 2 / 2 / g
// Z1+p1 /w+v1 2 / 2 / g=Z2+p2 /w+v2 2 / 2 / g+HeadLoss
v2 = sqrt (( Z1 - Z2 + delpBYw ) /(1/2/ g - v1BYv2 ^2/2/ g +1/8/2/ g )
) ; //m/ s
20 Q = A2 * v2 ; //m3/ s
21 Q = Q *1000; // l i t r e s / s e c
22 disp (Q , D i s c h a r g e i n p i p e i n l i t r e s / s e c : ) ;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

57

Chapter 6
Orifices

Scilab code Exa 6.1 Calculate Coefficients


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// Example 6 . 1
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
Do =25; //mm
Dc =20; //mm
H =85; //mm
x =335; //mm
y =350; //mm
a = %pi /4* Do ^2; //m2
ac = %pi /4* Dc ^2; //m2
Cc = ac / a ;
disp ( Cc , C o e f f i c i e n t
Cv = sqrt ( x ^2/4/ H / y ) ;
disp ( Cv , C o e f f i c i e n t
Cd = Cc * Cv ;
disp ( Cd , C o e f f i c i e n t
Cr =(1/ Cv ^2 -1) ;
disp ( Cr , C o e f f i c i e n t

o f c o n t r a c t i o n : );
o f v e l o c i t y : );
o f d i s c h a r g e : );
o f r e s i s t a n c e : );
58

Scilab code Exa 6.2 Calculate various Coefficients


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

// Example 6 . 2
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
Do =0.125; //m
H =10.5; //mm
Q =6500; // l i t r e s / m i n u t e
Q = Q /60/1000; // cumec
x =6; //m
y =1; //m
g =9.81; // g r a v i t y c o n s t a n t
a = %pi /4* Do ^2; //m2
Qth = a * sqrt (2* g * H ) ; // cumec
Cd = Q / Qth ; //
disp ( Cd , C o e f f i c i e n t o f d i s c h a r g e : ) ;
Cv = sqrt ( x ^2/4/ H / y ) ;
format ( v ,6) ;
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;
Cc = Cd / Cv ;
format ( v ,5) ;
disp ( Cc , C o e f f i c i e n t o f c o n t r a c t i o n : ) ;
Cr =(1/ Cv ^2 -1) ;
format ( v ,6) ;
disp ( Cr , C o e f f i c i e n t o f r e s i s t a n c e : ) ;

Scilab code Exa 6.3 Coefficient of velocity

59

1
2
3
4
5
6
7
8
9
10
11

// Example 6 . 3
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
g =9.81; // c o n s t a n t
h =102; //mm
H =105; //mm
Cv = sqrt (2* g * h ) / sqrt (2* g * H ) ;
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;

Scilab code Exa 6.4 Coefficient of velocity


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Example 6 . 4
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
Q =180/62; // l i t r e s / s e c
Q = Q /1000; // cumec
Dc =25/1000; //m
H =1.9; //m
ac = %pi /4* Dc ^2; //m2
g =9.81; // c o n s t a n t
Cv = Q / sqrt (2* g * H ) / ac ;
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;

Scilab code Exa 6.5 Various hydraulic coefficients


1 // Example 6 . 5
2 clc ;

60

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // c o n s t a n t
d =30/1000; // m e t e r
wl =2; //kgm
w1 =148.6/60; // kg / s e c
y =1.65; // m e t e r
H =1.3; // m e t e r
Cv = wl / w1 / y * sqrt ( g ) / sqrt (2* H ) ;
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;
Q = w1 /1000; // Cumec
a = %pi /4* d ^2; // m e t e r 2
Qth = a * sqrt (2* g * H ) ; // Cumec
Cd = Q / Qth ; // c o e f f . o f d i s c h a r g e
disp ( Cd , C o e f f i c i e n t o f d i s c h a r g e : ) ;
Cc = Cd / Cv ; // c o e f f . o f c o n t r a c t i o n
format ( v ,5) ;
disp ( Cc , C o e f f i c i e n t o f c o n t r a c t i o n : ) ;
// Answer i n t h e book a r e n o t a c c u r a t e .

Scilab code Exa 6.6 Various hydraulic coefficients


1
2
3
4
5
6
7
8
9
10
11

// Example 6 . 6
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
g =9.81; // c o n s t a n t
a =9*10^ -4; //m2
H =3; // m e t e r
x =2.5; // m e t e r
y =54/100; // m e t e r
61

12
13
14
15
16
17
18
19
20

Qactual =250*10^ -3/60; // Cumec


Qth = a * sqrt (2* g * H ) ; // Cumec
Cd = Qactual / Qth ; // c o e f f . o f d i s c h a r g e
disp ( Cd , C o e f f i c i e n t o f d i s c h a r g e : ) ;
Cv = sqrt ( x ^2) / sqrt (4* H * y ) ; // v e l o c i t y
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;
Cc = Cd / Cv ; // c o e f f . o f c o n t r a c t i o n
disp ( Cc , C o e f f i c i e n t o f c o n t r a c t i o n : ) ;
// Answer i n t h e book a r e n o t a c c u r a t e .

Scilab code Exa 6.7 Coefficient of discharge


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 6 . 7
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
g =9.81; // c o n s t a n t
d =20/1000; // m e t e r
a = %pi /4* d ^2; //m2
H =1; // m e t e r
Qactual =0.85*10^ -3; //m3/ s e c
v = sqrt (2* g * H ) ; //m/ s e c
Qth = a * v ; // Cumec
Cd = Qactual / Qth ; // c o e f f . o f d i s c h a r g e
disp ( Cd , C o e f f i c i e n t o f d i s c h a r g e : ) ;

Scilab code Exa 6.8 Coefficients of orifice


1 // Example 6 . 8
2 clc ;
3 clear ;

62

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // c o n s t a n t
d =1.5; // m e t e r
h =1; // m e t e r
Volume = %pi /4* d ^2* h ; //m3
time =25; // s e c
Qactual = Volume / time ; // Cumec
H =10; // m e t e r
do =10/100; // m e t e r
x =4.3; // m e t e r
y =0.5; // m e t e r
ao = %pi /4* do ^2; //m2
Qth = ao * sqrt (2* g * H ) ; // cumec
Cd = Qactual / Qth ; // C o e f f . o f d i s c h a r g e
disp ( Cd , C o e f f i c i e n t o f d i s c h a r g e : ) ;
format ( v ,5) ;
Cv = sqrt ( x ^2) / sqrt (4* H * y ) ; // C o e f f i c i e n t o f v e l o c i t y
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;
Cc = Cd / Cv ; // c o e f f . o f c o n t r a c t i o n
disp ( Cc , C o e f f i c i e n t o f c o n t r a c t i o n : ) ;
Cr_dash =(1/ Cv ^2 -1) ; // c o e f f . o f r e s i s t a n c e
disp ( Cr_dash , C o e f f i c i e n t . o f R e s i s t a n c e ) ;

Scilab code Exa 6.9 Various hydraulic coefficients


1 // Example 6 . 9
2 clc ;
3 clear ;
4 close ;
5 format ( v ,5) ;
6 // Given d a t a :
7 g =9.81; // c o n s t a n t
8 do =2.5/100; // m e t e r

63

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

H =75/100; // m e t e r
x =30/100; // m e t e r
y =3.2/100; // m e t e r
Qactual =1.186*10^ -3; // Cumec
ao = %pi /4* do ^2; //m2
Qth = ao * sqrt (2* g * H ) ; // cumec
Cd = Qactual / Qth ; // C o e f f . o f d i s c h a r g e
disp ( Cd , C o e f f i c i e n t o f d i s c h a r g e : ) ;
Cv = sqrt ( x ^2) / sqrt (4* H * y ) ; // C o e f f i c i e n t o f v e l o c i t y
format ( v ,7) ;
disp ( Cv , C o e f f i c i e n t o f v e l o c i t y : ) ;
format ( v ,6) ;
Cc = Cd / Cv ; // c o e f f . o f c o n t r a c t i o n
disp ( Cc , C o e f f i c i e n t o f c o n t r a c t i o n : ) ;
Cr_dash =(1/ Cv ^2 -1) ; // c o e f f . o f r e s i s t a n c e
disp ( Cr_dash , C o e f f i c i e n t . o f R e s i s t a n c e ) ;
// Answers i n t h e book a r e n o t a c c u r a t e .

Scilab code Exa 6.10 Meeting point of two jets


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 6 . 1 0
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
g =9.81; // c o n s t a n t
H1 =4 -1; // m e t e r
H2 =4; // m e t e r
Cv1 =0.9; // C o e f f i c i e n t o f v e l o c i t y
Cv2 =0.9; // C o e f f i c i e n t o f v e l o c i t y
// Cv1=Cv2 & x1=x2 a t m e e t i n g p o i n t
// x1 / s q r t ( 4 H1 y1 )=x2 / s q r t ( 4 H2 y2 )
y1BYy2 = H2 / H1 ;
// y1=1+y2 ;
64

16 y2 =1/( y1BYy2 -1) ; // m e t e r


17 y1 = y1BYy2 * y2 ; // m e t e r
18 x1 = Cv1 * sqrt (4* H1 * y1 ) ; // m e t e r
19 disp ( y1 , x1 , M e e t i n g p o i n t h o r i z o n t a l & v e r t i c a l co

o r d i n a t e s a r e ( x1 & y1 i n m e t e r ) : ) ;
20 // Answer i n t h e book a r e n o t a c c u r a t e .

Scilab code Exa 6.11 Discharge through the orifice


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 6 . 1 1
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
g =9.81; // c o n s t a n t
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
B =1.3; // m e t e r
H1 =6 -(1.8+1.5) ; // m e t e r
H2 =6 -1.5; // m e t e r
Q =2/3* Cd * B * sqrt (2* g ) *( H2 ^(3/2) - H1 ^(3/2) ) ; //m3/ s e c
disp (Q , D i s c h a r g e t h r o u g h t h e o r i f i c e i n m3/ s e c :
);

Scilab code Exa 6.12 Discharge through orifice


1 // Example 6 . 1 2
2 clc ;
3 clear ;
4 close ;
5 format ( v ,7) ;
6 // Given d a t a :
7 g =9.81; // c o n s t a n t

65

Cd =0.62; // C o e f f i c i e n t o f d i s c h a r g e
B =2; // m e t e r
H1 =3; // m e t e r
H2 =3+1.5; // m e t e r
Q =2/3* Cd * B * sqrt (2* g ) *( H2 ^(3/2) - H1 ^(3/2) ) ; //m3/ s e c
o r cumec
13 disp (Q , D i s c h a r g e t h r o u g h t h e o r i f i c e i n cumec : ) ;
8
9
10
11
12

Scilab code Exa 6.13 Calculate percentage error


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Example 6 . 1 3
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
g =9.81; // c o n s t a n t
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
B =1.6; // m e t e r
H1 =1500/1000; // m e t e r
H2 =(1500+1250) /1000; // m e t e r
Q =2/3* Cd * B * sqrt (2* g ) *( H2 ^(3/2) - H1 ^(3/2) ) ; //m3/ s e c
o r cumec
disp (Q , D i s c h a r g e t h r o u g h t h e o p e n i n g i n cumec : ) ;
// For s m a l l o p e n i n g
H =1.5+1.25/2; // m e t e r
D =1.25; // m e t e r
Qdash = Cd *( B * D ) * sqrt (2* g * H ) ; // cumec
Error =( Qdash - Q ) / Q *100; //%
disp ( Error , % o f e r r o r : ) ;
// Answer i s wrong i n t h e book .

Scilab code Exa 6.14 Discharge through orifice


66

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 6 . 1 4
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // c o n s t a n t
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
B =1600/1000; // m e t e r
D =1250/1000; // m e t e r
ao =1.6*1.25; //m2
H1 =2+1.25/2; // m e t e r
H2 =0.8+1.25/2; // m e t e r
H = H1 - H2 ; // m e t e r
Q = Cd * ao * sqrt (2* g * H ) ; //m3/ s e c o r Cumec
disp (Q , D i s c h a r g e i n Cumec : ) ;
// Answer i s wrong i n t h e book .

Scilab code Exa 6.15 Discharge through orifice


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 6 . 1 5
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
g =9.81; // c o n s t a n t
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
B =1600/1000; // m e t e r
D =1250/1000; // m e t e r
ao =1.6*1.25; //m2
H1 =2+1.25; // m e t e r
H2 =2; // m e t e r
H = H1 -0.8; // m e t e r
Q =2/3* Cd * B * sqrt (2* g ) *( H ^(3/2) - H2 ^(3/2) ) + Cd * B *( H1 - H ) *
67

sqrt (2* g * H ) ; //m3/ s e c o r Cumec


16 disp (Q , D i s c h a r g e t h r o u g h t h e o r i f i c e i n Cumec : ) ;

Scilab code Exa 6.16 Find time taken


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Example 6 . 1 6
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // c o n s t a n t
d =4; // m e t e r
d0 =0.5; // m e t e r
H1 =5; // m e t e r
H2 =2; // m e t e r
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
ao = %pi /4* d0 ^2; //m2
A = %pi /4* d ^2; //m2
t =2* A / Cd / ao / sqrt (2* g ) *( sqrt ( H1 ) - sqrt ( H2 ) )
disp (t , Time t a k e n t o f a l l from 5m t o 2m( i n s e c o n d s )
: );
// For e m p t y i n g H2=0;
H2 =0; // m e t e r
t =2* A / Cd / ao / sqrt (2* g ) *( sqrt ( H1 ) - sqrt ( H2 ) )
disp (t , Time t a k e n f o r c o m p l e t e l y e m p t y i n g ( i n
s e c o n d s ) : );

Scilab code Exa 6.17 Time of emptying the tank


1 // Example 6 . 1 7
2 clc ;
3 clear ;

68

4
5
6
7
8
9
10
11
12
13
14
15

close ;
format ( v ,5) ;
// Given d a t a :
g =9.81; // c o n s t a n t
d =1.2; // m e t e r
do =50/1000; // m e t e r
H =3; // m e t e r
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
ao = %pi /4* do ^2; //m2
A = %pi /4* d ^2; //m2
t =2* A * sqrt ( H ) / Cd / ao / sqrt (2* g ) ; // s e c
disp ( Time t a k e n f o r e m p t y i n g t h e t a n k i s + string (
floor ( t /60) ) + m i n u t e + string (( t /60 - floor ( t /60) )
*60) + s e c o n d s . ) ;

Scilab code Exa 6.18 Time required to bring down the level
1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Example 6 . 1 8
clc ;
clear ;
close ;
format ( v ,4) ;
// Given d a t a :
g =9.81; // c o n s t a n t
A =3.2; //m2
a =10*10^ -4; //m2
H1 =5; // m e t e r
H2 =2.5; // m e t e r
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
t =2* A *( sqrt ( H1 ) - sqrt ( H2 ) ) / Cd / a / sqrt (2* g ) ; // s e c
disp ( Time t a k e n i s + string ( floor ( t /60) ) + m i n u t e
+ string (( t /60 - floor ( t /60) ) *60) + s e c o n d s . ) ;

69

Scilab code Exa 6.19 Time required to empty the tank


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 6 . 1 9
clc ;
clear ;
close ;
format ( v ,4) ;
// Given d a t a :
g =9.81; // c o n s t a n t
A =3.2; //m2
a =10*10^ -4; //m2
H =5; // m e t e r
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
t =2* A * sqrt ( H ) / Cd / a / sqrt (2* g ) ; // s e c
disp ( Time t a k e n i s + string ( floor ( t /3600) ) + h o u r
+ string ( floor (( t /3600 - floor ( t /3600) ) *60) ) +
m i n u t e + string ((( t /3600 - floor ( t /3600) ) *60 - floor
(( t /3600 - floor ( t /3600) ) *60) ) *60) + s e c o n d s . ) ;

70

Chapter 7
Flow through pipes

Scilab code Exa 7.1 Relation between CGS and MKS unit
1 // Example 7 . 1
2 clc ;
3 clear ;
4 close ;
5 format ( v ,9) ;
6 disp ( P a r t ( i ) ) ;
7 disp ( A b s o l u t e u n i t o f
8
9
10
11
12
13
14
15
16
17

v i s c o s i t y ( i n C .G. S ) i s P o i s e .
);
disp ( P o i s e =1 dynes e c /cm2 ) ;
disp ( G r a v i t a t i o n a l u n i t o f v i s c o s i t y i s 1 gms e c /cm
2 . );
disp ( On e q u a t i n g we g e t , 1 gm = 981 dyne ) ;
// L e t x=1kgs e c /m2
x =1*10^3/10^4; // gs e c /cm2
x = x *981; // dynes e c /cm2 o r P o i s e ( P u t t i n g 1gm=981
dyne )
disp ( 1 kgs e c /m2 = + string ( x ) + P o i s e ) ;
one_Poise =1/ x ; // kgs e c /m2
one_Poise =1/ x *9.81; //Ns e c /m2 o r Pas e c ( a s 1Pa=1N/m
2)
disp ( 1 P o i s e = + string ( one_Poise ) + Ns e c /m2 o r
71

18
19
20
21
22
23
24
25
26
27
28

Pas e c ) ;
disp ( P a r t ( i i ) ) ;
disp ( K i n e m a t i c v i s c o s i t y = v i s c o s i t y /
s p e c i f i c g r a v i t y );
disp ( K i n e m a t i c v i s c o s i t y C .G. S u n i t i s cm2/ s e c . 1
cm2/ s e c =1 s t o k e ) ;
disp ( K i n e m a t i c v i s c o s i t y M. K . S u n i t i s m2/ s e c ) ;
// l e t x =1;//m2/ s e c
x =1; //m2/ s e c
x = x *10^4; //cm2/ s e c o r s t o k e s
disp ( 1 m2/ s e c = + string ( x ) + cm2/ s e c o r s t o k e ) ;
one_stoke =1/ x ; //m2/ s e c
disp ( 1 s t o k e = + string ( one_stoke ) + m2/ s e c ) ;
disp ( 1 s t o k e = 100 c e n t i s t o k e s ) ;

Scilab code Exa 7.2 Kinematic viscosity and Reynolds number


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 7 . 2
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
mu =0.009; // kgs e c /m2
rho =0.89; // s p . g r a v i t y
Q =4*10^ -3; //m3/ s e c
d =30/1000; // m e t e r
v = mu / rho ; //m2/ s
disp (v , K i n e m a t i c v i s c o s i t y i n m2/ s e c : ) ;
A = %pi * d ^2/4; //m2
vm = Q / A ; //m/ s
Rn = vm * d / v ; // R e y n o l d s no .
disp ( Rn , R e y n o l d s number f o r f l o w
: );
disp ( T h i s i s l a m i n a r f l o w b e c a u s e Rn no . i s l e s s
than 2 0 0 0 . );
72

Scilab code Exa 7.3 Calculate reynolds number


// Example 7 . 3
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
d =200/1000; // m e t e r
Q =40*10^ -3; //m3/ s e c
A = %pi * d ^2/4; //m2
vm = Q / A ; //m/ s
v =0.25*10^ -4; //m2/ s
Rn = vm * d / v ; // R e y n o l d s no .
disp ( Rn , R e y n o l d s number f o r f l o w
: );
disp ( T h i s i s t u r b u l e n t f l o w b e c a u s e Rn no . i s
g r e a t e r than 4 0 0 0 . );
15 disp ( Rn /8 , New R e y n o l d s number f o r f l o w
: );
16 disp ( T h i s i s l a m i n a r f l o w b e c a u s e Rn no . i s l e s s
than 2 0 0 0 . );

1
2
3
4
5
6
7
8
9
10
11
12
13
14

Scilab code Exa 7.4 Head Lost due to friction


1 // Example 7 . 4
2 clc ;
3 clear ;
4 close ;
5 format ( v ,7) ;
6 // Given d a t a :
7 D =30/100; // m e t e r
8 L =100; // m e t e r

73

9
10
11
12
13
14
15
16

v =0.01*10^ -4; //m2/ s


a =3; //m/ s
g =9.81; // g r a v i t y c o n s t a n t y
Rn = a * D / v ; // R e y n o l d s no .
f =0.079/ Rn ^(1/4) ; // u s i n g b l a s i u s f o r m u l a
hf =4* f * L / D * a ^2/2/ g ; // m e t e r
disp ( hf , Head l o s t i n m e t e r : ) ;
// Answer i n t h e book i s wrong .

Scilab code Exa 7.5 Difference in elevations


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// // Example 7 . 5
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D =30/100; // m e t e r
L =500; // m e t e r
Q =300*10^ -3; //m2/ s e c
f =0.0008; // c o e f f . o f f r i c t i o n
v = Q /( %pi /4* D ^2) ; //m/ s
g =9.81; // g r a v i t y c o n s t a n t y
hf =4* f * L * v ^2/ D /2/ g ; // m e t e r
disp ( hf , D i f f e r e n c e i n e l e v a t i o n i n m e t e r : ) ;
// Answer i n t h e book i s wrong .

Scilab code Exa 7.6 Head Lost due to friction


1 // // Example 7 . 6
2 clc ;
3 clear ;
4 close ;

74

5
6
7
8
9
10
11
12
13
14
15

format ( v ,6) ;
// Given d a t a :
D =20/100; // m e t e r
v =3; //m/ s
v1 =0.01*10^ -3; //m2/ s e c
Re = D * v / v1 ; // R e y n o l d s number
f =0.002+0.09/ Re ^0.3; // c o e f f . o f f r i c t i o n
L =5; // m e t e r
g =9.81; // g r a v i t y c o n s t a n t y
hf =4* f * L * v ^2/ D /2/ g ; // m e t e r
disp ( hf , Head l o s t due t o f r i c t i o n i n m e t e r : ) ;

Scilab code Exa 7.7 Loss of head due to friction


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// // Example 7 . 7
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
D =80/1000; // m e t e r
Q =600*10^ -3/60; //m3/ s e c
L =1*10^3; // m e t e r
f =0.02; // c o e f f i c i e n t o f f r i c t i o n
v = Q /( %pi /4* D ^2) ; //m/ s
g =9.81; // g r a v i t y c o n s t a n t y
hf =4* f * L * v ^2/ D /2/ g ; // m e t e r
disp ( hf , Head l o s t due t o f r i c t i o n i n m e t e r : ) ;
// Answer i s wrong i n t h e book .

Scilab code Exa 7.8 Various losses


1

// // Example 7 . 8
75

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t y
f =0.02; // c o e f f i c i e n t o f f r i c t i o n
Cc =0.62; // c o e f f i c i e n t o f c o n t r a c t i o n
// P o r t i o n AB
Q1 =50*10^ -3; //m3/ s e c
D1 =150/1000; // m e t e r
v1 = Q1 /( %pi /4* D1 ^2) ; //m/ s
hr =0.5* v1 ^2/2/ g ; // m e t e r
L1 =200; // m e t e r
hf1 =4* f * L1 * v1 ^2/2/ g / D1 ; // m e t e r
D2 =200/1000; // m e t e r
v2 = Q1 /( %pi /4* D2 ^2) ; //m/ s
hc1 =( v1 - v2 ) ^2/2/ g ; // m e t e r
L2 =500; // m e t e r
hf2 =4* f * L2 * v2 ^2/2/ g / D2 ; // m e t e r
d =75/1000; // m e t e r
ho =[( %pi /4* D2 ^2) / Cc /(( %pi /4* D2 ^2) -( %pi /4* d ^2) ) -1]^2*
v2 ^2/2/ g ; // m e t e r
D3 =120/1000; // m e t e r
v3 = Q1 /( %pi /4* D3 ^2) ; //m/ s
hc2 = v3 ^2/2/ g *(1/ Cc -1) ^2; // m e t e r
L3 =500; // m e t e r
hf3 =4* f * L3 * v3 ^2/2/ g / D3 ; // m e t e r
Kb =0.25; // assumed
hb1 = Kb * v3 ^2/2/ g ; // m e t e r
D4 =120/1000; // m e t e r
v4 = Q1 /( %pi /4* D4 ^2) ; //m/ s
L4 =500; // m e t e r
hf4 =4* f * L4 * v4 ^2/2/ g / D4 ; // m e t e r
hb2 = Kb * v3 ^2/2/ g ; // m e t e r
L5 =500; // m e t e r
hf5 =4* f * L5 * v4 ^2/2/ g / D4 ; // m e t e r
h_outlet = v3 ^2/2/ g ; // m e t e r
76

39

h_total = hr + hf1 + hc1 + hf2 + ho + hc2 + hf3 + hb1 + hf4 + hb2 + hf5 +
h_outlet ; // m e t e r
40 disp ( h_total , T o t a l l o s s o f head i n m e t e r : ) ;

Scilab code Exa 7.9 Intensity of pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// // Example 7 . 9
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t y
Cc =0.62; // c o e f f i c i e n t o f c o n t r a c t i o n
D1 =150/1000; // m e t e r
D2 =100/1000; // m e t e r
Q =2.7/60; //m3/ s e c
p1 =0.8*10^4; // kg /m2
v1 = Q /( %pi /4* D1 ^2) ; //m/ s
v2 = Q /( %pi /4* D2 ^2) ; //m/ s
hc = v2 ^2/2/ g *(1/ Cc -1) ^2; // m e t e r
w =1000; // kg /m3
p2 =( v1 ^2/2/ g + p1 /w - v2 ^2/2/ g - hc ) * w ; // kg /m 2 ( Z1=Z2 )
p2 = p2 *10^ -4; // kg /cm2
disp ( p2 , I n t e n s i t y o f p r e s s u r e i n kg /cm2 : ) ;

Scilab code Exa 7.10 Diameter of pipe


1 // // Example 7 . 1 0
2 clc ;
3 clear ;
4 close ;
5 format ( v ,5) ;

77

6
7
8
9
10
11
12
13
14
15
16

// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t y
L =3*1000; // m e t e r
hf =20; // m e t e r
Q =1; //m3/ s e c
f =0.02; // c o e f f . o f f r i c t i o n
// v=s q r t ( h f 2 g /4/ f /L/D) ; / / i t i s v 2D
D2v = Q /( %pi /4) ; // i t i s D2 v
D =( Q /( %pi /4) / sqrt ( hf *2* g /4/ f / L ) ) ^(2/5) ; // m e t e r
D = D *1000; //mm
disp (D , D i a m e t e r o f p i p e i n mm
: );

Scilab code Exa 7.11.a Discharge and velocity


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// // Example 7 . 1 1 a t p a g e 246
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t y
D1 =400/1000; // m e t e r
D2 =300/1000; // m e t e r
D3 =200/1000; // m e t e r
v1 =3; //m/ s
v2 =2; //m/ s
A1 = %pi /4* D1 ^2; //m2
A2 = %pi /4* D2 ^2; //m2
A3 = %pi /4* D3 ^2; //m2
Q1 = A1 * v1 ; // cumec
disp ( Q1 , D i s c h a r g e i n p i p e 1 i n cumec : ) ;
Q2 = A2 * v2 ; // cumec
Q3 = Q1 - Q2 ; // cumec
v3 = Q3 / A3 ; //m/ s
disp ( v3 , V e l o c i t y o f w a t e r i n 200mm p i p e i n m/ s : )
78

Scilab code Exa 7.11 Calculate the pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

// // Example 7 . 1 1
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t y
D1 =100/1000; // m e t e r
D2 =200/1000; // m e t e r
PQ =100; // m e t e r
QR =100; // m e t e r
slope =1/100; // upward s l o p e
Q =0.02; // cumec
p1 =2; // kg /cm 2 ( P r e s s u r e i n 100 mm d i a p i p e )
f =0.02; // u n i t l e s s
Q_P =100/100; // m e t e r ( P o i n t Q h i g h t r e s p e c t t o p o i n t P
)
Q_R =200/100; // m e t e r ( P o i n t Q h i g h t r e s p e c t t o p o i n t R
)
v1 = Q /( %pi /4* D1 ^2) ; //m/ s e c
v2 = Q /( %pi /4* D2 ^2) ; //m/ s e c
hf1 =4* f * PQ * v1 ^2/(2* g * D1 ) ; // m e t e r
hf2 =4* f * QR * v2 ^2/(2* g * D2 ) ; // m e t e r
hse =( v1 - v2 ) ^2/2/ g ; // m e t e r ( l o s s due t o s u d d e n
enlargement )
// S e c t i o n PQ
Z1P =0; // m e t e r ( Datum Head )
H1P = v1 ^2/2/ g ; // m e t e r ( v e l o c i t y Head )
p1BYw = p1 *10^4/1000; // m e t e r ( P r e s s u r e Head a t P)
Z1Q =1; // m e t e r ( Datum Head )
H1Q = v2 ^2/2/ g ; // m e t e r ( v e l o c i t y Head )
79

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

// A p p l y i n g b e r n a u l l i s t h e o r e m
p2BYw = Z1P + p1BYw + H1P - Z1Q - H1Q - hf1 ; // m e t e r ( P r e s s u r e
Head a t Q)
disp ( p1BYw , P r e s s u r e Head a t p o i n t P(m) )
disp ( H1P , V e l o c i t y Head a t p o i n t P(m) )
disp ( p2BYw , P r e s s u r e Head a t p o i n t Q(m) )
// S e c t i o n QR
// A p p l y i n g b e r n a u l l i s t h e o r e m
p2dashBYw = p2BYw + H1P - H1Q - hse ; // m e t e r ( P r e s s u r e Head a t
Q)
Z2 =1; // m e t e r ( Datum Head )
H1Q = v2 ^2/2/ g ; // m e t e r ( v e l o c i t y Head )
Z3 =2; // m e t e r ( Datum Head a t R)
H1R = v2 ^2/2/ g ; // m e t e r ( v e l o c i t y Head a t R)
// A p p l y i n g b e r n a u l l i s t h e o r e m
p3BYw = Z2 + p2dashBYw + H1Q - Z3 - H1R - hf2 ; // m e t e r ( P r e s s u r e
Head a t R)
disp ( H1Q , V e l o c i t y Head a t p o i n t Q a f t e r e n l a r g e m a n t
(m) )
disp ( p2dashBYw , P r e s s u r e Head a t p o i n t Q a f t e r
e n l a r g e m a n t (m) )
disp ( p3BYw , P r e s s u r e Head a t p o i n t R(m) )
disp ( H1R , V e l o c i t y Head a t p o i n t R(m) )
// Answer i n t h e book i s wrong f o r some c a l c u l a t i o n s .

Scilab code Exa 7.12 Discharge through 300mm pipe


1 // // Example 7 . 1 2
2 clc ;
3 clear ;
4 close ;
5 format ( v ,6) ;
6 // Given d a t a :
7 g =9.81; // g r a v i t y c o n s t a n t y
8 D1 =100/1000; // m e t e r

80

9
10
11
12
13
14
15

D2 =300/1000; // m e t e r
Q1 =0.01; //m3/ s e c
A1 = %pi /4* D1 ^2; //m2
A2 = %pi /4* D2 ^2; //m2
// h f 1=h f 2
Q2 = sqrt ( D2 /( D1 ) *( Q1 / A1 ) ^2* A2 ^2) ; // cumec
disp ( Q2 , D i s c h a r g e t h r o o u g h 300mm p i p e i n cumec : )
;

Scilab code Exa 7.13 Discharge in pipe line


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// // Example 7 . 1 3
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t y
f =0.02; // c o e f f . o f f r i c t i o n
PQ =500; // m e t e r
QR =1000; // m e t e r
RS =500; // m e t e r
hf =10+ PQ /62.5+ QR /125 - RS /100 -2; // m e t e r
l =500+1000+500; // / m e t e r
D =250/1000; // m e t e r
v = sqrt ( hf *2* g * D /4/ f / l ) ; //m/ s
Q = %pi /4* D ^2* v ; //m3/ s e c
Q = Q *1000; // l i t r e s / s e c
disp (Q , D i s c h a r g e i n p i p e l i n e i n l i t r e s / s e c : ) ;

Scilab code Exa 7.14.a Diameter of pipe line


1

// // Example 7 . 1 4 a t p a g e no . 250
81

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
l =4; //km
n =5000; // h a b i t a n t s
Ch =200; // l i t r e s / day ( h a b i t a n t c a p a c i t y )
t =10; // h o u r ( d a i y s u p p l y t i m e )
hf =20; // m e t e r ( Head l o s s )
f =0.008; // c o e f f . o f f r i c t i o n
Qty = n * Ch /2; // l i t r e s ( Water s u p p l i e d i n 10 h o u r s )
Q = Qty /( t *60*60) ; // l i t r e s / s e c
Q = Q /1000; //m3/ s e c
d =( f * l *1000* Q ^2/3.0257/ hf ) ^(1/5) ; // m e t e r
disp ( d *1000 , D i a m e t e r o f p i p e (mm) : ) ;

Scilab code Exa 7.14 Discharge in pipe line


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// // Example 7 . 1 4
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
slope =1/125; // s l o p e
hA =12; // m e t e r ( l e v e l o f w a t e r i n r e s e r v o i r A)
hB =1.5; // m e t e r ( l e v e l o f w a t e r i n r e s e r v o i r B)
L1 =500; // m e t e r
D1 =250/1000; // m e t e r
L2 =1000; // m e t e r
D2 =200/1000; // m e t e r
L3 =500; // m e t e r
82

16 D3 =150/1000; // m e t e r
17 f =0.02; // c o e f f . o f f r i c t i o n
18 fall_level =( L1 + L2 + L3 ) * slope ; // m e t e r
19 H = hA + fall_level - hB ; // m e t e r ( Head a v a i l a b l e f o r f l o w )
20 v2BYv1 =( D1 / D2 ) ^2;
21 v3BYv1 =( D1 / D3 ) ^2;
22 //H=h f=h f 1+h f 2+h f 3
23 //H=(4 f L1 v1 2 / ( 2 g D1 ) +4 f L2 v2 2 / ( 2 g D2 ) +4 f

L3 v3 2 / ( 2 g D3 ) )
24 v1 = sqrt ( H /(4* f * L1 /(2* g * D1 ) +4* f * L2 * v2BYv1 ^2/(2* g * D2 )

+4* f * L3 * v3BYv1 ^2/(2* g * D3 ) ) ) ; //m/ s


25 Q = %pi * D1 ^2/4* v1 ; //m3/ s e c
26 Q = Q *1000; // l i t r e s / s e c
27 disp (Q , D i s c h a r g e i n p i p e l i n e i n l i t r e s / s e c : ) ;

Scilab code Exa 7.15.a Difference in water level


// // Example 7 . 1 5 a t p a g e no . 252
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
D =30/100; // m e t e r
l =400; // m e t e r
Q =300; // l i t r e s / s e c
f =0.008; // c o e f f . o f f r i c t i o n
Q = Q *10^ -3; //m3/ s e c
A = %pi * D ^2/4; //m2
v = Q / A ; //m/ s ( v e l o c i t y o f f l o w )
h1 =0.5* v ^2/2/ g ; // m e t e r ( Head l o s s a t e n t r a n c e t o a
pipe )
16 h2 =4* f * l * v ^2/(2* g * D ) ; // m e t e r ( Head l o s s due t o
friction )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

83

17 h3 = v ^2/2/ g ; // m e t e r ( Head l o s s

at entrance of

reservoir )
18 H = h1 + h2 + h3 ; // m e t e r ( D i f f e r e n c e o f w a t e r l e v e l )
19 disp (H , D i f f e r e n c e o f w a t e r l e v e l b e t w e e n two

r e s e r v o i r ( meter ) );
20 // Answer i n t h e book i s n o t a c c u r a t e a s h2 i s
c a l c u l a t e d wrong .

Scilab code Exa 7.15 Rate of flow and diameter


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// // Example 7 . 1 5
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
D1 =50/1000; // m e t e r
D2 =100/1000; // m e t e r
l1 =100; l2 =100; // m e t e r
hf1 =10; // m e t e r ( l e v e l d i f f e r e n c e )
f =0.008; // c o e f f . o f f r i c t i o n
Q2BYQ1 = sqrt (( l1 / l2 ) *( D2 / D1 ) ^5) ; // a s h f 1=h f 2
Q1 = sqrt ( hf1 / f / l1 *(3.0257* D1 ^5) ) ; //m3/ s e c
Q2 = Q2BYQ1 * Q1 ; //m3/ s e c o r cumec
disp ( Q1 , Rate o f f l o w o f p i p e 1 (m3/ s e c ) ) ;
disp ( Q2 , Rate o f f l o w o f p i p e 2 (m3/ s e c ) ) ;
Q = Q1 + Q2 ; //m3/ s e c ( T o t a l D i s c h a r g e )
d =( f * l1 * Q ^2/3.0257/ hf1 ) ^(1/5) ; // m e t e r
disp ( d *1000 , D i a m e t e r o f s i n g l e p i p e (mm) : ) ;
// Answer i n t h e book i s n o t a c c u r a t e .

Scilab code Exa 7.16 Discharge through pipe


84

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// // Example 7 . 1 6
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
D =150/1000; // m e t e r
l =70; // m e t e r
H =2.6; // m e t e r ( head o f w a t e r )
f =0.01; // c o e f f . o f f r i c t i o n
// Applyong B e r n o u l l i s t h e o r e m
v = sqrt ( H *(2/ g *(1+0.5+4* f * l / D ) ) /4) ; //m/ s
Q = %pi * D ^2/4* v ; //m3/ s e c
Q = Q *1000; // l i t r e s / s e c
disp (Q , D i s c h a r g e t h r o u g h t h e p i p e ( l i t r e s / s e c ) ) ;

Scilab code Exa 7.17 Velocity discharge rate and energy


// // Example 7 . 1 7
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
Cv =0.97; // c o e f f i e c i e n t o f v e l o c i t y
Cc =0.95; // c o e f f i e c i e n t
Dn =50/1000; // m e t e r ( N o z z l e d i a m e t e r )
D =100/1000; // m e t e r ( P i p e d i a m e t e r )
p =6.867; //N/cm 2 ( P r e s s u r e a t t h e b a s e o f n o z z l e )
Hb = p *10^4/( g *1000) // m e t e r ( Head a t t h e b a s e o f n o z z l e
)
14 v = Cv * sqrt (2* g * Hb ) ; //m/ s ( v e l o c t y o f j e t )
15 disp (v , V e l o c i t y i n t h e j e t (m/ s ) ) ;

1
2
3
4
5
6
7
8
9
10
11
12
13

85

16
17
18
19
20
21
22

A = %pi /4* Dn ^2; //m 2 ( C r o s s s c t i o n o f j e t )


Q = Cc * A * v ; //m3/ s e c ( D i s c h a r g e )
Q = Q *1000; // l i t r e s / s e c
disp (Q , Rate o f d i s c h a r g e ( l i t r e s / s e c o n d ) ) ;
E = g *1000* Q /1000* Hb /1000; //kW( Energy t r a n s m i t t e d )
disp (E , Energy p e r s e c o n d n t h e j e t (kW) ) ;
// Answer i n t h e book i s n o t a c c u r a t e .

Scilab code Exa 7.18 Discharge in pipe and pressure


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// // Example 7 . 1 8
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
D =100/1000; // m e t e r ( P i p e d i a m e t e r )
L =700; // m e t e r ( T o t a l l e n g t h )
Lin =300; // m e t e r ( i n l e t l e n g t h )
hf =10; // m e t e r ( A v a i l a b l e head )
h =1.4; // m e t e r ( h e i g h t )
f =0.02; // c o e f f i c i e n t o f f r i c t i o n
v = sqrt ( hf *2* g * D /4/ f / L ) ; //m/ s
Q = %pi * D ^2/4* v *1000; // l i t r e s / s e c
disp (Q , D i s c h a r g e i n p i p e ( l i t r e s / s e c o n d ) ) ;
// A p p l y i n g B r n a u l l i s t h e o r e m
p1 =0; v1 =0; Z1 =0; // ( N e g l e c t i n g minor l o s s e s )
v2 = v ; //m/ s
Z2 = h ; // m e t e r
hf =4* f * Lin * v ^2/(2* g * D ) ; // m e t e r
p2BYw = - v2 ^2/2/ g - Z2 - hf ; // m e t e r o f w a t e r
hatm =10.3; // m e t e r ( A t m o s p h e r i c p r e s s u r e head )
habs = p2BYw + hatm ; // m e t e r ( A b s o l u t e p r e s s u r e head )
disp ( habs , P r e s s u r e a t t h e summit o f s i p h o n ( m e t e r ) )
86

Scilab code Exa 7.19.a Maximum Power


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// // Example 7 . 1 9 a t p a g e no . 265
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
l =10000; // m e t e r ( l e n g t h o f p i p e l i n e )
D =0.2; // m e t e r ( D i a m e t e r o f p i p e )
p =60*10^5; //N/m2
f =0.007; // c o e f f i c i e n t o f f r i c t i o n
w = g *1000; //N/m3
H = p / w ; // m e t e r
hf = H /3; // m e t e r ( f r i c t i o n head l o s s i s 1/3 r d )
v = sqrt ( hf *2* g * D /4/ f / l ) ; //m/ s
P = w * %pi * D ^2/4* v *( H - hf ) /1000; //kW
disp (P , Maximum power (kW) ) ;

Scilab code Exa 7.19 Increase in pressure Intensity


1
2
3
4
5
6
7
8
9

// // Example 7 . 1 9
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
g =9.81; // g r a v i t y c o n s t a n t
D =150/1000; // m e t e r ( P i p e d i a m e t e r )
Q =40; // l i t r e s / s e c ( r a t e o f d i s c h a r g e )
87

10
11
12
13
14

l =500; // m e t e r ( v a l v e d i s t a n c e )
T =0.5; // s e c o n d
v = Q /1000/( %pi /4* D ^2) ; //m/ s ( v e l o c i t y o f f l o w )
pi =1000/ g *( l * v / T ) ; // kg /m2
disp ( pi , I n c r e a s e i n p r e s s u r e i n t e n s i t y ( kg /m 2 ) ) ;

88

Chapter 11
Flow Measurement

Scilab code Exa 11.1 Velocity of flow


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 1 1 . 1
clc ;
clear ;
close ;
format ( v ,5) ;
// Given d a t a :
staticPHead =5; // m e t e r
stagnationPHead =6; // m e t e r
h = stagnationPHead - staticPHead ; // m e t e r
g =9.81; // c o n s t a n t
Cv =0.98; // C o e f f o f p i l o t t u b e
V = Cv * sqrt (2* g * h ) ; //m/ s
disp (V , V e l o c i t y o f f l o w i n m/ s e c : ) ;

Scilab code Exa 11.2 calculate Velocity


1 // Example 1 1 . 2
2 clc ;

89

3
4
5
6
7
8
9
10
11
12
13

clear ;
close ;
format ( v ,5) ;
// Given d a t a :
Cv =0.975; // C o e f f o f p i l o t t u b e
h =100/1000; // m e t e r
g =9.81; // c o n s t a n t
Sm =13.6; // Sp . g r a v i t y
S =0.86; // g r a v i t y o f t u r p i n r e
V = Cv * sqrt (2* g * h *( Sm /S -1) ) ; //m/ s
disp (V , V e l o c i t y i n m/ s e c : ) ;

Scilab code Exa 11.3 Rate of discharge of steam


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// Example 1 1 . 3
clc ;
clear ;
close ;
format ( v ,9) ;
// Given d a t a :
l =2; // m e t e r
d0 =0; // m e t e r
d1 =0.3; // m e t e r
d2 =1.0; // m e t e r
d3 =1.2; // m e t e r
d4 =1.6; // m e t e r
d5 =2.0; // m e t e r
d6 =1.4; // m e t e r
d7 =1.0; // m e t e r
d8 =0.4; // m e t e r
d9 =0.3; // m e t e r
d10 =0.2; // m e t e r
V0 =0; // m e t e r
V1 =0.5; // m e t e r
V2 =0.7; // m e t e r
90

V3 =0.8; // m e t e r
V4 =1.0; // m e t e r
V5 =1.2; // m e t e r
V6 =0.9; // m e t e r
V7 =0.8; // m e t e r
V8 =0.6; // m e t e r
V9 =0.5; // m e t e r
V10 =0.3; // m e t e r
Q = l /3*( d0 * V0 +4* d1 * V1 +2* d2 * V2 +4* d3 * V3 +2* d4 * V4 +4* d5 * V5
+2* d6 * V6 +4* d7 * V7 +2* d8 * V8 +4* d9 * V9 +2* d10 * V10 + d0 * V0 )
; //cum/ s e c
31 disp (Q , Rate o f d i s c h a r g e i n cum/ s e c : ) ;
22
23
24
25
26
27
28
29
30

Scilab code Exa 11.4 Find the discharge


1
2
3
4
5
6
7
8
9
10
11
12

// Example 1 1 . 4
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
Cd =0.62; // c o n s t a n t
H =0.12; // m e t e r
L =0.3; // m e t e r
g =9.81; // c o n s t a n t
Q =2/3* Cd * sqrt (2* g ) * L * H ^(3/2) ; //m3/ s
disp (Q , D i s c h a r g e i n m3/ s e c : ) ;

Scilab code Exa 11.5 Find the discharge


1 // Example 1 1 . 5
2 clc ;
3 clear ;

91

4
5
6
7
8
9
10
11
12
13

close ;
format ( v ,8) ;
// Given d a t a :
Cd =0.66; // c o n s t a n t
H =0.15; // m e t e r
L =0.40; // m e t e r
g =9.81; // c o n s t a n t
Q =2/3* Cd * sqrt (2* g ) * L * H ^(3/2) ; //m3/ s
disp (Q , D i s c h a r g e i n m3/ s e c : ) ;
disp ( Q *10^3 , D i s c h a r g e i n l i t r e s / s e c : ) ;

Scilab code Exa 11.6 Discharge over the notch


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 1 1 . 6
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
Cd =0.62; // c o n s t a n t
H =200/1000; // m e t e r
theta =90; // d e g r e e
g =9.81; // c o n s t a n t
Q =8/15* Cd * sqrt (2* g ) * tand ( theta /2) * H ^(5/2) ; //m3/ s
Q = Q *1000*60; // l i t r e s / m i n u t e
disp (Q , D i s c h a r g e i n l i t r e s / m i n u t e : ) ;

Scilab code Exa 11.7 Position of apex of notch


1 // Example 1 1 . 7
2 clc ;
3 clear ;
4 close ;

92

5
6
7
8
9
10
11
12
13
14
15

format ( v ,6) ;
// Given d a t a :
Cd =0.62; // c o n s t a n t
Q =250; // l i t r e s / s e c
Q = Q *10^ -3; //m3/ s
theta =90; // d e g r e e
g =9.81; // c o n s t a n t
d =1.3; // m e t e r
H =( Q /8*15/ Cd / sqrt (2* g ) / tand ( theta /2) ) ^(2/5) ; //m
h =d - H ; // m e t e r
disp (h , P o s i t i o n a b o v e t h e bed i n m e t e r : ) ;

Scilab code Exa 11.8 calculate time taken


// Example 1 1 . 8
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
Cd =0.65; // c o n s t a n t
A =220; //m2
g =9.81; // c o n s t a n t
l =30/100; // m e t e r
H1 =16.8/100; // m e t e r
H2 =6.8/100; // m e t e r
T = A /[2/3* Cd * l * sqrt (2* g ) ]* integrate ( h ( 3/2) , h ,H2
, H1 ) ; // s e c
14 disp ( Time t a k e n i s + string ( floor ( T /60) ) + m i n u t e
+ string (( T /60 - floor ( T /60) ) *60) + s e c . )
1
2
3
4
5
6
7
8
9
10
11
12
13

Scilab code Exa 11.9 Discharge flowing over the weir


93

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Example 1 1 . 9
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
H =0.40; // m e t e r
L =5; // m e t e r
disp ( ( i ) End c o n t r a c t i o n s a r e S u p p r e s s e d : ) ;
Q =1.84* L * H ^(3/2) ; //m3/ s
disp (Q , D i s c h a r g e i n m3/ s e c : ) ;
disp ( Q *1000 , D i s c h a r g e i n l i t r e s / s e c : ) ;
disp ( ( i i ) End c o n t r a c t i o n s a r e C o n s i d e r e d : ) ;
n =2;
Q =1.84*( L -0.1* n * H ) * H ^(3/2) ; //m3/ s
disp (Q , D i s c h a r g e i n m3/ s e c : ) ;
disp ( Q *1000 , D i s c h a r g e i n l i t r e s / s e c : ) ;

Scilab code Exa 11.10 Find the discharge


1
2
3
4
5
6
7
8
9
10
11
12

// Example 1 1 . 1 0
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
Cd =0.62; // C o e f f o f d i s c h a r g e
H =250/1000; // m e t e r
L =400/1000; // m e t e r
g =9.81; // g r a v i t y a c c e l e r a t i o n
Q =2/3* Cd * sqrt (2* g ) * L * H ^(3/2) ; //m3/ s o r cumec
disp (Q , D i s c h a r g e i n cumec : ) ;

94

Scilab code Exa 11.11 Discharge over cipoletti weir


1
2
3
4
5
6
7
8
9
10
11
12
13

// Example 6 . 1 1
clc ;
clear ;
close ;
format ( v ,8) ;
// Given d a t a :
g =9.81; // c o n s t a n t
Cd =0.6; // C o e f f i c i e n t o f d i s c h a r g e
B =1.3; // m e t e r
H1 =6 -(1.8+1.5) ; // m e t e r
H2 =6 -1.5; // m e t e r
Q =2/3* Cd * B * sqrt (2* g ) *( H2 ^(3/2) - H1 ^(3/2) ) ; //m3/ s e c
disp (Q , D i s c h a r g e t h r o u g h t h e o r i f i c e i n m3/ s e c :
);

Scilab code Exa 11.12 Find the maximum discharge


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Example 1 1 . 1 2
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
Cd =0.60; // C o e f f o f d i s c h a r g e
L =36; // m e t e r
H =1.1; // m e t e r
A =50; //m2
g =9.81; // g r a v i t y a c c e l e r a t i o n
Qmax =1.705* Cd * L * H ^(3/2) ; //m3/ s
disp ( Qmax , Maximum D i s c h a r g e i n m3/ s e c : ) ;
Va = Qmax / A ; //m/ s ( v e l o c i t y o f a p p r o a c h )
Q =1.705* Cd * L *[( H + Va ^2/2/ g ) ^(3/2) -( Va ^2/2/ g ) ^(3/2) ];
//m3/ s
95

16

disp (Q , New d i s c h a r g e c o n s i d e r i n g v e l o c i t y o f
a p p r o a c h i n m3/ s e c : ) ;

Scilab code Exa 11.13 Number of spillway


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// Example 1 1 . 1 3
clc ;
clear ;
close ;
format ( v ,7) ;
// Given d a t a :
w =1.5; //m
d =0.75; //m
Cd =0.64; // C o e f f o f d i s c h a r g e
QT =45; // cumec
h =8; // m e t e r
A = w * d ; //m2
g =9.81; // g r a v i t y a c c e l e r a t i o n
Q = Cd * A * sqrt (2* g * h ) ; //m3/ s e c
n = QT / Q ; // no . o f s p i l l w a y s
disp ( round ( n ) ,No . o f s p i l l w a y s : ) ;

Scilab code Exa 11.14 Calculate the discharge


1
2
3
4
5
6
7
8
9

// Example 1 1 . 1 4
clc ;
clear ;
close ;
format ( v ,6) ;
// Given d a t a :
B =1; // m e t e r
b =0.4; // m e t e r
H =0.57; // m e t e r
96

10
11
12
13
14
15

h =0.5; // m e t e r
A = B * H ; //m2
g =9.81; // g r a v i t y c o n s t a n t
a = b * h ; //m2
Q = A * a / sqrt ( A ^2 - a ^2) * sqrt (2* g *( H - h ) ) ; //m3/ s e c
disp (Q , D i s c h a r g e i n m3/ s e c : ) ;

97

Anda mungkin juga menyukai