Professional Documents
Culture Documents
46
RN(z ; a)
HY 1
Uc (t)
u
ua
w
(w i)
X(t)
x
(xi)
xa
y
Yo
ya
z
a
ox, Oy,
r
ot
t/x)
X
{aj}
T
<P
.<I>
ef>a(t)
r/>1'
r/> 2
l/I
l/l/x)
l/I T
...
January, 1973
HY 1
Va
9472
Journal of the
HYDRAULICS DIVISION
Proceedings of the American Society of Civil Engineers
INTRODUCTION
Computation of steady- state or transient mass flow rate and pressu re distribution in fluid net\vorks with given geometric configuration and dimensions
is a common problem in many branches of engineering. The design of municipal water and gas distribution systems as well as the dynamic analysis of
thermal systems in conventional and nuclear power plants are a few typical
examples.
The solutions to the aforementioned network problems gene rally have been
obtained on digital computers. Several difficulties have been observed in
these numerical solutions:
1. When the number of nehvork nodes and branches becomes large, the
computer storage requirement and running time for the solution become
excessive .
2. The iterative procedure, used for the solution of steady-state problems, does not always converge or may at times converge very slowly.
3. The time integration used for the solution of transient problems may
become numerically unstable or nonconvergent.
4. The computer programs are not sufficiently ge neral to treat networks
of any arbitrary configuration with all system compone nts encountered in
practice .
This situation indicates that new techniques for the solution of fluid networks are needed. A new technique for the solution of isothermal incom'
pressible fluid flow in networks under steady- state or transient conditions
is
presented herein. In contrast to conventional steady-state network analysis
methods, this new technique can be extended to the unsteady analysis of com.Note.-Discussion open until June 1, 1973. To extend the c losing date one month, a
written request must be filed with the Editor of Technical Publications, ASCE. This
paper is part of the copyrighted Journal of the Hydraulics Division, Proceedings of the
American Soc iety of Civil Engineers , Vol. 99, No. HYl, January, 1973. Manuscript was
submitted for review for possible publication on March 20, 1972.
1 Research Prof., Newark Coll. of Engrg., Newark, N.J.
2 Grad. Student, Newark Coll. of Engrg., Newark, N.J.
47
48
January, 1973
HY 1
HY 1
MATRIX METHOD
49
sis and ( 2) the extension of the method to the unsteady analysis of compressible flow in nehvorks having an arbitrary configuration with heat transfer
and phase change, seems to be feasible. This method constitutes the foundation for the present study.
SCOPE AND OBJECTIVES OF PRESENT STUDY
The main objectives of the present study are as follows: (1) To expand the
method developed by Nahavandi (15) for the transient and steady- state analyses of isothermal, incompressible flow networks and to link this procedu re
with the matrix method of network analysis ( 5) often used in the study of d- c
ele ctrical networks; (2) to develop a digital computer program for the transient and steady- state analyses of complex hydraulic networks based on this
new technique; and (3) to verify the results of the present study against the
results of another computer program based on the Hardy Cross method.
The present study provides the following flexibilities:
Januar y, 197 3
50
HY 1
These equations are then solved to obtain explicit relations for unknown nodal
pressures and branch mass flow rates in the following way.
The branch pr e ssure drop array, t::..p, de s igna ting the pressure drop in the
posit ive flow direction, is related to nodal pressures p by
{ t::..p}
(1)
i n which A = the connection matrix defined as foll ows. Every branc h of the
network, unde r investigation, is first given an arbitrary positive orie nta tion
or dire ction (see Fig. 1) . The connection matrix for branches and nodes is
then defined as a matrix whose elements are + 1, - 1, or 0 only. The r ows of
the connection matrix correspond to the network branches such that the maximum number of r ows are equal to the maximum number of system branches.
The columns of the connection matrix correspond to the network nodes s uch
that the maximum number of columns are equal to the maximum number of
2
SUPPLY
10
10
0
32
12
OUTPUT
19
11
12
11
33
31
41
19
31
OUT PUT
IS
30
38
OUTPUT
15
20
0
21
35
18
17 17
{. . l {
m - m0
h
ag
L
(144 AP + p ~ + pH - F)
.mwh1ch
. {F} = {1 (!DL')
2
and {!}
gp
= { 0 . 0055 [
1 +
0
1;l
2 x
Im 0 11
a2
10
... . . .. . . . . . .. (3)
106) 0 .333]
D + Rn
(4)
lf .. . . (5)
In the forego ing relations , a, D, L, and L ' = the branch flow c r oss- sectional
area, hydraulic diameter, length, and equi valent length, respectivel y. The inertia term is based on a forward fi nite difference form in time as the difference between the updated and the present values of the mass flow rates (m
and 0 ) divided by the time increment, h. A criterion for the selection of this
time increme nt will be presented later. Values of ~, H , F , and Rn = the
branch elevational head, pump head rise, frictional head loss , and Reynolds
number; while E, f , and p = pipe absolute roughness, fluid friction factor,
and density .
Eqs. 4 and 5 represent Moody' s method (4, 14) for the calculation of frictional head loss. In or der to be able to check the results of the prese nt
a nalysis against those of Ref. 19, provis ions to r eplace Moody's method by
Hazen- Williams method (8,20) are incorporated in the program. In the context of the present formulation, the Hazen-William formu lation is g iven by
3.02
( L' )
{F} - !l ci.ss
PO.BS DllBS
16
34
26
29
51
22
21
20
MATRIX METHOD
HY 1
28
.,noalB
lmol
o.esl
S
... . . . . (4a)
24
OUTPU T
35
system nodes . If the branch orie ntation is away from the node, the corresponding e lement of the connection matrix is + 1. If the branch orientation is
toward the node, the corresponding ele ment of the connection matrix is - 1.
If the branch and the node do not meet, the corresponding eleme nt of the conne c tion matrix is 0.
The nodal continuity equation, considering both the branch flow and the
nodal source and sink (input and output) fl ows is give n by the following matrix equation:
. } = {O} .. . . ... .. .. .. .. .. . . . . . . . . . . . (2)
[A T J {m' } + {mio
in which AT = the transpose of the connection matrix and 1n and mio = the
branch flow and the noda l source and s ink (input and output) flow arrays,
re spectively.
T he quantity, C, the Hazen-Williams coefficie nt, depends on the type and the
condition of the condui t and is tabulated i n Ref. 19.
If a network consists of j branches and i nodes, Eqs. 1, 2, and 3 constitute
a set of 2j + i algebraic equations in 2j + i unknowns . These unknowns are
b r anch pressure drops, branch mass flow rates, and nodal pressures. To
solve the preceding system of algebraic equations , it is necessary to eliminate the pressure drops and ma ss flow rates among Eqs. 1, 2, and 3 to obtain
a single matrix equation for the unknown nodal pressures. Solving the matrix
equation 3 for
array, the result is
ni
(7)
L ~G "'"'L ENGINEER
January, 1973
52
HY 1
mio.
mio.
NUMERICAL SOLUTION
MATRIX METHOD
HY 1
53
The numeral calculations can be conveniently divided into two groups. The
first group consists of mathematical operations performed once at the beginning of the program. The assembly of the connection matrix and its transpose, the formation of matrix M defined by Eq. 9 and its inverse as well as
the calculation of all flow-independent terms in Eqs. 8 and 1 are among this
group. The second group consists of iterative operations performed after
each time increment. The calculation of branch frictional head loss and pump
pressure rise as well as the computation of all flow-dependent terms in Eqs.
8 and 1 are among this group. Cl assification of the numerical calculations
into the aforementioned groups increases the computational efficiency of the
program and reduces the computer running time .
To perform the required mathematical computations, a number of matrix
operation subroutines, such as matrix addition, subtraction, multiplication,
inversing, and transposing were needed. T hese subroutines were obtained
from Ref. 21.
NUMERICAL STABILITY ANALYSIS
The present analysis is based on the numerical integration of the branch
momentum differential equations (Eq. 3). To obtain a convergent solution, it
is necessary that the selected time increment, h, for this integration be
smaller than the minimum time constant associated with these equations by a
good margin. The momentum equations are nonlinear and an accurate calculation of their time constants cannot be made readily prior to their numerical
solution. Fortunately, the accurate calculation of these time constants is not
necessary and a conservative estimate is all that is needed for the purpose of
obtaining a convergent solution. This objective can be achieved by making a
number of simplifying assumptions. First, as the dependence of the friction
factor and the pump head on mass flow rate is generally weak, it is reasonable to assume that these two var iables are flow- independent. Secondly, the
stability analysis will be performed on the linearized momentum equations.
This assumption is heuristically j1ustified because the linearized equations
approximate the nonlinear equations in small time regions. If the linearized
solution is convergent for every time increment, the overall nonlinear solution also will be convergent. It should be further emphasized that these simplifying assumptions are made only for the stability analysis and not for the
actual analysis presented herein.
Based on the preceding assumptions, the branch momentum equation may
be expressed by
topography, geometric dimensions, hydraulic properties, problem initial conditions, and control variables. The main input data in this study are as follows: ( 1) The connection matrix, A (only the nonzero terms are entered as
input data); (2) the branch actual length, L, equivalent length L', hydraulic
diameter D, nodal elevation Z arrays; (3) the fluid density, p, viscosity, and
pipe absolute roughness E; (4) the pumps' locations and their head versus
volumetric flow characteristics; ( 5) initial branch mass flow rates 0 ; ( 6)
nodal sink and source mass flow rates
and ( 7) integration time increment h and steady- state flow convergence error.
mio;
L din + [( in,2
ag dt
in which K =
= c .. .... . . . . . . . . . . . . .. . . . . . . . . . . .
2 ~P (!;') ;
(10)
(11)
and c = the sum of the pressure drop, the e levational head, and the pump
head rise. Because the linearized equation will be used only within a small
time increment, both K and c are treated as constants and thus the variation
of Eq. 10 is
54
January, 1973
. d(om)
ag
dt
2K
mo
om = 0
HY 1
. . . . . ( 12)
mo
T0
= 2Kag m0
13)
Substituting Eq. 11 into Eq. 13, the final expression for branch time constants
become
To
7TD 3 PL
4/ L,
mo
( 14)
Experience with the operation of the present program has indicated that if for
each integration step, the time increment is smaller than the minimum time
. . . . . . . . . . . . . . . . ( 15)
the numerical integration is conve rgent. Thus, to obtain a convergent solution, the branch time constants are computed from Eq. 14 prior to each integration step and their minimum value i s selected. The time increment for
the next time interval is then chosen to be 1/20 of the minimum time constant. This margin of 20 has proved to be satisfactory for the present analysis and has resulted in a convergent solution. In the event that approximate
values of the steady- state flows are known from a previous run, it is more
economical to compute the time increment on the basis of these flows. The
time increment can then be held constant throughout the dynamic analysis.
The reason for using the minimum time constant can be made clear by the
following argument. Any arbitrary network consists of a number of parallel
and series branches. For parallel branches, the line with minimum time constant has the fastest time response and therefore should be used for numerical stability purposes. For a j number of series branches, the equivalent time
constant can be shown easily to be
(~t
l
n =1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . (16)
2ni 0
(K)n
n=1
This equivalent time constant can be shown to be larger than the smallest
time constant among these branches. Consequently, the minimum time constant branch provides a conservative estimate for usage in the numerical
stability ana lysis.
When the transient solution is of no interest and only the final steady-state
values are desired, the time increment criterion is not as stringent as indicated by Eq. 15. The time increment can be increased to the order of the system minimum time constant or even higher, leading to a large reduction in
computer running time . The increase in the time increment reduces the actual
branch time constants without adversely affecting the steady-state results.
HY 1
MATRIX METHOD
55
It should be further emphasized that numerical instability and lack of convergence constitute two major hazards of any numerical integration scheme.
Numerical oscillations are caused by computational round- off errors, and the
lack of convergence is the result of integration truncation error. Both the numerical instability and the lack of convergence problems can be overcome by
the introduction of an appropriate upper bound for the integration time step,
h, as indicated by Eq. 15.
Although the numerical stability criterion presented herein, lacks a rigorous proof, it provides a reasonable estimate of the time interval, which appears to give stable results in all cases considered.
PRESENTATION OF RESULTS
The new computational technique developed herein is verified by employing lhe present d igital program to determine the flow and pressure d i stribution in the hydraulic network shown in Fig. 1. A steady-state numerical
solution, to this problem, based on the Hardy Cross method is available (19)
and is used to check the correctness of the present dynamic analysis. The
hydraulic network, shown in Fig. 1, represents a typical city water distribution system. All system nodes and branches are numbered independently, and
positive flow directions are shown by arrows. Water enters the system
through branch 1, at a rate of 2,825 gpm (0.1 782 m 3/s) with a constant pressure of 60 psi, and leaves the system through branches 30, 31, 32, 34, and 35
at 450 gpm, 400 gpm, 500 gpm, 650 gpm, and 825 gpm (0.0284 m 3/s, 0 .0252
m 3/s, 0.0316 m3/s, 0.0410 m3/ s, and 0 .0520 m3 /s), respectively. The length,
internal diameter, and elevational difference for every system branch is
specified in Table 1. In order to be able to match the present results against
those of Ref. 19, no booster pump is placed in any branch and the equivalent
length of each branch is taken equal to its actual length. It should be pointed
out that the present analysis is not restricted by these assumptions. These
restrictions are introduced to obtain a meaningful comparison between the
results of the present study and those of Ref. 19.
Typical transient results are demonstrated in Figs. 2 and 3. The final
steady- state results are shown in Tables 2 and 3 for all system branches.
Figs. 2 and 3 show the typical time - variation of mass flow rate and fric tional head loss for branches 11 and 23. An examination of these curves and
Tables 2 and 3 reveals the following features:
1. Application of Moody's and Hazen-Williams' frictional head loss formulas affects the shape of the system response curves. This is to be expected as the coefficients and power appearing in Eqs. 4 and 4a are somewhat
different. The difference between values obtained from the application of
Moody and Hazen- Williams is a function of branch diameter and mass flow
rate . For certain branches, the combination of diameter and mass flow rate
results in a closer agreement between the response curves. The choice between Moody's or Hazen-Williams' frictional head loss formulas is a matter
of personal preference . In any event, both correlations yield comparable re sults for practical purposes.
2. The steady- state values of branch flows and frictional head losses obta ined from the present analysis, using Hazen-Williams' formula are in good
January, 1973
56
HY 1
...
~
10
vi
V)
0
.....
...c
Diameter, D, in inchesa
Branch number
(1)
(2)
1
2
3
4
5
20
20
20
20
20
20
10
10
10
10
8
8
8
6
Elevation difference,
Length, L, in feetb
D.Z, in feet
(4)
(3)
57
MATRIX METHOD
HY 1
:z:
z
0
;:::
,.
-----------------------
L)
...
a:
0
BRANCH 11
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
5
5
5
8
6
44
45
a 1 in. = 25 .4 mm.
b l ft = 0.305 m .
6
6
5
5
8
5
5
5
5
6
8
5
6
6
5
10
10
5
6
6
5
5
5
5
5
1
200
150
120
130
100
200
50
100
100
80
50
200
70
80
72
16
130
120
85
100
70
30
205
90
20
30
205
100
200
75
300
100
100
100
200
300
200
1 00
100
5
5
50
5
6
0
0
-10
+5
+5
-10
- 10
-5
.,.40
-40
-10
+5
0
0
+10
0
0
-10
-10
+10
+20
+5
+5
-10
0
0
-5
0
+15
-15
+5
+20
-5
-5
+10
0
-30
+5
-10
-5
-5
-5
0
-5
-5
300
275
...~ 250
c..)
V)
Cl)
.....
..; 225
~
a:
3:
200
.:
.,,
.,,
175
; 150
125
100 L-~---li-----+-~--+-~~-+-~~-1-~~-+-~~-1-~~4
20
15
10
25
30
35
40
TIME, SEC.
t: 1.0
vi
en
0
.....
...
0
.5
:z:
z
0
;:::
L)
...a:
0
BRANCH 23
40
-
...~ 30
- -
L)
- - - - - -
- --
en
Cl)
.....
...;
~
a:
20
~
.....
......
en
en
10
0
L-~---4-~-+~~--+-~~-+~~-+-~~--+-~--+-~--'
10
15
20
25
30
35
40
TIME. SEC.
58
January, 1973
HY 1
Branch
number
(1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
392.7
274.0
176.8
176.8
74.9
59 .3
59.3
101.9
97.1
118.7
134.2
75.3
42.1
27.4
47 .5
27. 9
27 .9
27 .9
108.2
43 .8
31.7
71.1
8.5
19.7
61.1
80.8
33.9
25 .3
1 2.1
15.6
11.8
1 9.7
8. 5
13.2
12.1
15.5
26.5
33.2
52.6
62.6
55. 6
69.5
90.3
90.3
114.7
HY 1
MATRIX METHOD
(1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
0.0
0.1 63
0.052
0.042
0.008
0. 004
0. 294
0. 213
0.387
0.575
1.884
0.375
0.048
0.321
1.085
0.881
0.196
1.591
1.843
0.982
0.609
2.106
0. 036
1.264
0.447
2. 022
0.539
2.079
0.479
0.305
0. 015
1.850
0. 047
0.109
0.239
0.022
0.093
3.468
1.655
2.335
0. 240
0.374
6.321
0. 631
1.218
0. 0
0. 239
0. 079
0.063
0.014
0.007
0.409
0.278
0.523
0.787
2. 249
0.500
0.068
0.402
1.341
1.105
0.245
1.996
2.267
1. 214
0.792
2.493
0.054
1 .604
0.605
2.201
0.638
2.474
0.627
0.429
0.021
2.348
0.074
0.146
0.313
0. 024
0.115
4.338
2. 012
2.791
0.272
0.412
6.696
0. 669
1.249
Ref. 19
Branch
number
(4)
392.7
271.1
173.7
173.7
73.9
58.3
58 .3
99.8
97.5
121.3
133.8
76.7
42.9
26.7
47.5
28. 0
28 .0
28.0
107.9
43 .5
31.7
71.3
8 .8
19.5
61.7
81. 2
33.4
24.6
11.9
15.7
10.8
19.5
8 .8
12.7
11.9
12.5
23 .1
33.7
52.4
62.5
55 .6
69.5
90.3
90.3
114.7
59
al ft = 0.305 m.
Ref. 19
(4)
0.0
0.23
0. 08
0.06
0. 01
0.01
0.40
0.27
0.52
0.77
2.20
0.49
0. 07
0.39
1.31
1.08
0.24
1.96
2.22
1.19
0.78
2.44
0. 05
1.57
0.59
2.1 6
0. 63
2.43
0.61
0.43
0.02
2.30
0.07
0.14
0.31
0.02
0.11
4.25
1.97
2.74
0. 27
0.40
6.56
0. 66
1. 22
60
January, 1973
HY 1
agreement with those of Ref. 19, which is also based on the same formula.
This close agreement between this analysis and Ref. 19 verifies the correctness of the new technique presented herein. The apparent discrepancy between two frictional head losses (for branch numbers 5 and 6) is most likely
due to data round- off in Ref. 19.
3. Referring to the numerical stability analysis presented earlier, and
noting that the system minimum time constant, based on steady-state flow, is
2 sec (for branch 26), it can be concluded that the application of a constant
time increment equal to 2.0/20 or h = 0.1 sec throughout the analysis ensures
a convergent solution for the problem at hand. Setting h = 0.1 sec, the steadystate conditions are reached after 482 iterations with a relative flow convergence error of less than 0.0006. Decreasing the time increment to h = 0.05
sec does not appreciably change the dynamic results, while increasing the
time increment to h = 0.2 sec affects the system r esponse curves. This test
verifies the correctness of the numerical stability analysis presented earlier.
4. To provide a comparison between the computational time required by
this new method against the computer program presented in Ref. 19, both
programs were run on an RCA Spectra 70/45 digital computer. For the
steady- state analysis, as the dynamic behavior is of no interest, the time incre ment can be increased to the same order of the system minimum time
constant (3 sec) . This increase in the time increment changes the dynamic
response and speeds up the computer running time without adversely affecting
the steady- state results. The computer running time required to obtain
steady- state solutions for the aforementioned hydraulic network problem is
108 sec for the present program and 134 sec for the program presented in
Ref. 19. For problems in which tran sient behavior is of primary interest, the
running time is generally longer and = 0.36 sec for 1 sec of real time pe r
branch .
5. The dynamic curves shown in Figs. 2 and 3 have the following physical
significance. Assume that at time t = 0 the branch mass flow rates are those
typically indicated in the figures, and the input pressure and flow at branch 1
as well as the output flows at branches 30, 31, 32 , 34, and 35 remain constant.
The mass flow rate time histories in the system branches will then undergo a
transient behavior typically shown in the previously mentioned figure s and
will approach asymptotically to final steady-state values. In other words , in
the present study, both the steady- state and transient solutions are obtained
by a time-dependent dynamic analysis. Values of dependent variables at intermediate time points represent the actual system behavior during a transient and are, therefore, physically meaningful. In contra st, the Hardy Cross
and the direct solution methods obtain the final steady- state values after a
number of iterations (8). For these analyses, values of dependent variables
at these intermediate points have no physical significance. As stated earlier,
the initial values of branch flow rates are arbitrary provided that an initial
mass balance at each node is obtained.
CONCLUSIONS
A new technique for the steady- state and transient analyses of isothermal,
incompressible flow in networks is presented. In this method, the pressure
drop versus pressure, nodal continuity, and branch momentum equations are
HY 1
MATRIX METHOD
61
January, 1973
62
HY 1
18. Reisman, A., "On a Systematic Approach to the Analysis and Synthesis of Complex Systems
Involving the Unstea~y Flow of Fluids," American Society of Mechanical Engineers Publication
No. 64-WA / FE-36, 1964, pp. 1- 12.
19. Rosenhan, A. K. , "Computer Analysis of Flow in Pipe Networks,'' American Society of Mechanical
Engineers Publication No. 69-WA / PVP-9, 1%9, pp. 1-23.
20. Shamir, U., and Howard, C. D. D. , "Water Distribution Systems Analysis," Journal of the
Hydraulics Division, ASCE, Vol. 94, No. HYI , Proc. Paper 5758, Jan., 1968, pp. 219-234.
21. System / 360 Scientific Subroutine Package (360A-CM-03X) Version III, Programmer's Manual,
International Business Machine Corporation.
MATRIX METHOD
HY 1
om
Superscripts .
o = present value, and
T
63
= transpose
of matrix.