Sei sulla pagina 1di 215

PIPEFLOWANALYSIS

DEVELOPMENTS I N WATER SCIENCE, 19

OTHER TITLES I N TH/SSERfES

1 G. BUGLIARELLO AND F. GUNTER


COMPUTER SYSTEMS A N D WATER RESOURCES

2 H.L. GOLTERMAN
PHYSIOLOGICAL LIMNOLOGY

3 Y.Y. HAIMES, W.A.HALL AND H.T. FREEDMAN


MULTIOBJECTIVE OPTIMIZATION I N WATER RESOURCES SYSTEMS:
THE SURROGATE WORTH TRADE-OFF-METHOD

4 J.J. FRIED
GROUNDWATER POLLUTION

5 N. RAJARATNAM
TURBULENT JETS

6 D. STEPHENSON
PIPELINE DESIGN FOR WATER ENGINEERS

7 v. HALEK AND J. YSVEC


GROUNDWATER HYDRAULICS

8 J.BALEK
HYDROLOGY A N D WATER RESOURCES I N TROPICAL AFRICA

9 T.A. McMAHON AND R.G. MElN


RESERVOIR CAPACITY A N D Y I E L D

10 G. KOVACS
SEEPAGE HYDRAULICS

1 1 W.H. GRAF AND C.H. MORTIMER (EDITORS)


HYDRODYNAMICS OF LAKES: PROCEEDINGS OF A SYMPOSIUM
12-13 OCTOBER 1978, LAUSANNE, SWITZERLAND
12 W. BACK AND D.A. STEPHENSON (EDITORS)
CONTEMPORARY HYDROGEOLOGY: THE GEORGE BURKE MAXEY MEMORIAL VOLUME
1 3 M.A. MARIGO AND J.N. LUTHIN
SEEPAGE A N D GROUNDWATER

14 D. STEPHENSON
STORMWATER HYDROLOGY A N D DRAINAGE

15 D. STEPHENSON
PlPLELlNE DESIGN FOR WATER ENGINEERS
(completely revised edition of Vol. 6 in the series)

16 w. BACK AND R. LETOLLE (EDITORS)


SYMPOSIUM ON GEOCHEMISTRY OF GROUNDWATER
17 A.H. EL-SHAARAWI (EDITOR) IN COLLABORATION WITH S.R. ESTERBY
TIME SERIES METHODS I N HYDROSCIENCES
18 J. BALEK
HYDROLOGY AND WATER RESOURCES I N TROPICAL REGIONS
Civil Engineering Department, University of the Witwatersrand,
1 Jan Smuts Avenue, 2001 Johannesburg, South Africa

ELSEVIER

Amsterdam - Oxford - New York - Tokyo 1984


ELSEVIER SCIENCE PUBLISHERS B.V.
Molenwerf 1
P.O. Box 21 1,1000 A E Amsterdam, The Netherlands

Distributors for the United States and Canada:

ELSEVIER SCIENCE PUBLISHING COMPANY INC.


52, Vanderbilt Avenue
New York, N Y 10017

ISBN 0444422838 (Vol. 19)


ISBN 0444-41669-2 (Series)

0 Elsevier Science Publishers B.V., 1984


All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or
transmitted in any form or by any means, electronic, mechanical, photocopying, recording or other-
wise, without the prior written permission of the publisher, Elsevier Science Publishers B.V., P.O.
Box 330, 1000 A H Amsterdam, The Netherlands

Printed i n The Netherlands


V

PREFACE

The advent of economical and simple micro computers has left no


excuse for engineers to avoid computer solutions to problems.
H y d r a u l i c e n g i n e e r s now h a v e t o o l s f o r model I i n g s t e a d y a n d u n s t e a d y
flows in complex pipe networks. Tedious graphical and analogue
simulations can be discarded with relief. T h i s book i s aimed a t the
water engineer who has to design water reticulation pipe networks,
trunk mains, pumping lines and storage reservoirs. The practising
engineer often tends to negelect the theoretical side, but when the
occasion arises he requires a rapid, simple answer to p r o b l e m s of
h e a d loss, d i s c h a r g e c a p a c i t y a n d p r e s s u r e s . The v a r i o u s c o m p u t a t i o n -
al methods available to him are summarized in this book, starting
with simple steady flow problems a n d a d v a n c i n g t h r o u g h slow motion
to w a t e r hammer i n complex networks. The s u b j e c t m a t t e r w i l l a l s o be
of use to students of hydraulic engineering and those contemplating
research in t h i s f i e l d .
The i t e r a t i v e t e c h n i q u e s f o r f l o w a n a l y s i s of p i p e n e t w o r k s such a s
the H a r d y Cross method a r e k n o w n to most water engineers and have
been applied extensively without the aid of computers. Some lesser
known techniques are in f a c t simpler to a p p l y o n computers, e.g. the
linear method. When it comes to unsteady flow, e.g. water hammer,
computer analysis i s much more r a p i d t h a n t h e o l d e r g r a p h i c a l method
and can account for many more factors such as column separation,
changes i n section a n d b r a n c h pipes. N u m e r i c a l methods f o r computers
are easy and accurate provided simple r u l e s a r e followed. T h i s book
condenses and compares various methods for analysing flows and
pressure v a r i a t i o n s in pipelines, whether they b e p u m p i n g systems o r
mu1 t i p l e reservoir gravity systems. Simple BASIC computer programs
are given in many c h a p t e r s a n d these w i l l s e r v e a s a b a s i s f o r more
comprehensive p r o g r a m s w h i c h t h e r e a d e r s h o u l d b e a b l e to w r i t e a f t e r
r e a d i n g t h i s book.
In addition to those on flow analysis, sections are given on
design of pipe systems using optimization programs, and operation
using computer simulation programs. An introduction to computer
graphics is given but the book does not cover structural d e s i g n of
pipes. That i s covered in a n o t h e r book b y the same a u t h o r , 'Pipeline
Design f o r Water E n g i n e e r s ' (Elsevier, 1981 1.
This Page Intentionally Left Blank
VII

CONTENTS PAGE

PREFACE
CHAPTER 1 HYDRAULICS AND HEAD LOSS EQUATIONS . . . . . . i
Basic Equations . . . . . . . . . . . . . . . . . . . . . 1
Flow-Head L o s s Re l a t i o n s h i p s . . . . . . . . . . . . . . .
M i n o r Losses . . . . . . . . . . . . . . . . . . . . . . 16
Use o f H e a d L o s s C h a r t s f o r S o l u t i o n
of Simple P i p e Systems . . . . . . . . . . . . . . . . . . 18
References . . . . . . . . . . . . . . . . . . . . . . .20
CHAPTER 2 ALTERNATIVE METHODS OF P I P E
NETWORK FLOW ANALYSIS . . . . . . . . . . . . . . . . . 21
T y p e s of P i p e f l o w P r o b l e m s . . . . . . . . . . . . . . . . 21
M e t h o d s of S o l u t i o n . . . . . . . . . . . . . . . . . . . . 21
Simple P i p e Problems . . . . . . . . . . . . . . . . . . .2 3
Inter-Connected Reservoirs . . . . . . . . . . . . . . . . .2 4
Pseudo S t e a d y F l o w . . . . . . . . . . . . . . . . . . . .25
Compound P i p e s . . . . . . . . . . . . . . . . . . . . . .2 6
Node Head C o r r e c t i o n M e t h o d . . . . . . . . . . . . . . . .2 8
Computer P r o g r a m B a s e d o n Node
Head C o r r e c t i o n M e t h o d . . . . . . . . . . . . . . . . . .3 0
Newton-Raphson M e t h o d . . . . . . . . . . . . . . . . . . 31
References . . . . . . . . . . . . . . . . . . . . . . . .3 3
CHAPTER 3 LOOP FLOW CORRECTION METHOD OF
NETWORK ANALYSIS . . . . . . . . . . . . . . . . . . . .35
I nt roduct ion . . . . . . . . . . . . . . . . . . . . . . -35
Method o f F l o w C o r r e c t i o n . . . . . . . . . . . . . . . . .35
Loop S e l e c t i o n . . . . . . . . . . . . . . . . . . . . . .3 7
Mu1 t i p l e R e s e r v o i r s . . . . . . . . . . . . . . . . . . . .3 8
Branch Pipes . . . . . . . . . . . . . . . . . . . . . .3 8
Pumps a n d P r e s s u r e R e d u c i n g V a l v e s . . . . . . . . . . . .3 9
P r a c t i c a l D e sign f o r Loop Flow
Correct i o n Method . . . . . . . . . . . . . . . . . . . .4 0
Computer P r o g r a m . . . . . . . . . . . . . . . . . . . .41
References . . . . . . . . . . . . . . . . . . . . . . .4 4
CHAPTER 4 LINEAR METHOD . . . . . . . . . . . . . . . .4 5
Introduction . . . . . . . . . . . . . . . . . . . . . . .4 5
L i n e a r Method A p p l i e d to Loop Flows . . . . . . . . . . . .4 7
L i n e a r M e t h o d f o r Node H e a d s . . . . . . . . . . . . . . .4 8
Computer P r o g r a m f o r L i n e a r M e t h o d . . . . . . . . . . . .49
References . . . . . . . . . . . . . . . . . . . . . . .54
CHAPTER 5 OPTIMUM DESIGN OF BRANCHED P I P E
NETWORKS BY L I N E A R PROGRAMMING . . . . . . . . . . . . .55
I nt r o d u c t io n . . . . . . . . . . . . . . . . . . . . . . .5 5
Simplex Method f o r T r u n k M a i n Diameters . . . . . . . . . .5 5
Network D e s i gn . . . . . . . . . . . . . . . . . . . . . -60
Looped N e t w o r k s .L P O p t i m i z a t i o n . . . . . . . . . . .
.63 .
Linear Programming Program . . . . . . . . . . . . . .
.6 3 .
References . . . . . . . . . . . . . . . . . . . . . . .6 9
VIII

CONTENTS ( c o n t ) . PAGE

CHAPTER 6 DYNAMIC AND NON-LINEAR PROGRAMMING


FOR LOOPED NETWORKS . . . . . . . . . . . . . . . . . . 7 0
D y n a m i c P r o g r a m m i n g f o r O p t i m i z i n g Compound
Pipes . . . . . . . . . . . . . . . . . . . . . . . . .71
T r a n s p o r t a t i o n P r o g r a m m i n g f o r Least-Cost
.
A l l o c a t i o n o f Resources . . . . . . . . . . . . . . . . 7 4
Steepest P a t h Ascent T e c h n i q u e f o r
Extending Networks . . . . . . . . . . . . . . . . . . .77
Design of Looped Networks . . . . . . . . . . . . . . . .81
References . . . . . . . . . . . . . . . . . . . . . . . 8 6
CHAPTER 7 CONTINUOUS SIMULATION . . . . . . . . . . . . 8 7
Systems A n a l y s i s T e c h n i q u e s and t h e Use
of S i m u l a t i o n Models . . . . . . . . . . . . . . . . . . 8 8
Mathematical M o d e l l i n g of Water Q u a l i t y. . . . . . . . . . 9 0
Numerical Methods f o r the Solution of Single
Differential Equations . . . . . . . . . . . . . . . . .96
. . . . . . . .102
R e a l - T i m e O p e r a t i o n o f W a t e r S u p p l y Systems
Computer P r o g r a m to S i m u l a t e R e s e r v o i r
Level V a r i a t i o n s in a Pipe Network . . . . . . . . . . . .102
References . . . . . . . . . . . . . . . . . . . . . . .105
CHAPTER 8 UNSTEADY FLOW ANALYSIS BY
R I G I D COLUMN METHOD . . . . . . . . . . . . . . . . . .106
R i g i d Water Column Surge Theory . . . . . . . . . . . . .106
Derivation of Basic Equation . . . . . . . . . . . . . . .108
Solution o f Equation of Motion . . . . . . . . . . . . . .108
SurgeTanks . . . . . . . . . . . . . . . . . . . . . -112
References . . . . . . . . . . . . . . . . . . . . . . -114
CHAPTER 9 WATER HAMMER THEORY . . . . . . . . . . . -115
B a s i c W a t e r Hammer E q u a t i o n s . . . . . . . . . . . . . -115
E f f e c t of A i r . . . . . . . . . . . . . . . . . . . . . -118
Methods o f A n a l y s i s . . . . . . . . . . . . . . . . . . .120
Valves . . . . . . . . . . . . . . . . . . . . . . . . -122
A c c u r a c y and S t a b i l i t y o f F i n i t e
D i f f e r e n c e Schemes . . . . . . . . . . . . . . . . . . -124
B a s i c Computer P r o g r a m f o r A n a l y s i n g G r a v i t y L i n e s 131
References . . . . . . . . . . . . . . . . . . . . . . -135
CHAPTER 10 BOUNDARY CONDITIONS I N WATER
HAMMER . . . . . . . . . . . . . . . . . . . . . . . -136
Description . . . . . . . . . . . . . . . . . . . . . . -136
W a t e r Hammer P r o t e c t i o n o f P u m p i n g L i n e s . . . . . . . . -138
Non-Return Valves . . . . . . . . . . . . . . . . . . . .141
A i r Vessels. . . . . . . . . . . . . . . . . . . . . . .143
References . . . . . . . . . . . . . . . . . . . . . . .145
CHAPTER 1 1 WATER COLUMN SEPARATION . . . . . . . . . .146
Introduction . . . . . . . . . . . . . . . . . . . . * -146
IX

CONTENTS ( c o nt ) . PAGE

CHAPTER 1 1 ( c o n t . )
C o m p u t a t i o n a l Technique f o r Column
Separation . . . . . . . . . . . . . . . . . . . . . . 147
. . . . . . . . . . . . .
S i m p l i f i e d R i g i d Column A n a l y s i s 148
P r o g r a m f o r S i m u l a t i o n o f W a t e r Hammer i n
. . . . . . . . . . . . . .
Pump1 i n e s f o l l o w i n g P u m p t r i p 153
References . . . . . . . . . . . . . . . . . . . . . . . 159
CHAPTER 12 WATER HAMMER AND FLOW ANALYSIS
I N COMPLEX P I P E SYSTEMS . . . . . . . . . . . . . . . . 160
The P r o b l e m o f F l o w A n a l y s i s i n C o m p l e x
Pipe Networks . . . . . . . . . . . . . . . . . . . . . 160
. . . . . . . . .
C o n v e n t i o n a l Methods o f Network A n a l y s i s 162
. . . . . . . . . . . .
Method o f S o l u t i o n o f t h e E q u a t i o n s 164
Boundary Conditions . . . . . . . . . . . . . . . . . . 167
Valve Stroking . . . . . . . . . . . . . . . . . . . . . 168
References . . . . . . . . . . . . . . . . . . . . . . . 172
CHAPTER 13 GRAPHICAL WATER HAMMER ANALYSIS . * . . * * 175
. . . . . . . . . . . .
Reasons f o r G r a p h i c a l A p p r o a c h . 175
. . . . . . . . . . . . . . . . . . . .
B a s i c s of M e t h o d 175
. . . . . . . . . . .
M i d - P o i n t s and C h a n g e i n D i a m e t e r . 178
Pumping Lines . . . . . . . . . . . . . . . . . . . . . 179
References . . . . . . . . . . . . . . . . . . . . . . . 182
CHAPTER 14 P I P E GRAPHICS . . . . . . . . . . . . . . . 183
Introduction . . . . . . . . . . . . . . . . . . . . . . 183
Interactive Drawing . . . . . . . . . . . . . . . . . . . 185
Computer P r o g r a m f o r P i p e G r a p h i c s . . . . . . . . . . . 186
References . . . . . . . . . . . . . . . . . . . . . . 190
CHAPTER 15 COMPUTER PROGRAMMING I N BASIC . . . . . . . 192
Descri p t i o n ...................... 192
Arithmetic . . . . . . . . . . . . . . . . . . . . . . . 193
Logi ca I Operat o r s . . . . . . . . . . . . . . . . . . * . 193
Variables . . . . . . . . . . . . . . . . . . . . . . . 194
.......................
P r e c is i o n 194
Functions . . . . . . . . . . . . . . . . . . . . . . * 194
. . . . . . . . . . . . . . . . . .
Spec i a I C h a r a c t e r s * 195
. . . . . . . . . . . . . .
B a s i c P r o g r a m m i n g Statements 195
Graphics Statements . . . . . . . . . . . . . . . . . . . 198
INDEX . . . . . . . . . . . . . . . . . . . . . . . . 202
This Page Intentionally Left Blank
CHAPTER 1

HYDRAULICS AND HEAD LOSS EQUATIONS

BAS I C EQUAT I ONS

Most hydraulic problems in pipe systems can be solved s t a r t i n g


with one or more of the basic equations described below, or an
adaptation of them. It is the methods of solution of the equations,
be they analytical, graphical or numerical, which this book is
about.
The three equations which will appear in various forms
throughout the book are the continuity equation, the momentum
equation and the energy equation. For steady, incompressible
one-dimensional flow the continuity equation is simply obtained by
equating the flow r a t e at any section to the flow r a t e at another
section along the stream tube. By 'steady flow' it i s implied that
there is no variation i n velocity at any p o i n t . A s f a r as unsteady
flow is concerned the continuity equation has an additional term,
namely the change i n storage between the sections.
The momentum equatior! stems from Newton's basic law of motion
and states that the change i n momentum f l u x between two sections
equals the sum of the forces on the f l u i d causing the change. For
steady, one- dimensional flow t h i s i s

AFx = P Q A V x (1.1 1
where F is the force, P is the fluid mass density, Q is the
volumetric flow rate, V i s velocity and subscript x r e f e r s to the ' x '
direct ion.
The b a s i c energy equation i s d e r i v e d b y e q u a t i n g the work done
on an element of fluid by gravitational and pressure forces to the
change in k i n e t i c energy. Mechanical and heat energy transfer are
excluded from the equation. In most systems there is a loss of
energy due to f r i c t i o n a n d turbulence and a term i s included i n the
equation to account f o r this. The r e s u l t i n g equation f o r steady flow
of incompressible fluids is termed the Bernoulli equation and is
conveniently w r i t t e n as:

v,2 + p1 + z, = v22 + P1 + z2 + he
-
29
-
Y
-
29
-
Y
(1.2)
where V = mean velocity at a section
V2/2g = velocity head ( u n i t s of length)
9 = g r a v i t a t i o n a l acceleration
P = pressure
p/Y = pressure head ( u n i t s of l e n g t h )
Y = u n i t weight of f l u i d
Z = elevation above an a r b i t r a r y datum
= head loss due to f r i c t i o n or turbulence between
he
sections 1 a n d 2.
The s u m of the velocity head p l u s pressure head p l u s e l e v a t i o n i s
termed the total head. S t r i c t l y the velocity head should be m u l t i p l i e d
by a coefficient to account for the v a r i a t i o n in v e l o c i t y across the
section of the conduit. The average value of the coefficient for
t u r b u l e n t flow i s 1.06 and f o r l a m i n a r flow i t i s 2.0. Flow through a
conduit i s termed e i t h e r uniform o r non-uniform depending on whether
or not there is a variation in the cross-sectional velocity
d i s t r i b u t i o n a long the conduit.
For the Bernoulli equation to apply the flow should be steady,
i.e. there should be no change i n velocity at any point with time.
The flow is assumed to be one-dimensional and irrotational. The
fluid should be incompressible, or else a term f o r s t r a i n energy has
to be introduced.
The respective heads are illustrated in Figure 1.1. For most
practical cases the velocity head is small compared w i t h the other
heads, and it may be neglected. In fact it i s often the case that
minor head losses due to bends, expansions, etc. can also be
neglected a n d f r i c t i o n need be the o n l y method whereby head i s lost.

ENTRANCE L O S S
FRICTON LOSS
CONTRACTION L O S S

F R I C T I O N LOSS

VELOCITY
"hP
H AD

PRESSURE H E A D
PI 6

E L E VAT!ON

Fig. 1.1 Energy heads along a p i p e l i n e


3

FLOW-HEAD LOSS RELAT I ONSH I PS

Empirical Flow Formulae

The t h r o u g h p u t o r c a p a c i t y of a p i p e of f i x e d dimensions depends


o n t h e t o t a l h e a d d i f f e r e n c e between t h e e n d s . T h i s h e a d i s consumed
b y f r i c t i o n a n d o t h e r losses.
The first friction head loss/flow relationships were derived from
field observations. These e m p i r i c a l relationships a r e s t i l l popular in
waterworks practice although more rational formulae have been
developed. The head loss/flow formulae thus e s t a b l i s h e d a r e termed
conventional formulae and are usually given in a n exponential form
of the type

v = KD~SY (1.3)

or s = K'Q"/D~ (1.4)

where V is the mean flow velocity, m, n, x, y, K and K' are


constants, D i s the inside diameter of the c i r c u l a r p i p e a n d S i s the
head loss g r a d i e n t ( i n m head loss p e r m l e n g t h of pipe). Some o f
the equations more f r e q u e n t l y a p p l i e d a r e l i s t e d below:

Basic Equations S.I. units ft-sec

Hazen-
Williams S=Kl(V/Cw) 1.85 /D 1.167 =6.84 K =3.03 (1.5)
1 1
1.33
Manning S = K 2 ( n V l 2/D K =6.32 K =2.86 (1.6)
- 2 2
Chezy S=K3(V/cz)* /D K =13.13 K =4.00 (1.7)
3 3
Darcy S=XV2/2gD Dimensionless (1.8)

Except for the Darcy formula the above equations are not
universal and the 'constant' in the equation depends on the u n i t s .
I t should be borne in m i n d t h a t some o f t h e f o r m u l a e were i n t e n d e d
purely f o r standard water e n g i n e e r i n g p r a c t i c e a n d take no account
of variations in gravity, temperature or t y p e of liquid. The f r i c t i o n
coefficients vary with pipe diameter, surface configuration and age
of pipe.
The c o n v e n t i o n a l f o r m u l a e a r e c o m p a r a t i v e l y s i m p l e t o u s e a s t h e y
do not involve f l u i d viscosity. They may be solved directly a s they
4

do not require an initial estimate of Reynolds number to determine


the friction factor (see next s e c t i o n ) . On the other hand, the more
modern equations cannot be solved d i r e c t l y f o r r a t e of flow. Solution
of the formulae for velocity, diameter or friction head g r a d i e n t is
simple w i t h the a i d of a s l i d e r u l e , c a l c u l a t o r , computer, nomograph
o r graphs plotted on log-log paper. The equations a r e of p a r t i c u l a r
use for analysing flows in pipe networks where the flow/head loss
equations have to be i t e r a t i v e l y solved many times.
A popular flow formula i n waterworks p r a c t i c e i s the Hazen-Wil-
liams formula. Friction coefficients for use in this equation are
tabulated in Table 1.1. If the formula is to be used frequently,
solution with the a i d of a chart is the most e f f i c i e n t way. Many
waterworks organizations use graphs of head loss gradient plotted
against flow for various p i p e diameters, a n d v a r i o u s C values. As
the value of C decreases with age, type of p i p e and properties of
water, f i e l d tests a r e d e s i r a b l e f o r an accurate assessment of C.

TABLE 1.1 Hazen-Williams f r i c t i o n coefficients C

Type o f Pipe Condi t i on


New 25 y e a r s 50 y e a r s Bad I y
old old C orr o de d

PVC : 150 140 130 130


Smooth c o n c r e t e , A C : 150 130 120 100
S t e e l , b i tumen
I ined, galvanized: 150 130 100 60
Cast i r o n : 130 110 90 50
Riveted steel,
v i t r i f i e d , woodstave 120 100 80 45

Rational flow formulae

Although the conventional flow formulae are l i k e l y to remain in


use f o r many years, more r a t i o n a l formulae are gradually gaining
acceptance amongst engineers. The new formulae have a sound
scientific basis backed by numerous measurements and they are
universally applicable. Any consistent u n i t s of measurements may be
used and l i q u i d s of v a r i o u s viscosities a n d temperatures conform to

the proposed formulae.


3

The r a t i o n a l flow formulae f o r flow i n pipes a r e sim I a r to those


for flow past bodies or over flat plates (Schlichting, 1960). The
o r i g i n a l research was on smal I-bore pipes w i t h a r t i f i c i a roughness.
Lack of d a t a on roughness f o r l a r g e pipes has been one deterrent t o
the use of the r e l a t i o n s h i p s i n waterworks practice.
The velocity i n a f u l l p i p e v a r i e s from zero on the boundary to a
maximum in the centre. Shear forces on the walls oppose the flow
and a boundary layer is established with each annulus of fluid
imparting a shear force onto an inner neighbouring concentric
annulus. The resistance to relative motion of the fluid is termed
kinematic viscosity, and in turbulent flow it is imparted by
turbulent mixing with transfer of particles of different momentum
between one l a y e r a n d the next.
A boundary layer i s established at the entrance to a conduit and
t h i s l a y e r g r a d u a l l y expands u n t i l i t reaches the centre. Beyond t h i s
point the flow becomes uniform. The length of p i p e r e q u i r e d f o r f u l l y
established flow i s g i v e n by

5=0.7 f o r t u r b u l e n t flow (1.9)


D
The Reynolds number Re = VDh is a dimensionless number
incorporating the fluid viscosity u which is absent in the
conventional flow formulae. Flow i n a pipe i s laminar for low
Re ( < 2 0 0 0 ) and becomes t u r b u l e n t f o r higher Re ( n o r m a l l y the case
in practice). The basic head loss equation i s d e r i v e d b y setting the
boundary shear force over a length of p i p e equal to the loss in
pressure mu1 tip1 ied b y the area:

rnDL = yhf rrD2/4 (1.10)

(1.11)

(1.12)

where X = ( 4 . r / v ) / ( V 2 / 2 g ) i s the Darcy f r i c t i o n factor, T i s the shear


stress, D i s the p i p e diameter and h i s the f r i c t i o n head loss over
f
a l e n g t h L. X i s a function of Re and the r e l a t i v e roughness k / D .
For laminar flow, Poiseuille found that = 64/Re i.e. is
independent of the r e l a t i v e roughness. Laminar flow w i l l not occur i n
normal engineering practice. The t r a n s i t i o n zone between l a m i n a r and
turbulent flow i s complex and undefined b u t i s also of l i t t l e interest
i n practice.
6

Turbulent flow conditions may occur with either a smooth or a


rough boundary. The equations for the friction factor for both
conditions are derived from the general equation for the velocity
distribution in a turbulent layer, which is derived from mixing
Ieng t h theory :

(1.13)

Integrating w i t h t h e c o n s t a n t k f o u n d to b e 0.4 a n d c o n v e r t i n g to

= 5.75 Y
log - (1.14)
Y '
G77
where v is the velocity at a distance y from the b o u n d a r y . For a
hydrodynamical l y smooth b o u n d a r y there i s a l a m i n a r sub-layer, and
Nikuradse found that y'av /m where y' is the boundary layer
thickness, so

(1.15)

The c o n s t a n t 5.5 was f o u n d e x p e r i m e n t a l l y .


Where the boundary is rough the laminar sub-layer is affected
and Nikuradse found that y' = k/30 where k is the boundary
roughness.

Thus
V
- = 5.75 log $ + 8.5 (1.16)
rn
Rearranging equations 1.15 a n d 1.16 a n d e x p r e s s i n g v i n terms of
the average v e l o c i t y V b y means o f t h e e q u a t i o n Q =I vdA r e s u l t s i n

_ _- 2 l o g Re / T - 0.8 (1.17)
n-
(turbulent boundary layer, smooth b o u n d a r y ) a n d

- _- D
2 log - + 1.14 ( 1 .la)
k
Jx'
(turbulent boundary layer, rough boundary).
Notice that for a smooth boundary, is independent of the
relative roughness k/D and for a very rough boundary it is
i n d e p e n d e n t of t h e R e y n o l d s n u m b e r Re f o r a l l p r a c t i c a l p u r p o s e s .
Colebrook a n d White combined Equations 1.17 a n d 1.18 to p r o d u c e
an equation covering both smooth a n d rough boundaries as well as
the t r a n s i t i o n zone:

f 1i = 1.14 - 2 l o g ( -
k 9.35
+ ___ 1 (1.19)
D Rev"
7

Their equation reduces to Equ. 1.17 f o r smooth pipes, and to Equ.


1 .I8 f o r r o u g h pipes. T h i s semi-empirical equation y i e l d s satisfactory
results for various commercially available pipes. Nikuradse's
original experiments used sand as artificial boundary roughness.
Natural roughness is evaluated according to the equivalent sand
roughness. Table 1.2 g i v e s values of k f o r v a r i o u s surfaces.

TABLE 1.2 Roughness of p i p e m a t e r i a l s ( H y d r a u l i c s Research Station,


1969). Value of k i n mm

Finish Smooth Average Rough


____
G l a s s , drawn m e t a l s 0 0.003 0.006
S t e e l , PVC o r AC 0.015 0.03 0.06
Coated s t e e l 0.03 0.06 0.15
Galvanized, v i t r i f i e d clay 0.06 0.15 0.3
C a s t i r o n o r cemen t I i n e d 0.15 0.3 0.6
Spun c o n c r e t e o r wood s t a v e 0.3 0.6 1.5
R i v e t e d s t eel 1.5 3 6
Fou I s e w e r s , t u b e r c u I a t ed
water mains 6 15 30
Unl ined r o c k , e a r t h 60 150 300

Fortunately A i s not v e r y sensitive to the v a l u e of k assumed. k


increases linearly with age for water pipes. The various rational
formulae for A were p l o t t e d on a single g r a p h b y Moody and t h i s
g r a p h i s presented as F i g u r e 1.2.
A close approximation to A i s often g i v e n b y the f o l l o w i n g equation:

A = 0.0055 { 1 + ( 2 0 0 0 0 k / D + 106/Re)1/31 (1.20)

This equation avoids an implicit situation but i s only a first


approximation which should be substituted i n the r.h.s. of (1.19) to

o b t a i n a better value.
Unfortunately the Moody diagram is not very amenable to d i r e c t
solution for any variable for given values of the dependent
variables, and a trial and e r r o r a n a l y s i s may be necessary to get
the velocity for the Reynolds number if reasonable accuracy is
required. The Hydraulics Research Station at Wal l i n g f o r d (1969)
re-arranged the variables in the Colebrook- White equation to
produce simple explicit flow/head loss graphs. Thus equation 1 .I9
may b e a r r a n g e d i n the form
k 2.51~
v = -2 J2gDS' log (-
+

1 (1.21)
3.70 D m
0.10
0 09
0.08
0.07

0.06

1.05

f-
-
0

; 0.02
C

.0.
.-
U
z
0.015

0.01
0.00:

0.001

Fig. 1.2 Moody r e s i s t a n c e d i a g r a m f o r u n i f o r m f l o w i n pipes


9

Thus for any fluid at a certain temperature and defined


roughness k, a graph may be plotted in terms of V, D and 5.
Figures 1.3 to 1.7 are such graphs for water at
15"C and for
v a r i o u s roughnesses K .
I n s u m m a r y t h e D a r c y - W e i s b a c h e q u a t i o n f o r h e a d loss i n c i r c u l a r
p i pes

(1.22)

w h e r e h i s t h e h e a d loss ( o r t h e e n e r g y loss p e r u n i t w e i g h t ) , X is
the Darcy-Weisbach friction factor, L is the pipe length, D i s the
pipe diameter, g is the gravitational acceleration and V is the
average fluid velocity. I t may be noted t h a t in North America X is
replaced by f, whereas British practice i s to use another f'in the
equation

hf = f 'LV2/2gR (1.23)

where R i s the hydraulic r a d i u s D/4 for a circular pipe. Thus f'=


64.

Since V = 4Q/rD2 (1.24)

we c a n a l s o r e w r i t e e q u a t i o n 1.22 a s
--h f - 8XQ2
(1.25)
L V'gD

Solution of the basic equations

The Colebrook-White formula (1.19) which forms the b a s i s of the


Moody d i a g r a m m a y a l s o b e w r i t t e n a s

1
- = _ _ _ Pn
-0.8686 (-
I
k + ___
2.51 , (1.26)
3.7D R e r
vf-r

A l s o Re = VD/v = 4Q/nDv (1.27)


The equation must be solved b y ,iteration for h. This can be
-
conveniently done b y letting x = X -' a n d u s i n g t h e Newton Raphson
i t e r a t i v e scheme,

(1.28)

w h e r e in t h i s c a s e we h a v e f r o m e q u a t i o n 1.26
k + -
2.51~
g(x) = x + 0.8686 en (-
3.7D Re ) (1.29)

and g ' ( x ) i s t h e d e r i v a t i v e o f g ( x ) . We t h e n o b t a i n
10

k + 2.51~
x + 0.8686 en(-----
3.7D
- Re
1
x+ = x - I 1 (1.30)
2.51 Re
+ o'8686 k + /2.5lX 1
(m Re1
where x+ is a successive a p p r o x i m a t i o n to the s o l u t i o n of g(x) = 0
u s i n g the p r i o r approximation x. Setting x = x+ a n d s o l v i n g f o r x
+
s e v e r a l times, t h e s o l u t i o n c a n be o b t a i n e d to a n y d e s i r e d a c c u r a c y .
T h i s e q u a t i o n converges r a p i d l y for almost any starting value of
x and can be e a s i l y solved on a computer or on a programmable
calculator. Using t h i s equation in c o m b i n a t i o n w i t h e q u a t i o n s (1.22)
a n d (1.27) one c a n s o l v e f o r h e a d loss.

hf2gD (1.31)
Note t h a t s i n c e A =
Lvz

so that (1.26) can be solved directly for V given hf, L, 9, D,v


and k:
k + 2.51~
V = J2gDhf/L' -0.8686 en (- ) (1.33)
3.7D 1 2gD3h f / L '
If however, V is given then either A or hf must be obtained
e m p l o y i n g a n i t e r a t i v e procedure.

Comparison of F r i c t i o n Forrnul ae

The D a r c y e q u a t i o n may be w r i t t e n as

v (1.35)

or v = cZ fi (1.36)

w h i c h i s termed t h e Chezy e q u a t i o n a n d t h e Chezy c o e f f i c i e n t i s

cZ =m (1.37)

The Hazen-Wi I I iams equation may be rewritten for al I practical


p u r p o s e s i n t h e f o l l o w i n g dimensionless f o r m :

S = 515(V/CW)' (Cw/Re)'*15/gD (1.38)

By c o m p a r i n g t h i s w i t h t h e Darcy-Weisbach equation (1.25) i t may


be deduced t h a t

cW = 42.4 (A0'54Re0*08) (1.39)


FIG. 1.3 FRICTION LOSS CHART FOR PIPES FLOWING FULL
FRICTION LOSS CHART FOR PIPES FLOWING FULL

12
FIG. 1.4

01
9

8
c
P

008
ow 1
009

OOOP
WOE
FIG.
1M)
1.5 FRICTION LOSS CHART FOR PIPES FLOWING FULL
ffor water at 15OC) 1 k = 0 . 0 6 mm I
80
Typical example<
60 Galvanised iron
Coated cast iron
40
Glazed vitrified clay

30

20

-e 10

g 8
x
L
0
a 4
Y)

b ,
-2
I 7
-
P
I
1

01

0:

0.:
WhCrU

0.:

0
w
FRICTION LOSS CHART FOR PIPES FLOWING FULL

n
FIG. 1.6

14
FIG. 1 . 7 FRICTION LOSS CHART FOR PIPES FLOWING FULL

15
16

The H a z e n - W i l l i a m s c o e f f i c i e n t C i s t h e r e f o r e a f u n c t i o n of X and
W
Re a n d v a l u e s may be p l o t t e d on a Moody d i a g r a m (see F i g u r e 1 . 2 ) .
It will be observed from Figure 1.2 that lines for constant
Hazen-Williams c o e f f i c i e n t c o i n c i d e w i t h the Colebrook-White I ines o n l y
in the transition zone. In the completely turbulent zone for
non-smooth pipes the coefficient wi II actually r e d u c e the g r e a t e r t h e
Reynolds number, i .e. one c a n n o t associate a c e r t a i n Hazen-Wi I I i a m s
coefficient w i t h a p a r t i c u l a r p i p e as i t v a r i e s w i t h the flow r a t e .
The Manning equation i s widely used f o r open c h a n n e l flow and
p a r t f u l l pipes. The e q u a t i o n i s

V = KnR 2 k sf (1.40)

where K i s 1.000 in SI units and 1.486 in f t I b u n i t s , a n d R i s the


h y d r a u l i c r a d i u s A/P where A i s t h e c r o s s s e c t i o n a l a r e a of f l o w a n d
P t h e wetted p e r i m e t e r . R i s D/4 f o r a c i r c u l a r p i p e , a n d i n g e n e r a l
for nov-circular sections, 4 R may b e s u b 2 t i t u t e d f o r D .

TABLE 1 . 3 Values of Manning's In'


__._____

Smooth g l a s s , p l a s t i c 0.010
C o n c r e t e , s t e e l ( b i tumen I i n e d ) , g a l v a n i z e d 0.01 1
Cast I r o n 0.012
S I imy o r g r e a s y s e w e r s 0.01 3
R i v e t t e d s t e e l , v i t r i f i e d , wood-stave 0.01 5
Rough c o n c r e t e 0.017

MINOR LOSSES

One method of e x p r e s s i n g h e a d loss t h r o u g h f i t t i n g s a n d changes in


section is the equivalent length method, often used when the
conventional friction loss formulae are used. Modern practice i s to
express losses through f i t t i n g s i n terms of t h e v e l o c i t y head, i.e.
h = KV2//2g where K i s the loss c o e f f i c i e n t . T a b l e 1.4 gives typical
c'
loss coefficients although valve m a n u f a c t u r e r s may also provide
supplementary d a t a a n d loss c o e f f i c i e n t s K w h i c h w i l l v a r y w i t h g a t e
opening. The v e l o c i t y V to use i s n o r m a l l y t h e mean t h r o u g h t h e f u l l
bore of the p i p e or f i t t i n g .
17

TABLE 1.4 Loss c o e f f i c i e n t s f o r p i p e f i t t i n g s .

Bends hB = KBV2/2g
Bend a n g l e Sharp r/D=l 2 6

30° 0.16 0.07 0.07 0.06


45O 0.32 0.13 0.10 0.08
60° 0.68 0.18 0.12 0.08
goo 1 .27 0.22 0.13 0.08
1 80° 2.2 0.40 0.25 0.15

Valves hv = KVVf/2g
Open I n g : 1/4 1/2 3/4 Ful I

Sluice 24 5.6 1 .o 0.2


Butterfly 120 7.5 1.2 0.3
G I obe 160 40 20 10
Need I e 4 1 0.6 0.5
Ref l u x 1-2.5

b
Contract ions and expansions in cross section
Contract ions: Expansions:
hc = KcV22/2g hc = KcVl2/2g

A2/A 1 A 1 /*2
Wal I
angle 0 0.2 0.4 0.6 0.8 1.0 0 0.2 0.4 0.6 0.8 1.0

7.5O .13 .08 .05 .02 .O 0


15' .32 .24 .15 .08 .02 0
30° .78 .45 .27 .13 .03 0
180' .5 .37 .25 .15 .07 0 1.0 .64 .36 .17 .04 0

En t r a n c e a n d ex i t I osses: he= K e V 2 / 2 g
En t r a n c e Exit

Protruding 0.8 1 .o
Sharp 0.5 1 .o
Bevel I ed 0.25 0.5
Rounded 0.05 0.2
18

It i s frequently unnecessary to calculate the losses i n a l l pipe


fittings if in fact they need to be considered at all. The full
velocity head V2/2g is typically less than 0.2m so even the full
velocity head is small in comparison with many line friction head
losses. The losses due to fittings r a r e l y exceeds 5% of the f r i c t i o n
loss except for very high design pressure heads when it is
economical to reduce t h e diameter of f i t t i n g s such as valves.
On the other hand, the presence of a i r i n p i p e l i n e s can a d d to
the f r i c t i o n loss. Although a i r w i l l seldom b u i l d up to create a l a r g e
pocket in comparison with the cross sectional area there is
frequently air i n free b u b b l e form i n transport. The presence of 1%
of free air is not impossible and since the head loss is nearly
proportional to V 2 the corresponding head loss increases 2%.
F i t t i n g s can be accounted f o r b y a d d i n g the losses to the f r i c t i o n
loss:

Thus h = hf + h (1.41)
r
(1.42)

(1.43)

One method i s to add on an equiva ent length of p i p e to g i v e the


same head loss as the f i t t i n g . The equ valent length i s from (1.43)

L’ = (D/~)zK (1.44)

Obviously the v a r i a t i o n of 1 w i t h Re i s not s t r i c t l y accounted f o r


t h i s way and n e i t h e r i s the v a r i a t i o n of K or discharge coefficient
of valves w i t h opening.

USE O F HEAD LOSS CHARTS FOR SOLUTION OF SIMPLE PIPE SYSTEMS

Many of the following chapters describe methods of calculating


head losses i n complex p i p e networks. Those problems have a number
of unknowns. For instance if a pipe with a known head changes
diameter along i t s length, the head loss f o r each section, as well
as the total flow rate may be unknown. Similarly if the pipe
branches, the flows as well as the head losses become unknowns.
Some a d d i t i o n a l facts a r e needed to solve f o r a l l the unknowns. The
c o n t i n u i t y equation is invariably u t i l i z e d i n such cases. I n general,
19

however, it i s necessary to s i m p l i f y t h e flow-head loss relationships

somewhat where simultaneous solutions of a number of equations are


involved. Thus if the Darcy head loss equation is utilized the
friction factor X could be assumed a constant. Alternatively an
equation of the f o l l o w i n g form i s used

h = KLQn/Dm (1.45)
where K i s assumed constant f o r a l l pipes. I n many of t h e numerical
and iterative methods e x p l a i n e d later these simp1 i f i c a t i o n s are not
essential and friction factors varying with pipe and flow can be
accounted f o r . I f e q u i v a l e n t p i p e o r a n a l y t i c a l methods are employed
the simplifications are necessary, or at least the assumption that
f r i c t i o n factor i s independent of flow r a t e .
One method of accounting f o r simple pipes i n series o r in p a r a l l e l
i s the e q u i v a l e n t p i p e method. The diameter of an equivalent pipe to
replace a compound p i p e may be d e r i v e d a n a l y t i c a l l y (see Chapter 2 )
or more simply, if computations are to be performed by hand,
obtained from a h e a d loss c h a r t such as F i g u r e 1 . 5
Consider as an example a compound p i p e comprising a 300 mrn
bore 1000 m long p i p e i n series w i t h ( l e a d i n g i n t o ) a 400 mm bore
pipe 2000 m long. A simple r e l a t i o n s h i p between head loss and flow
rate is not possible unless the pipe is replaced by an equivalent
uniform bore pipe, say 3000 m long. A method of obtaining the
diameter of such a pipe i s to assume a reasonable flow rate (e.g.
100 e / s ) and read o f f the total head loss from F i g u r e 1 . 5 : h = 5.4 +
1 . 3 X 2 km = 8 rn, so that the mean head loss g r a d i e n t i s 8 / 3 = 2.67
m/km and the equivalent pipe diameter to discharge 100 e / s i s 345
mm.
As another example consider a 500 mm bore pipe, 3000 m long
l a i d p a r a l l e l to a 700 mm bore p i p e 4000 m long a n d both pipes a r e
connected at both ends. I n t h i s case a total head loss i s assumed,
say 10 m. The head g r a d i e n t along the 500 mm p i p e i s 3.33 m/km
and the flow r a t e from F i g u r e 1 . 5 i s 300. The head g r a d i e n t along
the 700 mm bore p i p e i s 2.5 m/km and the flow rate 620 P / s . An
equivalent pipe with a length of, say, 4000 m to discharge 920 e / s
a t a g r a d i e n t of 10 m/4 = 2.5 m/km would r e q u i r e a bore of 820 mm.
I t should be noted that F i g u r e 1 . 5 i s f o r a p a r t i c u l a r roughness and
20

slightly different results would be obtained if a l t e r n a t i v e head loss


charts were employed or even if different flow or head loss
assumptions were made to start with. That i s b e c a u s e t h e e f f e c t of
v a r y i n g Reynolds number was ignored. A more a c c u r a t e s o l u t i o n c o u l d
have been obtained by using the Moody diagram or the Colebrook-
White equation and iterating. The additional effort is, however,
seldom justified in real systems as the losses due to many factors
( i n c l u d i n g roughness) a r e o n l y estimates anyway.

REFERENCES

A l b e r t s o n , M.L., B a r t o n , J.R. and Simon, D.B., 1960. F l u i d Mech-


anics for Engineers, Prentice H a l l , N.J.
Diskin, M.H., Nov. 1960. The l i m i t s of applicability of the
H a z e n - W i l l i a m s f o r m u l a e , La H o u i l l e B l a n c h e , 6.
H y d r a u l i c s R e s e a r c h S t a t i o n , 1969. C h a r t s f o r t h e H y d r a u l i c D e s i g n of
C h a n n e l s a n d P i p e s , 3 r d Edn., H.M.S.O., London.
S c h l i c h t i n g , H., 1960. B o u n d a r y L a y e r T h e o r y , 4 t h E d n . , McGraw
H i l l , N.Y. %
Watson, M.D., J u l y , 1979. A s i m p l i f i e d a p p r o a c h t o t h e s o l u t i o n o f
p i p e f l o w p r o b l e m s u s i n g t h e C o l e b r o o k - W h i t e method. C i v i l E n g .
i n S.A., 2 1 ( 7 ) , pp. 169-171.
21

CHAPTER 2

ALTERNATIVE METHODS O F PIPE NETWORK FLOW ANALYSIS

TYPES O F P IPEFLOW PROBLEMS

The hydraulic engineer is confronted w i t h many problems i n the


planning, design a n d o p e r a t i o n of piped water supply systems. The
problems can be divided into analysis and design types, both for
steady flow a n d unsteady flow.
The a n a l y s i s of s t e a d y f l o w s in s i m p l e p i p e s may b e f o r f l o w r a t e
(given the head loss) or for head loss ( g i v e n the flow rate). The
same calculations apply to compound pipes (in parallel or series)
although solution of more t h a n one e q u a t i o n i s then involved. When
it comes to branched or looped n e t w o r k s more s o p h i s t i c a t e d methods
become n e c e s s a r y .
The d e s i g n pcoblem i s u s u a l l y t r e a t e d a s a s t e a d y s t a t e problem.
That i s f o r k n o w n heads a n d d r a w o f f s , t h e e n g i n e e r h a s to select t h e
pipe l a y o u t a n d diameter a n d r e s e r v o i r l o c a t i o n a n d size. The l a t t e r
aspect, namely reservoir sizing is r e a l l y an unsteady flow problem
w h i c h may o f t e n be s o l v e d using steady-state equations. Net o u t f l o w
over t h e p e a k d r a w o f f p e r i o d may b e assessed b y m u l t i p l y i n g d r a w o f f
r a t e b y time.
For more r a p i d v a r i a t i o n s in flow ' r i g i d column' s u r g e theory o r
even elastic water hammer theory is necessary to determine heads
and transient flows. Computer a n a l y s i s i s p r a c t i c a l l y e s s e n t i a l . Once
suitable programs are available they could, however, e v e n b e used
to d e t e r m i n e steady-state f l o w s o r heads.
The design problem associated with unsteady flows is the
determination of pipe wal I thicknesses, and the o p e r a t i n g r u l e s f o r
valves, pumps e t c .

METHODS OF SOLUTION

Where complex pipe networks a r e u t i l i z e d f o r water d i s t r i b u t i o n i t


i s n o t easy to c a l c u l a t e the flow i n each p i p e o r t h e h e a d a t each
point. Even if the flow-head loss equation assumed is explicit for
each given pipe length, diameter and roughness, the non-linear
22

relationship between head loss a n d flow makes c a l c u l a t i o n difficult.


In unlooped tree-like networks the flows will be defined by the
drawoffs b u t if the p i p e network incorporates closed loops flows a r e
unknown as well as heads a t the v a r i o u s nodes.
The complexity of the pipe network, as well as the facilities
available for computation, will dictate which method of analysis is
to be utilized. Many of the following methods can be performed
manually whereas computers are required for the more complex
methods, p a r t i c u l a r l y where unsteady flow i s involved:
1. Equivalent pipes f o r compound pipes i n series.
2. Equivalent pipes f o r complex pipes i n p a r a l l e l .
3. T r i a l a n d e r r o r methods f o r mu1 t i p l e r e s e r v o i r problems.
4. Analytical solution of flow-head loss equations for compound
pipes.
5. Analytical solution of flow-head loss equations f o r pseudo-steady
flow.
6. Iterative node head correction for predominantly branched
networks ( b y h a n d o r computer).
7. Iterative loop flow correction for looped networks (by h a n d or
computer).
a. Simultaneous solution of the head loss equations f o r a l l pipes b y
matrix or i t e r a t i v e methods (easiest f o r l a m i n a r flow when head
loss i s l i n e a r l y proportional to f l o w ) .
9. Linearization of head loss equation and iterative solution for
heads a t nodes.
10. L i n e a r i z a t i o n of head loss equation and iterative solution for
flows i n piEes.
1 1 . A n a l y t i c a l solkition of r i g i d column unsteady flow equation.
12. Numerical solution of finite difference form of rigid column
acceleration equation, head loss equation and continuity equa-
tion.
13. Graphical a n a l y s i s f o r unsteady r i g i d column flow.
14. Graphical a n a l y s i s for- unsteady e l a s t i c water hammer.
15. F i n i t e difference and c h a r a c t e r i s t i c solution of d i f f e r e n t i a l water
hammer equations u s i n g computers. Valves, pumps, vaporization,
release systems and branches may be considered.
Genera I I y the equations used a r e :
23

Continuity of flow at junctions (net inflow less d r a w o f f must


be z e r o ) .
Head d i f f e r e n c e s between nodes e q u a l f r i c t i o n h e a d loss in t h e
pipes linking them. Minor losses and velocity head are
generally neglected or included in the friction term, or an
e q u i v a l e n t l e n g t h o f p i p e i s a d d e d to t h e p i p e l i n e to a l l o w f o r
m i n o r losses.
Dynamic equations of motion - only where acceleration or
d e c e l e r a t i o n of w a t e r i s s i g n i f i c a n t .

SIMPLE P I PE PROBLEMS

Calculation OF Head Difference, Given F l o w Rate


For the case of a known flow rate in a p i p e of known length,
diameter and roughness, the c a l c u l a t i o n of head loss i s s i m p l e a n d
direct, u s i n g f o r e x a m p l e t h e Hazen-Williams equation,

hf = 6.84L(V/C) less /D 1 * 1 6 7 (m-s u n i t s ) (2.1)

where C is the Hazen-Williams coefficient e.g. 140 f o r smooth p i p e s


r e d u c i n g f o r rough pipes, o r t h e Darcy-Weisbach equation,
vz
XL
(2.2)
hf =3-
where A is a function of the pipe relative roughness and the
Reynolds number, Re = VD/v, v is the kinematic viscosity of the
fluid, V is the mean velocity, D the p i p e bore, L the p i p e l e n g t h
and g i s g r a v i t a t i o n a l acceleration.

Calculation of F l o w Rate, Given Head Difference

The exponential type of equation, e.g. Hazen-Williams, can be


solved directly for flow velocity a n d hence d i s c h a r g e r a t e . This is
one reason why this type of equation remains popular despite its
empiricism. The more scientific formula of Darcy has to be solved
iteratively for this case as the Reynolds number is a function of
flow velocity which i s a n unknown. The p r o c e d u r e i s to guess a V ,
calculate the corresponding Re, read 1 from a Moody d i a g r a m ( o r
c a l c u l a t e i t from t h e Colebrook- White e q u a t i o n ) a n d s o l v e f o r a new
flow velocity from the head loss equation. It is generally not
24

necessary to repeat the process with the new velocity more than
twice as the flow converges rapidly. If the procedure is to be
utilized i n a c o m p u t e r a Newton R a p h s o n c o n v e r g e n c e m e t h o d c o u l d b e
programmed (see Chapter 1). If the computations are performed
manually a head loss c h a r t based on the equations c a n be used to
simplify the calculations.

I NTER-CONNECTED RESERVO I RS

A more c o m p l i c a t e d problem involves the c a l c u l a t i o n of both flow


r a t e a n d h e a d d r o p a l o n g compound p i p e s inter-connecting a number
of reservoirs. For example a drawoff may occur from a point in a
p i p e network which i s fed from a number of reservoirs - the problem
is to estimate the flow rate in each pipe and the head at the
drawoff point.
It i s assumed that the f r i c t i o n factors, diameters and lengths of
all pipes are known. Also, the level in each reservoir remains
constant and the pressure head is nowhere negative in the pipe
network. A s i m p l e s u c h s u p p l y system i s d e p i c t e d i n F i g u r e 2.1

Water l e v e l 30

I I / 1 I

Fig. 2.1 Inter-connected Reservoirs

The problem can be reduced to the estimation of the residual


head at n o d e 3. Then the corresponding flow in each of pipes 1-3
a n d 2-3 can be calculated. I f t h e n e t f l o w to node 3 does n o t e q u a l
25

the drawoff, lOO@/s, the assumed head at node 3 is incorrect and


should be revised. A trial and error method could be employed to
obtain a more accurate head at 3. Thus i f the net flow towards 3 i n
both pipes exceeded lOOP/s the head should be increased, and i f the
flow was too low the head should be decreased. The f i n a l head at 3
should be above ground level or else the flow of lOO@/s would be
unobtainable as air would be drawn into the p i p e l i n e s through a i r
valves a n d f i t t i n g s .
If k = O.Olmm, X 0.014. T r y H3 = 25m and solve f o r Q =
31
3 5 4 / s , Q23 = + 8 O @ / s , so H3 i s too h i g h . Repeating w i t h H = 21m, i t
3
w i l l be found Q = 11OP/s, Q31 = 10 @ / s .
23
A methodical a n d converging method f o r improving the estimation
of the head at 3 at each i t e r a t i o n i s demonstrated l a t e r ( t h e node
head correction method). The methods ( t r i a l and e r r o r , or iterative
r e l a x a t i o n ) could be employed f o r more complex situations, e.g. 3 or
more reservoirs, more than one drawoff and compound pipes with
changes i n diameter.
A l t e r n a t i v e l y an a n a l y t i c a l solution could be o b t a i n e d .
Thus i f H1 - H3 = klQIZ (2.3)

and H2 - H3 = k2Q22 (2.4)

Then u s i n g Q1 + Q2 = Q to e l i m i n a t e Q2 and H
3 3
(2.5)

Q1 = -2k,Qg /(2k2Q3)' - 4 ( k l - k 2 ) ( H 2 -H 1-k 2 Q3' f (2.6)


2(kl-k2)
For X = 0.014 then kl = 3622 and k 2 = 712 so Q1 = -0.014 o r -0.035

m'/s. The latter solution i s found on inspection to be incorrect and


so Q2 = 0.1 + 0.014 = 0.114 rn'/s.

PSEUDO STEADY FLOW

I f the water levels i n two inter-connected r e s e r v o i r s change w i t h


time, i t may s t i l l be possible to o b t a i n an a n a l y t i c a l solution to the
flow r a t e a n d water levels at any time. Acceleration i s neglected i n
the c a l c u l a t i o n f o r the example i n F i g u r e 2.2.

Assuming a head loss equation of the form

h = H, - H2 = K Qn (2.7)

(e.g. K = X L/2gD5 ( ~ / 4 ) ' and n = 2 f o r the Darcy e q u a t i o n ) . (2.8)


26

Fig. 2.2 Inter-connected reservoirs w i t h heads converging

then
Q = (h/K)l/n (2.9)
For c o n t i n u i t y

dHIAl = dH2A2 = Qdt (2.10)


b

... -dh = dH,+dH2 = Qdt(l/A1+l/AZ) (2.11)

(2.12)

Kl/n
I n t egra t i ng , 1 /n -
( hlt- 1- 1/ n ) =At (2.13)
( 1 - l / n ) ( l / A 1 +1 /A2) 0

i.e. starting with a known head difference ho, the relationship


between h and time t may be determined from t h i s equation.
t
The problem could also be solved n u m e r i c a l l y a n d such methods
a r e discussed i n chapters 7 a n d 8.

COMPOUND P I PES

Equivalent Pipes for Pipes in Series

It i s often useful to know the equivalent p i p e which would g i v e


the same head loss a n d flow as a number of inter-connected pipes i n
series or parallel. The equivalent p i p e may be used i n place of the
compound pipes to perform f u r t h e r flow calculations.
The e q u i v a l e n t diameter of a compound p i p e composed of sections
27

of different diameters and lengths in series may be c a l c u l a t e d b y


equating the total head loss f o r any flow to the head loss through
the e q u i v a l e n t p i p e of length equal to the length of compound pipe:-

(2.14)

(2.15)

(m is 5 in the Darcy formula and 4.85 in the Hazen-Williams


formula).

Fig. 2.3 Pipes i n Series

Complex Pipes in P a r a l l e l

Fig. 2.4 Pipes i n P a r a l l e l


Similarly, the equivalent diameter of a system of pipes
parallel i s d e r i v e d b y e q u a t i n g the total flow through the equivalent
pipe 'el to the sum of the flows through the i n d i v i d u a l pipes ' i ' 'i n
para1 l e l :
Now h = h. (2.16)
28

i.e. KPeQnD! = KeiQin/Dm (2.17)

so ai = (Pe/ei)'/n(~i/~e)m/n~ (2.18)

and Q = ZQi = C[(Pe/Pi)'/n(Di/De)m/nQ] (2.19)

Cancelling out Q, and b r i n g i n g D and ee to the left h a n d side,

(Dem/Pe)'/" = C ( D i m / P i ) 1/ n (2.20)

and i f each P i s the same,


m/n n/m
De = ( C D i ) (2.21

The e q u i v a l e n t diameter could also be d e r i v e d u s i n g a flow/head


loss c h a r t . For pipes i n p a r a l l e l , assume a reasonable head loss and
read off the flow through each pipe from the chart. Read off the
e q u i v a l e n t diameter which would g i v e the total flow a t the same head
loss. For pipes in series, assume a reasonable flow and calculate
the total head loss with the assistance of the chart. Read o f f the
equivalent pipe diameter which wduld discharge the assumed flow
w i t h the total head loss across i t s length.
It often speeds network analyses to simplify pipe networks as
much as possible using equivalent diameters for minor pipes in
series or parallel. Of course the methods of network analysis
described below could always be used to analyse flows through
compound pipes and this is in fact the p r e f e r r e d method f o r more
complex systems than those discussed above.

NODE HEAD CORRECT ION METHOD

A converging iterative method of obtaining the correct heads at


nodes and the corresponding p i p e flows i s often used, especially for
complex branched networks with multiple reservoirs. T h i s method i s
termed the node head correction method. It is necessary to assume
initial heads at each node. Heads at nodes are then corrected by
successive approximation. The steps i n an a n a l y s i s a r e as follows:-
(1) Draw the p i p e network schematically to a c l e a r scale. Indicate
all inputs, drawoffs, f i x e d heads and booster pumps.
(2) Assume initial arbitrary but reasonable heads at each node
(except if the head a t that node i s f i x e d ) . The more accurate
the initial assignments, the speedier w i l l be the convergence of
29

the solution.
(3) Calculate the flow in each pipe to any node with a variable
head u s i n g a formula of the form Q = (hDm/Kt)'/" or using a
f low/head loss c h a r t .
(4) Calculate the net inflow to the specific node and i f t h i s i s not
zero, correct the head b y a d d i n g the amount

AH = C Q (2.22)
m
This equation i s d e r i v e d as follows:-
(2.23)
Since Q = (hDm/K@)'/"
dQ = Qdh/nh (2.24)

We r e q u i r e Z ( Q + dQ) = 0
Qdh
i.e. C Q + C -
nh
= o (2.25)

But dH = -dh where h i s head loss and


H i s head a t node (2.26)
\
so AH = ZQ (2.27)
zo
Flow Q and head loss are considered positive if towards the
node. H i s the head a t the node. I n p u t s ( p o s i t i v e ) and drawoffs
( n e g a t i v e ) a t the node should b e included i n Q .
(5) Correct the head a t each variable-head node i n s i m i l a r manner,
i.e. repeat steps 3 and 4 f o r each node.
(6) Repeat the procedcre (steps 3 to 5 ) u n t i l a l l flows balance to a
sufficient degree of accuracy. If the head difference between
the ends of a p i p e i s zero at any stage, omit the p i p e from the
p a r t i c u l a r b a l a n c i n g operation.
I t should be noted that the node head correction method i n some
cases converges s l o w l y i f at all or i t can be unstable. This can be
the case if the system is unbalanced, i.e. one pipe with a high
head loss i s adjacent to another p i p e w i t h a low head loss. A small
head correction at the common node could cause a l a r g e change i n
flow, even a flow r e v e r s a l i n the low head loss pipe. I n fact a head
correction should be less than the head loss i n any p i p e connecting
to the node in question. It may therefore take many iterations to
work a correction out of the system. A l t e r n a t i v e l y the flow r a t e could
o s c i l l a t e w i l d l y a n d no longer comply w i t h the l i n e a r i z e d r e l a t i o n s h i p
between a s m a l l change i n head loss and change i n flow.
30

O n the other h a n d , data input is very simple for the node head
correction method. No loops have to be assumed and initial flows
need n o t be estimated. Heads c a n b e t a k e n a s g r o u n d l e v e l s f o r e a c h
node to start with so sometimes no initial heads have to be
estimated. It is easier to identify pipes b y the nodes they connect
rather than the loops they separate. It i s easier to interpret the
results. Final heads are given for each node instead of just line
head losses a s f o r the loop method. I f c h a n g e s a r e r e q u i r e d once a
preliminary analysis is done it is easy to add, subtract or alter
pipes with the node method. Many of these a d v a n t a g e s are retained
in the l i n e a r method described in Chapter 4 .

COMPUTER PROGRAM BASED ON NODE HEAD CORRECTION METHOD

The method is very easy to use and simple to program (see


computer program appended to this chapter). Data input is also
simple, and easy to change after a' run. The method is, however,
slow to converge in cases of unbalanced layouts or low and high
head loss combinations. An example is depicted after the program
listing, together with input l i s t i n g a n d output. T h e same e x a m p l e i s
analysed in chapter 3 u s i n g a different method.

Program Input

The program is run interactively and will prompt for the


following information:
Line 1: N e t w o r k name
L i n e 2: No. of pumps; No. of nodes ( t o t a l ) ; No. o f f i x e d h e a d nodes
(reservoirs); permissible f i n a l maximum change in head p e r i t e r a t i o n
in m (the 'error'); Darcy factor (assumed constant for all pipes);
Head a t n o d e 1 ( w h i c h must be a reservoir) i n metres. Note t h a t i n
n u m b e r i n g nodes, the f i x e d heads should be numbered f i r s t .
Line 3 and subsequent lines (one for each pipe): Top node No.;
Bottom node (the correct order is not important at this stage);
Length in metres; Diameter in metres; First estimate of head at
b o t t o m node in m e t r e s ; D r a w o f f a t b o t t o m n o d e in m 3 / s .
Pipe data can be p u t in a n y o r d e r b u t e v e r y n o d e i n t h e system
should have its head and drawoff defined in t h e data input, i.e.
31

each node should be a bottom node in at least one pipe. If data


(head a n d drawoff) for any node i s supplied twice thus it i s only
the last d a t a which i s recorded. Drawoffs a r e ignored at f i x e d head
nodes.
When the answers are p r i n t e d , the top head node and bottom node
will be in the correct order thus d e f i n i n g flow direction. The head
at the bottom node i s also given.

i2=998.5m

500m 25
l\ 1
300m 25
f '
i

F i g . 2.5 Network analysed b y program

NEWTON-RAPHSON METHOD

Most methods of network a n a l y s i s described here a r e based on a


linearization of the head loss equations. Even the Hardy Cross
methods are based on a linear increment i n flow b e i n g proportional
to a linear increment in head loss. The method hereunder does not
require such a linearization by the analyst but a mathematical
32

a p p r o x i m a t i o n to the n o n - l i n e a r head loss term i s improved i n steps


using I inear increments. The Newton- Raphson technique i s u s e d to
solve the non-l i n e a r head-flow equations simultaneously f o r each p i p e
in the network. The method i s s a i d b y Jeppson (1976) to h a v e r a p i d
convergence, but requires a close initial estimate of flows if
instability is to be avoided. It also requires relatively little
computer s t o r a g e .
The method used in Chapter 1 to solve the Colebrook-White
equation f o r h , i s b a s e d on t h e a p p r o x i m a t i o n

where F ( x ) i s the f u n c t i o n of x t o b e s o l v e d ( F ( x ) = 0 ) and F ’ is


the differential of F with respect to x. Subscript m refers to the
m-th iteration. This equation comes directly from the first order
a p p r o x i m a t ion
F ’ ( x m ) = F ( x m + , ) - F ( x m ) where F ( X ~ + =~ 0) (2.29)
X - x
m+l m
The convergence is rapid because the error in the m+l-th
iteration i s proportional to the e r r o r i n t h e m-th i t e r a t i o n squared.
This is termed quadratic convergence. The method applied to the
simultaneous s o l u t i o n of a number of non-linear equations f o r heads
a t nodes i s d e m o n s t r a t e d w i t h a n e x a m p l e below

H=80 m

1OOOm x200m m
I

t
30 t / s

Head losses H = 0.02LQZf/s


D Sm l 0 0 0 2x (71 /4 )

= L Q 2 / D 5 ( D i n m,
0.0325~10-~ Q i n f / s , L in m )

. ’ .Q = 5547h’D5I2 / L 4
1
812 = 3.14 H12I
1
823 = 2.16 H232
1
834 = 4.96 H 3 4 I
33

Set F2 = '212-823 -30 = 0 f o r f l o w b a l a n c e a t node 2


1 1
= 3.14(8O-H2)'-2.16(H2-H3)' - 30
F3 = Q23-834 = 0 f o r f I ow b a l a n c e a t n o d e 3
1 1
= 2.16 (H2-H3) '-4.96 (H3-100)'
1 1
dF 2
- = 1 .57/(80-H2)? - 1 .08/(H2-H3)e
dH 2
dF3
- = - 1 .08/(H2-H3)i-2.48/(H3-100)i
dH 3
T r y H2 = 55m, H 3 = 90m
1 1
Then = 5 5 - 3.14(80-55)'-2.16(55-90)'-30 = 56.06
H22 I I

1.57/(80-55)'-1.08/(55-90):
1

= 9 0 - -2.16(55-90)'-4.96(90-100)p = 87.0
H32 1
-1.08/(55-90)~-2.48/(90-100)'

1 1
Note (55-90)' i s assumed to be -(90-55)? etc. to account f o r flow
direction. T h e new h e a d s c a n b e r e - s u b s t i t u t e d into the equations for
t h e n e x t i t e r a t i o n a n d so o n .
It will be observed that the r e s u l t i n g equations a r e i n effect the
same as those for the node head correction method. If the basic
equations were written i n terms of unknown flows instead of heads,
t h e r e s u l t i n g e q u a t i o n s w o u l d b e t h e same a s t h e loop f l o w c o r r e c t i o n
equation (see Ch. 3). The equations may, however, be solved
simultaneously for all new flows instead of for one loop a t a time
(Ch. 3 ) .

REFERENCES

Davis,C.V., 1952. H a n d b o o k o f A p p l i e d H y d r a u l i c s , McGraw Hi1 1,2nd


E d n . N.Y.
Jeppson, R.W., 1976. A n a l y s i s o f F l o w i n P i p e N e t w o r k s . A n n A r b o r
Science. 161pp.
Stephenson, D., 1981. P i p e l i n e D e s i g n f o r W a t e r E n g i n e e r s , 2 n d E d n .
E I sev i e r , A m s t e r d a m . 234pp.
Webber, N.B., 1971. F l u i d M e c h a n i c s f o r C i v i l E n g i n e e r s , C h a p m a n
and H a l I , L o n d o n .
34

Network a n a l y s i s by Node Head C o r r e c t ion-Program Output and Input

F'I' NUDE HERO t;OFF'

H2M
397 p
9'7.4
994.8
5 e Gz9.8 ! 32 I F F T - S U N I T S 994 .e
68. D I S P "HPlPES..NHODES,NRESS,E~ 990 3
Rm.. DARCY f I TOPHm" i 998.3
78 I NPUT N 1 N2 > t.13, H 3 , F 2 H < 1 3 993.8
80 FOR J = l TO N 1 I F I X E D HEADS 991.1
NUMBEF'ED F I R S T
90 D I SP " NODE 1+ . NODE2- I Lnr I Dm I I N NETWORK NHME?
ITLH2,Q2m?./s"; TEST I?CIN
.
180 I NPClT K i; J L 1:. J 3 X < J > ,D < J ? ,H 2 NPIPES., NNClDES, NRESS ERRm, D A R C Y f .,
I

,42 TOF'Hm?
118 H < L C . J >j = H 2 e..7.3.. 1.. .815.. 1880
120 p ( L < J j ? = ~2 NODEl+.. NODE2-, La, DNI: INITLH2..C!2m3
138 F < J > =F
148 NEXT 3
158 FOR Il=l TI2 50 ! M A X I T H S
168 U=B
170 FOR J = l TO N1
172 I F H < K < J ) ~ : ~ < > H ( L ( J > THEN
> 188
174 H<K<Jj>=H<L(J):>+ 01
188 I F H I K C . J j l > = H < L ( J l j THEN 228
190 lJ=L < -J1
208 L < J > =K ( J >
218
228
238

S=N
F O R J = l TO N l
I F K ( J > < > I THEN 338
R=R-Qi;J,
S=S +Q ( J 1 i < H ( K < I. ? - H < L ( J ? ! ?
GOTO 368
I F L < . . J > O I THEN 368

)-H<L (J?)?

I THEN 468

. ..
410 I F U < H 3 THEN 438
428 NEXT I 1
438 .P .R. -I N
..T. -
Lb.
44u P R I N T " H+ N- XIM) @ < M ? QM
3/5 H2M"
450 FOR J = l TO Nl
468 P R I N T U S I N G 478 ; K!:J?,L(J!..
X C J ) , D < . J j .,Q<.J> .H<L<..J>:>
470 1tlAGE DDD DDD, ~ @ @ C I @D@ , . DUD, I?
D.DDD>DDDDD.D
488 NEXT J
498 END
35

CHAPTER 3

LOOP FLOW CORRECTION METHOD OF NETWORK ANALYSIS

I NTRODUCT I ON

An efficient method of a n a l y s i n g the flows i n p i p e networks was


developed by Hardy Cross (1936). The numerical method can be
performed manually or by computer and i s one of the most rapid
methods of manually estimating flows and head losses in a network
with closed loops. By closed loops it is implied that there are
alternative routes supplying any of the (known) drawoffs from the
system. Provided the loops are selected judiciously the number of
iterations may be considerably less than the number of individual
pipes i n the network and convergence i s r a p i d .
The method suffers the disadvantages that the network has to b e
drawn i n t h e ’ f o r m of a number of closed loops o r routes and i n i t i a l
\
flows have to be estimated such that flows balance a t each node o r
intersection. There are further complications when more than one
r e s e r v o i r o r f i x e d head i s included o r when b r a n c h pipes feature.
Pipes j o i n nodes o r junctions and drawoffs should be taken from
the nodes. The number of nodes should be minimized to minimize the
number of pipes i n the network. T h i s may be done b y lumping a lot
of drawoffs, e.9. from a block of houses, together and t a k i n g them
off a central point. Where local head losses are important the
number of nodes may not be able to b e reduced much. On the other
hand, the longer the lengths of individual pipes the more r a p i d l y
d a t a assembly a n d a n a l y s i s can be done.

METHOD OF FLOW CORRECTION

The method requires an initial r e a l i s t i c estimate of flows which


a r e successively corrected. Corrections a r e made i n steps to the flows
in closed loops, using a r e l a x a t i o n o r converging i t e r a t i v e method.
The basis of the correction is derived as follows. A first order
approximation to the d i f f e r e n t i a l of the head loss equation i s made:
36

Assuming h = KLQn/Dm

Then dh = KLnQ"-'dQ/Dm = (nh/Q)dQ

The total net head loss around any closed loop should be zero
and if it is not, the head losses are incorrect and should be
adjusted by dh:
Then Z(h+dh) = 0 (3.3
Ch + Cdh = 0 (3.4
Zh + Z(nh/Q)dQ = 0 (3.5
AQ = -Lh (3.6)
nco
I f the Darcy-Weisbach equation i s used f o r head losses, n=2 a n d
m=5, whereas the Hazen-Williams equation would give n=1.85 and
m=4.85. Some degree of freedom i s a v a i l a b l e i n selecting n. I t may
also be noted that Q and h may be i n any units, e.g. P/s and m
respect i v e l y .
Barlow a n d M a r k l a n d (1969) showed how a second order a p p r o x i -
mation to the d i f f e r e n t i a l produced a more r a p i d convergence.
Steps in analysis may be set out as follows (lnstn. of Water
Engineers, 1969);
1. Draw the network p l a n to a c l e a r scale a n d set a l l d a t a such as
pipe lengths a n d diameters, r e s e r v o i r heads and drawoffs on the
plan. In fact it i s often convenient to set the c a l c u l a t i o n s out
on such a p l a n .
2. Number the closed loops consecutively and mark p o s i t i v e direc-
tions, e.g. clockwise.
3. Starting with any pipe in any loop, assign an arbitrary but
sensible flow and flow direction to this pipe. Repeat for an
adjacent pipe taking care that the flow balances at the
intermediate node, i.e. net inflow to less drawoff from each node
must b e zero. Proceed thus through the network a l l o c a t i n g flows
to each pipe. The number of assumptions necessary will equal
the number of inner loops, i.e. a new flow will have to be
assumed at each new loop. The more accurate the initial
estimates of flows the speedier w i l l be the solution.
4. Calculate t h e head loss i n each p i p e u s i n g a formula o f the form
h = KLQn/Dm. Also calculate the term h/Q for each pipe
r e t a i n i n g the p o s i t i v e v a l u e of h and Q i n t h i s case.
37

5. Select a loop such as the most prominent one if performing the


analysis manually, or proceed in numerical order starting at
loop 1 i f u s i n g a computer. Calculate the net head l o s s around
the loop, adding head drops, or subtracting head increases i f
the flow i s i n the adverse direction.
6. If the net head loss around the loop is not zero, correct the
flows i n each p i p e i n the loop u s i n g the formula

A Q = -Zh/nZ(h/Q). (3.6)
7. Repeat steps 5 a n d 6 f o r each loop.
8. Repeat steps 4 to 7 until the head losses around each loop
balance to a s a t i s f a c t o r y degree o r u n t i l the flow corrections a r e
negligible.
9. Calculate the head at each node by starting at a known head
point and going from pipe to pipe. Compare the heads at each
node w i t h ground levels to determine the r e s i d u a l pressure head.
It i s easier to estimate head losses from a head loss c h a r t than
to use an equatizn if the procedure i s done m a n u a l l y . The value of
n can also be set a t 2 f o r ease of manual computations.
If h ( a n d consequently Q) works out a t zero f o r any pipe d u r i n g
the computations, h/Q should be assumed to be zero in calculating
Zh/Q f o r the corresponding loop o r loops.

LOOP SELECT I ON

It is most convenient to select and number consecutively loops


adjacent to each other when proceeding across the network. This i s ,
however, not necessarily the method which w i l l result i n most r a p i d
numerical convergence when c o r r e c t i n g flows. By c a r e f u l l y designat-
ing loops the convergence can be speeded up. Remember a correction
can only proceed at the rate of one loop at a time through the
system.
It i s often convenient to have some of the loops embracing the
l a r g e r pipes, i.e. c u t t i n g across small minor loops. A l t e r n a t i v e l y the
outer pipes can be imagined as a loop turned inside out. The space
outside the network thus has a loop number. The method w i l l work
whether or not such additional loops are included. If a pipe is
identified by two loop numbers then it is necessary to number the
outer loop.
38

The procedure of identifying pipes by the loops they separate


may also be used to i n d i c a t e the d i r e c t i o n of flow. If all loops obey
a sign convention such as clockwise positive, then the loop i n which
the flow is i n the p o s i t i v e d i r e c t i o n can a l w a y s be g i v e n f i r s t when
i d e n t i f y i n g a p i p e a n d i t s flow direction.
When computing the flow correction f o r successive loops, the head
loss c a l c u l a t i o n and flow corrections may be made f o r one loop at a
time, or else all the flow corrections may .be computed before
correcting all the loop flows together. The former procedure is
easiest to computerize whereas the latter procedure is often the
easiest when doing the calculations manually. Careful a t t e n t i o n has
to be paid to signs and directions, however, or else the flow
balance can be lost f o r some of the nodes.

MULT I PLE RESERVO I RS

The loop network method becomes t r i c k y when more than one f i x e d


head reservoir is incorporated in the pipe network. The simplest
method of coping w i t h m u l t i p l e r e s e r v o i r s i s to insert a dummy p i p e
connecting the reservoirs (one dummy pipe per additional reservoir
above one). One a d d i t i o n a l loop i s thereby created per dummy pipe.
The length a n d diameter of dummy pipes may be selected a r b i t r a r i l y
and the estimated flow in a dummy p i p e should correspond to the
head difference between the r e s e r v o i r s i t connects.
The flow and head loss i n the dummy p i p e a r e taken i n t o account
i n c a l c u l a t i n g z h and c h / Q around the respective loops, b u t the flow
is not corrected in dummy pipes when the flow correction i s made
around the r e l e v a n t loop.

BRANCH PIPES

Although predominantly tree-like networks without closed loops


can often be handled most e f f i c i e n t l y u s i n g the node head correction
method, it is possible to include b r a n c h pipes i n the loop method.
The flow i n an isolated b r a n c h p i p e should be p r e - defined (unless
the b r a n c h connects a reservoir when it will be incorporated i n a
loop with a dummy p i p e ) . Therefore the head loss can be estimated
without r e s o r t i n g to i t e r a t i o n s except if it i s a compound p i p e made
39

up of a number of diameters i n series. Even then, equivalent pipe


methods a r e possible.
In general either the head at a node, or the drawoff, can be
defined. I n either case the other variable has to be c a l c u l a t e d i n
the network a n a l y s i s .
The method of including branch pipes with defined flows in a
network programme i s to a s c r i b e a r b i t r a r y loop numbers g r e a t e r than
the number of real loops to the branch pipe, and not correct the
flows i n those loops.

PUMPS AND PRESSURE REDUCING VALVES

Pumps may be assumed to increase or boost the head i n a pipe i n


one direction by a specified amount. Pressure reducing valves, on
the other hand, may reduce the head b y a specified head and can
be treated as a negative pumping head. ( I f e i t h e r operates to g i v e a
fixed total h e a d at a point that point may be treated like a
fixed-head reservoir).
A pumping head would be included i n an a n a l y s i s b y s u b t r a c t i n g
head generated from the f r i c t i o n head drop i f proceeding around the
loop i n the d i r e c t i o n of p o s i t i v e flow i n the p i p e w i t h pump. I f the
flow is against the pumping head add the friction head and
pumping head. T h i s pumping head i s included i n 1 h b u t not i n Zh/Q
when proceeding around the loop. The computation f o r Q i s then as
before.
Where a preset v a l v e or f i t t i n g i n a pipe causes a head loss i n
the d i r e c t i o n of flow the fitting can generally b e converted to an
equivalent length o f pipe and added to the r e a l p i p e length. Thus i f
the head loss through the fitting is KVZ/2g and the friction head
loss in the pipe is ( A L/D)V2/2g, then the equivalent additional
l e n g t h of p i p e is

AL = KD/A (3.7)

I f the pumping head i s a function of the flow r a t e , e.g.


2
h = a + a Q + a 2 Q (3.8)
P O 1
where a = the pump shutoff head and al and a
0 2 are pump
cons tan ts,
then equation (3.6) w i l l be replaced as follows:
40

The r e v i s e d Q1 = (Q + dQ) (3.9)


2 (3.10)
For any pipe head drop h = KLQn/Dm - a. alQ-a Q
2
or i f h i s the uncorrected head drop,
h+dh = KL(Qn+n Qn-'dQ+. ..)/Dm-aO-a, (Q+dQ -a2(Q2+2QdQ+...) (3.11)
The total head drop around a loop must be zero:
C(h+dh) = 0 (3.3)

Hence dQ = - c ( KLQn/Dm-a0-alQ-a2QZ (3.12)


n c K L Q n - l /Dm-a -2Qa2

-C(h -h )
or A Q = f P (3.13)
n C ( h /Q)-C(al+2Qa2)
f

PRACT I CAL DES I GN

The water engineer may be r e q u i r e d to analyse a p i p e network to


check flows o r heads. He may have to check pressure heads f o r aged
networks to see i f they a r e s u f f i c i e n t , o r to re-analyse a network f o r
a revised demand pattern. Alternativety the system may have been
designed to cope with a certain demand pattern and abnormal
conditions have to be checked. For example, design of p i p e sizes
may have been based on peak p e r i o d drawoffs, b u t an abnormal load
may come on the system when a f i r e h y d r a n t i s operated. Then lower
pressures generally may be tolerable provided the fire demand is
met. For example spread over a township, peak house demands may
be assumed to be 0.1 @ / s whereas i n d i v i d u a l f i r e h y d r a n t s may have
to d e l i v e r more than 10 e / s .
Pipe sizes have to be selected by trial and e r r o r . The network
will be analysed for each assumed pipe network layout and pipe
diameter until a satisfactory arrangement i s at hand. Generally a
tree-I i k e network with a radiating distribution of pipes becoming
smaller i n diameter towards the t i p s i s the most economic, b u t closed
loops a r e r e q u i r e d f o r security i n case pipes a r e damaged or taken
out of commission. The tree - l i k e network with consequent known
flows can be optimized using linear programming methods b u t trial
and error design is necessary for looped systems. As a guide the
head loss g r a d i e n t s should be lesser the l a r g e r the p i p e diameter o r
flow, b u t care i s necessary to ensure pressures a r e not too h i g h i n
valleys(e.g. lOOm upper limit for household fittings) or too low a t
41

high points (e.g. 15m lower limit for residential areas). In


u n d u l a t i n g areas, pressure r e d u c i n g v a l v e s may be r e q u i r e d to meet
these pressure limits, or many r e s e r v o i r s could be used to supply
separate zones.

COMPUTER PROGRAM FOR LOOP FLOW CORRECTION METHOD

The accompanying computer program i n BASIC language i s based


on the loop flow correction method. It is adapted to suit a HP-85
computer and as the program stands it can handle 50 pipes. No
pumps are permitted. It is in SI u n i t s (metres a n d seconds) b u t b y
a d j u s t i n g G from 9.8 to 32 i t may b e r u n - i n ft-sec u n i t s . Also where
m is indicated i n the p r i n t o u t , ft should be assumed i f calculations
are to be i n ft-sec units.
The Darcy head loss equation is used with a constant friction
factor (equivalent to f in North America). The symbol F i n the
program represents X and i s assumed the same f o r each pipe. X and
pumping heads could in fact be r e a d f o r each p i p e b u t t h i s would
increase d a t a i n p u t .
I n p u t requested i n t e r a c t i v e l y is:
Line 1; Name of system
Line 2 ; No. of pipes; No. of loops; No. of reservoirs; Error
permitted i n m3/s; Darcy f r i c t i o n f a c t o r .
Line 3 (One for each pipe starting with dummy pipes); Positive
etc.
- loop; Negative loop; Length (m); Diameter (m); Initial
estimate of flow (m’/s).

Running time i s r o u g h l y 1s per 3 pipes per i t e r a t i o n .


42
E
c
.r
n \
n o N
m w
N - - I
'-E
N b
o c -
.r
E
&
0
t X
E
E
In
E 7
m
0
0
X
X
E
0 0
V
m

0
0
N -
0
0
W
r
88t
BLP
89P
8SP
BPC
Bet?
BZP
91t
BBP
86E
88E
BLE
09.2
BEE
BPE
BEE
0ZE
BIZ
B0E
862
08Z
BLZ
B9Z
BSZ
8tZ
96 I
08 I
BL I
89 I
0sI
8t I
Br" I
8.2 I
81 1
na I
B6
68
8L
89
8s
OP
rl
iJI
43
44

pseudo-pipe w i t h head loss=Hl-H2


/ % \
\
n 1 \

I ' fi H1=1000m

I
a 1 a s s u m e d f 1o w s
oop method (ch 3 )

08m3 / s
"
11 400i Q.3

ed l o o p s

F i g . 3.2 Network analysed by program u s i n g loop method

REFERENCES

B a r l o w , J.F. a n d M a r k l a n d , E., June 1969. Computer a n a l y s i s of


p i p e n e t w o r k s , Proc. I n s t n . C i v i l E n g r s . , 48, p a p e r 7187, p249.
Cross, H., 1936. A n a l y s i s o f f l o w i n n e t w o r k s o f c o n d u i t s o r conduc-
t o r s . U n i v e r s i t y o f I l l i n o i s , B u l l e t i n 286.
I n s t i t u t i o n o f Water E n g i n e e r s , 1969. M a n u a l o f Water E n g i n e e r i n g
P r a c t i c e , 4 t h E d n . , London.
45

CHAPTER 4

LINEAR METHOD

I NTRODUCT I ON

The trial and error and relaxation methods of pipe network


analysis were o r i g i n a l l y developed f o r manual solution. Calculations
proceed from one pipe to the next in a routine manner and large
matrices or solution of simultaneous equations are not required. The
methods suffer disadvantages such as poor convergence for some
systems unless improved solution methods a r e used (e.g. Barlow and
Markland, 1969). With the development of digital computers came
methods of inversion of matrices and methods of solution of sets of
linear equations, e.g. Gauss' method of elimination. Rapid conver-
gence of non-l i n e a r equations, employing numerical method such as
that of Newton-Raphson (e.g. Martin and Peters 1963) is also
possible.
The possibility of solution of a matrix of equations for pipe
networks r e l a t i n g flows to head losses and i n c l u d i n g flow balance at
each node thus arises. Except for laminar flow which is rarely
encountered in waterworks practice, the flow-head loss relationship
for pipes i s non-linear. T h i s makes the establishment and solution of
I inear simultaneous equations difficult. A method of converting the
equations to a l i n e a r form was proposed b y Wood and Charles (1972).
The linearization makes matrix solution of a set of simultaneous
equations r e l a t i v e l y easy. The l i n e a r form of head loss-flow equation
is in fact an approximation to the true equation and the
approximation is improved iteratively by substituting revised flows
into a 'constant' in the head loss equation. The linearization
techniques can b e a p p l i e d i n s o l v i n g f o r flows around loops o r heads
at nodes (Isaacs and Mills, 1980). A comparison of the various
methods was made by Wood and Rayes (1981). Although the linear
method reduces computational effort, it can result in oscillating
solutions and averaging methods may be required to speed
convergence (Wood a n d Charles, 1972). There are also problems of
convergence for the node method where some pipes have low head
losses, as f o r the node head correction method of Hardy Cross.
46

I n general a set of equations i s established as follows:


A t each node, f o r c o n t i n u i t y

XIin = drawoff (4.1

There are j equations for j 'closed' nodes or junctions. That is


only nodes which can vary in head are considered thus, and
junctions where the head is fixed have to have a v a r i a b l e volume.
For such nodes the c o n t i n u i t y equation becomes

AtCQin = increase i n volume stored (4.2)

If the r e l a t i o n s h i p between volume and head i s known t h i s could


be u t i l i z e d b u t it i s common p r a c t i c e to assume r e s e r v o i r levels a r e
fixed, that is for steady state conditions volumes are assumed
constant. Therefore the mass balance equations at reservoirs or
fixed head nodes are not required as the number of variables in
the networks is reduced by the number of fixed head reservoirs.
Alternatively the above equation i s replaced b y one of the form f o r
\
each known head j u n c t i o n

H = constant

There are also i equations (one for each closed loop) of the
f o l l o w i n g form

I h = 0 (4.3)

where h is the head loss in a selected direction in one pipe


forming the loop, i.e. the net head loss around each closed loop
must be zero. Now each head loss h i s r e l a t e d to the flow r a t e i n
the pipe, Q , b y an equation of the form

h = KQn (4.4)

so that heads can be replaced by the term involving Q f o r each


pipe. I t can be shown that i n a network w i t h i pipes, j nodes a n d
m ioops, ( o n i y counting i n t e r n a l loops)

i = j + m - 1 (4.5)

This holds for all networks with closed loops as well as open
tree-like branches. There are j - 1 continuity or fixed head
equations ( t h e a d d i t i o n a l one i s r e d u n d a n t ) and m loop equations,
thus g i v i n g a total of i equations f o r i unknowns i f flows a r e used
as the unknowns. The j f equations f o r known heads can be omitted
where j f i s the number of f i x e d head nodes.
47

oniitted where j i s the number of f i x e d head nodes.


f
Alternatively, if heads a t nodes a r e regarded as the unknowns
there are j equations f o r nodes, where each flow Q i n m pipes i s
replaced b y ( h / K )
1/n
.
There are m equations r e l a t i n g head loss to flow i n the pipes,
so that once the Q ' s i n the head loss equations a r e replaced b y H
1
- H2 the number of equations i s s t i l l j f o r s o l v i n g f o r j unknown
heads.
Unfortunately, except in laminar flow situations the equations
relating h a n d Q a r e non-linear so d i r e c t simultaneous solution of
both the node equations and the loop flow equations is difficult.
There is no easy method of solution of non-linear simultaneous
equations a n d t r i a l and e r r o r o r numerical methods u s u a l l y have to
be employed. The method used here, the linear method, is to
approximate the head loss equations by l i n e a r equations and then
they can be solved simul taneously by various methods. Where
computer storac& is no problem, Gauss elimination i s an efficient
method, and if storage is limited but computing time is readily
a v a i lable, successive approximation, e.g. successive over-relaxation
a n d Newton Raphson methods can be employed.

LINEAR METHOD APPLIED TO LOOP FLOWS

If the head loss i n any p i p e can be expressed b y an equation


such as

h. = K.Q."
I I (4.6)

i t can be r e w r i t t e n approximately as follows


n-1
h. K.Q. Qi = KfQ. (4.7)
I I 10

where K. is a f u n c t i o n of the length of pipe i, i t s diameter and


roughness, Q. is the flow r a t e and Q. i s the flow r a t e indicated
10
by the previous iteration. Both €Ia
in d h. are unknowns f o r each
iteration and a set of equations r e l a t i n g flow and head loss is
established:

Around each loop, Che = 0 (4.8)


48

i.e. CK.: aim = o (4.9)

a n d f o r e a c h node j : ZQ.. = q. (4.10)


IJ J
where Q.. i s the f l o w i n p i p e i to node j , Qim i s the flow in pipe i
IJ
i n loop m a n d q . i s t h e d r a w o f f a t node j .
J
I f there a r e i pipes, j nodes a n d m loops, t h e n i t was s t a t e d t h a t
i = j + m - 1 (4.11)

There are j node equations and m loop e q u a t i o n s so there a r e


i+l equations in total of w h i c h one i s redundant so one c a n solve
for i flows. The r e s u l t i n g set o f l i n e a r equations h a s to b e s o l v e d
a number of times. Each time, new Q.'s emerge a n d the K."s are
revised (improved) before re-solving the equations. Initial flow
r a t e s h a v e to be e s t i m a t e d p r i o r to the f i r s t s o l u t i o n of t h e l i n e a r
equations.
Although the above method converges fairly we1 I the following
method i s e a s i e r to v i s u a l i z e a n d i s e x p l a i n e d i n more d e t a i l .
\

L I N E A R METHOD FOR NODE HEADS

In this case the Darcy head loss equation will be used to


simplify the calculations. The friction loss e q u a t i o n f o r a pipe is
then written as Q..lQ../I J IJ
= h../K..
IJ IJ
where Q.. i s
IJ
t h e f l o w from node i
to node j , h.. i s t h e h e a d d i f f e r e n c e between i and j and K . . =
IJ IJ
8 X..C../gd?.n'. If Q.. i s a n a p p r o x i m a t e s o l u t i o n to Q.. ( o b t a i n e d
IJ IJ IJ IJO IJ
from a previous iteration or from an initial estimate) and i f one
substitutes C . . = l / ( K . . l Q . . I), then a ' l i n e a r ' equation results;
IJ IJ IJO
ZQ.. = C..h.. (4.12)
'J IJ IJ
S u b s t i t u t i n g i n t o t h e c o n t i n u i t y e q u a t i o n a t e a c h node j,
CQ.. = q. (4.13)
IJ J
ZC..h.. = q. (4.14)
IJ IJ J
R e p l a c i n g h . . b y H.-H.
IJ I J
C(C..H.-C..H.) = q . (4.15)
IJ I IJ J J
Hence H . = CC..H.-q. (4.16)
J I J I J
CC..
IJ

One has J linear equations (equal to the number of variable


49

head nodes) for J unknowns (the heads H at each node). The


equations can be solved b y v a r i o u s techniques, e.g. Gauss e l i m i n a -
tion method, or the Gauss Siedel iterative method. A successive
over-relaxation method is employed in the accompanying computer
program as it requires little memory whereas a matrix would
r e q u i r e a l a r g e computer storage c a p a c i t y .
To avoid overshoot an averaging procedure can be introduced
a f t e r each step,
H.' = wH. + ( l - w ) H . (4.17)
J J1 JO

w h e r e 0 'w ' 1 and s u b s c r i p t o r e f e r s t o t h e p r e v i o u s H. and 1 to


J
t h e r e c e n t H..
J
After solution of the equations for each H . , f l o w s 8.. i n e a c h
J IJ
p i p e a r e c a l c u l a t e d and t h e n e a c h C . . . The linearization procedure
IJ
i s t h e n r e p e a t e d and a new set o f e q u a t i o n s s o l v e d f o r t h e h e a d s a t
each node H.. The procedure is repeated until convergence is
J
s a t i sf a c t o r y .
\

Pumps

If a pump in a line generates a h


specific head,
then the
P'
h e a d loss i s H.-H.+h
I J P
. Equation (4.10) i s therefore replaced b y
X..(Hi-H.+h ) = q. (4.18)
IJ J P J

CC..(Hi+h )-q.
P J (4.19)
:.H.= IJ
J CC..
IJ

If the pumping head i s a function of the flow r a t e , the convergence


c a n be slow.

COMPUTER PROGRAM FOR LINEAR METHOD

A BASIC program is presented. The program is written to


minimize data input. Thus no pumps o r pressure reducing valves
are possible as the program stands. Also the Darcy f r i c t i o n factor
is assumed constant. I n fact i t could be v a r i e d from p i p e to p i p e
and with Reynolds number and pipe roughness with small
modifications, but the former would increase input and the latter
50

w o u l d increase computational time.


A great advantage is that no initial flows or heads need b e
assumed. Flows are initially set to correspond to unit velocity
and the corresponding heads are calculated at s u c c e s s i v e nodes.
This procedure can lead to slow convergence f o r some cases but
i s i n f a c t one o f t h e m a i n a d v a n t a g e s o f t h i s m e t h o d .
Input and o u t p u t are in metres and c u b i c metres per second.
The input is prompted at each line. Typical running time o n an
HP85 i s 5s per pipe and the number of pipes could be increased
a b o v e 30 b y a l t e r i n g t h e d i m e n s i o n s t a t e m e n t .
The appended p r o g r a m follows t h e p r o c e d u r e Slescribed p r e v i o u s -
ly. The variable names used follow the nomenclature used in the
above section in general. Although data is in S.I. units here it
will also work in ft- s units if G is a l t e r e d t o 32.2 ( l i n e 69 o f
program). It should be noted t h a t t h e speed o f the program could
be improved for large networks if the iterations between lines
360 and 410 were limited to the p i p e a connecting to that node.
This would require a new d i m e n s i o n e d v a r i a b l e f o r e a c h n o d e and
a connectivity search.

D e s c r i p t i o n of V a r i a b l e s in P r o g r a m

SD/FX
Sums H ( I ) f o r e a c h S.O.R. iteration
Sums AF
Pipe diameter ( i n m)
H o l d s t h e o l d v a l u e o f H ( I ) t o com-
p u t e AH
Darcy f r i c t i o n factor F of p i p e K
Darcy f r i c t i o n factor f o r a l l pipks
Head a t j u n c t i o n
Node c o u n t e r
Number of nodes in system
Joint b e g i n n i n g number
Joint end number
Number o f f i x e d h e a d nodes (Number-
ed first)
K Iteration counter
L Node c o u n t e r
M Pipe counter
NO Maximum number of m a i n i t e r a t i o n s
e.g. J+5
N1 M a x i m u m n u m b e r of S.O.R. iterations
w i t h i n e a c h m a i n i t e r a t i o n e.g. J+10
N2 Counts the number of m a i n i t e r a t i o n s
N3 Counts the total n u m b e r o f S.O.R.
iterations
51

Number o f p i p e s i n s y s t e m
F l o w i n p i p e m’/s
D r a w o f f i n m’/s
Drawoff from junction (+ve out of
junction)
gn2/8
CK..
‘J
Counts the number of H( 1 ) ’ s
CK. .H.
IJ J
H o l d s o l d Q ( K ) v a l u e f o r c a l c u l a t i o n of
average of o l d value a n d continuity value
TO Tolerance on head c a l c u l a t i o n in F e.g.
0.0001
T1 T o l e r a n c e o n S.O.R. loop i n metres o n
h e a d s e . g . 0.01
S.O.R. factor w e.g. 1.3m. Must be
between 1 a n d 2.
Pipe length (in m)

Data Required

Line 1: Heading. This can be any alphanumeric


e x p r e s s i o n up t o 18 c h a r a c t e r s l o n g . W i l l
be p r i n t e d out a t head of results.
L i n e 2: P : Number o f p i p e s
J : T o t a l n u m b e r o f j u n c t i o n s o r nodes
J3 : Number o f j u n c t i o n s w i t h f i x e d h e a d s
F l : Darcy friction factor, assumed t h e
same f o r a l l p i p e s e . g . 0.015
L i n e 3 to J3+3: J ( I ) : Head a t s u c c e s s i v e f i x e d - h e a d nodes
(J3 l i n e s ) ( w h i c h must b e n u m b e r e d f i r s t )
L i n e 4+J3 t o 4+J3+P: ( P lines, i n o r d e r s u c h t h a t a n y node
except f i x e d head i s r e f e r r e d to f i r s t a s
a J2 t h e n a s a J1)
J l ( K ) : Joint b e g i n no.
J 2 ( K ) : J o i n t e n d no. M a k e s u r e e a c h node
is an end number at least once to
allocate a drawoff.
X ( K ) : Pipe length (in m )
D(K): P i p e diameter ( i n m)
Q 2 ( J 2 ( K ) ) : Drawoff from end node (in
m’/s); i f t h i s information i s r e a d twice
the l a s t v a l u e i s r e t a i n e d .

G e n e r a l Comments

Generally t h e l i n e a r method c o n v e r g e s in f a r less i t e r a t i o n s than


t h e H a r d y Cross method. Between 4 a n d 10 s u c c e s s i v e a p p r o x i m a t i o n s
to the flow is all that i s r e q u i r e d even f o r networks i n v o l v i n g up
to 100 pipes. The snag is the solution of large numbers of
52

s i m u l taneous equations. If successive over-relaxation is used at


least t h a t number of substitutions may be required.
The initial flow assumption may be critical i n some cases. The
program assumes a v e l o c i t y of lm/s and calculates the correspond-
ing f l o w r a t e i n m 3 / s f o r e a c h p i p e . The i n i t i a l h e a d s a t e a c h node
are also based on this assumption and these values are used to
start the SOR improvement of head at each node. When data for
each pipe are read into the computer the head at the assumed
downstream node is calculated on this basis provided the
u p s t r e a m head i s k n o w n . Hence t h e o r d e r in w h i c h d a t a a r e s u p p l i e d
should be such that the assumed upstream node head has been
calculated, o r supplied i n t h e case o f r e s e r v o i r s . Wood a n d C h a r l e s
(1972) u s e a u n i t f l o w r a t e in each p i p e f o r the f i r s t estimate b u t
this can lead to large errors especially i f the p i p e diameters v a r y
widely. Alternatively it could be assumed to start that flows are
laminar.
Although the convergence is fairly rap\id, i t h a s been o b s e r v e d
that successive trials oscillate about the f i n a l value. To overcome
this the next approximation can be taken as the mean of the
p r e v i o u s two v a l u e s (whether flows o r heads a r e the unknowns).

Computer Program for Linear Method Network Analysis with Output


and Input (same example as in Chapters 2 and 3 ) .

I NF'IUT ,, NO-
01 SP
Y 4 "
-
N P I PE'?, NODES F I i:H DHF'C .

DISP L :
It4PCIT H i Li
NEXT L
53

NEXT K F'I F'ENET


F O F C = 1 TO P TOPN BgTI.4 X u Dni
..
..-. ,
- .-I 1 i K ?=S2i(.-II
-,.-'i 1
1
3
4
588
788
258
28R
3 4 688 158
2 4 588 458
3 5 308 256
5 6 588 288
4 t; 488 3R8
E. 7 28R 256
t+APIE

TESTL I H
tJF'IPES> NODES, F I X H * OHRCY f
54

REFERENCES

Barlow,J.F. and M a r k l a n d , E., June, 1969. C o m p u t e r A n a l y s i s of


p i p e n e t w o r k s . P r o c . ICE, 43 p 249-259.
Campbell, G.V., 1981. Pipe network analysis program (linear
m e t h o d ) . P r o j e c t , U n i v e r s i t y of t h e W i t w a t e r s r a n d .
l s a a c s , L.J. and M i l l s , K.G., J u l y , 1980. L i n e a r t h e o r y m e t h o d s f o r
p i p e n e t w o r k a n a l y s i s . P r o c . ASCE 106 ( H Y 7 ) . p1191-1201
M a r t i n , D.W., and P e t e r s , G., 1963. The a p p l i c a t i o n of N e w t o n ' s
m e t h o d t o n e t w o r k a n a l y s i s b y d i g i t a l c o m p u t e r . J. I n s t n . W a t e r
E n g r s . 17, p115-129
Wood, D.J. a n d C h a r l e s , O.A., J u l y , 1972. N e t w o r k a n a l y s i s u s i n g
l i n e a r t h e o r y . P r o c . ASCE, 98 (HY7) p1157-1170.
Wood, D.J. and R a y e s , A.G., Oct. 1981. R e l i a b i l i t y o f a l g o r i t h m s for
p i p e n e t w o r k a n a l y s i s . P r o c . ASCE, 107 ( H Y l O ) p 1145-1161.
55

CHAPTER 5

OPT IMUM DESIGN O F BRANCHED P I PE NETWORKS BY L I NEAR


PROGRAMM I NG

I NTRODUCT I ON

In the previous chapters the p i p e diameters, lengths and layouts


were assumed known and the corresponding flows and heads were
computed. Design of pipe networks could only be undertaken by
trial. The design problem i s not a s easy as the a n a l y s i s problem. In
the n e x t t w o c h a p t e r s a p p r o x i m a t e methods f o r direct d e s i g n of p i p e
networks are given. Economics d i c t a t e s t h e most p r a c t i c a l design in
e a c h case.
Linear programming is a powerful optimization technique, but it
may only be used if the relationship between variables is linear.
L i n e a r programminb cannot b e u s e d f o r o p t i m i z i n g t h e d e s i g n of p i p e
networks with closed loops without resort to successive approxima-
tions. It can be used to design trunk mains or tree-like networks
where the flow in each branch is known. Since the relationships
between flow, head loss, diameter and cost are nonlinear, the
following technique is used to render the system linear: For each
branch or main pipe, a number of pre-selected diameters i s allowed
and the length of each p i p e of different diameter i s treated a s the
variable. The h e a d losses a n d c o s t s a r e linearly proportional to t h e

respective pipe lengths. Any other type of linear constraint can be


treated in the analysis. I t may be r e q u i r e d to m a i n t a i n the pressure
at certain points in the network above a fixed minimum ( a linear
inequal i t y of the greater-than-or-equal-to-type) or within a certain
range. The total length of pipe of a certain diameter may be
r e s t r i c t e d because there i s i n s u f f i c i e n t pipe available, etc.

SIMPLEX METHOD FOR TRUNK M A I N DIAMETERS

The following example concerns a trunk main with two drawoff


points. The permissible diameters of the first leg are 250 a n d 200
mm, and of the' second leg, 200 and 150 mm. There are thus four
variables, X1, X2, Xj and X4 which are the lengths of pipe of
different diameters. This simple example could be optimized by
manual comparison of t h e cost o f a l l a l t e r n a t i v e s g i v i n g the correct
56

head loss, but linear programming is used here to demonstrate the


technique.

rl H:lOrn

RESERVOIR

LENGTH m
FLOW 11s

DIAMETER m m
UNKNOWN LENGTH m
250
X,
500
LO

2 00
X2
2 6 11s

f
2 00
x3
LOO
tr,

150
XL
14 11s

1w5m
OPTIMUM L E N G T H m 50 L 50 0 4 00
HEAD LOSS m a12 3.2 0 1.68 TOTAL 5.0

Fig. 5.1 Least-cost trunk main b y linear programming.

The head losses per 100 mm of pipe and costs per m for the
\
v a r i o u s pipes a r e i n d i c a t e d below:-

TABLE 5.1 P i p e D i a m e t e r s a n d Costs

Diameter Head loss @ 40 P / s @ 14 P / s cost


mm m/100 m m/IOO m $1 O O / ~OOm

250 0.25 5
200 0.71 0.1 4
150 0.42 3

The linear constraints on the system are expressed in equation


form below and the coefficients of the equations are tabulated in
T a b l e 5.3 ( I ) . L e n g t h s a r e e x p r e s s e d i n h u n d r e d metres.

TABLE 5.2 Constraint Equations

Lengths = 5
x1 + x2

x3 +
x4 = 4

Head Loss 0.25X, + 0.71X2 + 0.1X3 + 0.42X4 = 5

Objective Function: 5X1 + 4X2 + 4x 3


3X4 = m i n .
57

The c o m p u t a t i o n s p r o c e e d b y s e t t i n g a l l r e a l v a r i a b l e s t o zero, so
it is necessary to introduce artificial slack variables into each
equation to s a t i s f y the e q u a l i t y . The s l a c k variables are designated
a, b and c in Table 5.3(1), and t h e i r cost c o e f f i c i e n t s a r e s e t a t
very high values designated m. To initiate the solution, the slack
variables a, b and c are assigned the values 5, 4 and 5
respectively (see t h e t h i r d c o l u m n of T a b l e 5 . 3 ( 1 ) .
The n u m b e r s in a n y p a r t i c u l a r l i n e of the m a i n body of the t a b l e
indicate the amount of the program variable which would be
displaced by i n t r o d u c i n g o n e u n i t of the column variable. T h u s one
u n i t of X 1 w o u l d d i s p l a c e 1 u n i t o f a a n d 0.25 u n i t s of c.
To determine whether it i s worthwhile replacing any variable in
the program by any other variable, a number known as the
opportunity number i s calculated for each column. I f one u n i t o f X 1
was introduced, t h e n t h e cost w o u l d i n c r e a s e b y ( 5 - ( 1 x m ) - ( 0 +
m) - (0.25 + ,,m
)) which is designated the o p p o r t u n i t y value, i.e.
the o p p o r t u n i t y value for each column is calculated by multiplying
the entries in that column b y t h e c o r r e s p o n d i n g cost coefficients of
the p r o g r a m v a r i a b l e i n t h e second c o l u m n a n d s u b t r a c t i n g t h e t o t a l
thus formed from the cost coefficient of the column variable. The
most p r o f i t a b l e v a r i a b l e to i n t r o d u c e w o u l d b e X2, s i n c e i t shows t h e
greatest cost reduction per u n i t (or negative opportunity v a l u e ) . The
X column i s now d e s i g n a t e d t h e k e y c o l u m n . The k e y c o l u m n i s t h a t
2
which shows the lowest opportunity value ( i n t h e cost minimization
case). O n l y one v a r i a b l e m a y b e i n t r o d u c e d a t a time.
To determine the maximum amount of the key column variable
which may be introduced, calculate the replacement r a t i o s f o r each
row as follows:-
Divide the amount of the program variable for each row b y the
corresponding number in the key column. The lowest positive
replacement ratio is selected as that i s t h e m a x i m u m amount which
c o u l d b e i n t r o d u c e d w i t h o u t v i o l a t i n g a n y of the c o n s t r a i n t s . The r o w
with the lowest positive replacement r a t i o i s designated the key row
a n d the number a t the intersection of the key column a n d key row,
the k e y number.
After introducing a new variable, the matrix is rearranged
(Table 5.3(1l)) so that the replacement ratios remain correct. The
p r o g r a m v a r i a b l e a n d i t s cost c o e f f i c i e n t in t h e k e y r o w a r e r e p l a c e d
58

TABLE 5.3 Limear p r o g r a m m i n g s o l u t i o n of p i p e problem

I Variable
Cost coef.
r 1

Prcg. Cost Amt. a b c RepI.


X, x2 x3 x4
Var. Coef. ratio
5 4 4 3 rn m m
a r n 5 1 1 1 5 / 1 ’*
b m 4 1 1 1 m

C m 5 0.25 0.71 0.10 0.42 1 5/.71

WPORTUN 1lY
VALUE : 5-1.2% 4-1.71rn 4-l.lm 3-1.42m 0 0 0 *key
KEY C O L M row

a b c
x1 x2 x3 x4
5 4 4 3 m m r n
4 5 1 1 1
3
C
rn
rn
4
1.45 -0.46
1
0.1
1
0.42 -0.71
1
1
m

4
3.458
\
1+0.46m 0 4-l.lm 3-1.4h 1.71rn-4 0 0

Ill
a b c
x2 x3 x4
4 4 3 rn m m

2 4
rn
3
5
0.55
3.45
1
1.1
-1 , l
1
0.76
0.24 1
1
1.69
-1 -69
-2.38 0.5*&
2.38 -
5

x4
1.1-l.lm 0 3.28-0.76m 0 t.1-0.6% 3.38-8.2

IV
a b c
x1 x2 x3 x4
5 4 4 3 rn m r n
4 4.5 1 -0.69 1 2.16
x2
5 0.5 1 0.69 1.52 -2.16
x1
3 4 1 1
x4
0 0 0.31 0 rn- m m

(NO FURTHER IWROVEhENT POSS l WE )


59

by the new v a r i a b l e a n d i t s cost coefficient. The amount column a s


well as the body of the t a b l e a r e r e v i s e d as follows:-
Each number i n the key row i s d i v i d e d b y the key number.
From each number in a non-key row, s u b t r a c t the corresponding
number i n the key row m u l t i p l i e d b y the r a t i o of the o l d row number
in the key column divided by the key number. The new tableau is
g i v e n as Table 5.3(1 I ) .
The procedure of studying opportunity values and replacement
ratios and revising the table is repeated u n t i l there i s no f u r t h e r
negative o p p o r t u n i t y value. I n the example, Table 5.3 ( I V ) shows a l l
positive opportunity values so the least-cost solution is at hand
(indicated by the c u r r e n t program v a r i a b l e s a n d t h e i r corresponding
values).
The reader should refer to a standard textbook on linear
programming (e.g. Dantzig, 1963) for a full description of the
technique. There are many other cases a few of which o n l y can be
men t ioned be low :4
If the constraints are of the < = (less-than-or-equal- to) type
and not just equations, slack variables with zero cost
coefficients a r e introduced i n t o the 1.h.s. of each constraint to
make them equations. The artificial slack variables with high
cost coefficients a r e then omitted.
I f the c o n s t r a i n t s a r e of the > = (greater-than-or- equal-to) type,
introduce artificial slack variables with h i g h cost coefficients
into the i.h.s. of the c o n s t r a i n t a n d s u b t r a c t slack variables
with zero cost coefficients from each inequality to make them
equations.
If the objective function is to be minimized, the o p p o r t u n i t y
value with the highest negative value is selected, but if the
function is to be maximized, the opportunity value with the
highest p o s i t i v e v a l u e i s selected.
Note a l l v a r i a b l e s are assumed to be positive.
The opportunity values represent shadow values of the
corresponding variables i .e. they indicate the value of
i n t r o d u c i n g one u n i t of that v a r i a b l e i n t o the program.
I f two replacement r a t i o s a r e equal, whichever row i s selected,
the amount of program variable i n the other row w i l l be zero
when the matrix is rearranged. Merely assume it to have a
60

v e r y small v a l u e a n d proceed a s before.

NETWORK DESIGN

Most n e t w o r k s c a n b e s i m p l i f i e d t o a t r e e - l i k e network with known


design flows. The most economic network is in fact a tree-like
network and loops a r e p u r e l y for backup. In tree-like networks the
pipe legs can be made up of lengths of commercially available
diameters w i t h costs a n d head losses p e r m e t r e o r k i l o m e t r e i n s e r t e d
as a function of flows beforehand. The r a n g e of diameters can be
l i m i t e d b y experience.
Example - Determine the least-cost p i p e diameters f o r the network
i I l u s t r a t e d below

x1 H=50m
P i p e b o r e , mm e 3 5 0
H e a d l o s s 2.5m/km 0
cost R1 O O / m

x2 Total length
@ 300 2000m
5.5m/km 100 e / s
R85/r (Sol-992m)

x3
e 250
18m/km ( 100811
R70h 800m 2 0 t / s

x4
I
I
- H=20m
(0) ( 8001111
@ 300
X6 x7
3.8m/km
@ 200 Q 150
R85/m
2m/km 8m/km
x5 R50/m R40/m
e250
1O O O m 1
9m/ km
R70/m

F i g . 5.2 P l a n o f t r a n c h network f o r example

Denote t h e u n k n o w n l e n g t h s o f i n d i v i d u a l s e c t i o n s a s X.
61

I n algebraic form the constraints a r e :


Head losses a l o n g each route:

0.0025X1+0.0055X2+0.018X3+0.0038X4+0.009X5(50
0.0025X1+0.0055X2+0.018X3+0.002X6+0.008X7~30

Lengths:

Xl+X2+X3 = 2000
x4+x5 = 1000
X6+X7 = 800

Objective f u n c t i o n :

Minimize 1OOX1+85X2+7OX3+85X4+7OX5+5OX6+4OX7
62

lee 88 85 ee 78 88 SURPLIJS VARIABLES ARE SUBTRACTED


8 5 88 7 8 80 5 0 80 FROM THE LEFT S I D E OF > =
48 88 8 ee 8 88 INEQUALITIES
8 88 8 80 8 08
8 Be SLACK VARIABLES ARE ADDED TO THE
OPTIMAL SiiLIUTION PIPE LEFT S I D E O F <= I N E Q U A L I T I E S

~ f i ~ 1 5 AFTEP
, 5 ITERATIONS A R T I F I C I A L 'JAPIABLES ARE ADDED
TO THE LEFT S I D E OF E Q U A L I T I E S
8 > = I N E Q U A L I T I E S TO GENERATE AN
'*!APIHBLE
SLACK 1 ';$LyiM I N I T I A L BASIC FEASIBLE SOLUTION

TABLEAU AFTEF'
9 98 8 . 88 H2 17.48 38 88 42 41
- 81 .81 L1 1311 11 2008 88 4290 9
8 Bb'r -1.8B L2 B0 1088 8 0 2933 3
8 88 .81 L3 .98 880 08 2375 81
17.48

- 24 1 . BE1 O B J FLINC COEFF RANGItiG


8.88 - 4.a B A S I S VAPIHRLES
8.88 5 8 ,8B
- 44 - .E.4 UHR LObJEP O B J FNC IJPPEI
1688.88 LIMIT 'sJFiLUE LIMI
x3 6 4 17 7 @ 08 85 0 ,
1.24 8.88 :1. 2 7 8 68 85 88 96 8 -
8.08 .4:3 X5 88 70 08 85 6(
8.88 -88.88 :.:7 UNBND 48 88 42 8i
1.44 ,' 64
992.88
OBJ FllNC COEFF RAHGING
8 88 8.88 NON-BASIS VARIABLES
1 .8rl 8 . 88
8.88 6.88 VAR LONER O B J FNC UPPEF
8 . 88 8 .68 LIMIT VALUE LIMIl
18 8 8 . 88 X1 88.68 100.98 UNBNC
x4 70.80 85.00 UNBNC
8.80 X6 47.28 58.08 IJNBNC
8.88 1 . 88
1 -88 8.80 W I T H I N THE L I M I T S Y O l l M A Y CHANGE
8.88 1.68 THE VALUE OF ANY ONE CONSTRAINT
8 8 8 . 88 RHS OR O B J FUNC COEFF WITHOUT
CAIJSING 'JRRIABLES TO ENTER OR
11 - 4 8 8.88 LEAVE THE SOLCfTION
15.88 2.80
8.80 1200. 8Ei BUT, VALUES FOP THE OBJ FUNC: AND
-91 .ha -49.68 SOLUTION VARIABLES M A Y CHANGE
-256888.88 LdHEN T H I S I S DONE
63

LOOPED NETWORKS - LP OPTIMIZATION

When p i p e loops a r e created b y connecting pipes i n t o the system


a t more than one place, the problem description becomes non- linear
and cannot be solved d i r e c t l y by l i n e a r programming methods. That
is largely because the flows a r e unknown. If, however, the network
can be reduced to a tree-like network the problem is again
simplified. The least-cost network is in fact i n v a r i a b l y a tree-like
network - the problem being to identify the tree. Because of the
economy of scale i n pipe transport, the most economic layout i s w i t h
only one pipe supplying to any point. If t h i s i s accepted, then a
close approximation to the best ( l e a s t cost) t r e e - l i k e network can be
obtained b y l i n e a r programming as follows.
Starting with a looped network number each node j , and each
pipe i, define arbitrarily the p o s i t i v e flow directions, then set up
the following (linear) constraints in terms of the unknown, Q, in
each p i p e i : \

For flow balance at each node j ,


ZQ. into node j = q . ( d r a w o f f from node j )
J
Objective f u n c t i o n : Minimize Z QiLi
where L . i s the known length o f p i p e i.
This will minimize the bulk transport, i.e. the litres per second
times metres. Strictly this will not be the optimum f o r non-linear
flow rate-cost r e l a t i o n s h i p s since economy of scale i s not introduced.
Each p i p e cost i s more likely to be proportional to Qm (m<l), so
that a more accurate b u t non-linear objective f u n c t i o n would b e M i n
Z LiQim. Separable programming methods (Hadley, 1964) could be
employed to optimize such a problem but the approach here p l u s
engineering judgement should generally suffice. Bhave (1978), pre-
sented a manual method of obtaining a s i m i l a r optimum network to
that proposed here, and Powell and Barnes (1982) proposed an
a l ternat i ve h i e r a r c h ica I method.

L I NEAR PROGRAMM ING PROGRAM

The appended program i s suitable for optimizing both stages of a


network, the network 'layout' a n d the p i p e diameters. The program
minimizes the objective function, a n d supplies the coefficients f o r a l l
64

dummy variables and artificial variables required for the simplex


method.
The p r o g r a m i s f o l l o w e d b y an e x a m p l e . A n e t w o r k i s r e d u c e d to
a branched system and then the pipe diameters are selected. The
input for each section follows and the optimal solution, namely
optimum program v a r i a b l e s , t h e i r magnitudes a n d costs.

Symbols i n linear p r o g r a m m i n g o p t i m i z a t i o n p r o g r a m b y m i n i m i z a t i o n

A(I) Objective coefficient o f v a r i a b l e in p r o g r a m


B(J) Objective coefficient o f v a r i a b l e in p r o g r a m
82 Net cost
E(J) B - ZX/A
E2 Min E
I Row no.
12 Key I
J Column no.
J2 Key J

N T o t a l no. o f v e W i a b l e s p l u s d u m m y s
N1 No. v a r i a b l e s
M Total columns
M1 No. o f < = c o n s t r a i n t s
M2 No. o f = constraints
M3 No. o f > = c o n s t r a i n t s
R(I) Rep I acemen t r a t i o
R2 Min replacement r a t i o

V(I) V a r i a b l e no. i n p r o g r a m
X(J, M a t r i x coefficient
X1 ( J M a t r i x coefficient
Z(I) M a g n i t u d e of v a r i a b l e i n p r o g r a m
Zl(l M a g n i t u d e of v a r i a b l e i n p r o g r a m

Note i n p u t n u m b e r s s h o u l d b e b e t w e e n 0.001 and 1000

F i r s t Problem: Network Layout

S U P PlY P i p e ( 1 1 400111-
Reserv o i r A n s w e r Q=(280)e/s (2001

Node

F i g . 5.3
65

Constraints: node 2: 8 , - Q2 - Q 3 = 0
node 4 : Q4 - Q
5
= o
node 3: = 200
2' + '6
node 5: Q3 + Q5 - Q6 = 80
M in i m i z e E QL=4OOQ +300Q +500Q3+500Q4+450Q5+700Q6
1 2

.7 -

2 R H S 4 '7
66

Second P r o b l e m : P i D e Sizina

Q,L = 280 e / s , 400m 200 P / s , 3 0 0 m


A *
/
V a r i a b l e X1 x2 ?3 /x 4 x 5'
D i a , mm 400 350 300 350 300
Grad m/km 9 17 9 20
C o s t $ / m 100 80
(01 (400 1 (300 1

80 e / s
500 m

Fig. 5.4

Constraints; Head l o s s t o 3: .009X1+.017X2+.04X3+.009X4+.02X5~50


5': . 0 0 9 X 1 + . 01 7 X 2 + . 0 4 X 3 + . 009X 6 + . 0 3 X 7 ~ 7 0
Length Xl-X3: Xl+X2+X3 = 400
x4-x5: x4+x5 = 300
X6-X7: X6+X7 = 500
67

I N P U T COEFS I N CONSTFAINTS I N O R
DEH I,=..=,>=
COEFS IN CONSTRAINT 1
X l ?
.889
X 2 ?
.017
X 3 ?
.a4
x 4 ?

:.;7?
. 8:
COEFS 114 CONSTRAINT 3
X i ?
1
x 2 ?
1
x 3 ? L P OPTIP1Zt.I P I P E D I H S
1 'JAR I ABLE .- MHGb4 I TLICIE s. COST COEF
x 4 '7
8
X S ?
68

L i n e a r programming program

10 550 EZ=@
=.--
J 8 M FUR J = l T O N
zij 578 I F EcJ)>=E2 THEN 658
538 E 2 = E I J >
538 J2=J
600 NEXT J
618 I F E 2 > = 8 THEN 938
620 F O R 1 = 1 TO M
624 I F Z i I > > @ THEN 638
626 Z<Ij=.88081
630 I F X C J 2 , I ? ( > r 3 TFEN 658
G 48 X<J2,1)=.@@0OBBI
656 R<I>=Z<Ij/X(J2,,1>
668 NEXT I
676 R2=999999939999
G8El FOR 1=1 T @ M
698 I F R < I > < = 8 THEN 738
7 8 B I F R ( I > > = R 2 THEN 730
718 R 2 = R < I )
726 I 2 = I
738 NEXT I
748 FOR 1=1 TO M
758 Z l I I > = Z < I >
768 FOR J=l TO N
779 X l I J , I ) = X ( J , Ii
7B8 NEXT J
798 NEXT I
888 FOR 1=1 TO M
818 Z < I > = Z l ( I ~ ~ - Z l < I 2 > * X 1 ~ . - II2> . ', X
1 ,:Jz. I.?)
8 2 0 FCIR J = l TO t.1
S30 Xi.!, I > = X l ' J . . I i - X l ~ ~ ~ J , I ~ i ~ : ~ i r . t
2 .- Ij / X 1 :t J Z .. 12 )
8 4 0 NEXT J
858 NEXT I
868 Z I I ~ ) = Z ~ I I ~ ? I X ~ 1~ 2. ) J ~ ,
--
-r

.:. 3 b-j
328 878 FOR J=l TO N
8 8 8 X r J ? I ; ' j = X l C J , I 2 . > / X l * : J 2 . , 12)
348 8 9 8 NEXT J
3 5 t3 98 8 H 1: I 2 Z =B r; .J2 >
368 518 U C I Z > = J 2
378 928 GOTO 4 9 8
388 938 BZ=8
338 3 4 8 FOR 1=1 TO M
488 558 BE=B2+H I I> 1:zc I >
418 968 NEXT. I
428 378 P R I N T " L P O P T I M Z N " i N f
4.38 988 P R I N T " V A R I A B L E , MAGt.(ITUDE,
448 C@ST COEF"
998 FOR 1 = 1 TO M
458 FOR .J=l TO N l 1988 P R I N T U S I N G 1818 i V C I ? , Z < I
468 D I S P " O B J . C n E F j , A< I:I

478 IHPIJT BilJS 1818 IMHGE DODDnD,@D@@@DD.DDD,DD


486 NEXT J DDDD . DUD
498 FOR .J=1 T @ N I 0 2 0 NEXT I
588 E i J .:-=B r J j 1836 P R I N T U S I N G 1835 i BZ
510 F O R 1=1 T O M 1035 I M A G E " C @ S T = " , @@@DDDDR.@DCI
528 E < J > =E C I. i -'A ( J , 1 0 4 0 STOP
538 NEXT I 1858 END
548 NEXT J
69

REFERENCES

Bhave, P.R., A u g . 1978. O p t i m i z a t i o n of s i n g l e s o u r c e n e t w o r k s ,


P r o c . ASCE, 104 ( E E 4 ) p799-814.
D a n t z i g , G.B., 1963. L i n e a r P r o g r a m m i n g and E x t e n s i o n s . P r i n c e -
ton U n i v . Press, Princeton.
H a d l e y , G., 1964. N o n l i n e a r and D y n a m i c P r o g r a m m i n g , A d d i s o n -
Wesley, R e a d i n g .
P o w e l l , W.F. and B a r n e s , J.W., Jan., 1982. O b t a i n i n g l a y o u t of
w a t e r d i s t r i b u t i o n systems. P r o c . ASCE., 108 ( H Y 1 ) .
70

CHAPTER 6

DYNAMIC AND NON-LINEAR PROGRAMMING FOR LOOPED NETWORKS

Chapters 2 to 4 described methods for calculating the flows in


p i p e networks w i t h o r without closed loops. For any particular pipe
network layout and diameters, the flow pattern corresponding to
fixed drawoffs or inputs at various nodes could be calculated. To
design a new network to meet certain drawoffs, it would be
necessary to compare a number of possibilities. A proposed layout
would be analysed a n d i f corresponding flows were j u s t s u f f i c i e n t to
meet demands and pressures were satisfactory, the layout would be
acceptable. If not, it would be necessary to try alternative
diameters for pipe sizes and analysis of flows i s repeated u n t i l a
s a t i s f a c t o r y solution i s at hand. This t r i a l and e r r o r process would
then be repeated for another possible layout. Each of the final
networks so d e r i v e d would then have to be costed a n d that network
w i t h least cost selected.
A technique of determining the least-cost network directly,
without recourse to trial and error, would be desirable. No d i r e c t
and positive technique is possible for general optimization of
networks with closed loops. The problem is that the relationship
between pipe diameters, flows, head losses and costs i s not linear
and most r o u t i n e mathematical optimization techniques r e q u i r e l i n e a r
relationships. There are a number of s i t u a t i o n s where mathematical
optimization techniques can be used to optimize layouts and these
cases are discussed and described below. The cases are normally
confined to s i n g l e mains o r tree-like networks f o r which the flow in
each branch is known. To optimize a network with closed loops,
random search techniques o r successive approximation techniques a r e
needed.
Mathematical optimization techniques are also known as systems
a n a l y s i s techniques ( w h i c h i s an incorrect nomenclature as they a r e
design techniques not analysis techniques), or operations research
techniques (again a name not really descriptive). The name
mathematical optimization techniques will be retained here. Such
tecniques include simulation ( o r mathematical model l i n g ) coupled w i t h
a selection technique such as steepest path ascent or random
searching.
71

The direct optimization methods include dynamic programming,


which is useful for optimizing a series of events or things,
t r a n s p o r t a t i o n progamming, which i s useful f o r a l l o c a t i n g sources to
demands, and I inear programming, for i n e q u a l i t i e s , ( v a n der Veen,
1967 and Dantzig, 1963.) L i n e a r programming u s u a l l y r e q u i r e s the use
of a computer, but there are standard optimization programs
available.

DYNAM I C PROGRAMM I NG FOR OPT I M I Z I NG COMPOUND P I PES

One of the simplest optimization techniques, a n d indeed one which


can normally be used without recourse to computers, is dynamic
programming. The technique is in fact only a systematic way of
selecting an optimum program from a series of events a n d does not
i n v o l v e any mathematics. The technique may be used to select the
most economic diameters of a compound pipe which may vary in
diameter along its length depending on pressures and flows. For
instance, consider a trunk main supplying a number of consumers
from a r e s e r v o i r . The diameters of the t r u n k main may be reduced as
drawoff takes place a l o n g the line. The problem i s to select the most
economic diameter f o r each section of pipe.
A simple example demonstrates the use of the technique. Consider
the pipeline in Figure 6.1. Two consumers draw water from the
pipeline, a n d the head a t each drawoff p o i n t i s not to drop below 5
m, neither should the hydraulic grade line drop below the pipe
profile at any point. The elevations of each p o i n t a n d the lengths
of each section of pipe are indicated. The cost of pipe i s $0.1 per
mm diameter per m of pipe. ( I n t h i s case the cost i s assumed to be
independent of the pressure head, although it is simple to take
account of such a variation). The analysis will be s t a r t e d at the
downstream end of the p i p e ( p o i n t A ) . The most economic arrangement
will be w i t h minimum r e s i d u a l head i.e. 5 m, a t p o i n t A. The head,
H, at p o i n t B may be a n y t h i n g between 13 m a n d 31 m above the
datum, but to simplify the analysis, we will only consider three
possible heads w i t h 5 m increments between them a t p o i n t s B and C.
The diameter D of the pipe between A and B, corresponding to
each of the three allowed heads may be determined from a head loss
chart and i s i n d i c a t e d in Table 6.1 ( 1 ) a l o n g w i t h the corresponding
72

ANSWER OIA = 260nm 310m 3 LO mm

Fig. 6.1 P r o f i l e of p i p e l i n e optimized b y dynamic programming.

cost .
We will also consider only three possible heads a t point C. The
n u m b e r o f p o s s i b l e h y d r a u l i c g r a d e l i n e s between B a n d C i s 3 x 3 =
9, but one of these is at an adverse gradient so may be
disregarded. I n T a b l e 6.1 ( I t ) a set of f i g u r e s i s presented f o r each
possible hydraulic grade l i n e between B a n d C. Thus i f HB = 13 a n d
HCE = 19 t h e n t h e h y d r a u l i c gradient f r o m C t o B i s 0.006 a n d the
diameter required for a flow of 110 e / s i s 310 mm ( f r o m F i g u r e 1 . 3 ) .
The cost of t h i s p i p e l i n e w o u l d b e 0.1 x 310 x 1 000 = $31 000. Now
to t h i s cost m u s t b e a d d e d t h e cost o f t h e p i p e between A a n d B, in
this case $60 000 (from Table 6.1(1)). For each possible head H
C
there is one minimum total cost of pipe between A and C, marked
with an asterisk. It is this cost and the corresponding diameters
only which need b e r e c a l l e d when proceeding to the next section of
pipe. I n t h i s example, the next s e c t i o n between C a n d D i s t h e l a s t
and there is only one possible head at D, namely the reservoir
level.
In Table 6.1 (I1I ) the hydraulic gradients and corresponding
diameters a n d costs f o r Section C - D a r e indicated. To t h e costs o f
pipe for this section are added the costs of the optimum pipe
arrangement up t o C. This i s d o n e f o r e a c h p o s s i b l e h e a d a t C, and
the least total c o s t s e l e c t e d f r o m T a b l e 6.1 ( I I I ) . Thus the minimum
possible total cost is $151 000 a n d t h e most economic diameters a r e
260, 310 and 340 mm for Sections A - 8, B - C and C - D
73

TABLE 6 . 1 Dynamic programming o p t i m i z a t i o n of a compound p i p e

I HEAD HYDR.
/AT B /GRAD. I_
DIA.
1

19 24 29 1
60000 60000 60000
9 1000": 87000 85000

I I I
.001
I
430
I
43000
I
.006
I
310 i
l
31000

I 1 50000 50000

Ill COST
$

19

24
I
.0035 340
62000
91000
153ooo
68000
83000
l?A-tiEi*
29 .oo 1 430 86000
74

respectively. It may be desirable to keep pipes to standard


diameters in which case the nearest standard diameter could be
selected f o r each section as the c a l c u l a t i o n s proceed o r each length
could be made up of two sections; one w i t h the next l a r g e r s t a n d a r d
diameter a n d one w i t h the next smaller s t a n d a r d diameter, but with
the same total head loss as the theoretical result.
Of course many more sections of p i p e could be considered a n d the
accuracy would be increased b y considering more possible heads a t
each section. The cost of the pipes could be v a r i e d w i t h pressures.
A booster pump station could b e considered a t any point, in which
case its cost and capitalized power cost should be added in the
tables. A computer may prove useful i f many p o s s i b i l i t i e s a r e to be
considered, and there are standard dynamic programming programs
available.
It will be seen that the technique of dynamic programming
reduces the number of p o s s i b i l i t i e s to be considered b y selecting the
least-cost arrangement at each step. Kally, (1969) and Buras and
Schweig, (1969) describe a p p l i c a t i o n s of the technique to s i m i l a r a n d
other oroblems.

TRANSPORTATION PROGRAMMING FOR LEAST-COST ALLOCATION OF


RE SOURCES

Transportation programming is another technique which normally


does not require the use of a computer. The technique i s of use
primarily for allocating the yield of a number of sources to a
number of consumers such that a least-cost system i s achieved. The
cost of delivering the resource along each route should be l i n e a r l y
proportional to the throughput a l o n g that route a n d f o r t h i s reason
the technique is probably of no use in selecting the optimum p i p e
sizes. It is of use, however, in selecting a least-cost pumping
pattern through an existing pipe distribution system, provided the
friction head is small in comparison with static head, or for
o b t a i n i n g a p l a n n i n g guide before demands a r e accurately known.
An example serves to illustrate the technique. I n t h i s example,
there a r e two sources of water, A a n d B, and two consumers, M a n d
N. A a n d B could deliver 12 a n d 20 O/s respectively and M and N
require 10 and 15 O/s respectively. Thus there is a surplus of
75

water. The cost of p u m p i n g a l o n g r o u t e s A - M, A - N, B - M and 6


- N a r e 5,7, 6 a n d 9 c/l 000 l i t r e s r e s p e c t i v e l y .

comuwu M N
REQUIREMENT 10 LIS 15 L I S

SOURCE A
YIEU) 12 LfS

F i g . 6.2 Least-cost a l l o c a t i o n p a t t e r n f o r t r a n s p o r t a t i o n
p r o g r a m m i n g example.

TABLE 6.2 T r a n s p o r t a t i o n programming - o p t i m i z a t i o n of a n


a l l o c a t i o n system

(1) CONSUMER: M N SURPLUS EVALUATION

SOURCE YIELD REQUIREMENTS: 10 7 NUMBER:


0 0

A 12 -2
0 2
B 20 /7

p
EVALUATION NUMBER: 5 7 -2

15 7
(11) 7 0

A 12 12
9 2

B 20 10 3
4 7 -2
76

The data are set out in tabular form for solution in Table
6.2( I ) . Each row represents a source a n d each column a demand. The
u n i t cost of delivery along each r o u t e i s i n d i c a t e d i n the top r i g h t
corner of the corresponding block i n the table. The f i r s t step i s to
make an a r b i t r a r y i n i t i a l assignment of resources i n such a manner
that each yield a n d demand i s satisfied. Starting with the top left
block of the table, the maximum possible allocation is 10. This
satisfies the demand of column M and the amount is written i n the
bottom l e f t corner of block AM. Proceeding to the next column, since
the f i r s t column i s completed, the maximum possible a l l o c a t i o n i n the
first row i s 2, which s a t i s f i e s the y i e l d of row A. So the next block
to be considered i s i n row B, namely column N. Proceed through tke
table making the maximum possible assignment at each stage until
all resources a r e allocated (even i f to the slack column). Thus the
next a l l o c a t i o n i s the 13 in the second row, then the 7 in the t h i r d
co I umn .
Once an initial allocation is made the figures are rearranged
methodically until a least-cost distribution emerges. To decide which
would be the most profitable arrangement, assign a relative
e v a l u a t i o n number to each row a n d column as follows:-
Assign the value 0 to row 1 a n d work out the other e v a l u a t i o n
numbers such t h a t the sum of the row e v a l u a t i o n number a n d column
evaluation number i s equal to the cost coefficient for any occupied
block. The v a l u e f o r column M i s 5, f o r column N i s 7, f o r row B is
2, a n d so on. Now w r i t e the sum of the row a n d column e v a l u a t i o n
numbers beneath the cost coefficient of each unoccupied block. If
this sum is bigger than the cost coefficient of the block, i t would
pay to introduce a resource a l l o c a t i o n into the block. This i s not
easy to see immediately, but stems from the method of determining
each evaluation sum from the cost coefficients of occupied blocks.
The biggest possible r a t e of improvement i s i n d i c a t e d b y the biggest
difference between the e v a l u a t i o n sum and the cost coefficient. The
biggest and in fact i n our case the o n l y , improvement would be to
introduce an amount i n t o Block BM. The maximum amount which can
be put in block BM i s determined by drawing a closed loop u s i n g
occupied blocks as corners (see the dotted c i r c u i t in Table 6 . 2 ( 1 ) ) .
77

Now f o r each u n i t which i s added to block BM, one u n i t would have


to be subtracted from block BN, added to block AN a n d subtracted
from block AM to keep the yields and requirements consistent. In
this case the maximum allocation to BM is 10, since this would
evacuate block AM. The maximum r e - d i s t r i b u t i o n i.e. 10 i s made, and
the amount in the block a t each corner of the closed loop adjusted
by 10 to satisfy y i e l d s and requirements. Only one re- distribution
of resources should be done a t a time.
After making the best new a l l o c a t i o n , re-calculate the evaluation
number and e v a l u a t i o n sums as i n Table 6.2 ( I I ) . Allocate resource
to the most p r o f i t a b l e block and repeat the r e - d i s t r i b u t i o n procedure
until there i s no f u r t h e r possible cost improvement, indicated b y the
fact that there i s no e v a l u a t i o n sum greater than the cost coefficient
i n any block. I n our example we a r r i v e d a t the optimum d i s t r i b u t i o n
in two steps, but more compl icated p a t t e r n s i n v o l v i n g more sources
a n d consumers may need many more attempts.
The example can only serve to introduce the subject of
transportation programming. There are many other conditions which
are dealt with in textbooks on the subject of mathematical
optimization techniques such as v a n d e r Veen (1967)and Dantzig ( 1963)
and t h i s example o n l y serves as an introduction. For instance, if
two blocks i n the t a b l e happened to be evacuated simultaneously, one
of the blocks could be allocated a very small quantity denoted b y
'e' say. Computations then proceed as before and the q u a n t i t y 'el
disregarded at the end.

STEEPEST PATH ASCENT TECHNIQUE FOR EXTENDING NETWORKS

A 'steepest path ascent technique' can be used for extending


p i p e l i n e networks a t minimum cost (Stephenson, 1970). The technique
i s p r i m a r i l y f o r a d d i n g new pipes to e x i s t i n g networks when demands
exceed the capacity of the e x i s t i n g p i p e networks.
It i s u s u a l l y possible to s u p p l y p o i n t s i n a system along v a r i o u s
routes o r from a l t e r n a t i v e sources. I t may not be necessary to l a y a
new pipeline all the way from the source to the demand, or
a l t e r n a t i v e l y the diameter of the new p i p e may v a r y from one section
to another. The fact that elevation, a n d hence pressure head, varies
a l o n g a p i p e l i n e route causes d i f f e r e n t p i p e diameters to be optimal
a t d i f f e r e n t sections.
78

O n account o f t h e c o m p l e x i t y of t h e o p t i m i z a t i o n t e c h n i q u e , use of
a computer i s essential. Alternative routes a l o n g which water could
be supplied to t h e node in q u e s t i o n a r e pre-selected manually. The
computer program is used to determine the optimum pipelines and
c o r r e s p o n d i n g d i a m e t e r s t o meet t h e s p e c i f i c demands.
An informal demonstration that the method yields an optimum
d e s i g n i s g i v e n w i t h t h e a i d of d i a g r a m s .

F i g . 6.3 R e l a t i o n s h i p between d i s c h a r g e a n d
cost of two p i p e s .

Fig. 6.4 Steepest p a t h p r o j e c t e d o n t o C,-C2 p l a n e


79

Pipel ine costs increase with increasing diameter and wal I


thickness. Wall thickness usually increases in proportion to the
diameter, so the cost per metre w i l l be a f u n c t i o n of the square of
the diameter.
Now for a g i v e n head g r a d i e n t , the discharge i s p r o p o r t i o n a l to
the pipe diameter to a power of approximately 2.5. However, if the
pipe is not laid along the entire route from the source to the
demand, b u t merely reinforces p a r t of the network, the capacity w i l l
be limited b y the c a p a c i t y of the remainder of the network. Hence i t
may be deduced that discharge varies with cost of a new pipe
section to a power g r e a t e r than u n i t y , b u t i s l i m i t e d b y the capacity
of the remainder of the p i p e network.
If more than one proposed new p i p e i s i n v o l v e d the r e l a t i o n s h i p
between discharge and pipe costs i s mu1ti-dimensional. F i g u r e 6.3
i I l u s t r a t e s the relationship between discharge at a particular node
a n d cost of two possible pipes in the network.
The curves on the C1 - C2 plane in F i g u r e 6.3 are lines of
constant discharge Q. The shortest p a t h between two Q l i n e s spaced
a small distance a p a r t is a l i n e p e r p e n d i c u l a r to the Q lines. This
i s the p a t h w i t h the steepest discharge/cost gradient, a n d i s the one
sought. The procedure i s therefore to s t a r t at the o r i g i n and proceed
in increments on the C1 - C2 plane, each increment being
perpendicular to the next Q line, until the desired discharge Q i s
attained.
To determine the increments in diameter corresponding to
increments in cost, the a c t u a l increment i n cost of each p i p e f o r a
step on the C1 - C2 plane has to be calculated. Consider the
t r i a n g l e XYZ, e n l a r g e d in F i g u r e 6 . 4 . C1 and C corresponding to
2
increment YW i n €I
a r e to be determined.

Now cos 0 = -/](*Q/ -$;'+ ( AQ/ aQ


-I2
aQ acl
ac2
80

AC, = YW cos 0 = AQf -


aQ cos20
ac1

Similarly AC2 = YW c o s +
L

In a s i m i l a r manner, for n possible pipes, i t may be p r o v e d t h a t

The rate of increase of discharge with respect t o t h e cost C. of


any pipe, a Q/aC is determined by analyzing the network with and
without a small increment in d i a m e t e r D..The increase in discharge,
divided by the increase in cost of pipe i associated with the
increase in diameter, gives the required relationship. The increment
in discharge per step, AQ, is pre-selected so t h a t the increase in
cost of e a c h p i p e i s y i e l d e d b y t h e a b o v e e q u a t i o n a t e a c h step. The
corresponding increases in diameter are then calculated from the
known diameter/ cost relationships. The diameters of the proposed
pipes are increased in steps until the discharge at the specified
node i s s u f f i c i e n t . A network a n a l y s i s should be performed a f t e r each
s t e p to r e - b a l a n c e t h e system.
It will be observed from F i g u r e 6.3 that it i s unlikely that any
local maxima will be reached with the technique as the dis-
charge/cost curves are generally concave upwards, and have few
points of inflection.
So f a r the t e c h n i q u e h a s been u s e d to s u p p l e m e n t the supply to
only one n o d e a t a time. I t h a s been f o u n d t h a t t h e p i p e l i n e system
should be well conditioned f o r s a t i s f a c t o r y convergence. It is usually
necessary to initialize the diameters of proposed pipes at a value
81

greater than zero ( s a y of the order of 1/4 of the a n t i c i p a t e d f i n a l


diameter). Otherwise the linear approximation to the differential
equations is unrealistic for the initial steps and false r e s u l t s are
yielded.

DESIGN O F LOOPED NETWORKS

It was explained previously that it i s not possible to design a


pipe r e t i c u l a t i o n network w i t h closed loops without recourse to t r i a l
and error or successive approximations. The non-ljnear flow/head
loss r e l a t i o n s h i p , the fact that flow magnitudes and directions are
initially unknown, that pipe diameters should conform to standard
sizes and be l a r g e r than specified minimum sizes, a n d that c e r t a i n
minimum pressures a r e r e q u i r e d , all pose problems. There are many
approaches to the solution f o r the least-cost looped network, none of
which, i t should be noted, overcome a l l the problems a n d ensure that
a t r u e least-cost solution, and not a local peak i n the cost function,
i s at hand. The solutions a r e nevertheless i n v a r i a b l y more economic
than a network which i s designed b y s t a n d a r d methods, and offer a
s t a r t i n g system f o r m a n i p u l a t i o n b y the design engineer.
Some techniques proposed for achieving least-cost solutions,
together w i t h t h e i r l i m i t a t i o n s , a r e o u t l i n e d below.

( i ) Loop/node correct ion method

A method of least-cost design, which does not depart radically


from the f a m i l i a r methods of Hardy Cross a n a l y s i s , was developed b y
the author. The optimization procedure is not based on linear or
non-l i n e a r programming techniques which are unfamiliar to most
engineers. Instead successive cost revisions are performed f o r each
node and f o r each loop i n the network u s i n g a correction based on
the d i f f e r e n t i a l of the cost function determined as follows:-

Assume any p i p e cost C = a D bt (6.2)


where a a n d b a r e constants.
Now the diameter, D, can be expressed in terms of flow Q and
head loss h f o r a n y p i p e : D=(KtQn/h)'/m
where K , m a n d n a r e constants
So C = a(KtQn/h) b/mt
82

Different i a t i n g , dC= ( nb/m) ( C/Q) dQ-( b/m ) ( C / h ) d h (6.3)

i.e. the cost of any p i p e can be v a r i e d in two ways: by varying


flow, Q , keeping the head loss, h , constant, and b y v ary i ng h while
m a i n t a i n i n g Q constant. Actually, both factors must be considered in
designing a least-cost network. The fact that the diameters and
corresponding costs are functions of the two independent v a r i a b l e s i s
often overlooked i n mathematical optimization models.
The complete optimization procedure f o r a network i s therefore as
follows:

(1) Assume a pipe layout and assume any reasonable initial


diameter f o r each pipe.

(2) Analyse the network using, say, the Hardy Cross method, to
determine flows in each pipe and heads at each node. Any
number of constant head r e s e r v o i r s a n d drawoffs i s permitted.

(3) For each loop in t u r n , c a l c u l a t e the sum of dC/dQ = (nb/m) C/Q


for each pipe in the loop. If Q is in the assumed positive
direction around the loop take the positive value of dC/dQ,
otherwise the negative value. Now if cdC/dQ i s positive, i.e.
cost increases if flow increases, it would pay to reduce the
flow in the positive direction around the loop. Conversely if
ZdC/dQ i s negative, i t would p a y to increase the flow around the
loop. Subtract or add an increment in flow around the loop
depending on the s i g n of ZdC/dQ, and decrease o r increase the
diameter of each p i p e in the loop respectively to keep the head
losses constant. The maximum size of increment is that which
would reduce any flow to zero, or reduce a n y p i p e diameter to
a specified minimum size. An increment slightly smaller than
this, say half this value, i s preferable. Proceed from loop to
loop, repeating t h i s analysis. I t i s p r e f e r a b l e to proceed i n the
order of decreasing absolute v a l u e of ZdC/dQ, which means the
loops should be ranked in order before making the flow
correct ions.

(4) For each node in turn other than fixed-head reservoirs,


c a l c u l a t e the sum of dC/h = ( b / m ) ( C / h ) f o r each p i p e connecting
the node. Take the p o s i t i v e v a l u e i f the head drops towards the
node i n question a n d the negative v a l u e i f the head drops away
83

from the node. If CdC/dh is positive it pays to reduce the


head, H, at the node, and if it is negative, it pays to
increase the head. By increasing the head a t the node, pipes
l e a d i n g to the node w i l l have to be increased in diameter and
the pipes leading away reduced in diameter to maintain the
flows. Conversely a decrease i n head w i l l decrease diameters of
pipe leading to the node and increase the diameters of pipes
leading away. Determine the maximum change in head permis-
sible to produce a decrease in cost without a l t e r i n g any flow
directions or reducing pipe diameters to less than specified
minimums. The head of the node should also be maintained
above the specified minimum. Vary the head correspondingly, or
preferably limit the head change to, say, half the maximum
permissible a n d c a l c u l a t e the new p i p e diameters connecting the
node.

(5) Repeat steps 3 and 4 u n t i l no f u r t h e r improvement in cost is


discernable. No f u r t h e r network analyses a r e necessary as once
the initial flow balance of step 2 has been achieved i t i s not
unbalanced. Notice however that once the flow directions have
been established they cannot be altered. It is therefore
important that the initially assumed diameters a r e r e a l i s t i c and
that the corresponding flow p a t t e r n i s g e n e r a l l y correct.

The technique will yield non-standard pipe diameters and these


will have to be corrected b y assuming the nearest s t a n d a r d p i p e size
or by l e t t i n g each p i p e comprise two sections, one the next s t a n d a r d
size greater and the other the next standard size less than the
diameter yielded by the a n a l y s i s . T h e corresponding length of each
section is calculated from the fact that the total head loss must
equal that indicated by the analysis. The calculations should be
performed by computer as they are lengthy and definitely not as
simple as those f o r a Hardy Cross network a n a l y s i s .

(ii) Flow correction b y l i n e a r programming

I n the previous section i t was demonstrated that f o r each p i p e dC


is linearly proportional to dQ and dH. (This is provided the
increments in Q a n d H a r e s m a l l ) . I f the objective f u n c t i o n i s taken
as the minimization of CdC f o r each p i p e , the problem may be set up
84

as a l i n e a r programming optimization problem. The I inear c o n s t r a i n t s


would be:
For each node, ZdQ i n = 0 where dQ could be p o s i t i v e or negative,
and H 'a specified minimum.
The objective function is C dC = minimum, where dC is a linear
function of increments i n flows i n each p i p e and heads a t each node.
A standard linear programming program could be used to select the
changes in flow along each pipe and head at each node once an
initial network is assumed and analysed. The corresponding dia-
meters could then be calculated. Unless the increments i n flow and
head are confined to very small values, the head losses will be
unbalanced a f t e r the I inear programming optimization and a network
analysis will be required. The linear programming optimization and
network analysis should be iterated until there is no further
reduction i n the total network cost. The subprogramme f o r s e t t i n g up
the l i n e a r programming tableau i s complicated and a l a r g e computer
core storage i s r e q u i r e d f o r reasonably l a r g e networks.
The core storage required is proportional to the square of the
number of pipes, whereas it i s proportional to the linear number of
pipes f o r the Loop/Node Correction Method.
Non-standard diameters are yielded, and the flow directions are
not a l t e r e d once an i n i t i a l assumption i s made.

( ii i ) Non-l i n e a r programming

As the problem of design of a pipe network is non-linear a


s t a n d a r d or "canned" non-l inear programming computer program could
be used. Many of these programs are based on the steepest path
ascent technique. A sub-program would be r e q u i r e d to formulate the
constraints and the objective function. The constraints could be
expressed as l i n e a r functions b u t the objective f u n c t i o n i s n o n l i n e a r .
T h e c o n s t r a i n t s are:-

For each node C Q in = 0


For fixed-head nodes H = a specified value.
For v a r i a b l e head nodes, HL a specified minimum.
For each loop C h = 0.
The objective f u n c t i o n i s CC = Z a (Ke Qn/h) ( 1 /m)
= minimum
85

Non-standard diameters are yielded and flow d i r e c t i o n s must be


assumed beforehand. As the technique of n o n l i n e a r programming is
fairly complicated, it may be difficult to debug the program if
e r r o r s occur.

(iv) Optimum length method

Kally (1971) proposed a method very similar to the linear


programming method of optimization of tree-I i k e networks w i t h known
flows.
Since the flows are likely to r e - d i s t r i b u t e a f t e r optimization of a
looped network b y t h i s method, Hardy Cross a n a l y s i s i s necessary to
balance flows at each node, after which a further optimization is
performed, a n d so on.
An initial estimation of diameter i s fed i n t o the program, which
calculates flows by Hardy Cross analysis. For a small change in
diameter along a portion of any pipe, the corresponding head
changes at various nodes are calculated. The r e l a t i o n s h i p s between
head change and length of enlarged ( o r reduced) pipes i s assumed
linear, and the optimum lengths of each section of new diameter
calculated by linear programming. Diameters may be confined to
s t a n d a r d sizes.

(v) Equivalent p i p e method

Deb, (1973) replaces a l l pipes in a layout b y p i p e s w i t h a common


predefined length and equivalent diameters ( i .e. such that head
losses remain unaffected).
An initial flow pattern is assumed and corrected in steps by
adjusting p i p e sizes f o r successive loops. The total p i p e cost f o r any
loop is a minimum at some flow extreme i.e. w i t h the flow i n some
pipes i n the loop equal to the specified minimum.
A constraint l i m i t i n g the minimum r a t e of flow through each p i p e
may be imposed ( f o r r e l i a b i l i t y a n d c o n t i n u i t y of supply i n case of
b u r s t s or blockage closed loops a n d specified minimum flows i n pipes
are u s u a l l y r e q u i r e d ) .
A minimum cost if assumed for each loop a n d a flow correction
which will b r i n g the loop cost to the assumed figure i s calculated.
86

If the minimum flow constraint is violated, a new minimum cost


figure is assumed and then the flows corrected accordingly. If the
flows are within permissible limits, a slightly lower loop cost is
assumed, and f l o w s c o r r e c t e d again. This i s repeated u n t i l the cost
cannot b e reduced a n y more w i t h o u t v i o l a t i n g the c o n s t r a i n t s .
The technique yields non-standard diameters, and is highly
dependent on the initial flow assumptions. The equations involved
tend to obscure the i n i t i a l assumptions.

REFERENCES

Appleyard, J.R., Aug. 1975. D i s c u s s i o n o n l e a s t cost d e s i g n o f


b r a n c h e d p i p e n e t w o r k systems. P r o c . Am. SOC. C i v i l E n g s . , 101,
(EE4).
B u r a s , N. and S c h w e i g , Z . , Sept. 1969. A q u e d u c t r o u t e o p t i m i z a t i o n
b y d y n a m i c p r o g r a m m i n g , P r o c . Am. SOC. C i v i l Engs., 95 (HY5).
D a n t z i g , G.B., 1963. L i n e a r P r o g r a m m i n g and E x t e n s i o n s , P r i n c e t o n
U n i v e r s i t y Press, Princeton.
Deb, A.K., J a n . 1973. L e a s t - c o s t p i p e n e t w o r k d e r i v a t i o n , W a t e r and
W a t e r E n g g . , 77 ( 9 2 8 ) .
Kally, E., April 1971. A u t o m a t i c p l a n n i n g of t h e l e a s t c o s t w a t e r
d i s t r i b u t i o n n e t w o r k , W a t e r and W a t e r E n g g . , 75 (8902).
Kally, E., March 1969, P i p e l i n e p l a n n i n g b y dynamic computer
p r o g r a m m i n g , J. Am. W a t e r W o r k s Assn., (3).
Lam, C.F., June, 1973. Discrete gradient optimization of water
s y s t e m s , Proc., Am., SOC. C i v i l E n g r s . , 99 ( H Y 6 ) .
Stephenson, D., 1970. O p e r a t i o n r e s e a r c h t e c h n i q u e s f o r p l a n n i n g and
operation of pipeline systems, Proc. P i p e l i n e Engg. Convn.,
B r i n t e x E x h i b s . , London.
Van d e r Veen, B., 1967. I n t r o d u c t i o n t o t h e T h e o r y o f O p e r a t i o n a l
Research, C l e a v e r Hume, L o n d o n .
87

CHAPTER 7

CONT I NUOUS S I MULAT I ON

The previous chapters have been confined to steady flow in


p i p e networks w i t h constant r e s e r v o i r heads. I n subsequent chapters
unsteady flow is considered. As a first approximation the water
column i n a pipe i s assumed to b e incompressible and the accelera-
tions and decelerations are estimated on that basis. I n subsequent
chapters the c o m p r e s s i b i l i t y of the water and the p i p e i s consider-
ed. The l a t t e r i s termed water hammer.
There are many unsteady flow conditions, however, in which
neither the compressibi l i t y nor accelerations are significant. An
example i s the slow depletion of storage i n a r e s e r v o i r over a num-
ber of hours, for instance d u r i n g peak flows in a r e t i c u l a t i o n sys-
tem. The reservoir will subsequently be refilled by pumping when
the demand is lower, for example d u r i n g the n i g h t s and weekends.
This is an unsteady flow situation to which the steady flow equa-
tions can be a p p l i e d without appreciable error. That is, pipe f ri c -
tion is the major head loss term but continuity is also applied
in order to observe the variations i n storage levels. Corresponding
to changes in stored volume the water level i n the reservoirs will
change and consequently the heads on the reticulation system will
change. These i n t u r n w i l l affect t h e discharges.
It is frequently necessary to analyse reticulation systems on
this basis in order to determine reservoir capacities and pumping
rates for a water r e t i c u l a t i o n system. The omission of the accelera-
tion and elasticity terms makes the simulation much easier and
the time interval can be hours instead of seconds which reduces
computational time considerably. Although the so-called global com-
puter program based on the water hammer equations could be em-
ployed it would be inefficient and unjustified. I n t h i s chapter the
coninui ty equation and pipe friction equations are used to develop
a general purpose simulation program for studying fluctuations
i n storage in a complex p i p e water supply system.
Most water supply systems can be assumed to comprise two major
components, one a link or pipe and the other a node which could
be a pipe junction or a reservoir. The h a n d l i n g of the node would
88

depend on the description of i t s operation. A constant head reser-


voir would be regarded as a node of i n f i n i t e surface area whereas
at the other extremity the outflow could be a f u n c t i o n of the stor-
. a g e volume which in turn controls the head on the discharge o r i -
fice.
The simulation approach can frequently be used to optimize the
design o f a water r e t i c u l a t i o n system where d i r e c t optimization tech-
niques would be too complicated. Another advantage of simulation
is that it can incorporate non-linear equations and specified func-
tions and does not have to be based on average o r assumed steady
state conditions.

SYSTEMS ANALYSIS TECHNIQUES AND THE USE O F SIMULATION MODELS

Developments i n operation research have led to numerous extreme-


ly powerful systems analysis techniques. These techniques can be
b r o a d l y c l a s s i f i e d i n t o two main categories:
1) Direct optimization techniques
2) Simulation techniques.
Direct optimization techniques can be used to find the optimum
solution to certain problems. Grosman (1981) describes the appli-
cation of transportation programming, extended transportation pro-
gramming, I inear programming and separable programming. Costs
are estimated for raw water, conveyancing and desalination. The
techniques a r e used to c a l c u l a t e the average flows from each source
to each demand point. The flows satisfy minimum water quality
and quantity constraints and result i n the minimum total cost solu-
t ion.

The techniques used i n many studies assume steady state condi-


tions. Average flows and constant water quality are assumed at
all the sources a n d demand points. The average flows are calculat-
ed which result i n the minimum cost. Real water systems are never
i n a steady state. Water r e q u i r e d at demand p o i n t s g e n e r a l l y v a r i e s
between zero and several hundred litres a second. During peak
demand periods i t may not be possible to draw water from the d i f -
ferent sources in the optimum ratio determined. The concentration
of pollutants in some sources varies throughout the day and week
depending on what source was used and the proportion of clean
89

water. It can be concluded that optimum solutions derived from


deterministic models which assume steady flows and constant water
quality may not be r e a l i s t i c . The 'optimum solution' cannot guaran-
tee that the constraints will be satisfied at all times, that the
solution is practical or, indeed, that the solution is an optimal
one a t a l l .
Simulation provides a means o f observing the behaviour of the
components of a system under varying conditions. No 'solution'
in the mathematical sense is sought. The objective is to gain an
understanding of the relationships among components of the system
and to find ways to make them work together in the best possible
way. Simulation does not yield an optimal solution directly and
it is thus necessary to simulate iteratively in order to achieve
an optimum. E v e n w h e n c o m b i n e d w i t h e f f i c i e n t t e c h n i q u e s f o r select-
ing the values of each decision variable, a n enormous c o m p u t a t i o n a l
effort may lead to a solution which is still f a r from t h e b e s t pos-
sible.
To i t s credit, simulation c a n b e u s e d to s o l v e m o d e l s w i t h h i g h -
ly non-linear relationships and constraints. The direct optimization
techniques are seldom able to deal with all the complexities and
non-linearities which are easily incorporated into a simulation mod-
el. Simulation can be used to experiment with alternative 'optimum
solutions' and together with direct optimization techniques it may
be possible to narrow the search for a real global optimum. Little
or no cost, time o r risk is involved with simulation. The t i m e s c a l e
can be controlled and long and short term effects of quantity and
quality can be determined and used as an aid to decision making
and planning. More important, variables and parameters can be
identified b y changing their values and studying the effects. Cer-
tain parameters and relationships can be determined from simula-
tions. A simulation model can be visualised by most people and
the results are generally more convincing than those o b t a i n e d f r o m
d e t e r m in i st i c a p p r o a c h e s .
The r a t e of change of water quantity and quality, with respect
to time can always be described by a set of first order ordinary
differential equations. These e q u a t i o n s c a n b e s o l v e d s i m u l t a n e o u s l y
at each iteration in a simulation using powerful numerical methods.
The solution to the set of equations yields the volume of water
90

in each storage component of the system at the end of each simula-


tion time-step. These values can be used in conjunction with the
operating rules and various relationships to determine pump on/off
settings, make-up flows, demands, overflows etc. The degree to which
the model represents the r e a l system a n d the accuracy of the r e s u l t s
depends on the validity of the model and the accuracy of the
solution of the set of equations.
A general simulation program has been w r i t t e n which can be used
to simulate water models. The model must be described b y a system
of first-order ordinary differential equations, Such a model,
consisting of j equations and involving q variables, can be w r i t t e n
i n the general form:

dx. dxl,dx2, dx.


-- 1 -
J )
dt Q(t,x1,x2,---x q ' d-
t -
dt ---d t

where i = 1 , 2 --- j
According to James (1978), the o r d e r l y procedure f o r constructing
simulation models i s :

Systems Analysis: the s a l i e n t components, inter-actions, relation-


ships a n d dynamic mechanism of a system a r e i d e n t i f i e d .
Systems Synthesis: the model i s constructed and coded i n accord-
ance w i t h Step 1 ) .
Verification : the model's responses are compared with those
which would be expected if the model's s t r u c t u r e was prepared
as intended.
V a l i d-
- ation: the responses from the v e r i f i e d model a r e compared to
corresponding observations o f , a n d measurements from the a c t u a l
system.
Inference: experiments w i t h , a n d comparisons of responses from,
the v e r i f i e d a n d v a l i d a t e d model - t h i s i s the design stage.

MATHEMAT I C A L MODELL I NG O F WATER QUALI T Y

Model I ing Concepts

A f i e l d to which many of the present concepts can be a p p l i e d i s


that of water qua1 i t y d e t e r i o r a t i o n i n i n d u s t r i a l systems. Cooling and
washing systems a r e examples where q u a l i t y w i l l deteriorate i n time.
91

I t i s not easy to p r e d i c t the r a t e of build-up of dissolved s a l t s o r


the equi I i b r i u m concentrations in water reticulation systems, even
w i t h an u n d e r s t a n d i n g of the o r i g i n s a n d methods of concentration of
salts. This is because of the complex nature of industrial water
r e c i r c u l a t i o n systems. One way of accounting f o r a l l these effects i n
a r e a l system appears to be b y modelling the system on a computer.
Once a model is produced and validated, i t may be used to
improve the operation of existing service water r e t i c u l a t i o n systems
and f o r o p t i m i z i n g the design of new systems. I t i s one of the objec-
tives of a research programme to produce such a mathematical model
which will be formulated in general terms for adaptation to any
p a r t i c u l a r system.
The b u i l d - u p of i m p u r i t i e s in water can b e simulated mathemati-
cally together w i t h the water r e c i r c u l a t i o n cycle. The flows of water
in conduits or in vapour form i n the a i r in a n d out of the system
can be calculated. The processes of evaporation, condensation, pol-
l u t i o n a n d make-up can a l l be modelled.

Mass Ba I ances

For the purposes of mathematical simulation of water systems, the


system must be described in terms of equations. One-stage systems
can be described i n terms of a mass balance equation which can be
solved a n a l y t i c a l l y . I n other more complex s i t u a t i o n s i t i s necessary
to express the equations in finite difference form and solve them
numerically. Different types of models a n d the assumptions therein
are described below.
Parameters whereby pol l u t i o n i s measured may e i t h e r be conserva-
t i v e o r non-conservative. I n a conservative system i n p u t to any p a r t
of the system equals outflow. Thus, i f the parameter studied i s water
flow then evaporation will be neglected in a conservative model.
Similarly if the parameter is a chemical compound it i s assumed
there i s no reaction, deposition o r solution i n a conservative model.
The model may be steady-state o r time-varying. D u r i n g the s t a r t -
up p e r i o d of a mine as concentrations b u i l d up the system i s s a i d to
be unsteady. After a w h i l e the system may reach e q u i l i b r i u m . That
is, in the case of salts in solution, the increases in mass of
dissolved solids i n the system due to leaching o r evaporation equals
92

t h e loss b y p u m p i n g o r d e p o s i t i o n .

Mixed a n d Plug Flow Systems

In a plug-flow system, the water is assumed to travel through


the pipes a n d d r a i n s a t a c e r t a i n r a t e , conveying impurities a t that
rate. The s a l t s c o n t e n t at any point can therefore be affected in a
series of steps as water with different concentrations arrives a t that
point. In a completely m i x e d system, the concentration of salts w i l l
be the same at every point. An input is assumed to spread
instantaneously through the system so that the concentration
increases by the mass o f salt input divided by the total volume of
water in the system. T h i s s i m p l i f i e d mechanism i s often satisfactory
to describe systems which exhibit gradual rates of change in
concentrations. Real systems will probably b e between p l u g f l o w a n d
completely mixed, as there will be diffusion and mixing due to
turbulence and cross connections. I n general s a l t s a r e conveyed by
advection (lateral transport) and dispersion.

Examples

The s i m p l e s t i l l u s t r a t i o n o f t h e u s e of t h e mass b a l a n c e e q u a t i o n s
is f o r a steady-state system. Q i s f l o w r a t e i n P / s o r MP/d, C i s the
concentration in mg/P. Inflow of water and of salts per unit time
equals outflow rate:

Fig. 7.1 Point Node

= Q3 (7.2)
Q1 Q2
+

Q I C l + Q2CZ = Q3C3 (7.3)


.. c3 = QlC1+Q2C2 (7.4)
+Q2
93

e.g. i f Q, = 5 MP/d, Q2 - 0 Me/d (water flow r a t e )


c, = 400 mg/e, C2 = 00 mg/e (salt concentration)
then c3 = 200 mg/@
and t h e t o t a mass o f salt d scharged p e r day
- Q3C3 15 x 200 = 3 0 0 0 k g / d .
= (7.5)

A completely m i x e d system c a n b e d e s c r i b e d b y d i f f e r e n t i a l e q u a -
tions: Subscript i refers to inflow, e to exit, s to initial condi-
tions.

Volume S
Conc. C

F i g . 7.2 M i x e d f l o w node

d(SC)
QiCi = QeC + -
dt

= Q C + S-dC f o r c o n s t a n t S
dt
SdC
.’. dt =
QiCi-QeC

Fig. 7.3 D i f f u s e node

Integrating and evaluating the constant of integration from the


fact that C = C a t t = 0:

t = S en QiCi-Q C
(7.9)
- (QiCi-QeC s ,
‘e
Q i C i - QiCi/Qe- Cs
(7.10)
or C = -
Qet/S
‘e
e
94

e.g. at t = 0, C = C a n d at t = - , o r Qe = - o r S = 0,
5’
c = (ai/ae)ci
Observe that if Qi does not equal Be, there must be internal
g a i n s o r losses, e.g. due to evaporation.
The previous example could be studied n u m e r i c a l l y . Although t h i s
requires specific numbers, it is often the only practical way of
s o l v i n g more complex problems.
Assume S = 1000 m 3 , Qi = 1 m 3 / s = Qe, C s = 0, C i = 500 m g / t .
Choose At = 100 s. The choice of At can affect the speed of
solution, the accuracy of r e s u l t s and the numerical s t a b i l i t y of the
computations. It must be determined by trial, from experience o r
from theoret ica I cons i d e r a t ions.
c 2 -c 1
NOWQ . C . - Q C = S - (7.11)
I I At

.. C2 = C1
At
+ -S
Q.(C.-C
l l l
) = C
1
+ 0.1(500-C1) (7.12)

The c o m p u t a t i o n s can b e s e t out i n tabular form as follows:

t cl 500-C, ~ 0 . 1 c,
0 0 500 50 50
100 50 450 45 95
200 95 405 40 135
300 135 365 37 172

1000 326 174 17 343 m g / t

Equation (7.10) would i n d i c a t e C = 316 m g / t a t t = lOOOs, which i s


comparable with the result indicated by the numerical solution of
343 m g / t .

Systems A n a l y s i s

A more sophisticated approach than the simulation method des-


c r i b e d above i s the use of systems a n a l y s i s a n d optimization tech-
niques, with the assistance of computers if necessary. The methods
a l l o w an optimum design to be selected from numerous a l t e r n a t i v e s .
95

a. Plug flow

b. Completely mixed system

I CI

ti C
t

C. D i f f u s e system

Fig. 7.4 Comparison o f p l u g f l o w and m i x e d s y s t e m s


96

The a l t e r n a t i v e s t a n d a r d engineering approach i s to select the best


option from a few selected designs. The l a t t e r approach i s tedious
where there a r e many a I terna t i ves.
The design optimization approach involves the creation of a
general configuration in which the numerical v a l u e of independent
variables has not been fixed. An overall economic objective is
defined and the system i s described i n terms of equations or con-
s t r a i n t s.

NUMER I CAL METHODS FOR THE SOLUT I ON OF S I NGLE D I FFERENT IAL


EQUATI ON5

Numerical solutions appear in the form of a tabulation of the


values of the functions at various values of the independent time
variable and not as a functional relationship. Numerical methods
have the ability to solve practically any equation but they have
the disadvantage that the entire table must be recomputed if the
i n i t i a l conditions a r e changed.
If a function f(t) can be represented by a power series in a
certain interval then it can be represented b y the Taylor series
expanded about a p o i n t t = t i.e. about the i n i t i a l value:
0'

(7.13)

L e t t i n g n represent the previous step a t time t o a n d n + l represent


the next step a t t +h, the series can be w r i t t e n as:
0
(7.14)
'n+1
Consider the example problem

)/' = dy = (7.15)
dt y+t

w i t h i n i t i a l conditions

Y(0) = 1 (7.16)
This is a linear time variant 1st order differential equation.
t
The a n a l y t i c a l solution to the problem, y = 2e -t-1 w i l l be used to
compare the numerical results of some of the methods and to
i l l u s t r a t e the e r r o r at a n y step.
97

The Euler Method

The Euler method is the simplest but least a c c u r a t e of all the


methods discussed. To obtain an exact numerical solution to the
example problem (7.15), a l l the d e r i v a t i v e s y
I1
, y I l l yiV , ... must
be e v a l u a t e d a n d s u b s t i t u t e d i n t o the T a y l o r series (7.14). Knowing
the initial values of y
n' 'n7
I
'n
'1 ..., yn+l could be e v a l u a t e d
after a time increment h. The v a l u e s of a l l the d e r i v a t i v e s could
then be calculated at n+l, a n d yn+2 c o u l d b e e v a l u a t e d a f t e r the
next time increment and so on. Derivatives of arbitrary functions
cannot easily be formulated in computer programs. The d e r i v a t i v e s
y'l, Y l l I , etc. a r e easy to e v a l u a t e f o r the example (7.15) but
this is not generally the case. The Euler method truncates the
Taylor series b y excluding t h e terms a f t e r t h e f i r s t d e r i v a t i v e a n d
eliminates the problem of having to evaluate the second and
subsequent d e r i v a t i v e s . Then

Yn+,=Yn+hYn I + 0 ( h 2) e r r o r (7.17)

Neglecting h2yni1/2 and the subsequent terms in (7.14) results


in a truncation e r r o r of order h2 w h i c h i s denoted O ( h 2 ) . This is
the local e r r o r and r e s u l t s f r o m one step o n l y , i.e. f r o m n to n + l .
I t c a n b e shown that the g l o b a l e r r o r a c c u m u l a t e d o v e r m a n y s t e p s
becomes O ( h ) , i .e. a n e r r o r o f o r d e r h.
Substituting the example (7.15) into the E u l e r a l g o r i t h m (7.17)
gives:

Y n+ 1= Y n + h . ( y n + t n ) (7.18)

The initial condition y ( O ) = l means t h a t y=O a t t=O. Choosing t h e


time increment h=0.02 and l e t t i n g t h e s t e p n u m b e r n = O a t t=O, the
values for y can be evaluated at successive time increments a s
f o l lows:

+h(y +t ) = 1+0.02(1+0) = 1.0200 (7.19)


Y1=Yo 0 0
Y2=Yl+h(Yl+tl) = 1.0200+0.02(1.0200+0.02) = 1 . 0 4 0 8 (7.20)
y =y + h ( y + t ) = 1 . 0 4 0 8 + 0 . 0 2 ( 1 .040+ 0 . 0 4 ) = 1 .0624 (7.21)
3 2 2 2
Y 4= = 1.0848 (7.22)
Y 5= = 1.1081 (7.23)

etc.
98

The numerical solution a f t e r 5 steps i s y(0.10)=1 .lo81 whereas


t
y=2e -t-1 gives the exact a n a l y t i c a l solution as y(O.10)=1.1103.
Hence the absolute global error i s 0.0022, i.e. two-decimal-place
accuracy. Since the g l o b a l e r r o r of the Euler method i s p r o p o r t i o n a l
to h, i.e. O(h), the step size h must be reduced a t least 22- fold
to gain four-decimal accuracy, i.e. h 0.004. This would increase
the computational effort 22-fold. Fig. 7.4 shows how the slope at
I .
the b e g i n n i n g of the interval y IS used to determine the function
value a t the end of the i t e r a t i o n i n the Euler method.

I Analytical

F i g . 7.4 The E u l e r method

The slope at the beginning of the interval is always wrong


unless the solution i s a str a i g h t line. Thus the simple Euler method
suffers from the disadvantage of lack of accuracy, requiring an
extremely small step size.

The Modified Euler Method

Fig. 7.4 and the subsequent discussion suggest how the Euler
99

method can b e improved w i t h l i t t l e a d d i t i o n a l computational effort.


The a r i t h m e t i c a v e r a g e of the slopes a t the b e g i n n i n g a n d the end
of the i n t e r v a l i s used ( o n l y the slope a t the b e g i n n i n g i s used i n
the E u l e r method).

(7.24)

The Eulera l g o r i t h m must f i r s t b e used to predict Yn+1


that Y n+l I c a n b e estimated. A p p l y i n g the same example (7.15) as
1
before a n d s u b s t i t u t i n g y = x+t i n t o (7.24) g i v e s

(7.25)

S u b s t i t u t i n g the E u l e r equation (7.18) f o r yn+l gives

'n+1 = y +h(yn+tn) + (yn +h(Yn+tn 1 + t n+)l (7.26)

2
U s i n g h=0.02 and t h e i n i t i a l condi t i o n s : y o = l , t 0 =O

(7.27)

=1+0.02 ( 1 + 0 ) +(1+0.02(1+0)+0.02) (7.28)


2

=1 . 0 2 0 4 (7.29)

y =1.0204+0.02(1.0204+0.02)+(1.0204+0.02(1.0204+0.02~+0~0~~
2
2
(7.30)
=l
.0416 (7.31)

y5=1.1104 cf analytical solution 1.1103

The answer agrees to within 1 in "the fourth decimal place.


Nearly twice a s much work was done as in the E u l e r method b u t
certainly not the 22 times more t h a t would h a v e been needed w i t h
t h a t method to a t t a i n f o u r decimal p l a c e a c c u r a c y . I t c a n b e shown
that the local and global e r r o r s of the M o d i f i e d E u l e r method a r e
100

O(h3) and O(hZ) respectively. The Modified Euler and the simple
E u l e r methods a r e o f t e n r e f e r r e d t o a s second a n d f i r s t o r d e r meth-
ods r e s p e c t i v e l y .

Runge-Ku t t a Met hods

The Fourth-Order Runge-Kutta methods are amongst those w h i c h


p r o v i d e the greatest accuracy p e r u n i t of computational effort. The
development of the method i s a l g e b r a i c a l l y complicated a n d i s g i v e n
completely i n Stummel a n d H a i n e r (1978) w h i l e G e r a l d (1980) d e r i v e s
t h e Second-Order Runge-Kutta algorithm and explains the p r i n c i p l e s
behind the methods. All the Runge-Kutta methods use the simple
E u l e r method a s a first estimate. I m p r o v e d e s t i m a t e s a r e t h e n made
u s i n g previous estimates a n d different time- values within the time
interval h. A weighted average of all the estimates is used to
calculate y The F o u r t h - O r d e r R u n g e - K u t t a methods a r e t h e most
n+l *
widely used because of t h e i r power a n d s i m p l i c i t y . The f o l l o w i n g i s
a particular Fourth-Order method w h i c h i s commonly u s e d a n d w h i c h
i s included in the simulation program:

yn+,=y + l (k1+2k2+2k3+k4) (7.32)


"6
kl = hf(tn,yn) (7.33)

k2 = h f ( tn+ih,yn+ikl ) (7.34)

k3 = hf ( t n + $ h , y n + i k 2 ) (7.35)

k4 = hf ( t n + l ,yn+k3) (7.36)

Again the problem given in (7.15) above is solved as an ex-


ample: dy/dt=f(t,y)=t+y,y(O)=l. This time y(O.1) is calculated in
one step (h=0.1) whereas y(O.1) was calculated in f i v e time incre-
m e n t s (h=0.02) u s i n g t h e s i m p l e a n d m o d i f i e d E u l e r methods a b o v e .

k = h ( t n + ~ n)

=o. 1 (0+1) = 0.10000 (7.37)

k2=0.1 (0.05+1 .05) = 0.11000 (7.38)

k3=0.1(0.05+1.055) = 0.11050 (7.39)


101

k4=0.1 (0.10+1 .1105) = 0.12105 (7.40)


1
y (0.1 ) =1 .OOOO+-,( 0.10000+2x0.11000+2x0.11050+0.12105) (7.41)

=1 .11034 (7.42)

This agrees to five decimals with the analytical result and


i l l u s t r a t e s a f u r t h e r g a i n i n accuracy w i t h less e f f o r t than r e q u i r e d
by the previous Euler methods. It i s computationally more e f f i c i e n t
than the modified Euler method because, w h i l e f o u r evaluations of
the f u n c t i o n a r e r e q u i r e d f o r each step rather than two, the steps
can be many-fold larger for the same accuracy. The simple Euler
method would have r e q u i r e d of the order of 220 steps to achieve
five-decimal accuracy in y(O.1) but each step involves only one
evaluation of the function. The efficiency of the Euler and
Runge-Kutta methods can be roughly compared by calculating the
number of function evaluations required for the same order of
accuracy. In this particular example the Runge-Kutta method is
approximately 50 times more e f f i c i e n t than the simple Euler method
(220/4). The local error term for the Fourth-Order Runge- Kutta
5
algorithm (7.36) is O(h ) and the global error would be about
0(h4).

M u l t i s t e p Methods

The simple Euler, Modified Euler a n d Runge-Kutta methods are


called single step methods because they use o n l y the information
from the last step computed. I n t h i s they have the a b i l i t y to per-
form the next step with a different step size and are ideal for
b e g i n n i n g the solution where o n l y the i n i t i a l conditions are a v a i l a -
ble. The p r i n c i p l e b e h i n d a m u l t i s t e p method i s to u t i l i z e the past
values of y and/or yl to construct a polynomial that approximates
the derivative function and to extrapolate this i n t o the next time
interval. Most mu1 tistep methods have the disadvantage that they
use a constant step size h to make the construction of the
polynomial easier. Another disadvantage of multistep methods i s that
several past p o i n t s a r e r e q u i r e d whereas o n l y the i n i t i a l conditions
are available at the start. The starting values are generally
102

calculated from the initial conditions using a single-step method


such as a Runge-Kutta method.

REAL-TIME OPERAT I ON OF WATER SUPPLY SYSTEMS

Although numerical models are of direct use for planning and


e v e n t u a l l y design of the components in a water supply system they
can e q u a l l y well be a p p l i e d on-line f o r the operation of the system.
Shamir (1981) described a number of a p p l i c a t i o n s of the connection
between data loggers and mini computers for optimizing the
operation of systems of reservoirs and water supply pipes. Cost
minimization of these operations can be performed on a continuous
basis (example Sterling and Coulbeck, 1975). On the other hand,
when a p p l i e d o f f - l i n e the methods can be used to i d e n t i f y s h o r t f a l l s
i n the system (Rao a n d Bree, 1977).
The telecommunication of reservoir levels, pipe pressures and
flow r a t e s i s r e l a t i v e l y simple whether i n analogue o r d i g i t a l form.
Although there are problems with the measurement of discharge
rate the accuracy of simple methods is s t i l l probably more than
adequate to cope w i t h the predicted f u t u r e demands. Forecasting in
fact i s the most d i f f i c u l t aspect of the r e a l time simulation. Demand
p a t t e r n s may be approximated by F o u r i e r methods. It i s generally
possible to prepare a daily and weekly demand pattern on a
deterministic basis but the introduction of probability makes the
calculations more cumbersome. Growth in demand can also be
included i n the simulation.
The simulation program can be used to investigate alternative
operating methods. Constraints on resource availability such as
water, power o r manpower can be b u i l t into the program. Costs can
be minimized by including energy tariffs and income from water
sales. Quality constraints can also be included.

COMPUTER PROGRAM TO SIMULATE RESERVOIR LEVEL VARIATIONS IN A


PIPE NETWORK

The accompanying computer program w i l l simulate the v a r i a t i o n s


103

in water level in reservoirs in addition to performing a network


flow balance.
The program i s based on the node head correction program i n
Chapter 2 with an additional variable, area of r e s e r v o i r f o r each
'fixed head' or, in this case, 'reservoir type' node. If the
simulation duration 11 in hours and time increment T2 are input,
f o r example 24 and 1, then the heads at each node and water level
in each reservoir will be p r i n t e d out for every hour. The a c t u a l
network iterations each time interval after the first should be
minimal since the network flows a r e balanced i n the f i r s t i t e r a t i o n
and o n l y unbalance due to r e s e r v o i r level changes which w i l l have
to be corrected a t subsequent time i n t e r v a l s . Although drawoffs a r e
time-fixed i n the present program, they could b e a l t e r e d a t pauses
i n the r u n n i n g o r inserted i n equation form.
The output, namely level variations, could be used to estimate
required r e s e r v o i r depths ( u s i n g t r i a l r e s e r v o i r surface a r e a s ) and
i n fact to see at which r e s e r v o i r locations the storage i s most

100 e/s
Res. A = 100m2
\ = lOOm
H,

F i g . 7.5 System f o r continuous simulation example


104

required. Data requirements are similar to the analysis program


w i t h the following additions.
In the first data line after the name, the simulation d u r a t i o n
and increment in hours is added at the end of the line. In the
pipe data, the first pipes should be from the various reservoirs
with the surface areas of the up-stream reservoirs in square
metres g i v e n at t h e e n d of t h e p i p e d a t a l i n e s . In order to d i s p l a y
the reservoir l e v e l s i n t h e b i g g e s t r e s e r v o i r i t i s n e c e s s a r y to h a v e
a supply pipe from a pseudo f i x e d head, very large, reservoir to
represent a pumped supply feeding into the actual biggest level
r e s e r v o i r in t h e d i s t r i b u t i o n system.

REFERENCES

G e r a l d , C.F., 1980. A p p l i e d N u m e r i c a l A n a l y s i s . 2 n d Ed., A d d i s o n


Wesley.
Grosman, D.D., 1981. O p t i m u m A l l o c a t i o n of M i n e S e r v i c e W a t e r
Subject to Q u a l i t y Constraints. MSc(Eng) Dissertation, U n i v e r s i t y
of the Witwatersrand.
H o l t o n , M.C., 1982. A Computer f r o g r a m m e for t h e S i m u l a t i o n o f
W a t e r R e t i c u l a t i o n Systems i n G o l d M i n e s . MSc ( E n g ) D i s s e r t a t i o n
U n i v e r s i t y of t h e W i t w a t e r s r a n d .
James, W., 1978. D e v e l o p i n g and U s i n g Computer S i m u l a t i o n M o d e l s
o f H y d r o l o g i c a l Systems. C o m p u t a t i o n a l H y d r a u l i c s I n c . H a m i l t o n .
Rao, H.S. and Bree, D.W., 1977. E x t e n d e d p e r i o d s i m u l a t i o n of
w a t e r systems, P r o c . ASCE, 103 (HY2) p97-108.
S h a m i r , U., June 1981. R e a l - t i m e c o n t r o l o f w a t e r s u p p l y systems.
Proc. I n t l . Symp. o n R e a l - t i m e O p e r a t i o n o f H y d r o - s y s t e m s . U n i v .
of W a t e r I oo, p555-562.
Sterling, M.J.H. and C o u l b e c k , B., 1975. O p t i m i z a t i o n o f w a t e r
p u m p i n g c o s t s b y h i e r a r c h i c a l methods. Proc. ICE, 59, p789-797.
Stumme1,F. and H a i n e r , K., 1980. I n t r o d u c t i o n to N u m e r i c a l A n a l y -
s i s . S c o t t i s h Academic P r e s s .
105

Computer program for umtinwus simu lation of p i p e network w i t h


raservoirr
l@ 3 4 6 p=R+O < I. >
358 S=S+Q<J>#LH<K<J>}-H(LCJ,S?
28 360 NEXT J
378 HLI>=H<I>+E*R/S
38 388 I F A B S < 2 t R 6 ) < = V THEN 40@
48 _...-. --*
TUPIIT I 390 V-ABSCE?R,S)
58 G = 9 . 8 ! 32 IF FT-S UNITS 480 NEXT I
68 D I S P 'NPIPES,NNODES*NRES,ERc 4 1 8 YF V<H3' THEN 440
,OftRCY f .-TOPHn, SIHLNh, DThmi 4 2 8 NEXT I1
78 INPUT Nl,N2,N3rH3,F,H(l),TII 4 4 8 PRINT ' N+ N- X<H) D<M> QM
T2 3 / S H2M"iTS
80 FOR J=l TO N l ! FIXED HEADS 458 FOR J-1 TO N l
YUHBERED F I R S T 468 PRINT USING 478 i V < - l > a L < J : ' ,
90 DISP mNODE1+,NODE2-.L~~D~,IN X<J>,D<J),Q<J),H<L<J,)
TLH~.Q~~~~,A~I~FORFHU 478 S ~IHAGE
~ DDD,DDDIDDDDU*DD.DDD.D
95 I F J<=N3 THEN 188 D.DD0,DDDQD.D
180 INPUT K<J),LCJ),X<J),D<J>,H2 488 NEXT J
> 62 4 8 5 NEXT T 3
183 GOTO i r e 4 9 8 END
188 INPUT K < J ) , L ( J > r X < J ) , D < J ) , H 2
,QE,A<KCJ>)
118 H<L<J))=H2 NETUORK NAME?
12e PCL<J))=QZ TESTRES
130 F<J)=F NPIPES,NNODES,NRES,ER~,OARCYf~lO
148 NEXT J PHriSlMLNh,DTh?
142 PRINT L I 3,3r2r.ir.e2r1e0.3r1
145 FOR T3=0 TO T 1 STEP T2 HODE~+,NOOE~-,LD,DR~INTLH~~~~D~~
158 FOR Il= TOl 58 ! MAX I T N 8 ,AnEFORFHUS?
1>2>3088#, 15890, .8S#180
NOOE1+rNODE2-rLn,Dn,INTLH2,Q2~3~
~ADEFORFHUS?
2 , 3 , 1 8 8 8 , .18,78~ .1~208
NODEl+,NODE2-,L~,D~~XNTLHZ,Q2r3s
21 ,ADEFGRFHUS?
22 1r3,2080, . 2 * 7 8 , . 1
23
G / F / X < J) >
2 312 NEXT J P I P E MET ANRL BY NODE HERD CORR
22 13 IF. 11>i THEN 258
231 4 FOR 101 TO M J TESTRES
2 315 H<I)=H<I)-P<I>/A<I)%T2?3608 N+ N- X<M> D<k> QH3/S H2H 8
2316 FOR J=l TO N1 1 2 3009 ,158 013 89.3
2318 I F K < J ) = I THEN 246 2 3 ism .i8e ,841 63.2
2 418 I F LCJ)=I THEM 242 1 3 2888 ,286 ,859 63.2
2 411 GOTO 249 N+ N- X < H > O<W> BM3/S H2H 1
2412 H<I)=H<I)+QCJ)/ACI>%T2%3608 1 2 3808 .158 ,013 88.6
2 4i3 GOTO 2 4 9 2 3 1800 ,188 .841 63.2
2416 H(I)=H<I)-Q<J)/~<I)ST2tJ688 1 3 2800 .208 .859 63.2
2 4I7 GOTO 249 N+ N- XCH) O < M > Q H 3 4 H2M 2
2 418 NEXT J 1 2 3808 150 ,813 88.8
2 419 NEXT I 2 3 1800 ,180 .a41 62.1
2si8 FOR I=N3+1 TO N2 i 3 2009 .200 .cis9 62.1
26i8 R=-P<I> N+ H- X < M > D<H> QM3/S H2M 3
27 0 s=0 1 2 3800 .158 813 87.3
2Et 0 FOR J=1 TO N l 2 3 1880 .188 841 62.1
2510 I F K < J ) < > I THEN 330 1 3 2800 .288 .859 62.1
381 8 RoR-QC J)
31.0 SrS+Q<J)/<H<K<J)>-H(L<J,))
32!8 GOTO 368
3 310 I F L<J)C>I THEN 360
106

CHAPTER 8

UNSTEADY FLOW ANALYSIS BY R I G I D COLUMN METHOD

RIGID WATER COLUMN SURGE THEORY

Transients i n closed conduits a r e n o r m a l l y classed i n t o two cate-


gories: slow motion mass o s c i l l a t i o n of the f l u i d which i s referred
to as surge, and rapid change in flow accompanied by elastic
s t r a i n of the f l u i d a n d conduit which i s r e f e r r e d to as water ham-
mer. For slow or small changes in flow rate or pressure the two
theories y i e l d simi t a r r e s u l t s .
It is normally easier to analyse a system by rigid column
theory than by elastic theory. On the other h a n d there a r e many
s i t u a t i o n s where it is inaccurate or even dangerous to a p p l y this
simplified theory, and water hammer theory must be a p p l i e d . With
rigid column theory the water in the conduit is treated as an
incompressible -mass, although the water column is free to move
around bends and through expansions etc. A pressure difference
applied across the ends of the column produces an instantaneous
acceleration throughout i t s length. The basic equation r e l a t i n g the
head difference between the ends of the water column i n a uniform
bore conduit to the rate of change in velocity is derived from
Newton's basic law of motion, a n d i s

h = --L
- dv
(8.1 )
g dt
where h is the difference in head between the two ends, L i s the
conduit length, v i s the flow velocity, g i s g r a v i t a t i o n a l accelera-
tion and t i s time.
The equation is useful for calculating the head r i s e associated
with slow deceleration of a water column. It may be used for
calculating the water level variations in a surge shaft following
power trip or starting up in a pumping line, or power load
changes i n a hydroelectric installation fed b y a pressure p i p e l i n e .
The equation may be solved i n steps of A t b y computer, i n tabular
form or g r a p h i c a l l y .
107

Example 1

Numerical A n a l y s i s of Surge Shaft

A 100 m long penstock w i t h a cross-sectional area, A t , of 1 m2


i s protected a g a i n s t water hammer b y a s u r g e s h a f t a t the t u r b i n e ,
with a cross-sectional area, A2, of 2 m2 and an unrestricted
orifice. The initial velocity in the c o n d u i t i s 1 m/s a n d there i s a
sudden complete load rejection at the turbine. Calculate the
maximum r i s e i n w a t e r level i n the s u r g e s h a f t n e g l e c t i n g f r i c t i o n .
Take At = 1 sec. Then from Equ. 8.1, A v = -ghA t/L = -9.8h/100
=-0.098h. By c o n t i n u i t y , A h = A,vAt/A2 = lv/2 = 0 . 5 ~ .

t Ah=0.5v h Av= - 0 . 0 9 8 h V

0- 1 0.5 0.5 -0.049 0.951


1-2 0.476 0.976 -0.096 0.855
2-3 0.428 1 .404 -0.138 0.717
3-4 0.359 1 .763 -0.173 0.544
4-5 0.272 2.035 -0.199 0.345
5-6 0.172 2.207 -0.216 0.129
6-7 0.064 2.271* -0.223 -0.094

The maximum rise i s 2.27 m, w h i c h may be compared w i t h the


analytical s o l u t i o n of 2.26 m. The a c c u r a c y of the n u m e r i c a l method
could be improved b y taking smaller time i n t e r v a l s o r t a k i n g the
mean v and h over the time intervals to calculate A h and A V

respectively. The method c a n readily be extended to i n c l u d e head


losses, a n d i s c a l c u l a t o r - o r i e n t a ted.

F i g . 8.1 D e r i v a t i o n of r i g i d column e q u a t i o n of motion


108

DERIVATION OF BASIC EQUATION

Net b o d y f o r c e a l o n g p i p e l i n e = wAL s i n 0
= wA(h -h ) (8.2)
2 1
F o r c e = mass x a c c e l e r a t i o n
w ( h -h -h ) A = - ( w / g ) A L d v / d t (8.3)
2 1 f
.*. ( h2-h 1 ) = hf - ( L / g ) d v / d t (8.4)

SOLUTION OF EQUATION OF MOTION

The equation can be solved analytically in some cases, or by


graphical means (Jaeger, 1956) or numerically (manually or by
computer).
Only the simplest of surge systems (constant conduit cross-
section and no friction) can be studied analytically. That i s the
relationships between velocity and amplitude and time can be
derived in algebraic form. Consider as an example the simple
U-tube in F i g . 8.2 which i s d i s t u r b e d b y f o r c i n g t h e l i q u i d up one
l e g to s t a r t . The e q u a t i o n o f motion from (8.1) is

dy
and s i n c e v = - d v - d 2 y
dt 'dt - dtz
I n t e g r a t i n g t w i c e w i t h r e s p e c t to t g i v e s y = cos( t m ,
'ma,
(8.6)
where the constants of integration are from at t=O, and
'='ma,
dy/dt = 0 w h e n t=O.

mean l e v e l s
Y

F i g . 8.2 U-tube
109

The oscillations obviously repeat every 2 n m which is the


period. (8.7)
The v e l o c i t y i s d y / d t = -y sin ( t a (8.8)
max
and
"max
-- _ 'max
J2g/L' (8.9)

For the case of a c o n d u i t of area A l e a d i n g from a reservoir


t
with constant level to a surge shaft w i t h cross-sectional area A
5'
the r e l a t i o n s h i p is slightly different.

-
AS
-
- -
Surge shaft

0
sudden valve closure

Fig. 8.3 Simple s u r g e s h a f t

It is customary to neglect the i n e r t i a of the water in the surge


shaft. Then f o r t h e f l o w in the tunnel,
L *
Dynamics: - d t + Y = O (8.10)
9
C o n t i n u i t y : vA = Asdy/dt (8.11)
t
:. -
dv = d2y 3
dt At dt2 (8.12)

... C s
A
d2Y (8.13)
g A t dt2' =

The g e n e r a l s o l u t i o n to t h i s i s y=a cos 2nt/T+b s i n 2nt/T(8.14)


where T = 2 n / v t (8.15)
I f a t t=O, y=O t h e n a=O
2 nt
cos -
T

I f a t t=O, v=v then (8.16)


0

Then y = v
0
fi 9 As
sin (8.17)
110

A More Precise Method for Manual Numerical A n a l y s i s

The simple numerical method illustrated should really only be


applied with very small time increments. A l a r g e number of steps
may therefore be involved and the method is more appropriate to
digital computer solution. When manual methods a r e employed it is
suggested the finite difference equations be written in implicit o r
time averaged form. Thus the average h over a time interval is
used, namely (h2 + h )/2 t o c a l c u l a t e Av, a n d t h e a v e r a g e v e l o c i t y
1
in the conduit or t u n n e l ( v 2 + v )/2 t o c a l c u l a t e A h over each
1
time interval. It i s t h e n n e c e s s a r y to s o l v e t h e two e q u a t i o n s
( d y n a m i c a n d c o n t i n u i t y ) s i m u l t a n e o u s l y f o r h2 a n d v2. Alternative-
ly one may work in terms of flow rate Q instead of v. The
following equations a r e s o l v e d f o r h2 and Q2. A h e a d loss term,
he
i s also introduced for throttling a t the surge shaft inlet. The i n l e t
area i s A,, and the head loss term i s expressed i n terms o f the
p r e v i o u s f l o w r a t e a s a n i m p l i c i t s o l u t i o n w o u l d b e more c o m p l i c a t e d
for t h e q u a d r a t i c term. Thus head losses must b e s m a l l r e l a t i v e to
surge rises.

D y n a m i c : Q2 = Q 1 - ( g A t A t / L ) { ( h 2 + h , ) / 2 + hf} (8.18)
where he = K Q t l Q t l / ( 2 g A z i )
(8.19)
Continuity: h -h =(Q2+Ql)At/2As
2 1 (8.20)
S o l v i n g f o r Q2 a n d h
2:

Q, - ( gAt A t / L ) { hl + ( Q1 A t/4AS)+KQ, I Q, 1 / ( 2 g A i 2 1
(8.21)
Q2 - l+gAtA t2/4LAS

a n d h2 = hl+(Q2+Q1 ) A t / ( 2 A s ) (8.22)

Another useful application of the r i g i d water column equation i s


w i t h water column separation. Following the stopping of a pump a t
the upstream end o f a pumping line, the pressure frequently drops
sufficiently to c a u s e v a p o r i z a t i o n a t peaks along the line. In such
cases the water column beyond the vapour pocket will decelerate
slowly and r i g i d c o l u m n theory i s sufficiently accurate for analy-
sis. Equ. 8.1 may be integrated twice with respect to time t to
determine the distance the water column wi II t r a v e l before stopping.
111

Simple open surge tank Variable area surge tank

Throttled inlet/outlet Closed surge tank

Differential area surge tank

Fig. 8.4 Types of surge tanks


112

If the pumps stop instantaneously t h e volume of the v a p o u r pocket


b e h i n d the w a t e r column o f length e will b e Q=Aev 2 / 2 g h where v
i s the i n i t i a l flow v e l o c i t y .

SURGE TANKS

By breaking a l e n g t h of closed c o n d u i t with a free water sur-


face, the water hammer pressure and surge amplitude can b e re-
duced considerably. The use of surge tanks for this purpose is
common i n hydroelectric installations with tunnels b u t n o t encount-
ered regularly i n pumped o r p i p e systems where the pressures a r e
greater and consequently surge tank heights would b e excessive.
Some shapes of s u r g e t a n k s a r e i n d i c a t e d i n F i g u r e 8.4. A p a r t from
the throttled and closed surge tanks, the hydraulic calculations,
namely water level variations and pressures, can be performed
analytically or numerically employing two equations. One is the
dynamic equation (8.1) a n d the o t h e r i s the c o n t i n u i t y equation,

v A = v3A3=G2A2 = A 2 d y / d t (8.23)
1 1
where v i s velocity, A i s cross-sectional area, y i s water depth, t
i s time, subscript 1 r e f e r s to t h e c o n d u i t a n d 2 to t h e open s u r g e
s h a f t a n d 3 to t h e i n l e t .
In the case of throttles, the head in the conduit could rise
higher than the water level in the surge shaft by the head loss
through the throttle. The loss through the restriction could be
r e p r e s e n t e d b y he = K . v31v31/2g where K . could v a r y depending
I /o I /o
on whether the flow is into or out of the opening. Generally the
throttle serves to reduce the water level fluctuations in the s u r g e
shaft and since the head loss is out of phase with the level
variations (see F i g u r e 8.5) it will not i n c r e a s e t h e maximum h e a d
i n t h e c o n d u i t i f n o t excessive.
Approximations to t h e damped s u r g e s c a n be o b t a i n e d b y a n a l y -
t i c a l methods ( P i c k f o r d , 1969).
Alternative methods of a n a l y s i s of surge shafts are g r a p h i c a l l y
( J a e g e r , 1956 a n d 1977) a n d w i t h t h e a i d o f c h a r t s ( R i c h , 1963).
113

Load rejection

head loss into surge shaft

Fig. 8.5 Surge in t h r o t t l e d surge shaft

Example 2

N u m e r i c a l A n a l y s i s of Penstock P r o t e c t e d w i t h an A i r C h a m b e r

From Boyles law H S = HS (8.24)


0 0
assuming isothermal expansion
w h e r e h e a d H i s a b s o l u t e i.e. + atmospheric head
Continuity: AS = vAAt (8.25)
Dynamics: Av = 3
e HAt ( r i g i d c o l u m n e q u . ) (8.26)
L = 1000m, Ho = 30m = 40m a b s o l u t e , v = 1.5m/s, A= 0 . 2 m Z ,
= lm3,At = .5s

40
t H = -C A V= - .005H V A S=-O.1 v S
- ~

0-.5 30+10=40 -.2 1.3 -.13 .87


.5-1 46.0 -. 23 1 .07 -. 11 .76
-1.5 52.6 -. 26 .81 -. 08 .68
-2 58.8 -. 29 .52 -. 05 .63
-2.5 63.5 - . 31 .21 - .0 2 .61
-3 6 5 . 6:: -. 33 -.12 .01 .62
-3.5 64.5 -. 32 - .44 .04 .68
-d

Max H = 6 5 . 6 - 10 = 55.6m.

This analysis i s not p a r t i c u l a r l y accurate as accelerations were too


great to permit accuracy w i t h r i g i d column theory. I t nevertheless
d e m o n s t r a t e s u s e of t h e t e c h n i q u e .
114

Fig. 8.6 Numerical analysis of penstock protected with an air


chamber

REFERENCES

Jaeger, C., 1956. E n g i n e e r i n g F l u i d Mechanics. B l a c k i e C? Son L t d .


L o n d o n . 529 p p .
Jaeger, C., 1977. F l u i d T r a n s i e n t s in H y d r o - E l e c t r i c Engineering
P r a c t i c e . B l a c k i e 0 Son L t d . L o n d o n . 413 pp.
P i c k f o r d , J., 1969. A n a l y s i s of Surge, M a c m i l l a n . 203 pp.
R i c h , G.R., 1963. H y d r a u l i c T r a n s i e n t s , Dover, N.Y. 409 pp.
115

CHAPTER 9

WATER HAMMER THEORY

BAS I C WATER HAMMER EQUATIONS

The fundamental wave equations describing the phenomenon of


water hammer may be a r r i v e d a t from consideration of conservation
of momentum and of mass. The following derivation is for the
general case of a pipe inclined at any a n g l e to the horizontal a n d
friction head loss varying with the square of the velocity. The
notation used i s g i v e n i n F i g u r e 9.1.

pd dx
2

Fig. 9.1 L o n g i t u d i n a l and cross sections through p i p e

Conservation of Momentum

The following equation is derived from a force-momentum


balance, but it is possible to derive it starting from Bernoulli's
energy equation. Newton's Second Law of motion is applied to an
element of fluid Adx moving i n the x- direction (see F i g u r e 9.1).
The r e s u l t a n t force i n the x-direction equals the r a t e of change of
momentum i n that d i r e c t i o n :

pA - (p+*dx)A - W A A c x - W A d x s i n e=-Adx-
W dv (9.1 )
ax 2gd dt

dv
and since -.- - av av
- - + -v. (9.2)
clt at ax
116

t h e e q u a t i o n becomes

(9.3)

(9.4)

ah az w v av (9.5)
t h e n W- =% + W-
ax
+ -
g
-
ax
ax ax
az
where a-x =sin 0 . (9.6)

Hence t h e momentum e q u a t i o n becomes

(9.7)

To account f o r t h e d i r e c t i o n a l c h a n g e i n h e a d loss w i t h v e l o c i t y one


can w r i t e v l v l i n s t e a d of v 2 :

In t h i s equation the v e l o c i t y h e a d v 2 / 2 g h a s been included in the


total head h . One c a n t a k e h a s t h e p i e z o m e t r i c h e a d p/W + z and
w r i t e t h e momentum e q u a t i o n t h u s :

ah + 1g (a” + v-)av xv2 =


+ - 0 (9.9)
ax at ax 2gd

Generally the term vav /ax i s small compared with av/at a n d can
be neglected, but i t can be accounted f o r i n numerical solutions if
n e c e s s a r y , e.g. i n flexible plastic piping.

Conservation of Mass

The second differential equation arises from continuity. The


difference between the r a t e of mass inflow to a n d o u t f l o w from an
elemental length of pipe is equated to the rate of increase of
storage caused by elastic expansion of the pipe and elastic
compression o f t h e w a t e r .

The r a t e of s t r e s s i n c r e a s e i n t h e p i p e w a l l i s ( d / 2 b ) d p/a t
The c o r r e s p o n d i n g r a t e o f s t r a i n i s (d/2bE)a p/a t
a n d t h e r a t e of increase in diameter i s (d2/2bE)ap/at
Now A = nd2/4 (9.10)

-
.. aA -
at
nd
2
ad
at
(9.11)
i17

_- - nd d2 ap (9.12)
2 2bE at

The r a t e of i n c r e a s e i n v o l u m e o v e r a l e n g t h d x i s g i v e n b y

(9. 3 )

- n d 3 d x ap (9. 4 )
4bE at

Longitudinal strains h a v e been n e g l e c t e d h e r e . I t h a s a l s o been


assumed that longitudinal stress which would affect the lateral
expansion due to the Poisson's r a t i o effect i s i n s i g n i f i c a n t a l t h o u g h
they can be included if desired.
The r a t e o f i n c r e a s e i n s t o r a g e c a u s e d b y e l a s t i c compression of
water i s

(9.15)

E q u a t i n g i n f l o w m i n u s o u t f l o w to r a t e o f c h a n g e of s t o r a g e ,
(9.16)
VA - (V + av
-dx)A
ax
= (-
nd2dx
4K
+ -
nd3dx
4bE)
ap

' a V + ( L + - )d * = o
1.e. -
ax K bE a t (9.17)

Again, i f we p u t h = p / W a n d r e c a l l az/at = 0, we g e t

(9.18)

where c = 1/ C-T p(- + -)

The b a s i c d i f f e r e n t i a l water hammer e q u a t i o n s , including a friction


term, t h u s become
-+-
ah 1 av+xvlvl=o (9.19)
ax g at 2gd
and

-ah
+ - - c 2 av = o (9.20)
at g ax

O m i t t i n g t h e f r i c t i o n t e r m t h e e q u a t i o n s become

-
ah + -
ax
l a-v
gat = O
(9.21)

(9.22)

The g e n e r a l s o l u t i o n to these e q u a t i o n s i s
118

(9.23)

X
v = v
0
+ 2f
c 1
(t - -)
c
+ 2f
c 2
(t + -)
X
(9.24)

which indicates that pressure and velocity changes a r e propagated


at speed +c along the p i p e . c i s r e f e r r e d to a s t h e w a t e r hammer
wave c e l e r i t y .

Where longitudinal expansion is allowed for a more accurate


expression f o r c is

c =I/$- (9.25)

5
where k = - - p f o r p i p e s u p p o r t e d a t one end o n l y

= 1 - p 2 f o r b o t h ends f i x e d
= 1 f o r a p i p e w i t h expansion j o i n t s
p i s the Poisson r a t i o which f o r steel i s 0.3
E i s the e l a s t i c modulus, (210 000 N/mmZ f o r s t e e l ) ,
K i s the b u l k modulus of f l u i d , (2100 N/mm2 f o r w a t e r ) ,
P i s t h e f l u i d mass d e n s i t y , (1000 kg/m3 f o r w a t e r ) ,
d and b a r e the p i p e diameter a n d wall thickness respectively, h
is total head, x is distance along pipe, g is gravitational
acceleration (9.81 m / s 2 ) , t i s time, v i s flow velocity, and A i s the
Darcy-Weisbach f r i c t i o n coefficient ( X in British practice and f in
U.S. practice). X is actually a function of the flow velocity as
indicated b y t h e Colebrook-White e q u a t i o n o r a Moody diagram. It
is also affected b y unsteady motion but no q u a n t i t a t i v e assessment
of t h i s i s a v a i l a b l e

EFFECT O F A I R

The presence of free a i r in p i p e l i n e s c a n r e d u c e t h e s e v e r i t y of


water hammer considerably. Fox (1977) indicates that the celerity
(speed) of a n e l a s t i c wave w i t h f r e e a i r i s

m p(- + - + - )
(9.26)
119

For l a r g e a i r contents t h i s reduces to c = (9.27)


where p i s the absolute pressure and f i s the free gas f r a c t i o n b y
volume.
c is reduced remarkably for even relatively low gas contents.
Thus 2% of air at a pressure head of 50 m of water reduces the
c e l e r i t y from about 1100 m/s f o r a t y p i c a l steel p i p e l i n e to 160 m/s.
The Joukowsky water hammer head i s
-C
Ah =- Lv (9.28)
9

where Av i s the change in velocity of flow. There i s thus a l a r g e


reduction i n water hammer head h f o r a r e l a t i v e l y small f r a c t i o n of
air. I f the a i r collects at the top of the p i p e there i s no reason to
see why the same equation cannot a p p l y . Stephenson (1967) on the
other hand derived an equation for the celerity of a bore in a
partly full pipe. The c e l e r i t y d e r i v e d from momentum p r i n c i p l e s i s
f o r small a i r proportions

c = JgAh/f (9.29)

where Ah is the head rise behind the bore. This indicates a


c e l e r i t y of 158 m/s f o r f = 0.02 and h = 50 m.
There is a school of thought which favours the i n s t a l l a t i o n of
air valves in pipelines as a means of reducing water hammer
overpressures. The intention is primarily to cushion the impact of
approaching columns. Calculations will, however, indicate that an
excessively large volume of air is required to produce any
significant reduction in head. The idea stems from the use of air
vessels to a l l e v i a t e water hammer i n pipelines. It will be realized
that air in air vessels is under high pressure initially and
therefore occupies a relatively smal I volume. Upon pressure
reduction f o l l o w i n g a pump t r i p , the a i r from an a i r vessel expands
according to the equation pUk = constant where U i s the volume of
air. The size of a i r valves to draw i n the necessary volume of a i r
at low (vacuum) pressures w i l l be found on a n a l y s i s to b e exces-
s i v e f o r l a r g e diameter pipelines.
120

METHODS O F ANALYSIS

A common method of analysis of pipe systems f o r water hammer


pressures used to be graphically (Lupton,1953). Friction was
assumed to be concentrated at one end of the pipe or at a few
points along the line, a n d the water hammer e q u a t i o n s were s o l v e d
simultaneously w i t h the v a l v e o r pump c h a r a c t e r i s t i c s on a g r a p h of
h plotted against v, for successive time intervals. T h i s method is
now l a r g e l y r e p l a c e d b y c o m p u t e r s e . 9 . Chaudhry, 1979.
The most economical method of solution of the water hammer
equations for p a r t i c u l a r systems is by digital computer. Solution i s
usually by the method of characteristics (Streeter a n d Wylie, 1967)
which differs little in principle from the old graphical method o r
by finite differences (Stephenson, 1966). The differential water
hammer e q u a t i o n s a r e e x p r e s s e d in f i n i t e d i f f e r e n c e f o r m a n d s o l v e d
for successive time intervals. The c o n d u i t i s d i v i d e d i n t o a number
of intervals and At is set equal to A x/c. The x - t grid on
which solution takes place is depicted in Fig. 9.2. S t a r t i n g from
known conditions along the pipeline at time t, one proceeds to
c a l c u l a t e the head a n d v e l o c i t y a t each p o i n t a l o n g the l i n e a t time
t + At.
By a d d i n g e q u a t i o n s (9.19) a n d (9.20) divided b y c, the p a r t i a l
differential terms can be replaced by total differentials and one
obtains

(9.30)

cX v I v l d t
for -
dx - - c : dh - Z d v - = o (9.31)
dt 9 29d
Equs.(9.30) and (9.31) may be solved for h' and v ' at point p
P P
at time t + A t in terms of known h and v at two other points q
and r at time t. Thus for qp, dh=h'-h dv=v'-v and for rp,
P q' P q
dh=h'-h
~r
dv=v'-v
~r
and . The resulting equations, termed the
characteristic equations, are
h +hr + c v - v r + cdth v (v 1-v I (9.32)
hl =L --9 ~
r r qlvq
P 2 9 2 29d 2
v +v g h -h - hdt v , I v r ~ + v q l v q I~
v l = 9 + - q-
r (9.33)
D 2 c 2 2d 2
121

TIME

0 0

F i g . 9.2 x - t G r i d f o r w a t e r hammer a n a l y s i s b y
c h a r a c t e r i s t i c s method.

At the terminal points, an additional condition is usually


imposed; either h is fixed, or v i s a f u n c t i o n o f a g a t e o p e n i n g or
pump speed. The correct Equ. (9.30) or (9.31) is solved
simultaneously with t h e k n o w n c o n d i t i o n to e v a l u a t e t h e new h a n d
v at time t + At. The c o m p u t a t i o n s commence at known conditions
and are terminated when the pressure fluctuations are sufficiently
damped b y f r i c t i o n .
Where a b r a n c h p i p e s o c c u r s ( f l o w o u t o f p to s ) o r t h e r e i s a
change in diameter, then Equs. (9.32) to (9.33) should be
r e p l a c e d b y Equs. (9.34) to (9.37):

h' = [ hqAq+hrAr+hSAS+(c/g) ( Q -Q,-Qs)-(chdt/2g).


P 9
(QqIQqI/dqAq-QrIQrI/drAr-QsIQsI/dSAs) ]/(A +Ar+As) (9.34)
q
t h e n 8' = Q + ( A g / c ) ( h - h ' )-ha Q d t 2d A (9.35)
qP q 4 4 P d q 1 / q q
QIpr = Qr+(Arg/c) ( hSp-hr)-h Qr lar[ dt/2dr Ar (9.36)

Q' = Qs+(ASg/c) ( h ' p - h s ) - h Q S I Q S l d t / 2 d S As (9.37)


PS
Where Q i s f l o w o u t of p to r e t c . and Q i s the flow out of q to
Pr q
p etc.
It should be noted that the finite difference form of the
equations above i s termed e x p l i c i t s i n c e h e a d losses a r e e x p r e s s e d
122

i n terms of the velocities a t the p r e v i o u s time i n t e r v a l . Where head


losses are significant compared with the water hammer heads, an
i m p l i c i t solution may be necessary (Chaudhry and Yevjevich, 1981 ) .
The l a t t e r is, however, more complicated as the equations involve
more unknowns and simultaneous solutions of equations for every
point i n space a r e necessary. The equations also become non-linear.
A method of overcoming these problems i s e x p l a i n e d i n Chapter 12.

VALVES

At a v a l v e o r other c o n s t r i c t i o n i t i s necessary to solve one of


the characteristic equations and the valve discharge equation
simultaneously. A valve acts in effect like a constriction which
increases head losses. One may therefore e n q u i r e why the head 1055
cannot be treated as f o r f r i c t i o n head loss. I t w i l l be r e c a l l e d that
f r i c t i o n head loss was assumed to be a function of velocity at the
previous point a n d previous time i n t e r v a l . Unfortunately t h i s method
becomes i n c r e a s i n g l y inaccurate ( a n d unstable) for increasing head
tosses a n d an e x p l i c i t (new time) f u n c t i o n i s g e n e r a l l y r e q u i r e d f o r
the head loss at a constriction. (It is however exceedingly
laborious to account f o r a new v e l o c i t y head loss at a p i p e branch,
so in the case of network programs a weighted pseudo-implicit
method has been employed).
The discharge c h a r a c t e r i s t i c of a v a l v e can be expressed i n the
f o l l o w i n g way:

Q = CdFAm (9.38)

where Q is the flow in the valve, H i s the head loss across the
valve a n d C d i s a discharge coefficient. F i s the f r a c t i o n a l opening
of the valve (0 i s closed and 1 is fully open). The discharge
coefficient i s often a f u n c t i o n of F unfortunately but t hi s w i l l be
accounted f o r here b y assuming the o n l y v a r i a b l e i s F.
The degree of v a l v e opening as a function of time i n the case of
uniform stem travel or proportional turns of a handwheel is
generally non-linear. For most valves the hole closes more r a p i d l y
near the end of the travel of the gate. The following figure
illustrates the proportional area open for different valves as a
function of time assuming steady t u r n i n g of the handwheel o r actua-
123

tor, ( t h e a c t u a t o r can be controlled to close n o n - l i n e a r l y i f desired


a n d t h i s w i l l be discussed under chapter 12.

1 .o
A -(l-x)sin arcos ( 1 -
Azi
0.8
s i n ( a r c o s x!l
/
-. \
0.6 ' I

Gate valve
0.4
/ - \

0.2
Spherical

0
0.2 0.4 0.6 0.8
.o Butterfly
Proportional rotation o f handwheel
from open to closed

F i g . 9.3 Proportional areas f o r some valves

For gate v a l v e s the F - T r e l a t i o n s h i p can be approximated b y


a parabol ic function :

F = 1 -(t/T)' (9.39)

I n general the head loss f u n c t i o n can be w r i t t e n

Q = { l - ( t / T ) N I A p m (9.40)

where Ho = i n i t i a l H/Vo' i.e. initial head loss through f u l l y open


v a l v e d i v i d e d b y i n i t i a l velocity A i s the p i p e area.
squared.
P
Solving t h i s a n d the c h a r a c t e r i s t i c equation at the downstream end
of a p i p e

dh + s v + X v l v l d x= 0 (9.30)
9 29d
124

J (9.41)

c . .AD

QZ
and h = + z (9.42)
(A [1-(t/T)N])2/Ho
P
where Z is t h e downstream head, H i s t h e head above Z and h
i s the total head. Subscript 1 r e f e r s t o the upstream p o i n t
at the previous time interval, and p to the p i p e upstream of the
valve. t is time, T is the closure time of a v a l v e , t/T i s the
proportional operation of the handwheel assuming a constant r a t e of
operation and A i s the open area.

ACCURACY AND STABILITY O F FINITE DIFFERENCE SCHEMES

The water hammer equations are non-linear partial differential


equations. As they cannot be solved a n a l y t i c a l l y f o r most cases,
numerical techniques are employed. Most existing methods can be
c l a s s i f i e d as follows:
a) e x p l i c i t f i n i t e difference methods
b) i m p l i c i t f i n i t e difference methods
c) f i n i t e element methods.
The implicit method of solution is a method whereby a simul-
taneous solution o f a l l the flow properties i s obtained b y s o l v i n g a
matrix; its main advantage is that the ratio of space to time
interval, &/At, i s not governed b y any s t a b i l i t y c r i t e r i a and the
method i s considered to be s t a b l e f o r any choice of Ax a n d At. Most
previous i n v e s t i g a t o r s considered t h i s to be an advantage. Others,
however, found that i t i s not a l w a y s possible to make p r a c t i c a l use
of this "advantage" as f o r h i g h r a t i o s of Ax/At inaccuracy i n the
r e s u l t s was h i g h . I m p l i c i t methods a r e also not convenient f o r use
as one cannot keep t r a c k of r e s u l t s a t d i f f e r e n t time periods.
F i n i t e element methods are usually avoided as they a r e expen-
s i v e to r u n and accuracy a n d s t a b i l i t y c r i t e r i a can be tedious.
125

Explicit finite difference schemes have been widely used i n the


past for the solution of different non-l inear partial differential
equations. They d i f f e r from each other i n the way they define the
variable gradients, but they all express the flow properties a t a
certain time as a function of the flow properties at a previous
time, thus permitting an e x p l i c i t solution. They a r e simple to use
as they use a fixed regular grid and it is easier to follow the
v a r i a t i o n of the flow properties a l o n g the catchment as the solution
is performed e x p l i c i t l y . They have been found to be accurate and
economical when properly used. The problems accompanying the
choice and the use of an explicit finite difference scheme are,
however, those of accuracy and s t a b i l i t y . Choosing the most proper
scheme and using it accordingly is, therefore, important in
o b t a i n i n g s t a b l e a n d accurate results.

Basic Terms Related to Accuracy and S t a b i l i t y f o r


Difference Schemes

Many natural systems which are continuous functions can be


described by differential equations. If the differential equations
cannot be solved mathematically one usually resorts to numerical
techniques b y a p p r o x i m a t i n g the d i f f e r e n t i a l equations to a comput-
ational algorithm using difference schemes. This procedure raises
two basic questions. "How well is the natural system modelled by
the differential equations?", and "How well is the solution to the
differentia 1 equations represented b y the computa t iona I a l g o r i thm?"
In the analysis to follow more attention is paid to the second
question. The f i r s t question can o n l y be answered b y s t u d y i n g the
behaviour of the n a t u r a l system and comparing i t to t h e equations
applied to it. Therefore it will be assumed here that the
differential equations approximate the system we1 I . The difference
between the differential equations and the difference scheme
a p p r o x i m a t i n g them i s c a l l e d a Truncation e r r o r ( T r ) ,
i.e. D i f f e r e n t i a l equations = Difference scheme + Tr (9.43)
The truncation error can r e a d i l y be established u s i n g T a y l o r ' s
expansion. There i s also a difference in the solutions of the two
schemes which one c a l l s the E r r o r ( E ) ,
126

i .e. Solution of Differential equations = Solutions of Difference


equations f E (9.44)
The exact v a l u e of the E r r o r cannot r e a l l y be obtained i n this
case as the d i f f e r e n t i a l equations cannot be solved a n a l y t i c a l l y . We
say that a difference scheme i s consistent w i t h a set of D i f f e r e n t i a l
equations if the Truncation error tends to zero as the space a n d
time increments tend to zero,
i.e. Consistent i f limit Tr = 0
as Ax, At + 0 (9.45)
We say that the solution of the difference scheme i s convergent
with the solution of the d i f f e r e n t i a l equations i f the E r r o r tends to
zero as the space a n d time increments tend to zero,
i.e. Convergent if limit E = 0
as Ax,At+O (9.46)
Numerical Diffusion is the process in which the Error (E) is
formed. It is the development of the truncation error (Tr) to the
error ( E ) through the numerical technique used. I t g e n e r a l l y mani-
fests in the form of a n attenuation a n d spreading of wave fronts.
I f computations a t p o i n t s distance Ax a p a r t a r e a t time i n t e r v a l s A t
then numerical diffusion w i l l proceed through the system a t a rate
Ax/ At.

Stability and Accuracy Criteria for an Explicit


Finite Difference Scheme

Since one is dealing with non-linear partial differential equa-


tions (p.d.e's) there is no rigorous proof specifying stability
c r i ter i a.
In the solution of a non-l near set of p.d.e's like the Water
Hammer equations i t was found that both s t a b i l i t y a n d accuracy a r e
influenced b y the values chose f o r the space increment ( A x ) and
the time increment ( At). In particular, a critical r a t i o of Ax/A t
i.e. ( Ax/ AtIcr., exists for determining whether a scheme w i l l run
under stable conditions or not. The effects of Ax and At on
s t a b i l i t y a n d accuracy a r e summarized i n F i g u r e ( 9 . 4 ) .
127

--
+
A
solution is solution is
stable unstabl e

Accuracy of Solution
decreases because of
numerical diffusion

If the difference scheme i s


convergent for a fixed ( A X / A t )
the smaller Ax and A t the more
accurate the solution.

t
0

Fig. 9.4 Effect of values on Ax a n d At on s t a b i l i t y a n d


accuracy f o r a n e x p l i c i t f i n i t e difference scheme

From F i g u r e (9.4) one can deduce that the main c r i t e r i a in the


selection of Ax and At values for an explicit finite difference
scheme are:
a) that the scheme s h a l l proceed u n d e r s t a b l e conditions i.e.

(9.47)

Ax AX
b) -
At
shall be close to (-)
At c r
to minimize d i f f u s i o n e r r o r s a n d
o b t a i n optimal accuracy.
c) The difference scheme s h a l l be convergent. T h i s could be ascer-
tained by running the scheme w i t h different Ax's and At's and
comparing w i t h a n a l y t i c a l r e s u l t s in a simple case.

Determining (Ax/AtIcr

(Ax/At)cr has been shown to be the speed of wave as it is


propagated. T h i s can be demonstrated b y considering the method of
characteristics
128

The method of characteristics describes flow in the form of


waves travelling along or against the flow at a specific velocity,
dx/dt. The f a m i l y of curves described b y dx/dt i n the x - t p l a n e
are called the characteristics. The flow properties, velocity and
total depth, in the case of the water hammer equations are des-
cribed by r e l a t i o n s h i p s obtained from the wave equations ( 1 and 2 )
u s i n g the r e l a t i o n s h i p s of dx/dt. I n other words, the r e l a t i o n s h i p s
derived describe the flow properties as seen by an observer
t r a v e l l i n g along the flow at a velocity defined b y the characteris-
tics.
I n the case of the water hammer equations, a wave i s caused by
a velocity gradient, i.e. change i n velocity anywhere i n the flow,
e.g. shutting of valves etc. This wave is propagated with or
against the flow at a velocity of 2 c as given by the equation
dx/dt = 2 c (9.48)
As the wave t r a v e l s i t propagates information about the velocity
gradient to different points in the conduit. The concept of
information propagation by the wave in time and space can be
i I lustrated by considering the characteristic curves defined by
equation ( 9 . 4 8 ) . This i s i l l u s t r a t e d i n Figure ( 9 . 5 )

Fig. 9.5 Propagation of information along c h a r a c t e r i s t i c s o f


the water hammer eauations
129

I n F i g u r e 9.5, C 1 and C2 a r e a set of c h a r a c t e r i s t i c s described


by equation (9.48). Suppose that the flow properties, total head
and velocity are known at points A and 0, xA and xB distances
from the o r i g i n at time tl. One can then o b t a i n the flow properties
at a p o i n t R w h i c h l i e s on the same c h a r a c t e r i s t i c s as points A and
B, xR distance from the o r i g i n a t time t .
The critical space to time interval ratio, (Ax/A t)cr, can be
shown to be the wave speed by considering a central difference
scheme for solving the water hammer equations. The scheme is
i l l u s t r a t e d i n F i g u r e 9.6.
Let i represent a space i n t e r v a l , a n d k represent a time inter-
val as shown in F i g u r e 9.6. The point i n question, i.e. where the
flow properties are to be calculated, has the co-ordinates ( i , k).
Information about the flow properties is sought from the previous
time interval. In Figure 9.6(a) the true propagation speed is
smaller than the numerical p r o p a g a t i o n speed w h i l e in F i g u r e 9.6(b)
the converse is true. Numerical propagation lines are lines that
have a slope Ax/At i n the x-t p l a n e while t r u e propagation lines
have a slope d x / d t in the x-t plane. I n F i g u r e 9.6(a) information
i s obtained w i t h i n the i - I , i + l r a n g e b y the t r u e propagation lines.
In Figure 9.6(b) information is sought by the true propagation
lines outside the i-I, i+l range. Since information outside this
range is not propagated by the numerical scheme, it cannot be
found a n d thus i n s t a b i l i t y w i l l r e s u l t .
For s t a b i l i t y of an e x p l i c i t f i n i t e difference scheme the f o l l o w i n g
must, therefore, hold:

A5
At - dt
>dx (9.49)

T h i s i s r e f e r r e d to as the "CFL condition" a f t e r Courant, Fried-


richs and Lewy (1956), o r simply the Courant c r i t e r i o n f o r s t a b i l -
ity.
To minimize d i f f u s i o n e r r o r s as mentioned e a r l i e r Ax/A t must be
as close as possible to dx/dt. Using the r e s u l t in equation (9.48),
&/At i s chosen to be equal to the wave c e l e r i t y , i.e.

(9.50)
130

t t
A \ I A, .
k
\y k

k-1 - k- 1

. i-I i ,i+l
W X - i-I i i+l
* X

- Numerical propagation 1 ines; slope(Ax/ At)

----------- True propagation 1ines; slope (dx/dt)

F i g . 9.6 Comparison o f n u m e r i c a l a n d t h e o r e t i c a l p r o p a g a t i o n of
i n f o r m a t i o n in a c e n t r a l d i f f e r e n c e scheme

Equation (9.50) i s used to define t h e space a n d t i m e i n t e r v a l .


The relationship ensures that the difference scheme is run u n d e r
stable conditions with no diffusion errors. The solution of the
e q u a t i o n i s f u r t h e r made more a c c u r a t e b y t h e c h o i c e of s m a l l e r Ax
a n d a t A t i n t e r v a l s as c a n be seen f r o m F i g u r e (9.4).
131

BAS IC COMPUTER PROGRAM FOR ANALYS 1 NG GRAV ITY L I NE W I TH ONE


DRAWOFF ALONG THE LINE, VARIABLE P I P E DIAMETER, NUMBER OF
INTERVALS AND CLOSURE T I M E OF DOWNSTREAM GATE VALVE.
I n p u t i s as follows:
Line 1; Title

L i n e 2: Pipelength, m; C e l e r i t y m/s; V a l v e c l o s u r e time, s;


Number of pipe divisions; E n d f l o w m'/s; N u m b e r of
iterations (in 1 iteration wave travels 1 pipe
division so At= A L / C ) ; Point at which draw-off
occurs.
L i n e 3; D r a w o f f m'/s ( p u t 0 if none).
L i n e 4 etc.; Elevations i n m of each point ( f i r s t one b e i n g t h e
fixed reservoir level), (one p e r l i n e ) .
L a t e r lines; D i a m e t e r s o f e a c h p i p e d i v i s i o n in m ( o n e p e r l i n e ) .

80 N 2 = N l t l
90 D I S P DRFtUOFF mA3
108 FOR J = l TO N2
110 P(J?=8
120 NEXT J
138 INPUT P ( M 1 )
1 4 0 D I S P "ELEVHTIONSm
1 5 8 F O R J = l T O N2
1 6 B INPUT Z C J
1 7 0 NEXT J
132

768 NEXT I
7 7 8 STOP
7 8 0 END

P I P E NRME?
SAMPLE RClN
133

.Be1 -25.8
-.
L
B 8 8 8 -29.3
FLcl . M3"S HER@
4 1 132
t4 0 D E
1
.3-.
.j
883
89.9
i 4 -23.7
7
&* t.4 U0E
1 132
-
9
i

3
.882

4
HOUE
1 13'
2 080
3 . a 8 1 297.2
48 . 8 8 9 286.4
NCfUE FLO. M3^S H E A D
1 .12Q 1 8 B . 8
L
-
3
'7
. B e 2 288.9
.@@I1
4 E1.889
NODE FLO. M 3
1 - 824
NUDE FLO . M3^S HERO 2 888
7
1 -.838 188.8 '-I .091
'2L .El88 327 4 4 8 . B88
NODE FLU. M 3
1 - .824
t4 U 0E F L U . N3"5 H E R D 975 - ,

1 - . @ 3 S lee.@ - .891
-.BY9 181.8 4 9.L398 2 1 1 . 6
- . 8 8 1 229.5 H0DE FLO. M3*S HERD
4 8.808 234.1 1 -.825 1sa.e
tJODE F L O . M3"S HEQ@ 2 -.0?5 199.7
1 -.a48 1B0.9 3 -.@?5 193.5
3 4
L -.a89 181.9 0 . 8 0 8 286.7
L
7
. - . 1389 1 8 5 . 2
4 8.088 228.1
NODE FLO.M3^S HEAD
1 -.049 188.8
- . El913 1883.7
-.El87 1 8 2 . 2
~ ~~

4 8.688 -20.3
t4ODE FLO . M 3 ^ S H E R D
1 -.a48 188.8
2 -.@I88 9 7 . 7
134

O.lm 3 / s
t

c = 1000m/s
L i s t of symbols i n g r a v i t y p i p e w a t e r hammer a n a l y s i s p r o g r a m

Symbols

A(J) Area o f p i p e
C Celerity
D(J) Diameter o f n e x t section
Dt Increment i n X
D2 Increment in T
F D a r c y f r i c t i o n f a c t o r i n H = FXV2/2GD
G G r a v i t a t i o n a l a c c e l e r a t i o n , 9.81
H(J) Head
H2 Dummy v a r i a b l e
H3 Dummy v a r i a b l e
H1 Head loss t h r o u g h valve/V’
I1 Number o f i t e r a t i o n s
I I t e r a t i o n number
J Node n u m b e r
J2 Counter
L Length
M3 M2-1
NS Name
N1 Number o f sections i n m a i n p i p e
N2 N1 + 1
M1 J a t w h i c h d r a w - o f f o c c u r s ( a n y node
2 to N1)
P(J Draw -off
81 Draw-off f r o m m a i n p i p e e n d
Q(J Flow
43 Draw-off b r a n c h
R(J P a t p r e v i o u s time i n t e r v a l
S(J H a t p r e v i o u s time i n t e r v a l
s1 P2/D
T Time i n seconds t o c l o s e ‘ m p i n p i p e
l i n e downstream v a l v e
T1 Dummy v a r i a b l e
v1 Power i n v a l v e a r e a - c l o s u r e e q u a t i o n
X Length of pipe
Z(J) Elevation
135

REFERENCES

C h a u d h r y , M.H. a n d Yevjevich, V. (Eds.), 1981. Closed Conduit


Flow. Water Resources Pub1 ics. Colorado.
C h a u d h r y , M.H., 1979. A p p l i e d H y d r a u l i c T r a n s i e n t s , Van N o s t r a n d
R e i n h o l d Co. 503 p p .
C o u r a n t , R., F r i e d r i c h s , K . a n d Lewy, H., 1956. O n the P a r t i a l
D i f f e r e n t i a l E q u a t i o n s of Mathematical Physics. N.Y. U n i v . I n s t .
Maths.
Fox, J.A., 1977. H y d r a u l i c A n a l y s i s of Unsteady Flow in P i p e
Networks. MacmiI I a n , London.
Lupton, H.R., 1953. G r a p h i c a l A n a l y s i s of Pressure Surges i n
Pumping Systems. J. I n s t . Water Engs.
Stephenson, D . , Oct. 1967. P r e v e n t i o n o f v a p o u r pocket c o l l a p s e i n
a p u m p i n g l i n e . t r a n s . , S.A. I n s t n . C i v i l Engs. 9(10) p 255-261.
Stephenson, D . , Sept., 1966. Water hammer c h a r t s i n c l u d i n g f l u i d
f r i c t i o n . Proc. ASCE., 92 (HY5), p71-94.
Streeter,V.L. a n d Wylie, E.B., 1967. H y d r a u l i c T r a n s i e n t s , McGraw
H i l l , N.Y.
Wood, D.J. a n d Jones, S.E., J a n u a r y 1973. Water hammer c h a r t s f o r
v a r i o u s types of valves. Proc. ASCE 99, HY p a p e r 9500, p
167-1 78.
136

CHAPTER 10

BOUNDARY COND I T IONS I N WATER HAMMER

DESCRIPTION

The finite difference solution of the characteristic equations


starts from known conditions along the pipe at a specified time.
The conditions may be steady-state flows and heads as defined
by the analyst or as determined from a given f ri c t i on head loss-
flow relationship together with given reservoir heads at either
end of the line. After the f i r s t iteration it i s unnecessary to r e f e r
to the initial flow conditions at intermediate points but the end
conditions should still be known. These conditions may also be
specified by the user, but it is these conditions which dictate
i n what way the flows are to v a r y .
Thus if valve closure is to be the cause of water hammer,
the valve opening has to be specified as well as the r e l a t i o n s h i p
between discharge and head loss across the v a l v e . The l a t t e r can
be g i v e n in equation form a n d the v a l v e opening can also be speci-
fied as a function of time, or even controlled by the program
(termed valve stroking and can be used to limit head rises)
(Wylie and Streeter, 1978).
Where a pipe leads to o r from a r e s e r v o i r , the r e s e r v o i r head
is generally specified. This may be at a f i x e d level i f the water
level does not vary much, or the water level may vary as flow
occurs i n t o o r out of the r e s e r v o i r .
Other boundary conditions encountered included changes in
pipe diameter, closed end pipes, or branches for both of which
the r e l a t i o n s h i p between head and flow may be determined b y equa-
tions such as ( 9 . 3 4 ) to (9.37) ( t h e cross sectional area of a pipe
beyond the closed end i s taken as zero).

Conditional B o u n d a r y Conditions

During the course of computations the physical limits to an


assumption may be encountered. Thus if the head computed using
equation (9.34) was to be below vapour head of the liquid, the
137

liquid would vaporize. The head would be u n a b l e to drop below


the vapour pressure so it should be set equal to vapour pressure
and the l i q u i d assumed to vaporize. The extent of the v a p o r i z a t i o n
(the volume) could be computed by calculating the flow r a t e up-
stream and downstream of the point using equations (9.35) or
(9.36). The increase in vapour volume is the difference in the
two flow rates either side of the point, multiplied by the time
increment. Chapter 1 1 elaborates on t h i s type of problem.
It may be that the engineer imposes controls on the system
to limit flow rates or pressures. Control valves can be used to
limit maximum flow rates, or pressures. The use of control valves
and other forms of water hammer protection, e.g. surge tanks,
n o n - r e t u r n v a l v e s a n d a i r vessels i s described l a t e r .
Spring loaded release valves can be set to discharge at a
specified rate when the pressure against them exceeds a preset
figure. T h i s condition can be programmed as w e l l as the discharge-
head relationship through the open valve. A further disadvantage
of the r u p t u r e disc (Fig.10.1 b ) i s that the l i n e could d r a i n a f t e r
it has opened, unless there is also a control valve on the Tee.
Both above methods r e q u i r e the head to increase before they oper-
ate, and by that time it may be too late to protect other points
in the pipe system. There are many control valves which operate
on this direct principle e.g. Figure 1 0 . 1 ~ . On the other hand,
there are pilot operated valves which could commence opening
on sensing the first downsurge, e.g. Figure 10.le. I n such cases
a sub-program is required to check the operating condition of
the v a l v e .
It should be noted that pressure reducing valves, or in fact
any constriction is liable to cause cavitation downstream if the
cavitation number is too high. The cavitation index i s generally
of the form
P -P
K = - d v
P -P
(10.1 1
u d
where P is pressure and subscript d refers to downstream, v to
vapour and u to upstream. Depending on the v a l v e design, values
as low as 0.3 a r e possible before the onset of c a v i t a t i o n . I f cavi-
tation occurs, vapour bubbles and gas release may occur down-
stream which actually reduce the water hammer wave celerity.
138

T h i s can i n t u r n reduce the downsurge downstream i f the v a l v e is


closing, which in t u r n provides a s t a b i l i z i n g c h a r a c t e r i s t i c to the
valve. On the other hand, cavitation erosion of pipework is a
troublesome phenomenon to be avoided.

WATER HAMMER PROTECTION OF PUMPING LINES

The pressure t r a n s i e n t s f o l l o w i n g power f a i l u r e to e l e c t r i c motor


d r i v e n pumps are usually the most extreme that a pumping system
w i I I experience. Nevertheless, the pver-pressures caused b y s t a r t i n g
pumps should also be checked: Pumps with steep head/flow
c h a r a c t e r i s t i c s often induce high over-pressures when the power is
switched on so a wave w i t h a head equal to the closed v a l v e head
is generated. By partly closing the pump delivery valves during
starting, the over-pressures can be reduced.
If the pumps supplying an unprotected pipeline are stopped
suddenly, the flow will a l s o stop. I f the p i p e l i n e p r o f i l e i s r e l a -
t i v e l y close to the h y d r a u l i c g r a d e I ine, the sudden deceleration of
the water column may cause the pressure to drop to a v a l u e less
than atmospheric pressure. The lowest v a l u e to which pressure could
drop is vapour pressure. Vaporization or even water column
separation may thus occur at peaks along the pipeline. When the
pressure wave is returned as a positive wave the water columns
w i l l r e j o i n g i v i n g r i s e to water hammer over-pressures.
Unless some method of water hammer protection i s installed, or
f r i c t i o n p l a y s a s i g n i f i c a n t r o l e in r e d u c i n g water hammer pressures
before p o s i t i v e r e t u r n surge occurs, a p u m p i n g p i p e l i n e system may
have to be designed f o r maximum water hammer overhead equal to
cv / g (termed the Joukowsky head). I n f a c t t h i s i s often done w i t h
0
high-pressure lines where water hammer heads may be small in
comparison w i t h the pumping head. For short l i n e s t h i s may be the
most economic solution, and even if water hammer protection is
installed it may be prudent to check that the u l t i m a t e strength of
the p i p e l i n e i s s u f f i c i e n t should the p r o t e c t i v e device f a i l .
The philosophy behind the design of most methods of protection
against water hammer is similar. The object in most cases is to
reduce the downsurge in the pipeline caused by stopping the
139

Screw - down t o preset


s p r i n g load

Isolating valve

dh a. Spring l oa de d r e l e a s e
valve
b. Rupture disc

e A c c u m u l ator

c. Pneumatically loaded
re1 ease valve

Valve e.g. sluice valve


Electric motor
actuated contact

d. Electrically operated valve


(opening and closing)

Needle control
Non return
valve Piston seal
, valve

e. Self actuated pil ot controlled valve


could be opened during the downsurge

F i g . 10.1 R e l e a s e valves
140

pumps. The upsurge will then be correspondingly reduced, o r may


even be entirely eliminated. The most common method of limiting
the downsurge i s to feed water i n t o the p i p e as soon as the pres-
sure tends to drop.

S UR
HYDRAULIC GRADE LINE JAN DELIVERY
RE SER H)IR

F i g . 10.2 P i p e l i n e p r o f i l e i l l u s t r a t i n g s u i t a b l e locations for


various devices f o r water hammer protection

Suitable locations for various protective devices a r e i I lustrated


in Figure 10.2. Most of the systems involve feeding water into
the pipe. Observe that in all cases the sudden momentum change
of the water column beyond the tank is prevented so the elastic
water hammer phenomenon is converted to a slow motion surge
phenomenon. Part of the original k i n e t i c energy of the water col-
umn i s converted into potential energy instead of elastic energy.
The water column gradually decelerates under the effect of the
difference i n heads between the ends. I f i t was allowed to deceler-
ate the water column would gather momentum i n the reverse direc-
tion a n d impact a g a i n s t the pump to cause water hammer over-pres-
sures. If, however, the water column i s arrested at its point of
maximum potential energy, which coincides w i t h the p o i n t of m i n i -
mum k i n e t i c energy, there will be no sudden change in momentum
141

a n d consequently no water hammer over-pressure. The reverse flow


may be stopped by installing a reflux valve or throttling device
at the entrance to the discharge tank or air vessel, or in the
pipeline. A small orifice bypass to the reflux valve would then
allow the pressures on e i t h e r side to g r a d u a l l y equal ize.
Fortunately charts are available for the design of a i r vessels
and for i n v e s t i g a t i o n of the pump i n e r t i a effects, so that a water
hammer analysis is not normally necessary (Stephenson, 1981 ) .
Rigid water column theory may be employed for the a n a l y s i s of
surge tank action, a n d in some cases, of discharge tanks.
If the pipeline system incorporates in-line reflux valves or
a pump bypass v a l v e , an e l a s t i c water hammer a n a l y s i s i s u s u a l l y
necessary. The analysis may be done g r a p h i c a l l y o r , if a number
of solutions of similar systems a r e envisaged, a computer program
could be developed. Normally the location, size and discharge
characteristics of a protective device such as a discharge tank
have to be determined by trial and error. The location and size
of in-line o r bypass r e f l u x v a l v e s may s i m i l a r l y have to be deter-
\
mined b y trial. In these instances a computer program i s u s u a l l y
the most economical method of solution, as a general program could
be developed, and by varying the design parameters methodically,
an optimum solution a r r i v e d at.

NON-RETURN V A L V E S

I n some s i t u a t i o n s the s t r a t e g i c location of a non-return valve,


or check valve or reflux valve, is sufficient to prevent or at
least reduce water hammer over-pressures. Where water col umn
separation occurs the installation of a non-return valve down-
stream of the pocket could prevent flow reversal and the subse-
quent over-pressures.
In another type of application, water could be drawn into
the pipeline from the suction reservoir or a tank when the head
in the main pipe drops below the head outside. T h i s water would
f i l l the c a v i t y a n d likewise reduce the r e t u r n surge.
Non-return valves are included with conditional statements
in computer programs. When the flow r a t e i s p o s i t i v e then an in-
line valve remains open with minimal head loss. When the flow
142

reverses, o r attempts to reverse the v a l v e closes. The flow r a t e a n d


head a r e initially calculated u s i n g equations (9.32) and (9.33).
Then the flow check is made. If negative, the flow r a t e i s reset
equal to zero on either side of the valve a n d the head upstream
and downstream re-compiled using equations (9.30) and (9.31)
respectively. There may be a further conditional check for head,
and if the upstream head i s less than vapour head, i t i s reset a n d
the upstream flow recalculated.
The use of off-line non-return valves with discharge tanks is
i l l u s t r a t e d i n F i g u r e 10.3.

Fig. 10.3 Discharge t a n k

I n p r i n c i p l e many forms of water hammer protection f o r pumping


lines operate similarly. That is they discharge liquid into the
pipeline when the pressure in the l i n e drops after a pump trip.
This f i l l s the p o t e n t i a l vacuum o r a t least reduces the downsurge.
When the (positive) water hammer wave then r e t u r n s from the f a r
end of the line it will be reduced in amplitude correspondingly.
The types of protection which operate thus include air vessels,
pump bypasses with non-return valves, flywheels on pumps,
discharge tanks a n d in-I ine non-return valves. Surge tanks operate
on a slightly different principle, i.e. they offer a continuous
insulation effect protecting the pipeline beyond them against
over-pressures. The analyis of various types of surge tank is
described b y Rich (1963).
143

AIR VESSELS

Air vessels a r e often used to cushion water hammer over-pres-


sures o r to feed water i n t o the low pressure zone created b y stop-
ping pumps. They are also used to balance flow on r e c i p r o c a t i n g
pump systems. Air vessels generally contain air at the operating
pressure of the adjacent pipeline. They a r e connected to the pipe-
l i n e v i a a p i p e which may have a constriction. This outlet constri-
tion w i l l reduce the volume of water forced from the a i r vessel into
the pipe when a low-pressure zone i s created in the pipe. This
constriction has the disadvantage that pressures in the pipe are
lower a f t e r the pump t r i p than without the constriction.
The a i r vessel outlet could also have a non-return v a l v e incor-
porated in the outlet to reduce backflow when the p o s i t i v e surge
occurs. This prevents the returning water column gathering
momentum a n d reduces the volume of a i r needed to cushion the f i n a l
maximum r e t u r n flow. The most efficient r e t u r n flow is usually a
ff
r e s t r i c t e d bypass p i p e around the discharge non-return valve. ,This
lets back some flow b u t also acts as a c o n s t r i c t i o n or t h r o t t l e . The
optimum combination of air vessel capacity, initial air volume,
outlet size a n d i n l e t size must be found b y t r i a l . There qre c h a r t s
available for preliminary selection of air vessel size (Stephenson,
1981; Thorley and Enever, 1979).

A i r Vessel Equations

The air in the air vessel, on release, expands in accordance


with the laws of physics. The expansion is usually in-between
isothermal (PS = constant, where P i s absolute pressure and S i s
volume) and adiabatic ( P S l e 4 constant). The r e l a t i o n s h i p generally
adopted i s P S l m 2= constant. (10.2)
The increment i n volume of air, dS i s obtained from the contin-
ui t y equation

d S = (Q2-Ql)dt (10.3)

where Q2 is the discharge rate in the pipeline beyond the air


vessel connection and 8, before the a i r vessel, averaged over the
time period, dt.
144

The change i n pressure head i n the a i r vessel over the t i m e dt


can be c a l c u l a t e d from the a i r expansion. The head i n the p i p e l i n e
adjacent to the air vessel is calculated by subtracting the head
loss i n the connecting p i p e o r bypass, (depending on whether flow
i s out or in). The new discharge rates in the pipeline are then
ca I c u lated u s i n g the respective character ist i c equations

(10.4)

Qi=Qr+(Ag/c) ( h ’ -hr ) - XQr 1 Qr I dt/2dA (10.5)

where q is an upstream point, r is a downstream point and the


prime’ refers to the new values.
I f dt i s l a r g e i t may be necessary to use the mean values of Q
1
and Q2 over the time i n t e r v a l , a n d not the initial values. This i s
a n i m p l i c i t solution a n d would mean the above equations would have
to be i t e r a t e d a few times to o b t a i n the discharge rates at the end
of the time i n t e r v a l .

COMPRESSOR

WATER

THROTTLED
INLET

F i g u r e 10.4 A i r Vessel
145

REFERENCES

R i c h , G.R., 1963. H y d r a u l i c T r a n s i e n t s . D o v e r Pub1 i c s . N . Y .


Sharp, B.B., 1981. Waterhammer P r o b l e m s and s o l u t i o n s . E d w a r d
Arnold, London.
Stephenson, D., 1981. P i p e l i n e D e s i g n f o r W a t e r E n g i n e e r s . E l s e v i e r ,
Amsterdam.
T h o r l e y , A.R.D. and E n e v e r , K.J., 1979. C o n t r o l and S u p p r e s s i o n of
P r e s s u r e S u r g e s i n P i p e l i n e s and T u n n e l s . C o n s t r u c t i o n I n d u s t r y
R e s e a r c h and I n f o r m a t i o n A s s o c i a t i o n , R e p o r t 84. L o n d o n .
Wylie, E.B. and S t r e e t e r , V.L., 1978. F l u i d T r a n s i e n t s . McGraw
Hill.
146

CHAPTER 1 1

WATER COLUMN SEPARATION

I NTRODUCT I ON

Water cannot tolerate a pressure less than i t s vapour pressure,


which is a f u n c t i o n of the temperature b u t i s only a few metres
absolute head. When the pressure i n a water column i s reduced, f o r
instance by stopping a pump, the pressure may reduce to below
atmospheric and to the vapour pressure of the water. T h e inherent
energy then no longer converts to s t r a i n energy b u t k i n e t i c energy.
The head may not drop low enough to stop the water column so that
downstream of the c a v i t y i t proceeds, a l b e i t a t a lower velocity, in
the same d i r e c t i o n as initially, creating a cavity in the conduit
between the pump a n d the water column.
The cavity is vacuous b u t contains water vapour a n d some a i r
which will come out of solution due to the lowering of the pressure
i n the water. It i s also possible that a i r w i l l be drawn i n through
air valves on the l i n e or even through the pumps. This a i r has a
limited elastic effect in cushioning the pressure drop and
subsequent rise on return of the water column. It is generally
found, however, that the mass of air is too small to have a
noticeable effect i n r e d u c i n g the subsequent water hammer pressure
rise.
The form of the c a v i t y created b y the drop i n pressure i s time-
dependent although the total volume can be computed accurately
u s i n g mass balance and even the rigid column equations in some
cases. It i s often s u f f i c i e n t l y accurate to assume the c a v i t y occu-
pies the full cross sectional area of the pipe and the effective
length can thence be determined at any time if the volume is
known. Initially the c a v i t y occurs i n the form of bubbles dispersed
across the section of the conduit. The bubbles r i s e to the top of the
section and may also travel longitudinally before coalescing to
create a pocket. I n fact i t i s o n l y i n steep pipes t h a t the interface
is sharp, and in longitudinal pipes the cavity or vapour pocket
147

spreads longitudinally. A bore may t r a v e l u p the l i n e to spread the


cavity laterally. I f the c a v i t y spreads over more than one 'node',
water hammer c a l c u l a t i o n s a r e complicated b u t often the c a v i t y can
be imagined as occuring i n separate pockets at nodes (see M a r t i n ,
1981 1.

Spreading o f Cavity

ine

Figure 1 1 . 1 Shape of c a v i t y

The mechanics of water hammer accompanied b y column separa-


tion can most readily be visualized using the graphical method,
(see F i g . 11.2).
Whether the graphical method or a computational method is
employed, a check i s made a t each stage to ensure the head does
not drop below vapour pressure head. Once i t does, a subroutine i s
entered s e t t i n g i t equal to vapour head a n d accumulating a volume
of vapour pocket by adding A S = A V A dt to S each time step, where
AV i s the difference in downstream a n d upstream velocities.

COMPUTATIONAL TECHNIQUE FOR COLUMN SEPARATION

The method of handling water column separation o r vaporization


numerically i s to an extent a process of t r i a l . At any time i n t e r v a l
head a n d flow may f i r s t be computed assuming c o n t i n u i t y at each
point, that i s i n f l o w equals outflow. The head i s computed without
148

heed to separation. If the resulting head is less than vapour


pressure head, it can be set equal to vapour head, e.g. -
+ 1 m
absolute or -9 m gauge head. I f , however, there i s an a i r v a l v e on
the ine near that point, or even considerable air transported in
the low, the 'separation' head may in fact be higher. The air
mass drawn in i s generally n e g l i g i b l e a n d w i l l have no cushioning
ef fec when the water columns subsequently rejoin ( a comparison
with the size of an air receiver to prevent water hammer will
reveal this). At the upper limit the head w i l l approach atmospher-
.IC, .1.e.
i t w i l l be the e l e v a t i o n of the p i p e above datum.
The flow r a t e s upstream and downstream of the pocket a r e now
recomputed u s i n g the respective c h a r a c t e r i s t i c equations a n d substi-
tuting vapour head for head at the point. Then the increase in
vapour pocket volume over the next time i n t e r v a l i s computed, At(Qo
-Qi) where Q. i s inflow a n d Q outflow at the p o i n t .
A tally of the cumulative vapour pocket volume at each such
point i s maintained d u r i n g the successive computations. As long as
this volume is greater than zero the head must be equated to
vapour head a n d the flows each side of the p o i n t computed thus.
When the vapour pocket r e v e r t s to zero ( o r t u r n s n e g a t i v e ) then
the head i s recalculated f o r a continuous water column. The vapour
pocket may collapse between computational time intervals, in which
case the head rises to a lesser extent than would be predicted
assuming i t rises a t the end of the time i n t e r v a l (compare p o i n t M2
with M1 i n F i g u r e 11.2).
I f a one-way discharge tank i s used to reduce water hammer the
same computational procedure i s employed. The discharge tank is
connected to the p i p e l i n e through a non-return v a l v e a n d discharges
only when the head in the p i p e drops below the tank head. Thus
r e t u r n flow and vapour pocket collapse a r e eliminated. The t a l l y on
volume of separation i s thus m a i n t a i n e d as f o r a vapour pocket b u t
as soon as i t attempts to reduce, the non-return v a l v e prevents t h i s
a n d the head r i s e s as f o r a water column without separation.

SIMPLIFIED R I G I D COLUMN ANALYSIS

If the water column can be assumed to separate at a known


149

M1

L
H M2

/
\ /
\ /
\ /
\
\ /
/
)c
\ /
\ /
\ /
\ /
\ /
\ /.
\ I

F i g u r e 11.2 Drop i n head due to pump t r i p and subsequent


r i s e i n r e j o i n i n g of water columns
150

point and the subsequent downstream head changes a r e small, the


following analysis will indicate the extent of column travel before
reversal. The downstream column may be assumed to decelerate
according to the f o l l o w i n g equation:

where h is the decelerating head, which could be the difference


between the vapour pressure head in the vapour pocket and the
elevation head of the downstream open end. F r i c t i o n head can also
be added to h if it is significant, and it will act i n an upstream
direction while the water column i s decelerating, and subsequently
i n the opposite, downstream (towards discharge end) d i r e c t i o n when
the water column reverses. This will cause a reduction in the
r e t u r n velocity of the water column whereas the f o l l o w i n g a n a l y t i c a l
solution without friction w i l l i n d i c a t e a r e t u r n velocity equal to the
o r i g i n a l velocity i n magnitude:
I n t e g r a t i n g the previous equation w i t h time, we get

v = v
0
- ght/L (11.2)

here v is the constant of integration which is the initial -\


flow
velocity. Now when the column reaches i t s extremity before revers-
ing, v = 0 hence t = voL/gh (11.3)

I n t e g r a t i n g a g a i n gives the distance the water column t r a v e l s

x = v t-ghtz/2L (11.4)

S u b s t i t u t i n g f o r t a t v=O gives

X = v 'L/2gh (11.5)
max
Hence the maximum volume of c a v i t y i s Ax = ALvo2/2gh
max
(11.6)

Rising Mains

Along gently rising pumping pipelines the vaporization may


occur along a considerable length of pipe. The spreading of the
vapour pocket front will occur initially as fast as an elastic
151

wave, but the subsequent refilling will be slower owing to the


additional 'elasticity' i n the vapour pocket.
In the following analysis the magnitude of the vapour pocket
formed in the rising length of pipeline i s evaluated in equation
form. The cross sectional area occupied b y the vapour i s shown to
be v e r y small i n r e l a t i o n to the total p i p e cross sectional area. It
is proved that the vapour pocket is rapidly filled by surges
travelling along the p i p e l i n e from both ends, and that no water
hammer pressure r i s e i s associated w i t h the f i l l i n g of the pocket.
To simplify the analysis it is assumed that the p i p e beyond
point C i s i n c l i n e d at a constant a n g l e e to the horizontal. Heads
a r e absolute values, that i s gauge p l u s atmospheric.

F i g u r e 1 1 .3 S i m p l i f i e d p i p e p r o f i l e f o r theoretical study

The velocity at any point x between c and the delivery end,


(see F i g u r e 11.3) a f t e r the i n i t i a l negative wave has passed, is
X
v = v -9[Ah -(x-x )sine]-g[t--] sine (11.7)
X o c 0

The second term on the right hand side is the v e l o c i t y reduction


caused by the initial negative surge, while the last term is the
deceleration due to g r a v i t y . The c o n t i n u i t y equation a p p l i c a b l e i s

a aA
-(av)
ax
+ -
at
= 0 (11.8)
152

F i g u r e 11.4 Detail at surge front

where A is the cross sectional area of water in the pipe. I f the


cross sectional a r e a of the v a p o u r 'a' may be assumed to b e s m a l l
in c o m p a r i s o n w i t h the t o t a l c r o s s s e c t i o n A, t h e l a s t e q u a t i o n may
b e simp1 i f i e d to

(11.9)

from (11.7) a v / a x = 29 s i n 8 / c , so t h a t (11.9) may b e i n t e g r a t e d to


yield

(11 .lo)

T h i s equation illustrates that 'a' i s s m a l l compared w i t h A.


At t h e open d e l i v e r y e n d t h e h e a d r e m a i n s a t atmospheric head
When t h e n e g a t i v e w a v e r e a c h e s t h i s p o i n t w a t e r i s forced back
ha.
into the pipe. A surge travels back along the pipe, filling the
vapour pocket. In order to s t u d y t h i s surge let the a n a l y s t t r a v e l
with the surge, at celerity c . Apply momentum principles to the
f r e e b o d y o f w a t e r shown in F i g u r e 11.4.

P ( v +c )2 ( A - a ) + p g y l ( A - a ) = ( v +c )2AP+PgAhAtPgy2A (11.11)
1 s 2 s
Here P i s t h e mass d e n s i t y o f water and 7 i s t h e d e p t h to t h e
centroid of the cross section of water. The velocity v2 may be
expressed in terms of v l , cs, a and A with the aid of the
cont inui t y e q u a t i o n :
153

(vl+cs)(A-a) = ( v +c ) A (11.12)
2 s
Since (A-a) i s very n e a r l y equal to A, y (A-a) i s n e a r l y equal
1
to y A. S o l v i n g t h e l a s t two equations f o r c
2

c e am (11 .13)

=r 2 sine(t-)

For m n y practical s i t u a t i o n s t h i s equation w i l l


(11 .14)

y i e l d v a l u e s of c
between 500 and 1000 m/s, i I l u s t r a t ing t h a t it i s of t h e same o r d e r o f
m g n i t u d e a s t h e Mave c e l e r i t y o f a f u l I p i p e . The v e l o c i t y change a t
t h e surge f r o n t m y b e expressed i n terms o f A h b y r e w r i t i n g (11.12) and
(11.13) a s f o l lows:-

I
A[ ( V , + C ~ ) - ( V ~ + C= ~gAhA/cS
)

:. ( v -v
1 2
) = 9Ah
cs

PROGRAM FOR SIMULATION OF WATER HAMMER I N PUMPLINES


FOLLOW I NG PUMPTR I P

The accompanying basic computer program for an HP-85


calculates water hammer pressures in a pipeline following a
pumptrip. The pump is assumed at the upstream end, the pipe
diameter is constant, but friction is accounted for. Data is
r e q u e s t e d i n t e r a c t i v e l y as f o l l o w s ;

Line 1: T h e name of t h e s y s t e m
L i n e 2: The number of sections
L i n e 3: The number of iterations (e.g. if the pipe is
divided into 4 intervals, 4 iterations represent the
travel time for the water hamrnmer wave up the

pipe)
L i n e 4: Length (m)
L i n e 5: Diameter (m)
L i n e 6: Wavespeed ( m / s )
L i n e 7: F l o w r a t e (m’/s)
L i n e 8: Friction head (m)
154

Line 9
on wards : Elevation of each successive p o i n t (all in m a n d s
units) .
The first and last elevations should represent the water level in
t h e suction sump a n d d e l i v e r y r e s e r v o i r ( b o t h assumed constant).
The program assumes the pump trips immediately the simulation
starts, and p r i n t s out heads a n d flows a t each p o i n t every inter-
val.
Water column separation is accounted f o r in a simplistic way.
When the head drops to the e l e v a t i o n of the p i p e a t any p o i n t , o r
t r i e s to drop below the elevation, it i s set equal to e l e v a t i o n a n d
the flow r a t e b o t h before a n d a f t e r the point a r e re-calculated for
the new head. Vapour pocket volume i s computed by summing the
difference between the two flows and when i t turns to zero (or a
negative value) the head reverts to that indicated by the finite
difference equations f o r a full pipe. The spreading o r longitudinal
movement of vapour pockets a r e neglected, a n d no reduction i n wave
speed i s made. D u e to t h i s s i m p l i f i c a t i o n and the f a c t that vapour
pocket closure can only occur at the computational time, the
program can overestimate water hammer pressure due to pocket
collapse.
The maximum heads at each head along the line are plotted
above the p i p e p r o f i l e a t the end of the r u n .

L i s t of symbols in p r o g r a m for p u m p l i n e w a t e r hammer a n a l y s i s

A cross sectional area


B c e l e r i t y of wave
D diameter
5
D1 sum of l / D
E mass density of l i q u i d
F unit friction
F1 total f r i c t i o n head
F2 f r i c t i o n term
F3 f r i c t i o n term
G g r a v i t a t i o n a l acceleration
H head
H2 head term
I i t e r a t i o n number
19 p r i n t o u t i n t e r v a l (0 = o n l y summary r e q u i r e d ,
1 = f u l l l i s t i n g of heads)
J p i p e number
155

K number o f iterations
L name
M number of p i p e i n t e r v a l s
M1 M + l
P maximum head
P1 h e a d term in p l o t
Q flow beyond point
82 flow term
R flow in f r o n t of p o i n t a t p r e v i o u s time i n t e r v a l
S flow beyond p o i n t a t p r e v i o u s time i n t e r v a l
T flow in f r o n t of p o i n t
T2 time increment
U head a t p r e v i o u s time i n t e r v a l
X length
x2 length interval
Y v a p o u r pocket volume
2 e Ie v a t i o n

Computer Program f o r A n a l y s i s of Water Hammer a f t e r Pumptrip

16 ! WATER HEMWER I N PIF'ELINES33E' D ~ : J > = I S i l i


AFTER PUMP T R I P - WAP 3 4 9 a<.))=. 7 s 5 m 1 , 1 ) ^ 2
28 l31F A<21),B(21j1F<2]).H(21), 358 nl=nl+l/D<J>*5
P<21>~Q<21>rRC21~~U~Z1~~ 2 ~ 2J1 3 6 9
NEXT '

) 378 H i 1 > = Z C fi 1> +F 1


38 @ I N D C 2 8 j . Y C E l > , T ( 2 1 ~ , 5 ( ~ 1 ) 3 8 8 FOR J = l TO M l ! P I F E SECNS
4 8 DISP "PUl'lPST@F P I F E NAME'; 398 C!iJ>=C!*:l)
5-8 - .. - . I- S
- TNPIIT 395 Tc.J)=Q(.-I>
52 D15.P "HCI. SEWS':
68 IHPIJT M
. - H. I_= M + l
7ci
8 8 D I C P "NO ITERHTIl3NS ' I . 428 P ( J ) = H < J )
99 IHF'UT Y 438 NEXT J
1 8 9 @ I E P " P I P E LENGTY.rn". 4 4 8 P P I N T 'WATEPHAtlMER " J L )
1 1 1 7 TUF'IIT S 45fr FOP I = 1 TO Y
469 I F I S < l THEN 518
478 P R I N T a PNT HEfiDmi FLOWIS"i I
156

778 PRINT WEADS e ieew N


ICF FIE
UE PlUHP
786 P l = P < 1 > + 2 6 8
799 21=2<1~-168
868 GCLERR
919 SCRLE l . M l , Z l , P l
826 X A X I S Z ( l > , l
839 Y A X I S 131ee
848 MOVE 1,2(1)
359 FOP J=2 TO Ill
868 @RAW J , Z ( J )
878 NEXT J
€!Re MOVE 1 , P C l )
Y98 FOP J=2 TO IT1
988 DRAW J , P C J )
918 NEXT J
928 COPY
938 STOP
948 END
157

output

PHT HEflDa FLOms 10


I 250 @.Be@
1
- 197 - . 0 3 4
3 195 - . % 3 2
4 193 -.El34
= 268 - . R 3 8
FGT HEflDn FLOms 11
I 256 9.8@@
2
‘ 24s .mi
3 ;95 - . e x
4 282 -.a36
5 206 -.I338
PN r W R O n FLOms 12
1 245 0.@B@
2 248 .gel
3 255 -.00J
4 Z@2 -.@34
5 288 -.035
PHT HEFlOm FLOrns 13
1 245 0.0B0
2 252 -.@84
3 255 -.Re3
1 252 -.eel
5 208 -.635
PNT HEFlOmr FLOas 14
1 259 8 . 0 0 0
2 252 -.a04
3 250 -.@a3
4 252 -.Be1
5
~~

4
5 288 . lee 208 .a31
F!4T YEADm FLOms 6 PNT HEAOm FLOns 15
i 38 6.8@@ 1 259 @ . e m
- 97 -
. P26 2
~ z57 .@el
3 i em ,834 3 250 - . 8 0 3
4 97 I032 4 la8 .@38
5 286 - e33 5 200 .031
PHT HEAQm FLOas 7 PNT HEROm FLOns 16
138 e . eee 1 254 @ . m e
141 -.@(?2 2 257 .eel
I80 . e34 3 285 .ew
4 282 - . # 3 1 4 198 ,038
5 288 -
. e33 5 200 .828
PHT HERDm FLOms 8 PNT YEROm FLOlrs 17
1 143 8.088 1 254 e . 0 m
2 141 - . B e 2 2 243 .832
3 195 - . e x 3 205 .834
4 292 - . a 3 1 4 287 .032
5 288 -.e2Es 5 298 .828
PNT HERDm FtOns 3 PNT HERDs FLOms 18
1 143 e.eee
2 197 - . 9 3 4
3 195 - . 8 X 3 205 .@31
4 193 - . 0 3 4 4 207 .a32
5 2013 -.ECG
150

HE

I nput
159

REFERENCES

F o x , J.A., 1977. H y d r a u l i c A n a l y s i s of U n s t e a d y F l o w in P i p e Net-


works. Macmillan, London.
Martin, C.S., 1981. Two-phase f l o w s . I n 'Closed Conduit F l o w ' ,
Edd b y Chaudhry, M.H. and Y e v j e v i c h , V., W a t e r Resources
Pub1 i c s . , C o l o r a d o , p225-251.
Stephenson, D., O c t o b e r 1957. P r e v e n t i o n o f v a p o u r p o c k e t c o l l a p s e
in a p u m p i n g l i n e . Trans. SAICE, 9 ( 1 0 ) , p255-261.
160

CHAPTER 12

WATER HAMMER AND FLOW ANALYSIS I N COMPLEX P I P E SYSTEMS

THE PROBLEM O F FLOW ANALYSIS IN COMPLEX P I P E NETWORKS

In many municipal and industrial water distribution systems


the pipework follows no regular geometric layout and i s developed
as the requirements grow. Although the main supply pipe may
be predesigned, extensions are often of variable diameter and
lengths and the distribution system at the ends of these pipes
is even more complex. Similar problems often arise in pumping
columns and in fact the water hammer pressures due to the trip-
ping of a pump can often be the most severe pressure condition
i n the p i p e l i n e .
Where h y d r a u l i c pressures can be h i g h , such as down t h e s h a f t
of a mine, the corresponding pipe velocities are often very high
e.g. above 5 metres per second. The high velocity is accepted
as it reduces the pipe diameter thus saving in capital cost. In
the case of gravity mains the hydraulic gradients can be very
high and the corresponding pipe velocities w i l l also be v e r y h i g h .
Unfortunately the water hammer heads associated with changes
of flow are directly proportional to the flow velocity and conse-
quently an accurate water hammer pressure analysis is necessary
or else a sophisticated method of protecting the pipe system
a g a i n s t w a t e r hammer i s required.
T h e r e a r e t h r e e m a i n s t a g e s i n t h e a n a l y s i s of a w a t e r r e t i c u l a -
tion system. During the initial planning stages the pipes have
to be sized and the corresponding wal I thicknesses selected b e f o r e
instal lation. Pipe bores should reduce the greater the pressure
in order to minimize wall thicknesses and costs. Where there are
off-takes then the diameter of t h e p i p e may be r e d u c e d . The total
available head will depend on the elevation of the supply point
below the supply r e s e r v o i r o r else on a pumping head. The head-
losses along individual sections of the pipe can be distributed
between various lengths of p i p e s d e p e n d i n g on f l o w rates. I n fact
161

simple linear programming optimization methods (Stephenson, 1981 )


can be used to select least cost p i p e diameters i n such a branch
network. Alternatively d y n a m i c p r o g r a m m i n g methods c a n b e used to
select successively decreasing diameters down deep mine shafts,
(Bernstein, 1982).
Pipe sizes are based on an initial estimate of design flow but
in later years the flows may be increased or altered and it is
n e c e s s a r y to a n a l y s e t h e system to d e t e r m i n e t h e f l o w s w h i c h c a n b e
obtained from the system. For example where water i s taken from a
pipe for supplying cooling coils then it is important that the
pressure be known a t each b r a n c h a l o n g the d i s t r i b u t i o n pipe. As
the head at each branch point i s not known e x p l i c i t l y i t must be
calculated from headloss equations. This i s not a n easy matter as
there are a number of unknowns and it i s often necessary to use
successive approximation methods to determine the flows and
pressures in the individual pipe lengths. The problem may be
aggravated by changing friction factors with time. As the pipes
corrode or scale the bores will be affected a n d the corresponding
friction losses change. Although iterative solution of the Darcy-
Weisbach flow resistance equation i s possible t h i s degree of sophis-
tication i s often not w a r r a n t e d as the exact roughness effect on the
h y d r a u l i c c a p a c i t y can o n l y be estimated r o u g h l y anyway.
The third problem in a n a l y s i n g p i p e r e t i c u l a t i o n systems i s the
determination of transient water hammer pressures due to closing
valves or tripping pumps. The water hammer h e a d c a n b e s e v e r a l
hundred metres if the flow in a pipe i s reduced rapidly such as
d u e to the c l o s u r e of a valve. T h i s head should be added onto the
static heads so that it may reduce the factor of safety of the
system a n d i n f a c t h a s been k n o w n to b u r s t p i p e s o r f i t t i n g s . Valve
closure times must therefore be selected to prevent water hammer
pressures being excessive and simi l a r l y precautions have to be
taken to minimize water hammer pressures due to pumps t r i p p i n g .
Water hammer pressure waves c a n a l s o be reflected from the ends of
branch pipes and be more severe in the b r a n c h p i p e than in the

main pipe where the flow is altered. Since water reticulation


systems c a n b e f a i r l y complex the use of computers i s necessary f o r
accurate analysis.
162

The two problems of analysis of flow in pipe networks and


the calculation of water hammer pressures due to c h a n g i n g of the
flows can be done u s i n g one computational approach. The t w o pro-
blems have been combined in developing a program the b a s i s of
which i s described here. The e f f o r t i n feeding data i n t o a comput-
er f o r the v a r i o u s analyses i s thus minimized.

CONVENT I ONAL METHODS OF NETWORK ANALYSIS

The standard methods of analysing flows and headlosses in


complex piping systems were developed by Hardy Cross in 1936
and are s t i l l used b y many engineers on account of t h e i r s i m p l i c i -
ty, the ease of visualization of the procedure and the p o s s i b i l i t y
of doing the calculations manually instead of r e s o r t i n g to comput-
ers. In earlier chapters these methods and others more computer
orientated a r e described.
Very mathematical methods such as the solution of a set of
simultaneous equations describing the flow of headloss relation -

ships in a pipe network have been proposed. An alternative ap-


proach i s to simulate the system u s i n g the d i f f e r e n t i a l water ham-
mer equations. Starting with any assumed flows and heads the
flows w i l l e v e n t u a l l y s t a b i l i z e at t h e i r steady-state values.
Although slightly more complicated if the problem i s only the
determination of flow r a t e s i n closed networks, the f o l l o w i n g proce-
dure in fact i s efficient computationally and i s considerably en-
hanced b y the ease of s u p p l y of d a t a to the computer. The method
r e l i e s on the fact that if a valve or pump i n a p i p e network is
operated, then a f t e r a length of time f r i c t i o n w i l l damp the e l a s t i c
waves travelling backwards and forwards in the pipe network
and a steady-state will emerge. One therefore has the steady-state
flows and pressures throughout the network. The method can be
extended to predict pressure and flow histories at every point
in the system. These a r e the pressures and flows which w i l l a c t u a l -
ly occur at any interval, which is not the case for the network
analysis methods described previously. Consequently if transient
conditions a r e to be studied the method w i l l y i e l d them as well.
163

There have also been many computer programs developed for


analysing water hammer pressures in pumping mains and pipe
networks. Although the method of finite differences is more rapid
for solution of the d i f f e r e n t i a l equations of f l u i d motion, the meth-
od of characteristics (Streeter and Wylie, 1967) i s generally pre-
ferred as the computations are more straightforward and can be
applied to varying boundary conditions more easily than the cen-
t r e d f i n i t e difference methods. All the methods s t a r t w i t h the basic
d i f f e r e n t i a l equations of c o n t i n u i t y a n d momentum,

(12.1)

(12.2)

The symbol h denotes water head (the sum of pressure head


a n d potential head above a specified d a t u m ) , v i s the water velo-
city averaged across the cross section of the pipe, d i s the p i p e
diameter, t is time, x is distance along the direction of flow,
is the Darcy-Weisbach friction coefficient which can vary with
Reynolds number, g is gravitational acceleration and the term
vlvl is used i n place of v 2 as i t accounts f o r c h a n g i n g d i r e c t i o n
of the friction headloss when the flow changes direction. c is
the water hammer wave celerity which may be shown to equal
1/J[ P(l/K + d/Et)] where P is the mass density of the f l u i d , K
is its bulk modulus, d is the p i p e diameter, t its wall thickness
and E its elastic modulus. For steel water pipes c is generally
of the order of 1100 m/s but increases f o r t h i c k - w a l l pipes. Adopt-
ing the time-distance grid i n d i c a t e d i n F i g u r e 12.1 then the ensu-
ing characteristic equations give the relationship between head
and velocity at known initial or boundary conditions and those
at a new point in time. Invariably the friction equation i s used
in an explicit form, that is v in the friction term i s assumed
to be the v at the previous time interval and previous point in
space.
164

TIME

Fig. 12.1 x-t Grid for water hammer analysis by characteristic


method.

METHOD OF SOLUT ON O F THE EQUATIONS

Starting with the f i n i t e d i f f e r e n c e f o r m of t h e d i f f e r e n t i a l equations


dx
and substituting - = + c yields
dt
hb' - h
t
+ p + c(v '
g b
- v )
t
+ fvlvl = 0 (12.3)

where p is pumping head, and the p r i m e ' r e f e r s to new values


after iteration, and f = (AL/D + k)/2g, where losses d u e to f i t t i n g s
are kv2/2g. Subscript b r e f e r s to t h e bottom (downstream) end a n d
t to the top (upstream) end of a pipe although these are
a r b i t r a r i l y d e f i n e d as the flow d i r e c t i o n can v a r y .
Generally it is sufficient to use t h e e x p l i c i t f o r m of XLv2/2gd,
i.e. the v e l o c i t y at t h e p r e v i o u s t i m e i n t e r v a l i s used i n t h e f i n i t e
difference forms of the equations. That is satisfactory provided
friction loss is small compared with water hammer head. I n some
situations this is not the case, for e x a m p l e a p i p e b u r s t down a
shaft can result i n a s t e a d y - s t a t e f r i c t i o n h e a d loss down t h e s h a f t
of several hundred metres. The head loss term kv2/2g is also
significant in many s i t u a t i o n s , e.g. when the head loss i s t h r o u g h
a valve. It is, nevertheless, much e a s i e r from. t h e p o i n t of v i e w o f
c o m p u t a t i o n s to lump t h e two h e a d loss terms t o g e t h e r .
165

It is, on the other hand, difficult to solve the characteristic


equations in implicit form, i.e. with the velocity in the head loss
term that at the new time. I f t h i s i s attempted a q u a d r a t i c expres-
sion results and computations are cumbersome. In chapter 9 the
head loss t e r m was solved in implicit form f o r a s i m p l e case, i.e.
with known head downstream of a valve. In general the head
downstream i s also a n unknown a n d must be obtained b y simultan-
eous solution of the head loss/discharge equation and the water
hammer equation. A further complication arises when there are
branches and changes in diameter at the upstream or downstream
nodes. The head at such a node is obtained by summating the
effects from each branch by employing the continuity equation at
t h e node.
I t should a l s o be noted t h a t the answer w i l l depend on whether
the h e a d loss i s assumed to b e a t the f a r e n d or t h e n e a r e n d of
the line. An averaging procedure would introduce further compli-
c a t i o n s and, in a n y case, concentrated h e a d losses s u c h a s v a l v e s
a r e u s u a l l y a t one e n d o r the other.
I n order to a v o i d m a n y o f these d i f f i c u l t i e s f o r a b r a n c h e d p i p e
network some s i m p l i f i c a t i o n i s necessary. A semi-explicit solution i s
obtained, but a degree of implicitness i s i n t r o d u c e d to s t a b i l i z e t h e
solution. This method is sometimes unstable, but, as stated, a
complete imp1 i c i t method i s complex. A w e i g h t e d compromise between
a f u l l y e x p l i c i t f o r m a n d a semi i m p l i c i t form i s

fvlvl = F fv
b
Iv
b
I + (I-F) f v ' ( v b l .

vt+?(ht-hlb-p-F f v b I vb 1 ) (12.4)
T h e n s o l v i n g (12.3) vb' =
I
1+( 1 - F ) f g v b I/c

Substituting i n t o the c o n t i n u i t y equation ' A . v . = qb where q


I bi b
i s the drawoff a t node b c o n n e c t i n g i pipes each w i t h area A , , a n d
solving for h I
b

(12.5)

This i s then substituted into (12.4) to o b t a i n velocity vb' i n each


p i p e leading to b. I t w i l l be observed that the e x p l i c i t form of the
head loss equation is not the only form used in the above
equations. Explicit solution can lead to serious instability i n the
computations i f the time interval selected f o r a n a l y s i s i s excessive.
I n fact when r a p i d v a l v e closure i s to be considered the numerical
solutions have been known to become unstable and magnify errors.
This is because the head loss through the valve or through the
pipe i s based on the v e l o c i t y at the previous time i n t e r v a l and not
a t the new time i n t e r v a l . I n fact the most accurate method would be
to take the average flow velocity at the b e g i n n i n g a n d end of the
time interval. This would render the equations exceedingly
cumbersome and quadratic equations have to be solved on an
iterative basis fo r each node. I n order to simplify the procedure
and adapt it to microcomputer solution the above s i m p l i f i c a t i o n was
therefore made. The procedure i n effect adopted a weighted average
of the previously described pseudo- explicit-implicit method and a
p u r e l y e x p l i c i t method.
It is also assumed that the relevant velocity for head loss
determination i s that at the end specified as the 'bottom' o r down-
stream end of the pipe. Although flow d i r e c t i o n s can change d u r i n g
flow variations the 'bottom end' is in fact specified as a fixed
position b y the a n a l y s t .
Where water hammer a n a l y s i s i s not important and the program
is used purely for the analysis and determination of steady-state
flows i n a p i p e network then damping can be increased b y assuming
a very low o r a r t i f i c i a l water hammer wave c e l e r i t y . The c e l e r i t y of
each p i p e i n the system to be analysed i s defined b y the user as
being i t s pipe length divided by the selected time i n t e r v a l between
successive analyses. Thus b y selecting a long time i n t e r v a l between
successive computations the water hammer waves a r e e l iminated a n d
friction controls the equations. The flows will therefore rapidly
converge to steady-state flows. Obviously t h i s technique should not
be used where t r u e water hammer heads a r e r e q u i r e d a n d i t may be
necessary to select a smaller time interval, f o r example less than
one second, f o r water hammer analyses.
167

BOUNDARY COND I T IONS

The head at certain input p o i n t s and discharge points w i l l be


fixed by the head i n a r e s e r v o i r and such nodes w i l l not have the
head changed in the computations. There is also the problem of
very low heads which may cause water column separation. When f o r
instance, a pump i s suddenly stopped in a low-head pumping main
then the water hammer head i n i t i a l l y drops and t h i s may vaporize
the water. The program accommodates t h i s effect automatical l y and
the head will not drop below the specified head a t any node. A
vapour pocket will therefore grow and diminish in size as waves
travel up and down the pipes. The corresponding water hammer
head when the water columns r e j o i n w i l l be computed automatically.
D i s t r i b u t i o n pipes often have pressure reducing valves or surge
relief valves installed to ensure no excessive pressure rises. A
pressure reducing valve can, in fact, be treated as a reverse

PUMP.
The p o s i t i o n i n g of control valves i n the p i p e network i s a l s o of
importance from the point of view of r a p i d a c c e s s i b i l i t y and closure
in times of emergency or for control purposes. Such valves can be
timed to close over a specified period in order to control water
hammer pressures. I n the case of automatic control valves they can
be installed to operate when pressures or flows exceed certain
limits. The program can accommodate the opening or closing of
valves at any point i n time a n d the combined opening and closing
of a valve in the same simulation can be made by i m a g i n i n g two
v a l v e s i n the same position.
An application of the program to steady-state flows is in the
analysis of flow in a reticulation system for various conditions.
Although pipes are normally designed on a reasonable load factor
with selected design flows to meet certain duties, there are often
abnormal situations to be considered. Where the water reticulation
system is to be used for fire-fighting then high peaks may be
required at specified points and at the same time specified m i n i -
mum pressures will have to be achieved. In such cases it can
be assumed that other loads w i l l be reduced o r eliminated i n order
to achieve the necessary peak flows.
168

300 mm d i a .
6 0 0 m 1 5 0 mm d i a .

250 mm dia.

(2) X
(4) H = 0

Fig. 12.2 Simple p i p e network analysed f o r flows and heads

The a n a l y s i s of the system f o r determining maximum water ham-


er pressures at various points in the system is also of interest.
The water hammer pressures may be caused by the tripping of
a pump or the opening or more p r o b a b l y the closing of a valve,
or valves, in the system. An example of a case which is likely
to be severe is where the pipe supplies water at a h i g h velocity
down a shaft at a h i g h pressure. For instance the supply to a
hydraul ic turbine may have to be rapidly control led as e l e c t r i c a l
load i s shed. I n f i g u r e 12.5 the results of such an analysis are
plotted for node number 2 i n F i g u r e 12.2. The system was i n i t i a l l y
analysed to determine steady-state heads then the valve in pipe
2-4 was shut at t = 10 sec (at i t e r a t i o n 20 u s i n g 0.55 intervals).
The valve was shut uniformly in 5 seconds. The heads at each
node were t a b u l a t e d at specified time intervals. The control valves
to such turbines can be adjusted to operate over specified times
and the closure time can be selected by trial and error or by
u s i n g an a d d i t i o n a l a l g o r i t h m on the program described here w h i c h
enables t h e program to recommend the v a l v e closure t i m e .

VALVE STROKING

The reader has been presented with methods of analysing pipe


169

systems f o r flows and pressures, both under steady flow conditions


and for transient conditions. The network analysis for flows gives
indirectly the diameters required for the various pipes. Water
hammer analysis wi II then reveal maximum pressures which, in
turn, i n d i c a t e p i p e wal I thicknesses.
Both types of analysis yield indirect answers, i.e. a trial
and error approach is required. In the case of some networks,
pipes can be sized directly using optimization methods. When it
comes to water hammer analysis the direct design approach is
often more difficult when it comes to optimum operation from the
water hammer point of view. Thus if the engineer i s confronted
with a pipe system and i s r e q u i r e d to specify v a l v e closure times
h e may resort to a trial and e r r o r approach - r e q u i r i n g an a n a l y -
s i s f o r each assumed v a l v e closure r a t e .
In some cases a direct solution may be obtained for a valve
closure relationship where pressures are to be maintained within
specified limits. The control of flow in a pre-determined way is
complicated by the fact that flow r a t e depends on pressure whi'ch,
in turn, i s affected b y changes i n flow. For instance, the closure
of a valve gives rise to pressure increases upstream, which in
t u r n can affect the flow r a t e through the valve.
The procedure of closure of a valve i n a p a t t e r n which limits
pressure rises to set values is referred to as valve stroking
(Streeter and Wylie, 1967). A mathematical solution to the valve
closure time is possible f o r single pipes w i t h or without friction.
In fact the minimum valve closure time i s yielded as well as the
r a t e of closure i n v a r i o u s steps.
For a single frictionless pipe the minimum valve closure time

(while maintaining the head at some point B less than HBmax )


is obtained with the following operating procedure. At the com-
mencement of operations at the discharge end valve A i s closed
uniformly, such that the head at point 'B' along the l i ne rises
i n the time 2L/c (see F i g u r e 12.3). T h i s i s assuming
to HBmax
i s less than Ho+cv/g. The actual flow r a t e through the
HBmax
v a l v e a f t e r 2L/c seconds may be solved from the water hammer
equation applied to the valve, AHA = cAv/g and the v a l v e dis-
charge equation V
A
= K 5.
170

Now the closing of the valve i s continued at a uniform rate


m a i n t a i n i n g the head at B equal
to HBmax.

Ho
-

B A
Fig. 1'2.3 Maximum head along pipe

Complex pipe system

If a valve i s to be closed a number of p i p e lengths away from


a point where the head i s to be l i m i t e d , the mathematical relation-
ship between the cause and effect can become cumbersome. If
branch pipes, changes in diameter and friction are involved the
relationship becomes even more complicated. For such cases it is
often simplest to o b t a i n the r e l a t i o n s h i p between v a l v e closure r a t e
at some point 'A' and head rise at a point 'B' by trial. The
re1at ionsh i p between AhB and partial valve closure could be
computed a t each successive time step. I f the g r a d i e n t i s too steep
or too flat the v a l v e closure over the next time interval could be
adjusted geometrically.
Thus assume the l i n e HBOD i n F i g u r e 1 2 . 4 i s a target head r i s e
function a t a specified node B. After one i t e r a t i o n w i t h an assumed
trial valve closure time T, the head HB rises to C. T h i s i s less
than expected so the valve closure could be speeded up by the
ratio S(H D)/S(H C) where S is the slope of the l i ne i n Figure
60 BO
12.4. The correction to the closing speed of the valve could be
continued each step.
It will, however, be found that if the time intervals are too
l a r g e o r the p o i n t B i s too close to the v a l v e A that overshoot or
unexpected o r even misleading answers can occur. A target closure
171

Target HB

/
t T t
1st t r i a l closure
time

Fig. 12.4 Feedback method of c o n t r o l l i n g head a t B

time and gate closure c h a r a c t e r i s t i c must be estimated beforehand


and this can only be refined using this technique. If reflections
occur somewhere in the system causing the heads to reverse or
drop, obviously the p r o p o r t i o n a l correction i s unappl i c a b l e a n d the
v a l v e i s being closed too q u i c k l y or the time step i s too great.
The accompanying computer p r i n t o u t s and p l o t s o f heads versus
time a r e from a program based on the above p r i n c i p l e .
The programmer may e n q u i r e from the program over what t i m e he
should close the v a l v e i n o r d e r to not exceed a specified head a t a
specified point in the pipe network. The method is to employ a
feedback p r i n c i p l e a n d g r a d i e n t method f o r p r o j e c t i n g water hammer
heads a t the specified node. The program w i l I therefore successively
correct the closure time of the v a l v e keeping an eye on the head
increase a t the designated node. I n fact the head a t the designated
node will be plotted on the screen as computations proceed and
subsequently be transferred to a graph such as F i g u r e 12.6. The
maximum head specified for node 2 was 1100 m above the datum,
whereas the maximum which a c t u a l l y occurred was 1121 m c.g. 1167
m f o r the v a l v e closure in 5 seconds i n F i g u r e 12.5
The most severe such conditions a r e likely to a r i s e where there
is a burst in a pipe which is to be followed by a rapid valve
closure upstream of the burst. At steady-state runaway conditions
172

the flow velocities can reach very h i g h values. On the other hand
the heads at the end of the system a r e c o n s e q u e n t l y very low as
most of the head will be d i s s i p a t e d i n f r i c t i o n a n d t h r o u g h v a r i o u s
fittings i n the p i p e system. The f r i c t i o n i s t h e r e f o r e v e r y h i g h a n d
the damping effect of the friction may often result in the water
hammer pressure rising n o t much more t h a n that for valve closure
under normal o p e r a t i n g conditions. N e v e r t h e l e s s e a c h system s h o u l d
be a n a l y s e d i n d i v i d u a l l y b e f o r e s u c h c o n c l u s i o n s a r e made.

REFERENCES

Fox,J.A., 1977. Hydraulic Analysis of Unsteady Flow in Pipe


Networks. M a c m i l l a n , London.
Streeter, V . L . a n d W y l i e , E.B., 1967. Hydraulic Transients. McGraw
Hill.
173

PIPE
PIPE ... . ... . . , ..., ,.
- - _H E R D
0
2
1

1
1
2
4

PIPE
3

e1 21
i , ,
AT2
.IVAL~~!EUPO-I

2 4
1 3
FIFE
0 1
1 2
E J
1 3
FIFE
0 1
1 2
2
1
4
x JT I 14 E - I 1.0 Tfi
T E F: A T I0 H
'1.0
FIFE
0 1
1 2
2 4
1 3
FIFE
E l !
1 z
2 4
1 3
FIFE
a 1
1 2
2 4
1 3
FIFE
8 1
1 2
2 4
1 3
PIPE
0 1
1 2
2 4
1 3

Fig. 12.5 Head v a r i a t i o n s a t node 2 due to v a l v e c l o s u r e i n 5 s


a f t e r 10 s convergence
174

T F I F E t l E T WATEP H A M M E F HtlkiL FFCll;

2 4
1 3
PIPE
8 1
1 2
2 4 8
1 3 185
PIPE FLOW L.5
a 1 1 SE'
1 2 - 3
2 4 @
1 3 195
F I F E FLOW L'S
B 1 136
1 2 1
2 4 8
1 3 192
PIPE F'FLCI T 11 H X
B 1 196 17.00
1 2 16.58
2 4 8 .0 0
1 3 8 . 88

F i g . 12.6 Head v a r i a t i o n s a t node 2 a n d v a l v e c l o s u r e p a t t e r n


i f maximum h e a d a t 2 i s l i m i t e d t o 1lOOm a b o v e d a t u m
175

CHAPTER 13

GRAPH I CAL WATER HAMMER ANALYSIS

REASONS FOR GRAPHICAL APPROACH

Although not advocated for general use, the graphical methods of


water hammer calculation still retain a place in water hammer
analysis. The graphical method proposed by Allievi (1925) and
developed b y Bergeron (1935) a n d Schnyder (1937) i s well suited f o r
illustrating the mechanics of water hammer wave reflection. A
clearer understanding of the wave reflections is possible by
students than with the use of a computer program. V a r i a b l e wave
speed, changes in diameter, the effects of valve closure, water
column separation and friction can all be portrayed graphically.
The technique does become laborious if many steps are required,
and the manpower to look at alternative designs often becomes
excessive. Computer solution is more economic in the majority of
cases, especially i f m u l t i p l e solutions a r e required.

BASICS O F METHOD

The graphical method i s based on the linear relationship AH =


(c/g) M (13.1)
If one plots head H against velocity V the line w i l l have a
slope of + o r -c/g. The procedure i s therefore to p l o t l i n e s through
the known ( s t a r t i n g ) p o i n t s on an H versus V plot. Where the l i n e
crosses another known relationship between H and V (e.g. at a
v a l v e o r another c/g l i n e ) the new conditions a r e obtained. It is in
fact a way of solving two equations graphically for 2 unknowns,
namely H and V .
The graphical method i s i n fact identical to the c h a r a c t e r i s t i c s
method, since one s t a r t s w i t h the same equations (see chapter 9 ) :
dx
for -dt
= +c ; AH = - $lV - xVIVIL/Zgd (13.2)

dx
for - = -c ; AH = A V + xVIVIL/Pgd (13.3)
dt 9
176

where L i s the length of p i p e over which the flow velocity changes


by V a n d head changes b y AH.
The procedure employing the equations i s to c a l c u l a t e g r a p h i c a l -
ly at intervals in time the head and velocity at selected points
spaced L a p a r t along the line. I f L i s not the total p i p e length i t
i s necessary that each L i s such that waves a r r i v e a t the j u n c t i o n
from either end at the same time. Thus each L/c should equal the
selected time interval between computed conditions. In this way
pipes w i t h changes i n wave c e l e r i t y and even changes i n diameter
can be accounted for. I n the l a t t e r case, a n d i f b r a n c h pipes e x i s t
the diagram should be replaced by a H-Q p l o t (see l a t e r ) .
An e x p l a n a t i o n of the procedure follows w i t h reference to F i g u r e
13.1. On the H-V g r a p h one marks the known conditions, namely H
the s t a t i c head, a n d Vo the i n i t i a l line velocity. If line friction is
significant the relationship between l i n e velocity and l i n e head at
R is plotted as a parabola below the H line (the curve H -Hf).
Note that on the negative V side the p a r a b o l a curves upwards since
XVIVIL/2gd i s i n the opposite d i r e c t i o n .
The valve discharge characteristics are also plotted on the
graph since a relationship between discharge through and head
across the downstream v a l v e i s r e q u i r e d to be solved simultaneously
with the water hammer characteristic equation. The relationship
between flow a n d head drop through a valve i s generally assumed
to be of the form H = K where V i s the p i p e velocity which i s
L
directly p r o p o r t i o n a l to flow rate i n m’/s. The f a c t o r K reduces as
the valve i s closed and it i s a f u n c t i o n of open area as well as
discharge characteristic. If it is reduced in a defined way the
factor K i s known at each step of L/c seconds. I t s i n i t i a l value i s
obtained from

KO = Hvo/ Jvd (13.4)

where H i s the i n i t i a l head loss through the v a l v e ( H - H f ) a t a


vo
l i n e velocity V
0
.
A p a r a b o l a can be drawn through the p o i n t s ( H V )
0’ 0
with its apex at (0,O). Other parabolae can be drawn at
d i f f e r e n t v a l v e openings p r o v i d e d K i s known.
F i g u r e 13.1 i l l u s t r a t e s the g r a p h i c a l procedure f o r the case
177

Lc
C
H
(m
20

-201

Sp-VALVE SHUT

R X -t CHART S

F i g u r e 13.1 Graphical a n a l y s i s f o r slow v a l v e closure i n g r a v i t y


line with friction
I78

of slow v a l v e closure at the downstream end ( p o i n t S ) of a g r a v i t y


l i n e w i t h i n i t i a l f r i c t i o n head loss H
f‘
The waves emanating a t the v a l v e proceed up and down the
pipeline in time as indicated by the full l i n e s on the x-t chart.
The characteristic equations (13.2) and (13.3) are applied across
the waves. For instance, i n order to compute conditions a t p o i n t S
1’
commence at the defined boundary point Ro and use the charac-
teristic corresponding to dx/dt = +c to o b t a i n V a n d H a t S1. On
the H-V g r a p h the l i n e s t a r t i n g at R (Ho,Vo) drops b y Hf=XVIVIL
/2gd and then proceeds along a l i n e w i t h slope -c/g. The p o i n t S,
i s also on the v a l v e c h a r a c t e r i s t i c f o r time L/c.
It may be noted that the line friction i s assumed concentrated
at the upstream end i n t h i s case since it i s the velocity at point
Ro which was used in establishing the f r i c t i o n head. For charac-
teristics i n the opposite d i r e c t i o n to compute conditions a t point R ,
the velocity at the downstream end i s used to assess f r i c t i o n loss.
Thus, s t a r t i n g at p o i n t S 1 on the H-V d i a g r a m one draws a l i n e up
by Hf ( t h e difference between the H and Hf lines at V S 1 ) and then
0
draws a l i n e w i t h slope +c/g. Where t h a t l i n e intersects the H line
i s point R2. One proceeds i n t h i s manner to e s t a b l i s h p o i n t s S
3’ R4’
S5, R6 etc. Similarly, starting at point So one can establish
successively p o i n t s R 1 , S2, R3, Sq etc. (not done i n F i g u r e 13.1)

MID-POINTS AND CHANGE I N DIAMETER

It is frequently necessary to determine heads at intermediate


points along the line, for instance in order that the pipe wall
thickness can be v a r i e d to s u i t the maximum heads. I n such cases
the pipe is divided into a number of intervals. The heads at the
end points are determined as before commencing from an adjacent
known point and using the relevant characteristic equation to
e s t a b l i s h the boundary condition at the next time i n t e r v a l . The time
interval between computations is AL/c where AL is the length
interval. Each AL/c should be the same no matter how many i n t e r -
vals there are. There is the possibility of c varying from one
interval to the other, which can be accommodated i n t h i s way. The
179

f r i c t i o n head per i n t e r v a l i s XVIVlAL/2gd.


The head and flow at intermediate points is established by
p r o j e c t i n g two c h a r a c t e r i s t i c I ines from n e i g h b o u r i n g p o i n t s on each
side. Where the two lines meet (slope - c/g from the upstream p o i n t
and + c/g from the downstream p o i n t ) i s the head a n d l i n e Jeloc i t y
at the mid-point.
The same procedure i s applicable i f there i s a change i n d i a -
meter. In such cases, however, it i s convenient to p l o t H against
flow r a t e Q not V . AH =
A Q + XQ1Q1AL/2gdAZ].
+[-c A
Then 13.5)
- - 9-
where A i s the p i p e c r o s s sectional area so the slope of the lines
on the H-Q graph are 2 c/gA, where A (and c) and hence the
slopes could be d i f f e r e n t f o r each section. The procedure i s i l l u s -
t r a t e d i n F i g u r e 13.2.

PUMP I NG L I NES

When pumps trip in a pumping line there is first a drop in


head downstream (on the delivery side) of the pump. The same
graphical procedures can be followed to determine i n i t i a l head drop
a n d subsequent head rises.
It often occurs that the drop in head is sufficient to cause
water vaporization at points along the line. The mechanics of
separation and subsequent rejoining of the water columns was
described in Chapter 10. A separate t a l l y must be kept of vapour
pocket volumes as they expand and l a t e r contract i n order to iden-
tify the time the head r i s e occurs on r e j o i n i n g . I t may be neces-
sary to divide the pipe into a number of increments i n order to
p i c k up the locations o f v a p c u r pockets.
A similar procedure can be adopted if water hammer discharge
tanks are used to eliminate water hammer overpressures. In such
cases the vapour pocket does not need to collapse before the head
rises.
Many systems of protecting pumping lines against water hammer
overpressures are possible. One method is the use of release
valves. A valve immediately downstream of the pump non-return
valve i s opened a f t e r the pump i s t r i p p e d a n d subsequently slowly
180

R T S
H

Ho

0
F i g . 13.2 G r a p h i c a l c a l c u l a t i o n of w a t e r h a m m e r h e a d s a t m i d - l i n e
w i t h c h a n g e in p i p e d i a m e t e r
181

P R

;"-I-i
neglect f r i c t i o n

Head H
(m)

300
RO 9

R1

R2 R3 ' R4 R5 R6

c/g=lOOs

Velocity

P1

HO

F i g . 13.3 G r a p h i c a l a n a l y s i s of pump stop w i t h water hammer


release v a l v e
182

closed. The a n a l y s i s o f such a v a l v e i s done g r a p h i c a l l y in F i g u r e


13.3.
The rotational inertia of the pump can also assist in r e d u c i n g
water hammer. Parmakian (1955) and Pickford (1969) d e s c r i b e me-
thods of graphical analysis of the transients following pumptrip
with the pump rotational characteristics included. For graphical
analyses of s u r g e s h a f t s and r i g i d c o l u m n t r a n s i e n t s , the reader i s
a 1 so r e f e r r e d to J a e g e r ( 1956) .
REFERENCES

A l l i e v i , L., 1925. T h e o r y of W a t e r h a m m e r , t r a n s l a t e d b y E.E. Hal-


mos, R i c c a r d o G a r o n i , Rome.
B e r g e r o n , L., 1935. E t u d e des v a r i a t i o n s d e r e g i m e d a n s l e s con-
duites d ' e a u : Solution g r a p h i q u e generale, Revue Generale de
I ' h y d r a u l i q u e , P a r i s . V o l . 1 p12-69.
Jaeger, C., 1956. E n g i n e e r i n g F l u i d M e c h a n i c s , B l a c k i e & Son,
L o n d o n , 529pp.
P a r m a k i a n , J, 1955. W a t e r h a m m e r A n a l y s i s , D o v e r Pub1 i c s . , N.Y.,
161pp.
P i c k f o r d , J. 1969. A n a l y s i s of S u r g e , M a c m i l l a n , 203pp.
S c h n y d e r , 0. Nov., 1937. C o m p a r i s o n s b e t w e e n c a l c u l a t e d and t e s t
r e s u l t s on waterhammer in p u m p i n g p l a n t . Trans. ASME, 59,
P a p e r Hyd-59-13, p695-700.
183

CHAPTER 14

P I PE GRAPH I CS

INTRODUCTION

It i s frequently informative and useful to draw a p i p e network


to scale. Sketch plans were utilized in the chapters on p i p e net-
work analysis a n d optimization and pipe profiles were drawn for
water hammer analysis. Three dimensional depiction, or viewing
from alternative angles would be even more useful. The relation-
ship between elevation of the pipe and the pressure head at all
points would be very illustrative when pressure limits and grad-
ients have to be studied. Bottlenecks can f r e q u e n t l y be pinpointed
in this manner, as steep h y d r a u l i c g r a d i e n t s w i l l stand out. High
heads likely to cause bursts, and low heads resulting in insuf-
ficient pressures, will also be identified. This type of depiction
i s possible i n 3-dimensional graphics.
Industrial water systems can be particularly complicated to
v i s u a l ize unless some form of graphical display i s available. Wat-
er distribution networks and fire fighting systems supplying fac-
tory complexes on a number of levels are t y p i c a l examples. These
systems are frequently extended as the factory grows, a n d a rec-
o r d of p i p e positions would be of use in l a t e r extensions. Suitable
positions of connections, duplications and additional storage can
be v i s u a l i z e d on a 3-dimensional drawing.
The computer screen i s the ideal place to depict such systems.
Interactive construction and amendments to a pipe system can be
performed before pipe runs, drawings and orders are finalized.
A considerable cost savings is possible if mistakes are ironed
out on the screen a n d not on site.
Computer graphics enables the d r a w i n g scale, size and v i e w i n g
a n g l e to be a l t e r e d at will, until the best p i c t u r e f o r any purpose
is obtained. Various pipes, connections or valves may be best
viewed from another angle and detail p i c t u r e s of any particular
part of the system can be called on while the engineer sits at
the computer.
184

Graphics are p a r t i c u l a r l y useful in the f a b r i c a t i o n of i n d u s t r i a l


pipework subject to close tolerances. In fact for many plants,
factories or r e f i n e r i e s a p h y s i c a l model of the p l a n t i s made to i r o n
out problems before construction commences. During the model I i n g
problem areas a r e i d e n t i f i e d a n d remedial steps taken. For example
pipes which get i n the way of each other can be relocated. Support
systems can be designed f o r stacks of pipes to minimize space and
maximize the strength of the system. Tight corners, bends and
intersections where erection is likely to be difficult will be
identified. High head loss areas, e.g. sharp bends one after the
other, valves and tees can be ironed out. Locations f o r measuring
orifices i n accessible, long, s t r a i g h t sections w i l l be f a c i l i t a t e d . It
is preferable to sort out such problems at design stage with a
physical model or graphical portrayal rather than at erection
stage. Erection costs and r e - f a b r i c a t i o n of incorrect assemblies w i I I
be reduced. Erection time will be more r a p i d a n d f u r t h e r savings
are possible.
It will be found that the cost of a computer g r a p h i c s model is
less than that of a p h y s i c a l model. I t can be assembled f a s t e r , and
can match many of the features of a r e a l model, e.g. colour coding
for pipes, s t a n d a r d codes f o r v a r i o u s devices such as valves, and
ease of viewing. I n some ways it i s superior, e.g. rapid variation
of viewing angle, zooming for closeups, linking to a hydraulic
a n a l y s i s model, and r a p i d alterations to the set-up. I n some other
features it is inferior. For instance, to view the plant from a
s l i g h t l y different angle may r e q u i r e a coded i n s t r u c t i o n , a c l e a r i n g
of the screen and re-drawing the system which takes time. The
computer is less p o r t a b l e than a physical model and colour screen
graphics suffer poor resolution, although t h i s can be overcome b y
p l o t t i n g the p i c t u r e on paper ( h a r d c o p y ) .
A computer program f o r d r a f t i n g a n d design of p i p e layouts can
easily be linked to other programs for analysing flows and
pressures, as well as programs for stress analysis. Temperature
movements, superimposed loads and supports a l I a d d t o l o n g i t u d i n a l
stresses, while internal pressures, supports and external loads
cause circumferential stressing. Supports can be repositioned to
185

reduce stress concentration by going back and forth between the


l a y o u t a n d the a n a l y s i s programs.

I NTERACT I V E DRAW I NG

On some o f the commercially available computer aided d r a f t i n g


(CAD) systems for piping, editing can be done directly on the
drawing or screen. Data can generally be input off a sketch or
drawing with the aid of a digitizer. That is, the location of a
point is identified with a pointer on a drawing or a cursor or
arrow on a screen. The c u r s o r c a n b e moved a r o u n d b y h a n d con-
trolled buttons until it points to the correct spot on the screen.
Then by pushing the correct key, a symbol such as a valve, a
f l a n g e o r reducer i s r e p r o d u c e d on t h e d r a w i n g .
In the simple program accompanying d a t a can only be r e a d i n
or changed i n a l p h a n u m e r i c mode, that i s b y means o f c o - o r d i n a t e s
and not while the p i c t u r e i s on t h e screen. T h i s i s a l i m i t a t i o n of
the computer used, but large systems can use more interactive
drawing, that is adding to and editing while the picture is in
f r o n t o f one.
I n m a n y modern C A D systems t h e d r a f t s m a n h a s a menu i n f r o n t
of him and identifies the correct symbol with an arrow before

pushing a button to r e p r o d u c e t h e symbol. The s i z e a n d o r i e n t a t i o n


of the device can also be c o n t r o l l e d by keys or buttons suitably
des i g n a t ed .

Fig. 14.1 3-dimensional d e p i c t i o n o f a catchment


186

Many of the symbols are diagrammatic, i.e. distinguishing the


characteristics of the device rather than its appearance. This
assists in distinguishing between, for- example, butterfly valves,
globe valves, gate v a l v e s a n d control valves.
F i g u r e 14.2 was abstracted b y Lamit (1981) from ANSI standards
a n d covers a wide r a n g e of symbols.
Annotation and l e t t e r i n g can also be done b y l o c a t i n g the label
s i z i n g the letters a n d then t y p i n g the labels on a keyboard.
Once the d r a w i n g on the screen (cathode r a y tube o r C.R.T.) is
to the satisfaction of the draftsman it may be reproduced on a
proper sheet. This can be to a larger scale than on the C.R.T.
and, i f done on a d r a f t i n g machine, the q u a l i t y of l i n e s a n d reso-
lution w i l l be much better than on the C.R.T. This i s p a r t i c u l a r l y
so i f colour g r a p h i c s a r e used, as colour resolution i s o n l y 1/3 of
that f o r b l a c k a n d whife on a C.R.T. I t i s s t i l l often useful to use
different codes to depict different types of line, for example to
d i s t i n g u i s h between gas, water, products, etc. b y means of dashed,
dotted o r f u l l lines.

COMPUTER PROGRAM FOR PIPE GRAPH I CS

The appended computer program was w r i t t e n f o r a micro computer


depiction of p i p i n g systems.

Program Description

The program as written can accommodate 100 pipes and 100


devices ( f l a n g e s , v a l v e s o r t a n k s ) . Unless d e t a i l close-up views a r e
used t h i s number of pipes w i l l more than c l u t t e r the screen of the
HP-85. Alternatively if a colour screen were available or if
drawings were reproduced graphical l y on paper, different colours
could b e used to depict d i f f e r e n t pipes, e.g. cold water, hot water,
sewers, ventilation ducts o r high pressure. Alternative computers,
e.g. the HP87, present different types of lines, e.g. dashed o r
dotted, which a r e also useful f o r d i s t i n g u i s h i n g lines.
Input is typed below the program s t a r t i n g from l i n e 700, and
187

TYPE

, 32 CmIFtCE

33 REDUCtWG

34 SOCKET WELO

35 WELD NECK

43 EXPANSION

46 LATERAL

87 LOCISHELD td;3
+&
VALVE
48 YOTOP CONTROL
VALVE
PLUGS
a BULL +c,
XAR

F i g . 14.2 Symbols for pipe f i t t i n g s


188

r e q u i r e s l i n e n u m b e r s a s w e l l a s a DATA statement followed b y :

Line 1: Left hand limit, Right hand limit, Lower limit, Upper
limit of screen display (in metres or ft.), Angle of
v i e w i n g measured from x to y axis, A n g l e up o f v i e w -
i n g m e a s u r e d f r o m x-z plane. Since t h e HP-85 screen i s
4 x 3 , t h e d i f f e r e n c e between the left and right hand
limits should be 4/3 times the difference between the
upper and lower limit for an undistorted scale. A
practical angle combination for isometric viewing is
30°, 15".

Line 2 onwards: Pipe data i.e., Xl,Yl,Zl,X2,Y2,Z2 of start and


e n d p o i n t s on the pipe, Cost p e r m e t r e o f p i p e .
After the last real pipe line, insert a data line with
O,O,O,O,O,O,O to i d e n t i f y the last pipe.

D e v i c e 1ines:The information on devices: Pipe no. (in the order


typed i n ) , D i s t a n c e f r o m s t a r t p o i n t t o e n d p o i n t meas-
ured along the pipe, Type of device (1 = flange rep-
resented by a vertical line, 2 = valve represented b y
X, 3 = tank represented by U), Size of device (m o r
ft.).
After the last device line, insert a data line with
O,O,O,O to identify end of data. After running the
program, it remains activated until PAUSE i s p r e s s e d ,
or until K1 i s pressed. I n the l a t t e r case the program
is reset to amend any pipe and a screen display
requests the pipe number (in order of original pipe
input), the new X1 ,Y1 ,Z1 ,X2,Y2,Z2 and C for amend-
ment. Upon typing in this data and pushing END
LINE, that p i p e on the p i c t u r e i s altered a n d t h e cost
also corrected. Note that this amend facility is not
available for altering screen limits or viewing angles
as the whole picture has to be drawn again i n these
cases.
189

Fig. 14.3 F i r e D i s t r i b u t i o n P i p i n g Depiction

Example

The appended program i s used to depict the f i r e f i g h t i n g water


distribution network to a double-storey bui Iding. Water i s supplied
from a roof t a n k through a double looped p i p e network. An isolat-
ing valve is i n d i c a t e d downstream of the tank a n d a f l a n g e d con-
nection extends from the lower floor to a future extension. Data
describing the system follows the computer program. The cost of

each p i p e i s estimated to be $10 per metre length.


Upon r u n n i n g the program the general view i n F i g u r e 14.3a was
depicted and copied from ? e screen. The v i e w i n g a n g l e i s 30° from
the x - a x i s and 15" up. A more d e t a i l e d view ( F i g u r e 14.3b) of the
supply tank from an (0,O angle was also obtained. Note that in
each case the total cost of the system i s also indicated.

Symbols in pipe g r a p h i c s p r o g r a m

A1 angle of viewing from x-axis measured in y


d i r e c t ion
A2 a n g l e of viewing from z-axis measured towards
190

x-y plane.
cost of p i p e per u n i t length
total cost of pipes
dimension of device
0 = o r i g i n a l d a t a , 1 = amended p i p e data
length
distance a l o n g p i p e from s t a r t to device
p i p e counter
device counter
device type. 1 = flange, 2 = v a l v e , 3 = tank
x - co-ordinate
l e f t h a n d l i m i t on screen
s t a r t p o i n t i n screen x-co-ordinates
end point i n screen x-co-ordinates
x-co-ordinate of device i n p l a n e of screen
r i g h t h a n d l i m i t on screen
y-co-ord i na te
z-co-ord i na te
z-co-ordinate of device in p l a n e of screen
lower l i m i t on screen
s t a r t point i n screen z-co-ordinate
end p o i n t i n screen z-co-ordinates
z-co-ordinate of device i n p l a n e of screen
upper l i m i t on screen
s t a r t x of l i n e
end x of l i n e
x1
x2
x-co-ordinate of device
s t a r t y of l i n e
end y of l i n e
Yl
Y2
y-co-ord i na te of dev ice
s t a r t z of l i n e
end z of l i n e
21
22
z-co-ordinate of device.
191

, DATUM , 1.0 I

I I I

COVER LEVEL

Fig. 14.4 Computer f l a t b e d p l o t of graded sewer

COMPUTER GRAD I NG

Pipelines a r e well s u i t e d f o r automatic g r a d i n g by computer and


drawing of sections by a linked plotter. A network is designed
largely on empirical bases which can be readily programmed as
constraints.
Although it is possible to start from d a t a from a contour p l a n
a n d develop the p l a n layout w i t h i n the computer, i t i s preferable to
lay the network out on a p l a n , peg and survey i t i n the f i e l d and
feed the data from pegging sheets directly to the computer. A
s u i t a b l e program w i l l then select the most economic depths and p i p e
diameters. The data may be d i s p l a y e d i n summary form f o r visual
inspection and adjustment if desired, taking off quantities. The
192

results are then submitted to a separate plotting routine for


drawing longitudinal sections. Such a plot i s i l l us t rat ed i n Figure
14.14.

REFERENCES

ANSI 232.23. Symbols f o r p i p e f i t t i n g s


Lamit, L . G . , 1981. P i p i n g Systems, D r a f t i n g and Design. Prentice
H a l l , Eaglewood C l i f f s . 612 p p .
193

498
588
518
528
5.38 "fP
548
558
568
578
588
598
688
618
628
638
648
658
666
676
688
708
718
728
738
748
758
768
770
788
798
808
818
828
238
848
858
868
878
889
898
194

CHAPTER 15

COMPUTER PROGRAMM I NG IN BAS IC

DESCRIPTION

BASIC i s an e l e m e n t a r y c o m p u t e r l a n g u a g e o r i e n t a t e d to t e c h n i c a l
problem solving, and somewhat s i m i l a r to FORTRAN l a n g u a g e . BASIC
i s often used on microcomputers w h i c h a r e designed to streamline
the human input effort. Some o f the statements in the l a n g u a g e a r e
a c t u a l l y commands to t h e c o m p u t e r a s w e l l a s p r o g r a m s t e p s .
The programming may be classified into various types, e.g.
Statements, Functions, Operators and Commands. Statements are
program lines which have to be numbered in the correct order
although not necessarily sequentially, e.g.
10
20
21
50
200

Computer Commands

Some s t a t e m e n t s a c t i v a t e t h e c o m p u t e r , e.g.

AUTO [ b e g i n s t a t e m e n t n o . , [increment]]e.g. AUTO 100,5 m a k e s


the computer s t a r t a t statement 100 and a u t o -
m a t i c a l l y increment each number b y 5
during input. Numbers in [I a r e optional.
CAT produces a l i s t o f e v e r y t h i n g o n the tape.
CONT [ s t a t e m e n t n o . ] , continues execution of a program a t the
s p e c i f i e d s t a t e m e n t no. a f t e r a PAUSE.
COPY r e p r o d u c e s i n f o r m a t i o n o n t h e s c r e e n to p a p e r .
DELETE f i r s t s t a t e m e n t n o . [ l a s t statement no.] r e m o v e s those
statements from the program.
ERASETAPE initializes a tape
INlT resets the program to t h e f i r s t l i n e and s e t s a l l
v a r i a b l e s to u n d e f i n e d v a l u e s .
195

L I S T [ b e g i n s t a t e m e n t no. [ e n d statement no.]] l i s t s the program


o n screen.
LOAD " p r o g r a m name" c o p i e s t h e p r o g r a m f r o m a t a p e o r d i s c to
c o m p u t e r memory.
P L I S T [ b e g i n s t a t e m e n t no. [ e n d statement n o . ] ] l i s t s the program
on paper.
REN [ f i r s t s t a t e m e n t n o . [ increment]] renumbers the program I ines
a s specified. Default values a r e 1 0 , l O .
RUN [ s t a t e m e n t n o . ] s t a r t s e x e c u t i o n of t h e p r o g r a m f r o m t h e s p e c i -
f i e d statement.
SCRATCH d e l e t e s t h e p r o g r a m f r o m memory.
STORE " p r o g r a m name". Stores t h e p r o g r a m onto t a p e o r disc.
SECURE " f i lename", " s e c u r i t y code", type. Type 0 secures a g a i n s t
LIST, P L I S T and E D I T . T y p e 1 a g a i n s t STORE,
LIST, P L I S T and E D I T . T y p e 2 a g a i n s t STORE,
PRINT#,STORE B I N and T y p e 3 a g a i n s t CAT.
e.g. SECURE " P R O G l " , " X Y ~ ' 1 .
UNSECURE " f i lename", " s e c u r i t y code", type.

AR I THMET I C

T h e f o l l o w i n g s y m b o l s a r e u s e d in a r i t h m e t i c s t a t e m e n t s
+ add
- subtract
'> multiply
divide
A r a i s e to the power.
The arithmetic functions have certain p r i o r i t i e s and t h e p r e c e -
D
dence i s A+,* and , + and -, t h u s A+B*C"D i s A + { B * ( C ) } .

LOG I CAL OPERATORS

= equal to
less t h a n
> greater than
f not equal to
196

VARIABLES

Any letter may be used to represent a v a r i a b l e , as well as any


letter followed by a number, e.g. A,B3. Subscript variables are
confined to letters, e.g. C(3). Up to two s u b s c r i p t s a r e possible,
e.g. D(4,5). Nested parentheses a r e e v a l u a t e d from i n w a r d s out.
Arrays should be preceded by a DIM (dimension) statement if
s u b s c r i p t s e x c e e d 10, e . g . DIM A(20), B(30,lOO).

PRECISION

REAL v a r i a b l e s a r e accurate to 12 d i g i t s , w h i l e SHORT INTEGER


variables are truncated to 5 d i g i t s . REAL p r e c i s i o n is used unless
v a r i a b l e s a r e d e c l a r e d SHORT o r INTEGER.

FUNCT IONS

ABS(x) absolute, positive, value of x


ACS(x) arcos ( x )
ASN(x) arcsin x
ATN(x) arctan x
CEIL(x) smal lest integer<=x
COS(X) cosin x
COT(x) cotangent x
CSC(X) cosecant x
DTR(x) degrees to r a d i u s
X
EXP ( x )
FLOOR(x) same a s I N T ( x )
FP(x) fractional p a r t of x
INT(x) largest integer <=x
IP(x) i n t e g e r p a r t e.g. l P ( - 3 . 2 7 6 ) = -3
LGT(x) loglox
LOG(x) n a t u r a l log x
MAX(x, y ) x o r y whizhever i s largest
MIN(x,y) x o r y whichever i s smallest
MOD i n t e g e r e.g. MOD B = p o s i t i v e i n t e g e r v a l u e o f B
PI 3.14159265359
RMD(x, y ) remainder of x/y-yqlP(x/y)
RND n e x t number x in a r a n d o m sequence o<=x<l
RTD(x) r a d i u s to degrees
SEC(x) secant x
SGN(x) s i g n of x , + o r -
SIN(x) sine x
SQR(x) square root of x
197

TAB(n) s k i p s to column n
TAN(x) tangent of x
VAL (S$) n u m e r i c a l e q u i v a l e n t o f s t r i n g S$
VAL$(x) s t r i n g e q u i v a l e n t of x

SPECIAL CHARACTERS

permits multi-statement line, e.g. 100 A=B @


G O T 0 200
delimits a remark e.g. 100 A=B!A IS A NEW
VAR I ABLE
prompts f o r input
I,
I,
delimits a s t r i n g of text which i s displayed

BAS I C PROGRAMM I NG STATEMENTS

The f o l l o w i n g statements c a n be i n c o r p o r a t e d in programs.

ASSIGN n u m b e r TO "name", e.g. ASSIGN 2 TO "DATA"


CHAIN " f i l e n a m e " . L o a d s and r u n s t h e p r o g r a m . T h e current program
is deleted except for "common" variable and
"assigned" buffers.
CLEAR Clears the screen
COM Common v a r i a b l e l i s t . Used w i t h CHAIN
CREATE " f i l e n a m e " , number of records [number of bytes p e r record]
Establishes a d a t a f i l e of the specified size.
DATA l i s t . Provides constants and/or s t r i n g s from which
READ s t a t e m e n t s a b s t r a c t d a t a .
DEFAULT ON/OFF p r e v e n t s o r c a n c e l s some m a t h e r r o r s f r o m h a l t -
ing e x e c u t i o n
DEF FN n a m e [ ( p a r a m e t e r ) ] [ = expression]. Defines a special f u n c t i o n
w i t h i n a program, e.9. DEF FN A(X)=SQR ( X + 2 + 2 * X )
DEG Sets d e g r e e mode f o r t r i g f u n c t i o n s
DIM list. Declares the maximum subscripts f o r a r r a y s .
e.g. DIM A(20), B(50,lOO)
198

DlSP [ l i s t ] d i s p l a y s t h e l i s t o n the screen. e.g. DlSP "A


EQUALS", B
DlSP USING f o r m a t line [; list). D i s p l a y s o n screen a c c o r d i n g to the
format in format line. I f a l i n e number i s used
that l i n e h e a d e d IMAGE a c t s a s t h e f o r m a t , e.g.
DISP USING 50;A,B
END Terminates program execution
FOR c o u n t e r = f i r s t v a l u e TO l a s t v a l u e [ s t e p increment]. The
s t a t e m e n t s up t o a l i n e NEXT c o u n t e r a r e
repeated f o r the counter proceeding from the
f i r s t v a l u e to the last value. The counter
step i s one unless otherwise specified.
GOSUB s t a t e m e n t n o . The n e x t statement executed i s the specified
statement in a subprogram. Control is returned
to the m a i n p r o g r a m w i t h a RETURN s t a t e m e n t .
GOT0 s t a t e m e n t n o . Control i s t r a n s f e r r e d to the designated
st a t emen t
GRAD s e t s t r i g o p e r a t i o n s to grads. ( 400 grads in
360")
I F e x p r e s s i o n THEN s t a t e m e n t n u m b e r [ELSE s t a t e m e n t n u m b e r 1.
1 2
I f the expression is true control i s transferred
to s t a t e m e n t , and i f n o t , to the next
statement [ o r statement ]
2
IMAGE f o r m a t . Used w i t h PRINT USING o r DlSP USING s t a t e m e n t s t o
specify the format o f the output.
T h e f o l l o w i n g can b e s p e c i f i e d :
n ( .....) r e p e a t s t h e o p e r a t i o n i n p a r e n t h e s i s n
times
A string character
Z L.H. d i g i t p o s i t i o n o r l e a d i n g z e r o
D L.H. d i g i t p o s i t i o n o r l e a d i n g b l a n k
. decimal p o i n t position
S s i g n (+ o r - )
M m i n u s o r blank
E e x p o n e n t i a l f o r m ESDDD
X blank
/ carriage return
Is I' literal
e.g. IMAGE 2D.DDD,PXZDD
INPUT v a r i a b l e name [, v a r i a b l e name ...I V a r i a b l e s a r e assigned
199

v a l u e s o n the k e y b o a r d when a prompt 'I?"

appears on the screen


INTEGER v a r i a b l e [ s u b s c r i p t s ] . . .. Specifies v a r i a b l e s a s integers
and d i m e n s i o n s them
KEY L A B E L D i s p l a y s l a b e l s a s s o c i a t e d w i t h ON KEY s t a t e -
ments
LOAD B I N " f i l e n a m e " . Loads a b i n a r y coded f i l e from tape i n t o
memory
NEXT c o u n t e r . Returns control t o a FOR s t a t e m e n t
ON ERROR GOTO s t a t e m e n t n u m b e r . T r a n s f e r s to d e s i g n a t e d statement
if a recoverable execution e r r o r i s encountered
ON e x p r e s s i o n GOTO l i s t . T r a n s f e r s c o n t r o l t o t h e s t a t e m e n t no.
in t h e I i s t c o r r e s p o n d i n g t o e x p r e s s i o n
being 1, 2 , 3 etc.
PAUSE H a l t s e x e c u t i o n u n t i l CONT i s e n c o u n t e r e d
P R I N T [USING s t a t e m e n t n u m b e r ] [ l i s t ] . Prints the l i s t on paper
u s i n g the format in t h e s p e c i f i e d s t a t e m e n t
number o r in free format. Items in the
l i s t m u s t b e s e p a r a t e d b y commas o r semicolons,
e.g. PRINT USING 1 0 0 ; A , B ( 5 ) , " I S THE ANSWER''
PRINTER I S code number. Redefines the p r i n t e r . l=screen, 2=paper
PURGE f i l e name. Eliminates the designated f i l e from tape
RAD Sets r a d i a n mode f o r t r i g f u n c t i o n s
RANDOMIZE [ e x p r e s s i o n ] . G e n e r a t e s a r a n d o m n u m b e r seed. By
s p e c i f y i n g an e x p r e s s i o n t h e r a n d o m n u m b e r
sequence c a n b e r e p e a t e d
READ [ b u f f e r n o . ] name,[,name2 ...]. Reads a s t r i n g o f v a r i a b l e s
f r o m DATA s t a t e m e n t s o r f r o m a b u f f e r
REAL v a r i a b l e [ ( s u b s c r i p t s ) ] . .. D e c l a r e s v a r i a b l e s r e a l and
d i m e n s i o n s them
REM [ a n y t h i n g remark statement, not f o r execution, same a s !
RENAME o l d n a m e TO newname. F i l e i s renamed
RESTORE [ s t a t e m e n t n o , ] . Resets d a t a p r i n t e r t o t h e s p e c i f i e d
s t a t e m e n t o r to t h e b e g i n n i n g o f t h e d a t a f i l e
RETURN Transfers control from the l a s t l i n e of a
s u b r o u t i n e back t o t h e o r i g i n a l p r o g r a m l i n e
200

f o l l o w i n g a GOSUB s t a t e m e n t
SHORT v a r i a b l e [ ( s u b s c r i p t ) ] ... D e c l a r e s v a r i a b l e s short a n d
d i m e n s i o n s them
STOP T e r m i n a t e s e x e c u t i o n and r e t u r n s p o i n t e r to f i r s t
statement
STORE B I N "name". Stores the f i l e named on tape
TRACE Used t o f o l l o w s t a t e m e n t s e x e c u t e d . NORMAL w i l l
c a n c e l t h e TRACE o p e r a t i o n

GRAPH I CS STATEMENTS

The HP s e r i e s 80 m i c r o c o m p u t e r e n a b l e s g r a p h s to b e p l o t t e d o n t h e
s c r e e n and o n p a p e r u s i n g t h e f o l l o w i n g s i m p l e s t a t e m e n t s .

ALPHA Sets d i s p l a y to a l p h a n u m e r i c mode


BPLOT s t r i n g , number of characters p e r line. P l o t s a g r o u p of d o t s
as specified b y the s t r i n g
DRAW x - c o - o r d i n a t e , y-co-ordinate. D r a w s a l i n e f r o m c u r r e n t pen
p o s i t i o n to s p e c i f i e d ( x , y )
GCLEAR [ y ] c l e a r s screen below specified y v a l u e
GRAPH Sets d i s p l a y t o g r a p h i c mode
IDRAW x - i n c r e m e n t , y-increment. Draws a l i n e from c u r r e n t pen
p o s i t i o n to p o s i t i o n d e t e r m i n e d b y t h e x and y
increments
IMOVE x - i n c r e m e n t , y-increment. Moves t h e p e n b y t h e s p e c i f i e d
increments, without d r a w i n g a l i n e
LABEL s t r i n g . Writes the s t r i n g s t a r t i n g a t the c u r r e n t pen
posit ion
LDlR angle. Specifies d i r e c t i o n of abel ( a n g l e = O o r 90°)
MOVE x - c o - o r d i na te, y-co-ord i na te. Moves p e n f r o m c u r r e n t p o s i i o n
to ( x , y ) w i t h o u t d r a w ng a l i n e
PEN n u m b e r . Specifies whether dots a r e b l a c k ( n e g a t i v e
number) o r white (positive number)
PENUP L i f t s p e n up
PLOT x - c o - o r d i n a t e , y-co-ordinate. Makes a dot a t (x,y)
SCALE x - m i n , x-max, y-min, y-max. Sets t h e x and y s c a l e o n t h e
screen between the l i m i t s sDecified
20 1

X A X l S y i n t e r c e p t [ , t i c s p a c i n g [xrnin, xrnax]]. Draws a h o r i z o n t a l


a x i s with t i c marks and within l i m i t s specified.
Negative t i c s specify the r i g h t s i d e as reference
YAXIS x intercept [ , t i c spacing [yrnin, yrnax]]. Draws a v e r t i c a l
axis

(By c o u r t e s y of the Hewlett P a c k a r d company.)


202

INDEX

Acceleration, 1 13 D a n t z i g , G.B.,71, 86
A c c u r a c y , 97,124 D a r c y f r i c t i o n f a c t o r , 3,5,10,23
Advec t i o n , 92 27,30,49
A i r , 18,118,148 D a r c y h e a d loss e q u a t i o n ,
A i r v a l v e s , 119, 141 41,48
A i r vessels, 143 D a r c y - W e i s b a c h , 9,10,23,25,36,
A l b e r t s o n , M.L. 20 118,161,163
A l l i e v i , L , 175, 182 Deb, A.K. 85
A l l o c a t i o n , 72 Demand, 40
A n a l y t i c a l s o l u t i o n , 22 , 96 D e s i g n , 21
A r i t h m e t i c , 193 D i a m e t e r s , 56,66,71 ,178
Assumpt ions, 36 D i f f e r e n t i a l e q u a t i o n s , 125
A v e r a g i n g , 45 D i f f u s i o n , 92, 126
D i s c h a r g e c o e f f i c i e n t , 122,
B a r l o w , J . F . , 44,45,54 176
BASIC, 192 D i s c h a r g e . t a n k s , 142
Basic equations, 1 D i s k i n , M.H,,20
Bend, 17 D i s t o r t i o n , 188
B e r g e r o n , L, 175, 182 D i s t r i b u t i o n system, 160
Bernoul t i equation, 1 , 2 D r a w i n g s , 28,183
B h a v e , P.R., 63, 69 D r a w o f f , 25,55
B o u n d a r y c o n d i t i o n s , 136, 167 Dummy p i p e s , 38
Boundary layer, 5 D y n a m i c e q u a t i o n , 23, 110
B o y l e s l a w , 113 D y n a m i c p r o g r a m m i n g , 71,161
B r a n c h p i p e , 38, 55, 161, 165
E l a s t i c i t y , 116
Cathode r a y t u b e , 186 Elevation, 2
C a v i t a t i o n , 137, 138 Empirical, 3
C e l e r i t y , 118, 129 E n e r g y , 1,2, 140
C h a r a c t e r s , 187, 195 E n t r a n c e loss, 17
C h a r a c t e r i s t i c s , 128, 144, 175 E q u i v a l e n t l e n g t h , 18
C h a u d h r y , M.H., 120, 135 E q u i v a I en t p i p e , 19,22,38,85
Chezy, 3, 10 E r r o r , 125
Closed loops, 70, 85 E u l e r , 97
Colebrook a n d W h i t e , 6 E v a p o r a t i o n , 94
Col ebrook-W h i t e e q u a t i o n , 6,7,16,20, E x i t loss, 17
23, 32, 118 E x p l i c i t , 128,165
Command, 193
Compound p i p e s , 26 F e e d b a c k , 171
Computer p r o g r a m s , 30,41 ,49,63 F i n i t e d i f f e r e n c e , 124
68,102,131 ,153,186 F i r e h y d r a n t , 40,183
Computer s t o r a g e , 149 F l o w c o r r e c t i o n , 83
C o n s t r a i n t s , 63, 86 FORTRAN, 113
C o n t i n u i t y e q u a t i o n , 1, 109, 112 F o u r i e r methods, 102
Convergence, 26,29,45,51 F o u r t h o r d e r , 100
Cost, 188 F r i c t i o n , 1 17
Courant, F r i e d r i c h s & Lewy, Friction factors, 4
C o n d i t i o n , 129 F r i c t i o n loss c h a r t s , 1 1
Cross, H , 31,35,45,51, F u n c t i o n , 193
82,84,162
203

Gauss m e t h o d o f e l i m i n a t i o n , 45
M a n n i n g , 3, 16
47, 49
M a n u a l a n a l y s i s , 35, 110
G e r a l d , C.F., 100, 105
M a r k l a n d , E., 4 5 3 4
G l o b a l E r r o r , 97
M a r t i n , C.S., 147, 159
Grading, 192
Mass, c o n s e r v a t i o n , 115
G r a p h i c a l m e t h o d , 175
Mathemat i c a l opt imiza t ion tech -
G r a p h i c s , 183, 195
n i q u e s , 70, 82
G r a v i t y l i n e s , 131
M a x i m u m h e a d , 172
Grosman, D.D., 88, 105
Menu, 185
M i d p o i n t , 178
Hadlev - ,, G.. , 63., 69
M i n e , 161
H a z e n - W i l l i a m s , 3,4,10,16,23
M i n i m u m f l o w , 85
27.36
M i n i m u m p r e s s u r e , 4 0 , 167
Head loss, 1 ,3,16,35,40,71 ,122
M i n o r h e a d losses, 16
Houses, 35
M i x e d f l o w , 96
H y d r a u l i c g r a d e l i n e , 2, 72
M o d e l s , 90, 184
H y d r a u l i c r a d i u s , 16
Momentum, 1 , 115, 152
H y d r a u l i c s r e s e a r c h s t a t i o n , 7,20
Moody d i a g r a m , 7,8,16,20,23
118
I m p l i c i t , 165
M u l t i s t e p , 101
I n d u s t r i a l s y s t e m s , 183
I n e r t i a , 709
N e t w o r k s , 21,35,36,45,63,70,160
I n i t i a l f l o w s , 51
New ton-Raphson, 9,24,32
I n i t i a l v a l u e s , 57
New t o n ' s I a w , 45,47,105,115
I n t e g r a t i o n , 110
Nikuradse, 7
I n t e r a c t i v e compu t i n g , 102
Node h e a d c o r r e c t i o n , 28
I n t e r a c t i v e d r a w i n g , 185
Nodes, 28,35,87
lrrotat ional, 2
Non c i r c u l a r s e c t i o n s , 16
I s a a c s , L.J., 45, 54
Non l i n e a r equations, 21, 89,
I t e r a t i v e methods, 10, 153
124
Non l i n e a r p r o g r a m m i n g , 84
J a e y e r , C . , 112, 114, 182
Non r e t u r n v a l v e , 131, 141
James, W . , 90, 105
N u m e r i c a l d i f f u s i o n , 126
J o u k o w s k y h e a d , 138
O b j e c t i v e f u n c t i o n , 63
K a l l y , E., 85
One d i m e n s i o n a l , 2
K e y c o l u m n , 57
O r i f i c e , 88
Kinematic viscosity, 5, 23
O p e r a t i o n s r e s e a r c h , 70, 88
O p p o r t u n i t y v a l u e , 59
L a m i n a r f l o w , 5, 22
O p t i m i z a t i o n , 55, 70
L a m i t , L.G., 185
O p t i m u m l e n g t h , 85
L a y o u t , 63
O p t i m u m s o l u t i o n , 89
L i n e a r method, 45
O v e r p r e s s u r e s , 138,140,142,143
L i n e a r p r o g r a m m i n g , 63, 83
L i n e a r i z a t i o n , 22, 29
P a r a l l e l , 26
L i n k , 87
P a r r n a k i a n , J . , 182
L o a d r e j e c t i o n , 103
P a r t f u l l p i p e s , 16
L o c a l e r r o r , 97
P e n s t o c k , 106
L o g i c , 194
P e r i o d , 109
L o o p e d n e t w o r k s , 63, 81
P i c k f o r d , J., 112,114,182
L o o p f l o w c o r r e c t i o n method, 35
P l a n , 36
L o o p / n o d e c o r r e c t i o n , 81
P l u g f l o w , 96
L u p t o n , H.R., 120, 135
P o l y n o m i a l , 101
P o i s s e u i I le, 5
P o i s s o n ' s r a t i o , 117, 118
204

P o w e l l , W.F., 63,69 T a b u l a t o r s o l u t i o n , 106


P r e c i s i o n , 96, 195 T a y l o r s e r i e s , 97, 125
P r e s s u r e , 40 T a y l o r ' s e x p a n s i o n , 125
P r e s s u r e r e d u c i n g v a l v e s , 39,41 Time s t e p , 103
P r e s s u r e t r a n s i e n t s , 138 T r a n s i e n t p r e s s u r e s , 162
Pseudo e x p l i c i t & i m p l i c i t , 166 Transportation programming, 74
Pseudo r e s e r v o i r , 105 T r e e - l i k e n e t w o r k s , 66, 85
Pseudo s t e a d y f l o w , 22,25,98 T r i a l a n d e r r o r , 22,45,70
Pumps, 39,49,137,160,182 T r u n c a t i o n e r r o r , 125, 126
P u m p t r i p , 153, 167 T r u n k m a i n s , 45, 55
T u n n e l , 109
Q u a d r a t i c convergence, 32 T u r b i n e , 106
Q u a l i t y , 90 Turbulent flow, 5

Rao, H. S . , 102, 105 U n k n o w n s , 46


Real time o p e r a t i o n s , 102 Unsteady flow, 21, 106
R e l a x a t i o n , 35, 45, 47 U-tube, 106
Rep I acemen t r a t i o , 57
R e s e r v o i r s , 24,28,38,88,102,103 V a l v e c h a r a c t e r i s t i c s , 176
Resources, 102 V a l v e s , 17,122,137,141 ,169
Reynolds n u m b e r , 4,5,6,7,16,20 V a l v e s t r o k i n g , 172
23,49,163 Van d e r Veen, 71, 86
Rich, G.R., 112,114,142,145 Vapour p o c k e t , 1 12,137,148,150,
R i g i d col umn, 21 ,22,23,106,110,113 1 51 , 1 54,167,179
141 ,146,148,182 V a p o u r p r e s s u r e , 138,146,147,
R i s i n g m a i n , 150 150,
Rough b o u n d a r y , 6 V a r i a b l e s , 195
Runge-Kutta, 100, 101 V e l o c i t y , 116, 172
R u n n i n g time, 41 V e l o c i t y head, 2, 16

S c h l i c h t i n g , H., 5, 20 W a l l t h i c k n e s s , 21,79,115
S c h n y d e r , O., 175, 182 Water column s e p a r a t i o n , 110,
Screen, 183 138,
Series, 26 141,146,147,148,154,167,175,179
S h a m i r , U., 102, 105 Water hammer ,21,87,106,112,1
15,
Simplex method, 55 118,119,120,136,137,138,140,141,
Simultaneous s o l u t i o n , 22, 33, 176 142,143,147,148,151,153,160,175,
S t a b i l i t y , 124 182,183
S t a n d a r d d i a m e t e r , 74 Water hammer equations,22,117,
Statements, 196 124,126,128,129
Steady f l o w , 1 , 21 Water hammer p r o t e c t i o n , 140
Steepest p a t h method, 77 Water r e t i c u l a t i o n systems, 91
Stephenson, D . , 33,70,86,120 Water s u p p l y , 102
135 ,143,145 Watson, M.D., 20
S t e r l i n g , M.J.H., 102, 105 Wave, 118,126,175
Stream t u b e s , 1 Wetted p e r i m e t e r , 16
Streeter, V.L., 120,135,136,145, Wood, D . , 45,54
169,172
Stummel, F., 100, 105 Yields, 75
Successive o v e r r e l a x a t i o n , 49
Surge, 106
Surge t a n k s , 112, 137
Symbol, 185
Systems a n a l y s i s , 70, 88