You are on page 1of 13

Head- and Flow-Based Formulations for Frequency

Domain Analysis of Fluid Transients in Arbitrary


Pipe Networks
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

John P. Vítkovský1; Pedro J. Lee2; Aaron C. Zecchin3; Angus R. Simpson, M.ASCE4; and Martin F. Lambert5

Abstract: Applications of frequency-domain analysis in pipelines and pipe networks include resonance analysis, time-domain simulation,
and fault detection. Current frequency-domain analysis methods are restricted to series pipelines, single-branching pipelines, and single-loop
networks and are not suited to complex networks. This paper presents a number of formulations for the frequency-domain solution in pipe
networks of arbitrary topology and size. The formulations focus on the topology of arbitrary networks and do not consider any complex
network devices or boundary conditions other than head and flow boundaries. The frequency-domain equations are presented for node
elements and pipe elements, which correspond to the continuity of flow at a node and the unsteady flow in a pipe, respectively. Additionally,
a pipe-node-pipe and reservoir-pipe pair set of equations are derived. A matrix-based approach is used to display the solution to entire
networks in a systematic and powerful way. Three different formulations are derived based on the unknown variables of interest that
are to be solved: head-formulation, flow-formulation, and head-flow-formulation. These hold significant analogies to different steady-state
network solutions. The frequency-domain models are tested against the method of characteristics (a commonly used time-domain model)
with good result. The computational efficiency of each formulation is discussed with the most efficient formulation being the head-
formulation. DOI: 10.1061/(ASCE)HY.1943-7900.0000338. © 2011 American Society of Civil Engineers.
CE Database subject headings: Hydraulic transients; Unsteady flow; Pipe networks; Numerical analysis; Fourier analysis.
Author keywords: Transients; Unsteady flow; Pipes; Networks; Numerical analysis; Fourier analysis.

Introduction response is transferred into a time-domain response. The technique


assumes that the system is driven by a discharge perturbation at the
The use of time-domain or frequency-domain analyses depends on downstream boundary and the solution requires a formulation of
the problem at hand. Suitable problems for frequency-domain the impedance equations for the particular system. Kim (2007,
analysis are those that are linear in nature or involve a small per- 2008) presented a matrix-based implementation of the impedance
turbation about a reference state. Frequency-domain analysis is method for a simple network, although the method is closely
used in applications such as resonance analysis (Chaudhry 1987; related to the transfer-matrix method.
Wylie and Streeter 1993), leakage detection (Ferrante and Brunone These applications, as described in the previous paragraph, have
2003; Lee et al. 2005a, b, 2006; Covas et al. 2005; Kim 2005, been limited to single pipelines, pipelines with single branches, and
2007, 2008), and blockage detection (Mohapatra et al. 2006a, b; single-loop networks. This paper derives different formulations for
Sattar et al. 2008). Additionally, certain time-domain solutions frequency-domain analysis for an arbitrary pipe network. For the
can be calculated via the frequency-domain solution allowing many purposes of clearly establishing the type of network considered
applications, which involve time-domain analyses, to utilize fre- in this paper, the network elements considered include pipes,
quency-domain analyses. Suo and Wylie (1989) presented the nodes, demands, and reservoirs. Excitation to the system can be
impulse response method (IMPREM) where the frequency-domain made through perturbations in either demand (or flow) at a junction
or head at a reservoir. Analysis in the frequency domain, for a
1
Hydrologist, Hydrology Group, Water Planning Sciences, Environ- suitable problem, can be efficient and accurate provided that the
ment and Resource Sciences, Dept. of Environment and Resource Manage- nonlinearities involved are small. Additionally, frequency-domain
ment, Queensland Government, Australia (corresponding author). E-mail: analysis allows convenient inclusion of unsteady friction and vis-
John.Vitkovsky@derm.qld.gov.au
2
Lecturer, Dept. of Civil Engineering, Univ. of Canterbury, Christch-
coelastic behavior where their solution is efficient. The solution for
urch, New Zealand. a transient response, when calculated using frequency-domain
3
Lecturer, School of Civil and Environmental Engineering, Univ. of analysis, requires the solution of the system response at many
Adelaide, Adelaide, Australia. single frequency components; therefore, it is desirable that each
4
Professor, School of Civil and Environmental Engineering, Univ. of frequency component be solved as efficiently as possible. Three
Adelaide, Adelaide, Australia. sets of network equations are derived in this paper: the continuity
5
Professor, School of Civil and Environmental Engineering, Univ. of of flow at a node, the unsteady-state equations of continuity and
Adelaide, Adelaide, Australia. motion for a pipe, and pipe-node-pipe and reservoir-pipe pairs.
Note. This manuscript was submitted on December 8, 2008; approved
From those three sets of equations, three formulations are derived
on October 8, 2010; published online on April 15, 2011. Discussion period
open until October 1, 2011; separate discussions must be submitted for based on solutions for the complex perturbations in heads and flow,
individual papers. This paper is part of the Journal of Hydraulic Engineer- heads only, and flow only. The computational merits of each for-
ing, Vol. 137, No. 5, May 1, 2011. ©ASCE, ISSN 0733-9429/2011/5-556– mulation and similarities to steady-state solution formulations are
568/$25.00. discussed.

556 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568


Background of hydraulic elements such as leaks, pumps, valves, etc. Addition-
ally, there is no consideration of column separation, fluid–structure
The analysis of pipelines in the frequency domain (which also interaction, minor losses, or convective terms, etc. This paper is
includes Laplace domain analysis) began in the 1950s (summarized primarily concerned with the problem of finding the frequency-
in Goodson and Leonard 1972; Stecki and Davis 1986). This work domain solution for an arbitrarily configured and basic network.
was typically limited to a single pipeline. The development of As a matter of nomenclature, uppercase denotes a full variable
general frequency-domain solutions in more complicated pipelines in the time domain, lowercase denotes a perturbation variable in
involves two main methodological streams. The first method is the time domain, and lowercase with a caret denotes a perturbation
the transfer-matrix method (Chaudhry 1970, 1987). This method variable in the frequency domain.
develops field matrices, which relate to the solution along the pipe,
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

and point matrices that consider junctions, hydraulic devices,, and Network Quantities
changes in pipe characteristics. A block diagram is used to formu-
late the matrices, usually by hand, for more complicated systems The network considered consists only of pipes, junctions, reser-
like pipes in series, single-branches, and single loops. While these voirs, and demand nodes. For an arbitrary network the quantities
units could be manipulated to solve small and restricted problems of each of these components are linked by
(limited to networks that do not have second-order loops), in a com- np ¼ nn þ nr þ nl  nc ð1Þ
plex network, the number of units required can quickly become
overwhelming. The second method is the impedance method where np = number of pipes; nn = number of nodes; nr = number of
(Wylie 1965; Wylie and Streeter 1993). This method solves for reservoirs; nl = number of loops; and nc = number of (separate)
the impedance that is equal to the complex head perturbations components. This relationship is useful when considering the top-
divided by the complex flow perturbations. Again, this method ology of an entire network. An arbitrary network consists of pipe
is usually formulated for each system by hand, and although is (links) and node elements. The following sections define the rela-
useful in forming explicit relationships in simple systems, it is tionships for these elements.
poorly suited to complex network analysis.
The behavior of various hydraulic devices and phenomena in the Frequency-Domain Equations for Node Elements
frequency-domain has been addressed by many authors. Chaudhry The head is common at a node and can be either known or
(1987) and Wylie and Streeter (1993) present a summary of solu- unknown. Also, a node element represents a junction of pipes
tions for different hydraulic elements, such as valves, orifices, and and demands. The continuity of flow is applied for pipes, p,
junctions. Suo and Wylie (1990a) present solutions for viscoelastic connected to node k as
pipe material. Viscoelasticity was incorporated using a frequency- X
dependent wave speed. Similarly, Suo and Wylie (1990b) present Qp;k ¼ Dk ð2Þ
p
frequency-domain solutions for rock-walled tunnels. Unsteady fric-
tion has been dealt with by, among many others, Brown (1962) and where Qp;k = flow into node k from pipe p; and Dk = demand out of
D’Souza and Oldenburger (1964). Vítkovský et al. (2003) present node k. Each pipe requires an arbitrarily set flow direction (not
frequency-domain solutions for weighting function-type unsteady related to the actual flow direction). In terms of continuity, pipe
friction models. Finally, Tijsseling (1996) presents a number of flows are taken as positive into a node and demands are positive
studies where fluid-structure interaction has been considered in out of a node. Taking the perturbation of Q and D about steady-
the frequency (or Laplace) domain. state conditions as q ¼ Q  Q0 and d ¼ D  D0 , gives the continu-
In terms of network analysis, Wylie and Streeter (1993) present ity of perturbations at node k.
the frequency-domain solution for a simple network, although not X
expressed in an arbitrary way for general network analysis. Other qp;k ¼ d k ð3Þ
network-type analyses do not directly consider the frequency- p
domain solution but are nonetheless relevant. Ogawa et al. (1994) The Fourier transform gives the frequency-domain continuity at
present frequency-domain solutions in networks with respect to the node k
effect of earthquakes on water distribution networks. They used a X
matrix-based approach, but were solving for different response ^qp;k ¼ d^k ð4Þ
p
modes resulting from sinusoidal ground movement. Shimada et al.
(2006) present an exploration into numerical error for time-line The relationship in Eq. (4) is now complex-valued and repre-
interpolations in pipe networks. Although this work relates to errors sents the continuity of flow at a node for different frequency
in time-domain methods, the errors are assessed in the frequency- components.
domain where exact solutions exist. More recently, Kim (2007,
2008) presents a more generic approach to the application of the Frequency-Domain Equations for Pipe Elements
impedance method in networks but with respect to a particular net- Each pipe element represents the behavior of unsteady pipe
work. Recently, Zecchin et al. (2009) formulated a Laplace-domain flow between two nodes. The equations of continuity and motion
network admittance matrix formulation of the fundamental network for unsteady pipe flow, including unsteady friction and a viscoelas-
equations, which shares a similarity to the ^h-formulation derived in tic pipe material (Wylie and Streeter 1993; Gally et al. 1979;
this paper. Vítkovský et al. 2006), are
The remainder of this paper presents a systematic, matrix-based  
approach for frequency-domain analysis in arbitrary pipe networks. ∂H a20 ∂Q α0 ρ0 D0 a20 ∂H ∂J r
þ þ  ðtÞ ¼ 0 ð5Þ
∂t gA0 ∂x e0 ∂t ∂t
Formulations for Frequency-Domain Analysis
 
∂H 1 ∂Q f 0 QjQj 16v ∂Q
The formulations for the frequency-domain solution investigated in þ þ þ  W 0 ðtÞ ¼ 0 ð6Þ
this paper consider a simplified network. There is no consideration ∂x gA0 ∂t 2gD0 A20 gD20 A0 ∂t

JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011 / 557

J. Hydraul. Eng., 2011, 137(5): 556-568


where H = head; a = wave speed; g = gravitational acceleration; and where the viscoelastic component RV is
D = pipe diameter; A = pipe cross-sectional area; e = pipeline thick-
ness; ρ = fluid density; α = pipe restraint coefficient; ν = kinematic iωα0 ρ0 D0 a20 ^J r
RV ¼ ð16Þ
viscosity; J r = retarded component of creep compliance function; e0
W = unsteady friction weighting function; x = distance along pipe;
and t = time. The subscript “0” on some variables denote that it is The elastic wave speed is
based on an initial or steady-state value. The operator “∗” repre- sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
sents convolution. Taking a perturbation in flow (q ¼ Q  Q0 )  
K α0 D0 J e K 1
and head (h ¼ H  H 0 ) and linearizing the steady friction term, a0 ¼ 1þ ð17Þ
ρ0 2e0
the equations of continuity and motion become
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

  where J e = elastic component of the creep compliance function


∂h a2 ∂q α0 ρ0 D0 a20 ∂h ∂J r
þ 0 þ  ðtÞ ¼ 0 ð7Þ (J e ¼ 1=E, where E = Young’s modulus of elasticity); and α0 =
∂t gA0 ∂x e0 ∂t ∂t dimensionless pipe constraint coefficient, which depends on the
relative pipe wall thickness e0 =D0 , Poisson’s ratio of the pipe wall
  material, and the type of pipe anchoring. Note that for elastic pipe
∂h 1 ∂q f 0 jQ0 j 16v ∂q materials, such as steel, cast iron, copper, etc., the convolution term
þ þ qþ 2  W 0 ðtÞ ¼ 0 ð8Þ
∂x gA0 ∂t gD0 A20 gD0 A0 ∂t in Eq. (5) is removed making the term RV in Eqs. (12) and (13)
equal to zero, and the constant α0 =2 in Eq. (17) can be replaced
Taking the Fourier transform with respect to time and simplify- by C 1, resulting in the more common form of the equations of con-
ing the resulting equation gives the following frequency-domain tinuity and motion for unsteady pipe flow (Wylie and Streeter
equations for a pipe element: 1993). Eq. (11) can be directly compared to the field matrix for
a pipe element in the transfer-matrix method (Chaudhry
!
1970, 1987).
α0 ρ0 D0 a20 ω2 ^J r ^ a2 d ^q
iω  hþ 0 ¼0 ð9Þ
e0 gA0 dx Frequency-Domain Equations for an Arbitrary Network
The preceding sections have presented the relationships for individ-
! ual node elements and pipe elements. This section outlines how
d ^h iω f jQ j iωvW
^ 0 16 those elements can be combined and organized for an arbitrary net-
þ þ 0 02 þ ^q ¼ 0 ð10Þ work of pipes. A topological matrix-based approach is considered
dx gA0 gD0 A0 gD20 A0
allowing the presentation of relationships that apply to an entire
network.
where i = imaginary unit; and ω = angular frequency. Eqs. (9) and The organization of all node elements is considered first, essen-
(10) are a set of coupled ordinary differential equations with full tially specifying flow continuity at all nodes in a network. The
derivatives only in space (x). The transfer-matrix solution for this complex unknown upstream and downstream flow perturbations
system of coupled ODEs can be derived for a pipe element (p) for each pipe written as column vectors are
relating the upstream (U) head and flow to the downstream (D)
head and flow for given frequency perturbation as ^D ¼ f^qD1 ; …; ^qDnp gT
q ^U ¼ f^qU1 ; …; ^qUnp gT
q ð18Þ
( )  ( )
ð^qD Þp coshðγp Lp Þ Z 1
p sinhðγp Lp Þ
ð^qU Þp The complex demand perturbations at each node written as
¼
ð^hD Þj;p Z p sinhðγp Lp Þ coshðγp Lp Þ ð^hU Þk;p a column vectors are

ð11Þ ^ ¼ fd^1 ; …; d^nn gT


d ð19Þ

where L = pipe length; propagation constant Two topological matrices are required that define if a pipe
is connected to a node by its downstream or upstream end.
iω pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi These pipe-node incidence matrices are defined as B1D and B1U ,
γ¼ ð1 þ RS þ RU Þð1 þ RV Þ ð12Þ
a0 respectively.

and where the characteristic impedance Z is 1 if pipe p enters node k
ðB1D Þpk ¼
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 0 otherwise
a0  ð20Þ
Z¼ ð1 þ RS þ RU Þð1 þ RV Þ1 ð13Þ 1 if pipe p exits node k
gA0 ðB1U Þpk ¼
0 otherwise
and where the steady friction component RS is
Using Eqs. (18)–(20), the frequency-domain nodal continuity
8 equations [Eq. (4)] can be written in matrix form as
< 32ν
for laminar flow
iωD20
RS ¼ f 0 jQ0 j ð14Þ
: iωD for turbulent flow ^D  B1TU q
B1TD q ^U ¼ d
^ ð21Þ
0 A0

In a similar manner, the relationships for all pipe elements in a


and where the unsteady friction component RU is network can be written in matrix form. The complex unknown head
perturbations at each node written as a column vector are
ν16W
^0
RU ¼ ð15Þ
2
D0 ^ ¼ f^h1 ; …; ^hnn gT
h ð22Þ

558 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568


The complex known head perturbations at each reservoir written set of equations into matrix form gives
as a column vector are
2 38 9
^r ¼ f^r1 ; …; ^rnr gT ð23Þ B1TD B1TU 0nn <q
^D =
4 Inp c z1 s B1U 5 q
^U
: ^ ;
An additional topological matrix is required to relate the con- 0np z s c B1U  B1D h
nectivity of pipes and reservoirs. Two pipe-reservoir incidence 8 9
matrices, B2D and B2U respectively, are defined for pipes that < ^
d =
connect to a reservoir by its downstream or upstream end. ¼ z1 s B2U ^r ð27Þ
: ;
ðB2D  c B2U Þ^r

Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

1 if pipe p enters reservoir k


ðB2D Þpk ¼
0 otherwise
 ð24Þ This can be written in a simplified form as
1 if pipe p exits reservoir k
ðB2U Þpk ¼
0 otherwise 8 9
<q
^D =
^ U ¼ Nqh
Mqh q ð28Þ
Using Eqs. (20) and (22)–(24), the frequency-domain pipe : ^ ;
h
element equations for an entire network [Eq. (11)] can be written
in matrix form as
The matrix Mqh is complex, sparse, and asymmetric. Both Mqh
^U  z1 sðB1U h
^D ¼ c q
q ^ þ B2U ^rÞ and Nqh depend on frequency, although some elements of each are
ð25Þ independent of frequency. The number of unknowns, and hence the
^ þ B2D^rÞ ¼ zs q
ðB1D h ^ þ B2U ^rÞ
^U þ cðB1U h size of Mqh , is 2np þ nn.
^-Formulation
Frequency-Domain h
The matrices c and s are diagonal matrices that represent the
hyperbolic functions cosh and sinh for each pipe (for completeness The second formulation is the ^h-formulation. This formulation
t represents the tanh function, which is used later), and the diagonal begins by rearranging the pipe element equations from Eq. (25)
matrix z represents characteristic impedance for each pipe, that is, in terms of the complex flow perturbations, that is,

c ¼ diag½coshðγ1 L1 Þ; …; coshðγp Lp Þ ^U ¼ ðzsÞ1 ½ðc B1U  B1D Þh


q ^ þ ðc B2U  B2D Þ^r
ð29Þ
s ¼ diag½sinhðγ1 L1 Þ; …; sinhðγp Lp Þ ^D ¼ ðzsÞ1 ½ðB1U  c B1D Þh
q ^ þ ðB2U  c B2D Þ^r
t ¼ diag½tanhðγ1 L1 Þ; …; tanhðγp Lp Þ
z ¼ diag½Z 1 ; …; Z p  ð26Þ
Substituting the result into the node element equations
[Eq. (21)] gives the solution of the complex head perturbations as
Eqs. (21) and (25) define all of relationships for all of the node
and pipe elements in an arbitrary pipe network. This set of equa- ½B1TD ðztÞ1 B1D  B1TD ðzsÞ1 B1U  B1TU ðzsÞ1 B1D
tions can be solved for different frequency inputs, allowing the
development of the frequency response function. This paper con- þ B1TU ðztÞ1 B1U h
^
siders three different formulations for the frequency-domain solu-
¼ ½B1TD ðzsÞ1 B2U þ B1TU ðzsÞ1 B2D ^r  d
^ ð30Þ
tion. All formulations are organized into the generic linear system
AX ¼ B that can be solved using existing complex matrix solvers.
Comments relating to the solution efficiency of each formulation Written in a simplified form as
are discussed.
^ ^ ¼ Nh ð31Þ
Frequency-Domain q^h-Formulation Mh h
^
The first formulation is the ^qh-formulation, which solves for the
complex flow and head perturbations. This is the most straightfor- The structure of the Mh matrix can affect how efficiently the
ward approach that uses Eqs. (21) and (25) as they are. Putting this linear solution can be solved. The Mh matrix is constructed as

X
nd
ðMh Þjj ¼ ½Z p tanhðγp Lp Þ1 for all pipes p connected to node j
p
8 P
<  ½Z p sinhðγp Lp Þ1 for all pipes p connecting node j to node k
ðMh Þjk ¼ p
:
zero if node j is not connected to node k
¼ ðMh Þkj ð32Þ

JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011 / 559

J. Hydraul. Eng., 2011, 137(5): 556-568


The matrix Mh is complex, sparse, and symmetric and shares The flows in pipes joined at a common node can be equated to
these similarities with the H-formulation for the steady-state solu- form a set of equations representing pairs of pipes joined by a
tion (as discussed later). The number of unknowns, and hence the common head, i.e., the PNP pairs. Fig. 1(a) shows an example
size of Mh , is nn. The Nh vector can be constructed as of a node connected to four pipes. Also shown is a graph (in
X the mathematical sense) of all of the possible pipe pairings called
for all pipes p connecting
ðNh Þj ¼ d^j þ ^r k ½Z p sinhðγp Lp Þ1 the complete graph [see Fig. 1(b)]. If the degree of the node is
p
node j with reservoir k dn, then the total number of pipe pairings is ð1=2Þðdn2  dnÞ. This
ð33Þ complete set of pipe pairings would form an overdetermined set of
equations in terms of pipe pairs, but all that is required is a set of
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

Both Mh and Nh are functions of frequency. Once the complex pipe pairs that are nondegenerative when solving the linear system.
head perturbations have been determined, the complex flow pertur- A nondegenerative set of PNP pairs can be found by finding any
bations can be calculated using Eq. (29). spanning tree of the complete graph. In a pipe network sense, the
set of PNP and RP pairs must form a continuous coverage across
Frequency-Domain q^-Formulation the whole network (no isolated areas). For a node with dn pipes
The final formulation is based on solving for the complex flow connected to it, the minimum number of nondegenerative PNP
perturbations. The ^q-formulation begins by rearranging the pipe pairs is dn  1, from a total number of possible nondegenerative
element equations in Eq. (25) such that all known and unknown PNP-pair sets of dndn2 .
complex head perturbations are on the left side of the relationship A logical method to generate a nondegenerative set of PNP pairs
and all unknown complex flow perturbations are on the right: is to (1) selectively consider each node in order of node number;
(2) determine the degree of the node (how many pipes are con-
^ þB2U ^r ¼ zs1 ð^
B1U h qD  c q
^U Þ nected); (3) select the pipe with the lowest pipe ID number and
ð34Þ form a set of pairs with that pipe and all other pipes connected
^ þ B2D^r ¼ zs1 ðc q
B1D h ^D  q
^U Þ to the node; and then (4) move to the next node and repeat. An
example of this approach gives the selected spanning tree shown
Together with the node element equations, Eq. (34) can be in Fig. 1(c).
reformulated to link both the upstream and downstream complex The total number of PNP pairs depends on the connectivity of
flow perturbations between two pipes, provided they are connected the network as does the number of RP pairs; however, the sum of
by a common node or reservoir. There arises the need to generate all PNP and RP pairs must equal 2np  nn. The PNP pairs can be
of the pipe-node-pipe (PNP) pairs and reservoir-pipe (RP) pairs in defined in matrix form by first defining the following topological
an arbitrary network. incidence matrices B3D , and B3U for pipe-pairs as

8
<1 if the 1st pipe p in PNP pair k enters common node
ðB3D Þpk ¼ 1 if the 2nd pipe p in PNP pair k enters common node
:
0 otherwise
8 ð35Þ
<1 if the 1st pipe p in PNP pair k exits common node
ðB3U Þpk ¼ 1 if the 2nd pipe p in PNP pair k exits common node
:
0 otherwise

The PNP-pair equations [a rearrangement of Eq. (34)] can be The RP pair equations can be written [a rearrangement of
written in the following form: Eq. (34)] in the following form:

ðB3TD c þ B3TU Þzs1 q


^ D  ðB3TD þ B3TU cÞzs1 q
^U ¼ 0 ð36Þ ðB4TD c þ B4TU Þzs1 q
^ D  ðB4TD þ B4TU cÞzs1 q
^U ¼ B5T ^r ð38Þ

Similarly, the RP pairs can be defined in matrix form by first The ^q-formulation uses the node-element equations, the PNP-
defining the topological incidence matrices B4D , B4U , and B5 pair, and RP pair equations, Eqs. (21), (36), and (38), respectively.
for RP pairs: Putting the set of equations into matrix form gives

 2 3
1 if pipe p in RP pair k enters reservoir B1TD B1TU  
ðB4D Þpk ¼ ^
q
0 otherwise 4 ðB3T c þ B3T Þzs1 ðB3TD þ B3TU cÞzs1 5 D
 D U ^U
q
1 if pipe p in RP pair k exits reservoir ðB4TD c þ B4TU Þzs1 ðB4D þ B4U cÞzs
T T 1
ðB4U Þpk ¼ ð37Þ 8 9
0 otherwise < d ^ =

1 if pipe connects reservoir j in RP pair k ¼ 0 ð39Þ
ðB5Þjk ¼ : T ;
0 otherwise B5 ^r

560 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568


Pipes Sharing a Complete Graph on The first validation is performed on a simple pipeline (Fig. 2)
Common Node dn Labeled Nodes
(degree of node, dn = 4) (by pipe number)
with parameters given in Vítkovský et al. (2006). The pipeline is
bounded by a known head at one end and a perturbed flow at the
other end. Three cases are considered: (1) steady-state friction only,
2 1 2
1 H (2) steady and unsteady friction, and (3) steady friction, unsteady
friction, and a viscoelastic pipe material. The results are shown in
Figs. 3–5, respectively, for the frequency response function at the
5
4 flow boundary (node 2). The weighting function model for the
(a) 4 5 (b)
unsteady friction is from Vardy and Brown (2003, 2004). The creep
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

All Spanning Trees in Complete Graph compliance function is for polyethylene at 25°C from Gally et al.
on dn Labeled Nodes

1
1 2

0.3 m/s
(+perturbation)

Fig. 2. Example pipeline (data from Vítkovský et al. 2006)

6
10

(c)
5
10
) (m)/(m /s)
3

No. possible pipe pairs = ½(dn 2–dn) = 6


No. pipe pairs required to form a non-degenerative set = dn–1 = 3
No. possible non-degenerative sets of pipe pairs = dndn–2 = 16 104

Fig. 1. Pipe pairings around a node in example network


abs(

103
Written in a simplified form as Frequency-Domain Solver
  2
Time-Domain Solver (MOC)
^D
q 10
Mq ¼ Nq ð40Þ 0 5 10 15 20 25 30
^U
q
(rad/s)

The matrix Mq is complex, sparse, and asymmetric. The number Fig. 3. Frequency- and time-domain solutions for example pipeline
of unknowns, and hence the size of Mq , is 2np. A difference with steady friction only
between the ^q-formulation and the other two formulations is that
only the Mq matrix depends on frequency. The Nq matrix is inde-
pendent of frequency and would need to be calculated only once for
6
the full calculation of the transfer function. Once the complex 10
upstream and downstream flow perturbations have been solved,
Eq. (25) can be used to calculate the complex head perturbations.
5
10
abs( Θ ) (m)/(m /s)
3

Numerical Verification
104
The previous section presents three formations for the frequency-
domain solution of an arbitrary pipe network. This section pro-
^

vides numerical verification of those formulations [Eqs. (27),


(30), and (39)]. Because all formulations produce exactly the same 103
solution, no comparison in terms of accuracy can been made among Frequency-Domain Solver
the methods. However, the validity of the frequency-domain solu- Time-Domain Solver (MOC)
tion can be tested against a rigorously tested time-domain method. 102
In this paper, the method of characteristics (MOC) is used generate 0 5 10 15 20 25 30
the frequency response function for validation. The perturbation ω (rad/s)
size was kept small to not incur errors from the linearization of
Fig. 4. Frequency- and time-domain solutions for example pipeline
nonlinear terms. Additionally, a very finely discretised MOC dia-
with steady and unsteady friction only
mond grid was used to reduce numerical error.

JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011 / 561

J. Hydraul. Eng., 2011, 137(5): 556-568


6
10 11 pipes and 7 nodes that are supplied from a single reservoir
(node 1) and supplies two demands (nodes 4 and 6). The system
is excited by a perturbation in the demand at node 6. Fig. 7 shows
5
10 the match between the frequency-domain and time-domain analy-
abs( Θ ) (m)/(m /s)

ses for the head response at node 6.


3

Both validations show an excellent match between the


104 frequency-domain and time-domain analyses. Of course, this is to
be expected as both analyses are solving the same set of equations.
^
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

103
Discussion of Frequency-Domain Analysis
Frequency-Domain Solver
Time-Domain Solver (MOC) This section provides a further discussion of frequency-domain
102 analysis in arbitrary networks. This includes the properties of
0 5 10 15 20 25 30 frequency-domain network matrices, a comparison to steady-state
ω (rad/s)
analysis in arbitrary networks, and the efficiency of frequency-
Fig. 5. Frequency- and time-domain solutions for example pipeline domain formulations.
with steady and unsteady friction and viscoelastic pipe material
Properties of Frequency-Domain Network Matrices
During the formulation of the frequency-domain solution, a number
of matrices were defined. Selected properties of these matrices are
now discussed. Consider the diagonal matrices that contain the
hyperbolic functions for each pipe in a network, c, s, and t, which
1 7
are related by

c2  s2 ¼ Inp t ¼ sc1 ð41Þ


1 3 9 6
Many topological matrices share relationships based on basic
system connectivity ideas. The matrices B1, B2, B3, and B4 share
4 20 L/s relationships by noticing that no pipe can simultaneously enter a
2 5 (+perturbation) reservoir and enter a node at the same time, giving

B1TD B2D ¼ 0 B1TD B4D ¼ 0


ð42Þ
4 B3TD B2D ¼ 0 B3TD B4D ¼ 0

Similarly, no pipe can simultaneously exit a reservoir and exit a


58 L/s node, giving
Fig. 6. Example pipe network (data from Liggett and Chen 1994) B1TU B2U ¼ 0 B1TU B4U ¼ 0
ð43Þ
B3TU B2U ¼ 0 B3TU B4U ¼ 0
(1979). As observed, the frequency-domain analysis and the
Additionally, the B5U , B5D , and B5 matrices can be formed
time-domain analysis match.
from existing matrices B2U , B2D , B4U , and B4D as
The second validation considers a small pipe network from
Liggett and Chen (1994), as shown in Fig. 6. This network has B5D ¼ B2TD B4D
ð44Þ
B5U ¼ B2TU B4U
5
10
Similar relationships can be found in topological matrices for
4
steady-state analysis [see Eqs. (89) and (90)]
10
abs( Θ ) (m)/(m /s)

Comparison to Steady-State Analysis


3

3
10 Given that both steady-state analysis and frequency-domain analy-
sis can be performed in networks sharing the same topology, it
comes as no surprise that some matrices from both analyses are
102
^

related. The appendix outlines three formulations (head, flow,


and loop) for the steady-state solution in an arbitrary pipe network.
101 The relationship between the B1D and B1U matrices and the steady-
Frequency-Domain Solver state topological node incidence matrix A1 [see Eq. (53)] is
Time-Domain Solver (MOC)
100 A1 ¼ B1D  B1U ð45Þ
0 5 10 15 20
ω (rad/s) The relationship between the B2D and B2U and the steady-state
topological reservoir incidence matrix A2 [see Eq. (57)] is
Fig. 7. Frequency- and time-domain solutions for example pipe
network A2 ¼ B2D  B2U ð46Þ

562 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568


Other similarities occur in the shape of the linear systems of reservoir-pipe connections, and nruc = number of reservoir-pipe
formed when finding solutions in terms of heads (or complex head connections that connect at the upstream end of the pipe). In terms
perturbations). The Mh matrix in the ^h-formulation [Eq. (30)] has of the network in Fig. 6, the percentage of nonzero elements in M is
elements in identical locations to the JH of the steady-state 11, 67, and 17% for the ^q^h-, ^h-, and ^q-formulations, respectively.
H-formulation [see Eq. (83)] and the P matrix of the steady-state Another efficiency consideration is that some of the formula-
QH-formulation [see Eq. (74)]. Zecchin et al. (2009) term the JH tions, in particular the ^q^h-and ^q-formulations, have significant
matrix a “hydraulic admittance matrix” because it maps from pres- frequency-independent parts of their M matrix. These parts would
sure to flow. A more in-depth comparison of the element locations only be required to be computed once when solving for different
common to the formulations can be observed in Eq. (32) and frequencies, thus saving time. Table 1 shows relationships for the
Eq. (84). The similarity occurs when a node-pipe incidence matrix
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

number of frequency-independent and frequency-dependent ele-


is multiplied by its transpose. The resulting matrix is sparse and ments of M. In terms of the network in Fig. 6, the percentage
symmetric, and in the case of the steady-state formulation is of frequency-independent elements compared with the nonzero
positive definite. elements in M is 51, 0, and 25% for the ^q^h-, ^h-, and ^q-formulations,
Other similarities are that the formulation for the frequency- respectively.
domain ^q-formulation [see Eq. (39)] and the steady-state With regard to the solution of the linear equations, the condition
Q-formulation [see Eq. (85)] are sparse and asymmetric. Both number of M provides information about the computability of their
formulations require node-element equations (continuity around solution using numerical methods. If the condition number is
a node); however, the steady-state formulation adds the loop smaller than ∼106 , then the solution is computable using single-
equations (head-loss corrections around a loop), whereas the precision variables; and if the condition number if less than
frequency-domain formulation adds the pipe-node-pipe pair and ∼1012 , then the solution is computable with double-precision
reservoir-pipe pair equations. Both the frequency-domain ^q^h- variables. Fig. 8 shows the condition number for each formu-
formulation [see Eq. (27)] and the basic steady-state QH- lation across a range of frequencies for the network in Fig. 6.
formulation [see Eq. (70)] are sparse and asymmetrical. The ^h-formulation has the smallest condition numbers and should
be most amenable to numerical solution. The ^q^h-formulation has
Computational Considerations the largest condition numbers and should be computed using
Given the three different formulations, a number of factors relate double-precision variables.
the linear solution to its computational efficiency, the most impor- It is trivial to solve for intermediate locations along a pipe from
tant being the number of unknowns of the linear system (see a known ^h and ^q using Eq. (11). Hence, it is only necessary to
Table 1). In general, for a dense matrix, the solution complexity solve for points in a network where there is a change in the pipe’s
is Oðn3 Þ, whereas for a sparse matrix, the use of sparse matrix properties or there is a hydraulic device. Therefore, trimming those
solvers will give a comparatively faster solution approaching intermediate points that do not represent a change in pipe properties
Oðn2 Þ. A small increase in the dimensionality of the problem
results in a large increase in computational effort. This means that
the ^h-formulation, with the smallest number of unknowns, will be 10
16

the computationally fastest formulation. Timing of the frequency- qh-Formulation


domain analysis for the network in Fig. 6 gave the ^h-formulation as 1014 h-Formulation
the fastest, followed by the ^q-formulation (43% slower), and the 12 q-Formulation Double Precision Limit
10
Condition Number

^q^h-formulation (60% slower), although this is generally problem


dependent. (Note that the timings were performed by running 1010
10,000 simulations on a PC with an Intel Core2 Duo CPU running Single Precision Limit
Microsoft Vista. Relative measures are utilized to negate 108
PC-specific results.) 10
6

For moderate and large networks, the M matrices are sparse.


Sparse-matrix solvers should be used for efficient solutions. Most 104
sparse solvers have a preconditioning (or reordering) phase that 2
10
would only need to be performed once because the topology of
the M matrix does not change for different frequencies. An addi- 100
tional computational saving can be made for the ^h-formulation, 0 5 10 15 20
which has a symmetric M matrix that could be exploited. ω (rad/s)
Sparse-matrix solvers also reduce the amount of memory required
Fig. 8. Condition number of coefficient matrix for example pipe
to solve large matrices. General relationships for the number of
network
nonzero elements of M are shown in Table 1 (where nrc = number

Table 1. Properties of Coefficient Matrix M


Matrix M property ^q^h-formulation ^h-formulation ^q-formulation
Unknowns 2np þ nn nn 2np
Total elements ð2np þ nnÞ2 nn2 ð2npÞ2
Nonzero elements 8np  2nrc  nruc 2np þ nn  2nrc 10np  4nn  3nrc
Frequency-independent elements 4np  2nrc þ nruc 0 2np  nrc
Frequency-dependent elements 4np  2nruc 2np þ nn  2nrc 8np  4nn  2nrc

JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011 / 563

J. Hydraul. Eng., 2011, 137(5): 556-568


(and their associated ^h and ^q) from the linear system will reduce its f p Lp
size thus increasing computational efficiency. The intermediate ðH 0 Þk;p  ðH 0 Þj;p ¼ ðQ0 Þp jðQ0 Þp j ð48Þ
2gDp A2p
points are then calculated using Eq. (11) after the linear system
has been solved. A third set of equations can be formulated based on the property
that head loss around a loop is equal to zero. A WDS has two types
of loops: simple loops and path loops. The simple loop is an
Conclusions internal loop of pipes. The equation that describes the summation
This paper presents formulations for the frequency-domain solution of the head loss in pipes p around a simple loop l is
in arbitrary pipe networks. The formulations focus on the topology X f p;l Lp;l
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

of arbitrary networks and do not consider any complex network 2


ðQ0 Þp;l jðQ0 Þp;l j ¼ 0 ð49Þ
devices or boundary conditions, other than head and flow bounda- p 2gDp;l Ap;l
ries. The frequency-domain equations are derived for pipe net-
works, including the effects of unsteady friction and viscoelastic There are many different simple loops that can be defined for a
pipe material. A topological-matrix-based approach is useful to network; however, they form a nondegenerative set (sometimes
organize the system of equations. Three sets of equations have been called a fundamental cycle basis). Typically, the set of loops that
derived: (1) node element equations, (2) pipe element equations, contain the smallest number of pipes is most desirable, the number
and (3) pipe-node-pipe pair and reservoir-pipe pair equations. of which is nl. The path loop considers the head loss around a loop
Three formulations: the ^q^h-, ^h-, and ^q-formulations, are derived containing two reservoirs linked by a path. The head difference
and their various merits discussed. Of the three formulations, the between the reservoirs acts like an additional head loss element.
^h-formulation should be the most computationally efficient and The head loss in pipes p between reservoirs k and j around a path
accurate. The frequency-domain solution formulations share many loop l is
characteristics with the steady-state solution formulations, allowing X f p;l Lp;l
the reuse of some of the topological matrices. The systematic 2
ðQ0 Þp;l jðQ0 Þp;l j ¼ ðR0 Þk;l  ðR0 Þj;l ð50Þ
approach for the frequency-domain solution in pipes networks pre- p 2gDp;l Ap;l
sented in this paper does not consider other hydraulic elements,
such as valves, pumps, leaks, air vessels, etc., or other boundary There are many different combinations of reservoirs and pipe-
condition types. It is envisaged that future research will consider paths that constitute a set of path loops. Again, the multiple path
these other hydraulic elements and boundary conditions, although loops must form a nondegenerate set with the number of path loops
their incorporation may not be straightforward. The calculation equal to np  nn  nl.
of the frequency response function is integral to other transient ana-
lysis applications, e.g., resonance studies, time-domain simulation Steady-State Equations for an Arbitrary Network
(IMPREM), and fault-detection methods, which will benefit from The three basic relationships (node elements, pipe elements, and
the methods presented in this paper. loop elements) for the steady-state solution in an arbitrary pipe net-
work are written in matrix-form in this section. The node elements,
representing flow continuity, are considered first. The unknown
Appendix: Formulations for Steady-State Analysis steady-state flows for each pipe are
This section contains a basic derivation of different formulations for Q0 ¼ fðQ0 Þ1 ; …; ðQ0 Þnp gT ð51Þ
the steady-state solution for arbitrary pipe networks. The section’s
purpose is for comparison against the different frequency-domain The known steady-state demands at each node are
solution formulations. The following sections outline the basic
equations and three different solution formulations. Note that the D0 ¼ fðD0 Þ1 ; …; ðD0 Þnn gT ð52Þ
loop flow correction formulation for steady-state analysis is not
presented here. The topological node-pipe incidence matrix A1 is defined as
8
Steady-State Basic Equations <1 if pipe p enters node k
The equations of WDS analysis are based on three relationships. A1pk ¼ 0 if pipe p and node k are not connected ð53Þ
:
The first considers flow continuity at a node, which is a statement 1 if pipe p exits node k
of the conservation of mass. The sign convention adopted is that
all flows entering a node are positive and flows exiting a node Using Eqs. (51)–(53), the flow continuity around a node
are negative. Given the sign convention, the summation of the flows [Eq. (47)] for an arbitrary pipe network can be written in matrix-
entering and exiting a node must equal zero (no accumulation of form as
mass). The continuity equation applied at a node k (or junction) for
pipes p is A1T Q0 ¼ D0 ð54Þ

X In a similar manner, the head loss for all pipe elements in a net-
ðQ0 Þp;k ¼ ðD0 Þk ð47Þ work can be written in matrix form. The unknown steady-state
p heads at each node are

H0 ¼ fðH 0 Þ1 ; …; ðH 0 Þnn gT ð55Þ


The second equation for WDS analysis describes the head loss
attributable to friction along a pipe. For a particular pipe in a WDS, The known heads at each reservoir are
the Darcy-Weisbach head loss relationship (including reservoirs)
for pipe p from node k to node j is R0 ¼ fðR0 Þ1 ; …; ðR0 Þnr gT ð56Þ

564 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568


The topological reservoir-pipe incidence matrix A2 is defined where G1 is a positive-valued diagonal matrix that is dependent on
as Q0 and is defined as
8
<1 if pipe p enters reservoir k " #
A2pk ¼ 0 if pipe p and reservoir k are not connected ð57Þ f p Lp
: G1 ¼ diag jðQ0 Þp j p ¼ 1; …; np ð59Þ
1 if pipe p exits reservoir k 2gDp A2p

The head loss for each pipe [Eq. (48)] for an arbitrary pipe
network can be written in matrix-form as Finally, the loop equations are considered. The loop-pipe inci-
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

dence matrix (for both simple and path loops) for pipes p that
A1H0 þ A2R0 ¼ G1Q0 ð58Þ belong to loop l is defined as

8
<1 if pipe p belongs to loop l and its direction is with the loop direction
A3pl ¼ 0 if pipe p does not belong to loop l ð60Þ
:
1 if pipe p belongs to loop l and its direction is against the loop direction

The direction of the path linking two reservoirs in a loop is defined as identical to the simple loop’s direction. The loop-reservoir incidence
matrix for reservoirs k that belong to loop l is defined as
8
<1 if reservoir k belongs to loop l and its path exits the reservoir
A4kl ¼ 0 if reservoir k does not belong to loop l ð61Þ
:
1 if reservoir k belongs to loop l and its path enters the reservoir

The head loss for both the simple and path loops are written in Rearranging for δX gives
matrix form for an entire network as
δX ¼ J1 ðXk ÞYðXk Þ ð66Þ
A3 G1Q0 þ A4 R0 ¼ 0
T T
ð62Þ The final set of unknowns is calculated by addition of δX to
Xk as
The number of loop equations (including path loops) is equal to
np  nn. Eqs. (54) and (62) form the basis for formulation to solve Xsolution ¼ Xk þ δX ð67Þ
the steady state in an arbitrary network.
If the vector of functions YðXÞ is linear, then the solution vector
Steady-State Solution Algorithm of variables is
The three steady-state solution formulations are considered in Xsolution ¼ Xk  J1 ðXk ÞYðXk Þ ð68Þ
this section: the Q-formulation, the H-formulation, and the QH-
formulation. Unlike the frequency-domain equations, the set If the vector of functions YðXÞ is nonlinear, then the vector of
of steady-state equations are nonlinear. The Newton-Raphson variables X is iterated using the formula
algorithm can be used to determine a set of unknown variables from
Xkþ1 ¼ Xk  J1 ðXk ÞYðXk Þ ð69Þ
a set of nonlinear equations. The iterative solution by the Newton-
Raphson algorithm is derived by making a Taylor-series expansion The Newton-Raphson algorithm exhibits quadratic convergence
of a set of nonlinear functions YðXÞ about some initial vector of in the neighborhood of the solution. The iterative solution pro-
variables Xk [such that YðXk ) does not need to equal zero] as cedure concludes when convergence criteria are met. The most
computationally intensive component of the Newton-Raphson
YðXk þ δXÞ ¼ YðXk Þ þ JðXk ÞδX þ OðδX2 Þ ð63Þ algorithm is dealing with the inversion or decomposition of the
Jacobian matrix. The following sections consider the form of
Ignoring the higher-order terms and assuming that the perturba- the Jacobian derived for each formulation.
tion of Xk by δX, results in the correct steady-state solution [i.e.,
YðXk þ δXÞ ¼ 0] produces Steady-State QH-Formulation
The first formulation considers the solution of both heads and flows
0 ¼ YðXk Þ þ JðXk ÞδX ð64Þ simultaneously. The two relationships required to form a solvable
system are Eqs. (54) and (58), which can be written in matrix
where J is the Jacobian matrix that is defined as form as
    
∂ G1 A1 Q0 A2 R0
JðXÞ ¼ YðXÞ ð65Þ ¼ ð70Þ
∂X A1T 0 H0 D0

JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011 / 565

J. Hydraul. Eng., 2011, 137(5): 556-568


where both Q0 and H0 are required to be solved. Rearranging Then, ðH0 Þkþ1 is used to calculate ðQ0 Þk þ 1 by
Eq. (70) gives a set of nonlinear equations Y, the roots of which
can be solved for using the Newton-Raphson algorithm 1
ðQ0 Þkþ1 ¼ ðQ0 Þk  Tk ðA1ðH0 Þkþ1 þ A2R0 Þ ð77Þ
     2
G1 A1 Q0 A2 R0
YQH ¼ þ ð71Þ
A1T 0 H0 D0
Steady-State H-Formulation
The Jacobian matrix is equal to An alternative to the Q-formulation is to formulate the WDS equa-
  tions in terms of the heads. To achieve this, Eq. (48) is rearranged in
terms of the flows as
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

2G1 A1
JQH ¼ ð72Þ
A1T 0  
f p Lp 0:5 h i

0:5

ðQ0 Þp ¼ 2
ðH 0 Þ k;p  ðH 0 Þ j;p ðH 0 Þk;p  ðH 0 Þj;p
The Jacobian matrix in Eq. (72) is sparse and symmetric for the 2gDp Ap
Darcy-Weisbach head-loss formulation used in this paper, but can ð78Þ
be a difficult to invert or decompose. A more efficient way to deal
with the Jacobian matrix was shown by Todini and Pilati (1988), For an entire network, the matrix-based form of Eq. (48) in
which was originally based on the Content Model (Collins et al. terms of H is
1978). Todini and Pilati developed an efficient approach to the
inversion of the Jacobian matrix by partitioning, as Q0 ¼ G2ðA1H0 þ A2R0 Þ ð79Þ
 1  
T1 A1 T  T A1 P1 A1T T T A1 P1 where the positive valued diagonal matrix G2 is defined as
¼ ð73Þ
A1T 0 P1 A1T T P1 " !0:5 #
f p Lp
G2 ¼ diag jðH 0 Þk;p  ðH 0 Þj;p j p ¼ 1; …; np
where the positive diagonal matrix G1 is dependent on Q0 , and 2gDp A2p
where the submatrices T and P are defined as
ð80Þ
P ¼ A1T T A1 and T ¼ ð2G1Þ1 ð74Þ
Now that a relationship exists for the flows in terms of the heads,
The critical and time-consuming step in the inversion of the this relationship can be substituted in the continuity equation
Jacobian matrix is inverting the submatrix P. The matrix P is sym- [Eq. (54)] giving
metric, diagonally dominant, has positive diagonal elements, has
A1T G2ðA1H0 þ A2R0 Þ þ D0 ¼ 0 ð81Þ
either zero or negative off-diagonal elements, and is positive def-
inite and of the Stieltjes type. Also, for large networks, P is sparse.
The preceding set of equations represents the steady-state equa-
Todini and Pilati (1988) suggest the use of the ICF/MCG algorithm
tions for a WDS in terms of the heads. Rearranging gives the set of
for the efficient inversion of P
functions Y for the Newton-Raphson algorithm as
X
ðPÞjj ¼ n1 G11 ii for all pipes i connected to node j YH ¼ A1T G2ðA1H0 þ A2R0 Þ þ D0 ð82Þ
i
( 1 P 1
n G1ii for all pipes i connecting node j to node k The Jacobian matrix for the Newton-Raphson algorithm is
ðPÞjk ¼ i  
zero if node j is not connected to node k 1
JH ¼ A1T G2 A1 ð83Þ
2
¼ ðPÞkj ð75Þ
The matrix JH is symmetric, diagonally dominant, has positive
The method of solution is applied in the following steps. First, diagonal elements, and has either zero or negative off-diagonal
the following system of equations is solved for ðH0 Þkþ1 as elements and is, therefore, positive definite and of Stieltjes type.
Also, for large networks JH is sparse. After solving for the heads,
1 the solution flows can be calculated using Eq. (58). More directly,
Pk ðH0 Þkþ1 ¼ A1T ðQ0 Þk  D0  A1T Tk A2R0 ð76Þ
2 the matrix JH is defined as

X
nd
ðJH Þjj ¼ n1 G2pp for all pipes p connected to node j
p
( Pnd
n1 p G2pp for all pipes p connecting node j to node k
ðJH Þjk ¼
zero if node j is not connected to node k
¼ ðJH Þkj ð84Þ

This matrix is similar to the Jacobian matrix in the QH-formulation. In fact, both are of identical dimension and have identically located
elements, which is obvious since both have similar components (i.e., P ¼ A1T ðG11 ÞA1 and JH ¼ A1T ½ð1=2ÞG2A1).

566 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568


Steady-State Q -Formulation d = perturbation in demand;
E = Young’s modulus of elasticity;
Rearranging the basic WDS equations to be in terms of the flows
e = pipe wall thickness;
only produces the Q-formulation. The Q-formulation considers the
f = Darcy-Weisbach friction factor;
continuity equations [Eq. (54)] and the head loss around a loop
G1, G2 = steady-state diagonal matrices for steady friction
equations [Eq. (62)], both of which are only dependent on Q0 .
components;
Eqs. (54) and (62) can be written in a matrix form as
g = gravitational acceleration;
   
A1T D0 H = head (unknown head);
Q ¼ ð85Þ h = perturbation in head (unknown head);
A3T G1 0 A4T R0
I = identity matrix; pffiffiffiffiffiffiffi
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

In terms of the Newton-Raphson algorithm, the set of functions i = imaginary unit ð¼ 1Þ;
Y is J = Jacobian matrix (Newton-Raphson algorithm);
    Je = elastic component of the creep compliance function;
A1T D0 Jr = retarded component of the creep compliance function;
YQ ¼ Q 0 þ ð86Þ
A3T G1 A4T R0 K = bulk modulus of elasticity of fluid;
L = pipe length;
and the Jacobian is M = coefficient matrix;
 
A1T N = right-hand-side vector/matrix;
JQ ¼ ð87Þ
A3T 2G1 nc = number of network components;
nd = degree of node;
The Jacobian for the Q-formulation is sparse, but neither nl = number of loops;
symmetric nor positive definite. nn = number of nodes (unknown heads);
np = number of pipes;
Steady-State Matrix Relationships nr = number of reservoirs (known heads);
Some relationships exist between the steady-state topological nrc = number of reservoir-pipe connections;
matrices. Substituting Eq. (58)–(62) results in nruc = number of reservoir-pipe upstream connections;
Q = flow (unknown flow);
A3T A1H0 þ A3T A2R0 ¼ A4T R0 ð88Þ q = perturbation in flow (unknown flow);
R = reservoir head (known head);
By observation, the following relationships can be realized: RS = steady friction coefficient;
RU = unsteady friction coefficient;
A3T A2 ¼ A4T ð89Þ
RV = viscoelastic coefficient;
r = perturbation in reservoir head (known head);
s, c, t, z = frequency-domain diagonal matrices for sinh, cosh,
A3T A1 ¼ 0 ð90Þ
tanh, and Z components;
Although not presented here, other graph-theoretic relationships T, P = steady-state matrices for Todini and Pilati algorithm;
exist for topological matrices, such as derivation of the A3 and A4 T, Y = steady-state solution matrices (Newton-Raphson
pipe-loop incidence matrices from the pipe-node incidence matri- algorithm);
ces A1 and A2. t = time;
W = weighting function;
x = distance;
Z = characteristic impedance;
Notation α = pipe constraint coefficient;
γ = propagation constant;
The following symbols are used in this paper: ρ = density of liquid;
A = cross-sectional pipe area; ν = kinematic viscosity; and
A1 = steady-state topological matrix (pipe-node incidence); ω = angular frequency.
A2 = steady-state topological matrix (pipe-reservoir Subscripts
incidence);
D = downstream end of pipe;
A3 = steady-state topological matrix (pipe-loop incidence);
H = relating to the steady-state H-formulation;
A4 = steady-state topological matrix (reservoir-loop
h = relating to the frequency-domain ^h-formulation;
incidence);
Q = relating to then steady-state Q-formulation;
a = wave speed;
QH = relating to the steady-state QH-formulation;
B1 = frequency-domain topological matrix (pipe-node
q = relating to the frequency-domain ^q-formulation;
incidence);
qh = relating to the frequency-domain ^q^h-formulation;
B2 = frequency-domain topological matrix (pipe-reservoir
U = upstream end of pipe; and
incidence);
0 = initial or steady-state quantity.
B3 = frequency-domain topological matrix (common node
pipe-pair incidence);
B4 = frequency-domain topological matrix (reservoir pipe-
pair incidence); References
B5 = frequency-domain topological matrix (reservoir pipe-
pair incidence); Brown, F. (1962). “The transient response of fluid lines.” J. Basic Eng.,
D = pipe diameter, demand; 84(3), 547–553.

JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011 / 567

J. Hydraul. Eng., 2011, 137(5): 556-568


Chaudhry, M. H. (1970). “Resonance in pressurized piping systems.” Ogawa, N., Mikoshiba, T., and Minowa, C. (1994). “Hydraulic effects on a
J. Hydraul. Div., 96(9), 1819–1839. large piping system during strong earthquakes.” J. Pressure Vessel
Chaudhry, M. H. (1987). Applied hydraulic transients, Van Nostrand Technol., 116(2), 161–168.
Reinhold, New York. Sattar, A. M., Chaudhry, M. H., and Kassem, A. A. (2008). “Partial block-
Collins, M., Cooper, L., Helgason, R., Kennington, J., and Le Blanc, L. age detection in pipelines by frequency response method.” J. Hydraul.
(1978). “Solving the pipe network analysis problem using optimization Eng., 134(1), 76–89.
techniques.” Manage. Sci., 24(7), 747–760. Shimada, M., Brown, J., Leslie, D., and Vardy, A. (2006). “Time-line in-
Covas, D., Ramos, H., and Almeida, A. B. (2005). “Standing wave differ- terpolation errors in pipe networks.” J. Hydraul. Eng., 132(3), 294–306.
ence method for leak detection in pipeline systems.” J. Hydraul. Eng., Stecki, J. S., and Davis, D. C. (1986). “Fluid transmission-lines—
131(12), 1106–1116. Distributed parameter models: 1. A review of the state-of-the-art.”
D’Souza, A. F., and Oldenburger, R. (1964). “Dynamic response of fluid Proc., Inst. Mech. Eng. Part A—J. Power Energy, 200(4), 215–228.
Downloaded from ascelibrary.org by UNICAMP - Universidade Estadual De Campinas on 09/09/22. Copyright ASCE. For personal use only; all rights reserved.

lines.” J. Basic Eng., 86, 589–598. Suo, L., and Wylie, E. B. (1989). “Impulse response method for frequency-
Ferrante, M., and Brunone, B. (2003). “Pipe system diagnosis and leak dependent pipeline transients.” J. Fluids Eng., 111(December), 478–
detection by unsteady-state tests: Harmonic analysis.” Adv. Water 483.
Resour., 26, 95–105. Suo, L., and Wylie, E. B. (1990a). “Complex wavespeed and hydraulic
Gally, M., Güney, M., and Rieuford, E. (1979). “An investigation of transients in viscoelastic pipes.” J. Fluids Eng., 112(4), 496–500.
pressure transients in viscoelastic pipes.” J. Fluids Eng., 101, 495–499. Suo, L., and Wylie, E. B. (1990b). “Hydraulic transients in rock-bored
Goodson, R. E., and Leonard, R. G. (1972). “A survey of modeling tunnels.” J. Hydraul. Eng., 116(2), 196–210.
techniques for fluid line transients.” J. Basic Eng., 94, 474–482. Tijsseling, A. S. (1996). “Fluid-structure interaction in liquid-filled pipe
Kim, S. (2007). “Impedance matrix method for transient analysis of systems: A review.” J. Fluids Struct., 10, 109–146.
complicated pipe networks.” J. Hydraul. Res., 45(6), 818–828. Todini, E., and Pilati, S. (1988). “A gradient algorithm for the analysis of
Kim, S. H. (2005). “Extensive development of leak detection algorithm by pipe networks.” Computer applications in water supply, Research Stud-
impulse response method.” J. Hydraul. Eng., 131(3), 201–208. ies Press, Letchworth, Hertfordshire, UK, 1–20.
Kim, S. H. (2008). “Address-oriented impedance matrix method for generic Vardy, A. E., and Brown, J. M. B. (2003). “Transient turbulent friction in
calibration of heterogeneous pipe network systems.” J. Hydraul. Eng., smooth pipe flows.” J. Sound Vib., 259(5), 1011–1036.
134(1), 66–75. Vardy, A. E., and Brown, J. M. B. (2004). “Transient turbulent friction in
Lee, P. J., Lambert, M. F., Simpson, A. R., Vítkovský, J. P., and Liggett, fully-rough pipe flows.” J. Sound Vib., 270(1-2), 233–257.
J. A. (2006). “Experimental verification of the frequency response Vítkovský, J. P., Bergant, A., Lambert, M. F., and Simpson, A. R. (2003).
method for pipeline leak detection.” J. Hydraul. Res., 44(5), 693–707. “Frequency-domain transient pipe flow solution including unsteady
Lee, P. J., Vítkovský, J. P., Lambert, M. F., Simpson, A. R., and Liggett, friction.” Pumps, electromechanical devices, and systems applied to
J. A. (2005a). “Frequency-domain analysis for detecting pipeline urban water management, E. Cabrera and E. Cabrera Jr., eds.,
leaks.” J. Hydraul. Eng., 131(7), 596–604. International Association for Hydro-Environment Engineering and
Lee, P. J., Vítkovský, J. P., Lambert, M. F., Simpson, A. R., and Liggett, Research (IAHR), Valencia, Spain, 773–780.
J. A. (2005b). “Leak location using the pattern of the frequency Vítkovský, J. P., Stephens, M. L., Bergant, A., Simpson, A. R., and
response diagram in pipelines: A numerical study.” J. Sound Vib., Lambert, M. F. (2006). “Numerical error in weighting function-based
284(3), 1051–1073. unsteady friction models for pipe transients.” J. Hydraul. Eng., 132(7),
Liggett, J. A., and Chen, L.-C. (1994). “Inverse transient analysis in pipe 709–721.
networks.” J. Hydraul. Eng., 120(8), 934–955. Wylie, E. (1965). “Resonance in pressurized piping systems.” J. Basic Eng.,
Mohapatra, P. K., Chaudhry, M. H., Kassem, A. A., and Moloo, J. (2006a). 87, 960–966.
“Detection of partial blockage in single pipelines.” J. Hydraul. Eng., Wylie, E. B., and Streeter, V. L. (1993). Fluid transients in systems,
132(2), 200–206. Prentice-Hall, Englewood Cliffs, NJ.
Mohapatra, P. K., Chaudhry, M. H., Kassem, A. A., and Moloo, J. Zecchin, A. C., Simpson, A. R., Lambert, M. F., White, L. B., and
(2006b). “Detection of partial blockages in a branched piping system Vítkovský, J. P. (2009). “Transient modeling of arbitrary pipe networks
by the frequency response method.” J. Fluids Eng., 128(5), 1106– by a Laplace-domain admittance matrix.” J. Eng. Mech., 135(6), 538–
1114. 547.

568 / JOURNAL OF HYDRAULIC ENGINEERING © ASCE / MAY 2011

J. Hydraul. Eng., 2011, 137(5): 556-568

You might also like