The process involved in the proposed leakage detection algorithm is briefly discussed in the pseudo code illustrated in Algorithm 1. The algorithm incorporates a leakage model into a classical water distribution network hydraulic simulation model to estimate the network flows, including leakage outflow at each node as well as at the pipe level. As shown in Algorithm 1, the process entails the hydraulic analysis of the water network and the leakage computation. The algorithm load and read the supplied water distribution network data and initialised. Afterwards, a hydraulic analysis is performed for such network based on the supplied data. The hydraulic analysis is achieved through modelling the water network topology and solving the resulting model using an iterative Newton-based methodology. During the hydraulic analysis of the network, the nodal leakage outflow is computed and the algorithm then checks if the estimated leakage outflow at the node is relatively low (or is less than a predefine tolerance), and if such is confirmed, it reports no leaking node as the flow rate in such node is less than tolerance or relatively low. Otherwise, it reports the leaking node number and search for all the pipes connected to this node. Thereafter, it computes the leakage flow in each pipe. Furthermore, it checks if the estimated leakage flow in each pipe is relatively high. Such pipe is tagged as critical pipes, the algorithm then recommends a pressure control along the critical pipes. In most cases, any pipe of the network with a relatively high background leakage flow above a predefine tolerance is tagged as a critical pipe where a pressure control or pressure adjustment is recommended.
3.1. WDN Topology and Model Formulation
A water distribution network (WDN) can be represented by a connected graph with a set of edges and a set of nodes. The former consist of pipes, pumps, and valves. The basic hydraulic equations describing the flow in a water distribution system are governed by two basic principles; namely the principle of mass continuity in the node and energy conservation around the hydraulic loop. For any water piping networks comprising of
b number of branches or pipes,
n number of junction nodes,
number of source nodes or fixed-grade nodes (nodes with known pressure heads), and
number of load nodes (nodes with unknown pressure heads), the total number of nodes in the network is
. The mass continuity equation can be written for each node, and the energy conservation equation can be written for any loop. Using graph theory, the continuity equation at any given node may be expressed as
where,
represents the column vector of nodal injection or demand and
is the column vector of pipe flows while
denotes the node-pipe connectivity matrix of dimension (
), whose elements are derived from
The node-pipe connectivity matrix
C may be decomposed into two sub-matrices as
where,
denotes the source node-pipe connectivity matrix of dimension (
) relating to the node with known pressure and
is the load node-pipe connectivity matrix of dimension (
) relating to the node with unknown pressure. If the pressure is given at the source nodes and demand (loads) are given at the load nodes, by decomposing Equation (
5) and writing the flow at the load nodes only
Furthermore, the energy conservation concerns the pressure drop across the pipes. For a closed loop, the pressure drop across the pipes may be expressed as
where
represents the loop-pipe incidence matrix and
m is the number of loops. The elements of matrix
D are derived from
In Equation (
9),
represents the pressure drop vector across the pipes.
The energy conservation may also be expressed as
where
denotes the column vector (dimension (
)) of the source pressure and
is the vector of the load pressure of dimension (
).
Another set of equations necessary for the solution of a piping network are the pipe-flow equations which relate the pressure drop across a given pipe to the flow in that pipe. Consider a network element shown in
Figure 1, with two end nodes
i and
g, the pressure drop due to the friction of the flow of water with the pipe wall is generally expressed as
where
and
are the pressure at both ends of the pipe,
is the flow in the pipe
j and
k represents the pipe hydraulic resistance.
Substituting
into Equation (
11)
If we define a matrix
A as
Equation (
13) may be written as
Both Equations (
8) and (
14) are the steady state hydraulic model to be solved to estimate the pipe flow and the pressure at the load node, given the pressure at the source node and the demand at the load node. The system of equations described by Equation (
15) is partly linear and partly non-linear.
Equation (
15) can be solved by an iterative method. The matrix
A is a diagonal matrix of dimension (
) whose elements are derived from the pressure drop relation as
Both
and
k depend on the pressure drop or head loss model used [
14,
63].
k is the vector of pipe hydraulic resistance, it depends on parameters as
where
represents the pipe equivalent roughness coefficient,
D is the pipe diameter,
L is the pipe length and
is the the pressure exponent whose value depends on the pressure drop or head loss model used (1.85 for Hazen-William (HW) and 2 for both Darcy-Weisbach (DW) or Chezy-Manning (CM) head loss model) [
14,
63].
In any event, using the DW or the HW model, the hydraulic resistance for the
pipe may be expressed as
for DW model, and
for HW model. In Equation (
18),
, and
g represent the frictional factor of the
pipe and the acceleration due to gravity. In Equation (
19),
denotes the Hazen-William friction coefficient for the
pipe. The variables
and
in both equations represent the length and diameter of the
pipe.
The pipe frictional factor
in Equation (
18) depends on the Reynolds number
as well as the equivalent roughness factor
and can be estimated using the Colebrook equation, the Jain’s formula or any other related expressions.
It is important to emphasize that in order to account for leakage flow in the model represented by Equation (
15), the demand vector
q comprises of the normal demand and the nodal leakage flows. That is,
where
denotes the vector of the normal nodal demand and
is the vector of the nodal leakage flow.
3.2. WDN Hydraulic Model Solution
The classical pipe network analysis problems is to find a set of flow
Q and the pressure
P in a water distribution network with the input (nodal injection or demand) and the source pressure known. The system of equation in (
15) may be solved applying Newton-Raphson iterative method. Define
as
with
, therefore,
The system of non-linear equation of
may be solved by Newton-Raphson (NR) iterative method. Thus, at every iteration “
”, the NR method is described as
where
J is the Jacobian matrix of the function
. For the function above, the Jacobian matrix is given by
where
is a diagonal matrix whose elements are the partial derivatives of pressure drop component
given as
. The elements of matrix
D for all the pipes in the network may be obtained as
Substituting the value of
J,
and
into Equation (
26), one may write
From Equation (
27), one may rewrite
and,
Multiplying both sides of Equation (
28) by
, one may write
Replacing
in Equation (
30), therefore
Define matrix
B (network admittance matrix) as
Equation (
31) may the be rewritten as
Therefore, the estimate of the pressure at each iteration “
” is obtained as
The admittance matrix
B used is highly sparse, symmetric and must be handled using an efficient sparsity techniques. From Equation (
28) as well, the estimate of the pipe flow at each iteration “
” may be expressed as
The Equations (
33) and (
34) give the iterative solution of the system of non-linear equation describe in Equation (
15). The Newton-Raphson method is known to give a fast convergence provided a good initial solution is available [
64]. The derived solution is closely similar to those obtained by [
65,
66,
67]. The matrices
and
are derived from the topology of the water distribution networks.
3.3. Integrating a Leakage Model
In water distribution networks (WDNs), leakage occurs at the nodes as well as along the pipes. Previous research works have shown that leakage depends on the network pressure, therefore, the pressure-leakage relationship is defined in the vector
. It should be noted that background leakage flow occurs continuously along the length of a pipe. If the leakage flow along a pipe
j is denoted by
, then
may be expressed as
where,
is the background leakage discharge coefficient of the
pipe,
is the length of the
pipe,
is the leakage-pressure exponent reported to be equivalent to 1.18 for background leakage [
68].
is the pressure in pipe
j computed as the mean of the pressure values at its end nodes.
In matrix form, defining a vector
as the vector of the leakage flow along all the pipes, then
where,
is the vector of empirical constants relating to background leakage parameter,
is the vector of the pipe length, and
is the vector of the average pressures along the pipes. The vector
may be expressed using the topological incidence matrix as
where,
is the absolute of the network incidence matrix
C, which gives a matrix of ones.
is the vector of the load node pressures.
If the vector of the nodal leakage is denoted by
, then the elements of
may be computed from the topological incidence matrix as