1 Introduction

Hydraulic simulation models of water distribution networks are invaluable for design and operation purposes. They help predict the properties of the flow including water quality under normal and abnormal operating conditions. Moreover, there is increasing emphasis on the application of hydraulic simulation models for solving optimisation problems by combining them with evolutionary algorithms (Kougias and Theodossiou 2013; Méndez et al. 2013; Dini and Tabesh 2014; Bragalli et al. 2016). The simulation models evaluate the equations for conservation of mass and energy and other properties such as nodal pressures (Seifollahi-Aghmiuni et al. 2013; Kang and Lansey 2014; Tao et al. 2014; Yang and Boccelli 2014; Laucelli and Giustolisi 2015; Kun et al. 2015). Evolutionary algorithms, by nature, often generate numerous infeasible candidate solutions. While conventional demand-driven hydraulic simulation models (Rossman 2000; Spiliotis and Tsakiris 2011) are incapable of simulating pressure-deficient conditions or infeasible solutions satisfactorily, pressure-driven models (Gorev and Kodzhespirova 2013; Tsakiris and Spiliotis 2014) do so realistically.

Evolutionary algorithms are essentially unconstrained optimisation procedures. On the other hand, many real world optimisation problems have multiple constraints and, consequently, the need for satisfactory approaches for incorporating constraints arises. Previous studies have demonstrated the benefits of explicitly maintaining infeasible solutions among the candidate solutions for single- and multi-objective constrained optimization problems (Singh et al. 2008; Ray et al. 2009). For example, some recent evolutionary optimization algorithms that retain infeasible solutions until the last generation achieved good results in terms of the convergence rate and quality of solutions (Siew and Tanyimboh 2012b; Saleh and Tanyimboh 2013, 2014).

Considering the optimization of real-world networks with hundreds or thousands of pipes, where the computational time for evaluating millions of candidate solutions to carry out multiple runs of an evolutionary algorithm could be prohibitive, a computationally efficient and robust pressure-driven simulation algorithm is vital. Very recently, Elhay et al. (2015) emphasized the urgent need for hydraulic models that are suitable for extreme operating conditions and/or extreme events e.g. electrical power failure and terrorist attacks.

The pressure-driven simulation algorithm in this article builds on the pressure-dependent extension of the EPANET hydraulic simulator, i.e. EPANET-PDX (Siew and Tanyimboh 2012a). EPANET-PDX has an integrated logistic nodal head-flow function (Tanyimboh and Templeman 2010) plus a line minimization procedure that facilitates convergence in the computational solution of the constitutive equations. This paper describes the EPANET-PDX algorithm in detail and addresses weaknesses uncovered under conditions of extremely low pressure (Seyoum 2015).

The modelling functionality of EPANET 2 (Rossman 2000) was preserved in full including extended period simulation and water quality modelling (Seyoum and Tanyimboh 2014). By contrast, some investigations into pressure-driven analysis (e.g. Kovalenko et al. 2014; Elhay et al. 2015) did not consider extended period simulation. Furthermore, they excluded key elements e.g. tanks, pumps and control devices. Control devices (e.g. pressure regulating valves) make the constitutive equations for water distribution systems difficult to solve due to convergence problems (Rossman 2007; Deuerlein et al. 2009; Kovalenko et al. 2014; Elhay et al. 2015). While Tanyimboh and colleagues (Tanyimboh et al. 2003; Tanyimboh and Templeman 2010) included pumps and control devices, extended period simulation was not considered. An extensive review of pressure-driven simulation and its applications is available in Abdy Sayyed et al. (2015). Other recent works on head-driven simulation include Elhay et al. (2015) and Sivakumar and Prasad (2015). Reviews of nodal head-flow relationships are available in Ciaponi et al. (2015) and Vairagade et al. (2015).

2 Formulation of The Pressure-Driven Simulation Model

The EPANET 2 hydraulic simulator (Rossman 2000) uses the global gradient algorithm (Todini and Pilati 1988) to solve the constitutive equations. Siew and Tanyimboh (2012a) extended the algorithm by enabling it to simulate pressure-deficient conditions realistically. The pressure dependent model known as EPANET-PDX integrates the continuous nodal head-flow function that Tanyimboh and Templeman (2010) proposed in the constitutive equations. The nodal head-flow function is

$$ Q{n}_i\left(H{n}_i\right)=Q{n}_i^{req}\frac{ \exp \left({\alpha}_i+{\beta}_iH{n}_i\right)}{1+ \exp \left({\alpha}_i+{\beta}_iH{n}_i\right)} $$
(1)

Its first derivative is

$$ \frac{dQ{n}_i\left(H{n}_i\right)}{dH{n}_i}=Q{n}_i^{req}{\beta}_i\ \frac{ \exp \left({\alpha}_i+{\beta}_iH{n}_i\right)}{{\left(1+ \exp \left({\alpha}_i+{\beta}_iH{n}_i\right)\right)}^2} $$
(2)

where, for node i, Qn i and Hn i are the flow and head, respectively; \( Q{n}_i^{req} \) is the demand; α i and β i are parameters that are determined by calibration with field data. A Monte Carlo simulation procedure for calibrating α i and β i is available in Ciaponi et al. (2015).

Tanyimboh and Templeman (2010) provided a generic procedure for estimating αi and βi that may be summarized briefly as follows.

$$ Q{n}_i\left(H{n}_i^{\min}\right)={\varepsilon}_1Q{n}_i^{req} $$
(3)
$$ Q{n}_i\left(H{n}_i^{req}\right)=\left(1-{\varepsilon}_2\right)Q{n}_i^{req} $$
(4)

where Hn i min and Hn i req are, respectively, the head below which flow at node i is unacceptably low or effectively zero, and above which the demand is satisfied in full effectively. ε1 and ε2 represent small tolerances that may be selected to suit the circumstances, for example, say ε 1 = 0.01 and ε 2 = 0.001 (as in Tanyimboh and Templeman 2010). Kovalenko et al. (2014) adopted ε 1 = ε 2 = 0.001. Self-evidently the two values need not be identical, and any suitable combination may be used. Eq. 3 implies that the available flow would be practically zero at \( H{n}_i\approx H{n}_i^{\min }. \) Similarly, Eq. 4 implies that the available flow would be practically satisfactory at \( H{n}_i\approx H{n}_i^{req}. \) Illustrative examples are available in Ciaponi et al. (2015).

Eq. 1 represents a family of curves, and ε 1 and ε 2 lead to values of α i and β i that adjust the shape of the nodal head-flow function in Eq. 1. Approximate values of α i and β i may be obtained by substituting the values of Hn i min, Hn i req, ε 1 and ε 2 in Eqs. 3 and 4 the solution of which provides the values of α i and β i . Following Tanyimboh and Templeman (2010), ε1 and ε2 were taken as 0.01 and 0.001, respectively.

The system of equations applied in the global gradient algorithm is

$$ \left[\begin{array}{ccc}\hfill {\boldsymbol{A}}_{11}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{12}\hfill \\ {}\hfill \cdots \hfill & \hfill \cdots \hfill & \hfill \cdots \hfill \\ {}\hfill {\boldsymbol{A}}_{21}\hfill & \hfill \vdots \hfill & \hfill 0\hfill \end{array}\right]\left[\begin{array}{c}\hfill \boldsymbol{Q}\boldsymbol{p}\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill \boldsymbol{H}\boldsymbol{n}\hfill \end{array}\right]=\left[\begin{array}{c}\hfill -{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill -\boldsymbol{Q}{\boldsymbol{n}}^{\boldsymbol{req}}\hfill \end{array}\right] $$
(5)

A 11 is a diagonal matrix whose elements are \( {K}_{ij}{\left(Q{p}_{ij}\right)}^{n_f-1} \); K ij and n f are the resistance coefficient and flow exponent in the head loss formula respectively; Qp ij is the flow rate in pipe ij. A 12 and A 10 are the incidence matrices relating the pipes to the nodes with unknown and known heads, respectively. The elements of the incidence matrices are: −1 for pipe flows away from a node, +1 for pipe flows towards a node and 0 for pipes that are not connected to the node under consideration. A 21 = (A 12)T is the transpose of A 12. Qp is the column vector of the unknown pipe flow rates. Hn and H 0 are column vectors for the unknown and known nodal heads, respectively. Qn req is the column vector for the required nodal supplies.

To incorporate the nodal head-flow function, Eq. 5 is re-formulated as

$$ \left[\begin{array}{ccc}\hfill {\boldsymbol{A}}_{11}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{12}\hfill \\ {}\hfill \cdots \hfill & \hfill \cdots \hfill & \hfill \cdots \hfill \\ {}\hfill {\boldsymbol{A}}_{21}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{22}\hfill \end{array}\right]\left[\begin{array}{c}\hfill \boldsymbol{Q}\boldsymbol{p}\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill \boldsymbol{H}\boldsymbol{n}\hfill \end{array}\right]=\left[\begin{array}{c}\hfill -{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill 0\hfill \end{array}\right] $$
(6)

A 22 is a diagonal matrix with elements Qn i (Hn i )/Hn i ; Qn i (Hn i ) is the nodal head-flow function in Eq. 1. Thus, Eq. 6 may be rearranged as.

$$ -\left[\begin{array}{ccc}\hfill {\boldsymbol{A}}_{11}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{12}\hfill \\ {}\hfill \cdots \hfill & \hfill \cdots \hfill & \hfill \cdots \hfill \\ {}\hfill {\boldsymbol{A}}_{21}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{22}\hfill \end{array}\right]\left[{\begin{array}{c}\hfill \boldsymbol{Q}\boldsymbol{p}\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill \boldsymbol{H}{\boldsymbol{n}}^k\hfill \end{array}}^k\right]+\left[\begin{array}{c}\hfill -{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill 0\hfill \end{array}\right]=-\left[\begin{array}{c}\hfill {\boldsymbol{f}}_1\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill {\boldsymbol{f}}_2\hfill \end{array}\right] $$
(7)

where the vectors f 1 = f 1(Qn, Hn) and f 2 = f 2(Qn, Hn) indicate the errors, for any given approximate solution (Qn, Hn)T; at the solution, both f 1and f 2 should be zero.

Considering Eq. 7, Eq. 6 may be solved by successive linearization using a first order Taylor series expansion that gives

$$ \left[\begin{array}{ccc}\hfill {\boldsymbol{D}}_{11}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{12}\hfill \\ {}\hfill \cdots \hfill & \hfill \cdots \hfill & \hfill \cdots \hfill \\ {}\hfill {\boldsymbol{A}}_{21}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{D}}_{22}\hfill \end{array}\right]\left[\begin{array}{c}\hfill \boldsymbol{Q}{\boldsymbol{p}}^{k+1}-\boldsymbol{Q}{\boldsymbol{p}}^k\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill \boldsymbol{H}{\boldsymbol{n}}^{k+1}-\boldsymbol{H}{\boldsymbol{n}}^k\hfill \end{array}\right]=-\left[\begin{array}{ccc}\hfill {\boldsymbol{A}}_{11}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{12}\hfill \\ {}\hfill \cdots \hfill & \hfill \cdots \hfill & \hfill \cdots \hfill \\ {}\hfill {\boldsymbol{A}}_{21}\hfill & \hfill \vdots \hfill & \hfill {\boldsymbol{A}}_{22}\hfill \end{array}\right]\left[\begin{array}{c}\hfill \boldsymbol{Q}{\boldsymbol{p}}^k\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill \boldsymbol{H}{\boldsymbol{n}}^k\hfill \end{array}\right]+\left[\begin{array}{c}\hfill -{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0\hfill \\ {}\hfill \cdots \hfill \\ {}\hfill 0\hfill \end{array}\right] $$
(8)

D 11 is a diagonal matrix of the derivatives of the pipe head losses with respect to the pipe flow rates, whose elements are \( n{K}_{ij}{\left(Q{p}_{ij}\right)}^{n_f-1} \); D 22 is a diagonal matrix of the derivatives of the nodal head-flow function with respect to the nodal heads, whose elements are described in Eq. 2; k is the iteration number. Eq. (8) gives the following routine for computing the nodal heads and pipe flows iteratively.

$$ \boldsymbol{H}{\boldsymbol{n}}^{k+1}={\boldsymbol{A}}^{-1}\boldsymbol{F} $$
(9)
$$ \boldsymbol{Q}{\boldsymbol{p}}^{k+1}=\boldsymbol{Q}{\boldsymbol{p}}^k-{\boldsymbol{D}}_{11}^{-1}\left({\boldsymbol{A}}_{11}\boldsymbol{Q}{\boldsymbol{p}}^k+{\boldsymbol{A}}_{12}\boldsymbol{H}{\boldsymbol{n}}^{k+1}+{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0\right) $$
(10)

In the above equations, i.e. Eq. 9 and 10,

$$ \boldsymbol{A}={\boldsymbol{A}}_{21}{\boldsymbol{D}}_{11}^{-1}{\boldsymbol{A}}_{12}-{\boldsymbol{D}}_{22} $$
(11)
$$ \boldsymbol{F}=-{\boldsymbol{A}}_{21}{{\boldsymbol{D}}_{11}}^{-1}{\boldsymbol{A}}_{11}\boldsymbol{Q}{\boldsymbol{p}}^k-{\boldsymbol{A}}_{21}{{\boldsymbol{D}}_{11}}^{-1}{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0-{\boldsymbol{D}}_{22}\boldsymbol{H}{\boldsymbol{n}}^k+{\boldsymbol{A}}_{22}\boldsymbol{H}{\boldsymbol{n}}^k+{\boldsymbol{A}}_{21}\boldsymbol{Q}{\boldsymbol{p}}^k $$
(12)

The procedure described above is for steady-state analysis. Extended period simulation may be carried out as described in Rossman (2000) and Siew and Tanyimboh (2010).

EPANET-PDX utilizes line minimization (Dennis and Schnabel 1996; Press et al. 2007) to help ensure global convergence in the computational solution of Eqs. 7 and 8. However, in an attempt to exploit the excellent computational properties of EPANET 2, the line minimization was not optimized in Siew and Tanyimboh (2012a). While the applications to date suggest that the strategy works well in general (Seyoum and Tanyimboh 2014; Siew et al. 2014, 2016), relatively poor and inconsistent performance was discovered subsequently, under conditions of extremely low pressure (Seyoum 2015). For the networks investigated, this corresponds roughly to a demand satisfaction of less than around 10 %.

The algorithm proposed herein allows unimpeded application of the line minimization procedure and, as a result, the computational efficiency is more consistent under all operating conditions. Overall, the number of minor iterations (i.e. iterations of the line minimization algorithm) has increased substantially while the number of major iteration (i.e. iterations of the global gradient algorithm) has decreased.

3 Details of The Computational Solution Procedure

The equations for conservation of energy and mass in Eq. 7 are:

$$ {\boldsymbol{f}}_1\left(\boldsymbol{H}\boldsymbol{n},\boldsymbol{Q}\boldsymbol{p}\right)={\boldsymbol{A}}_{11}\boldsymbol{Q}{\boldsymbol{p}}^k+{\boldsymbol{A}}_{12}\boldsymbol{H}{\boldsymbol{n}}^k+{\boldsymbol{A}}_{10}{\boldsymbol{H}}_0 $$
(13)
$$ {\boldsymbol{f}}_2\left(\boldsymbol{H}\boldsymbol{n},\boldsymbol{Q}\boldsymbol{p}\right)={\boldsymbol{A}}_{21}\boldsymbol{Q}{\boldsymbol{p}}^k+{\boldsymbol{A}}_{22}\boldsymbol{H}{\boldsymbol{n}}^k $$
(14)

Together, Eqs. 13 and 14 are a system of simultaneous non-linear equations, i.e. f = f(Hn, Qp) = (f 1 , f 2 )T, the solution of which is required. The aim of the line minimization procedure is to find an appropriate fraction λ of the Newton step δ = (δHn, δQp)T that decreases the function g in Eq. 15 sufficiently.

$$ g=\frac{1}{2}\boldsymbol{f}.\boldsymbol{f} $$
(15)

where f.f = f T f is the 2-norm of the vector of the system of equations f; δHn and δQp are the vectors of the changes in the nodal heads and pipe flow rates, respectively. Given the scaler λ, the nodal heads Hn are updated iteratively as

$$ \boldsymbol{H}{\boldsymbol{n}}^{k+1}=\boldsymbol{H}{\boldsymbol{n}}^k+\lambda .\boldsymbol{\delta} \boldsymbol{H}\boldsymbol{n};0<\lambda \le 1 $$
(16)

where k is the iteration number and δHn is the Newton step for the nodal heads. The pipe flow rates Qp k + 1 are then updated by substituting the newly obtained nodal heads Hn k + 1 into Eq. (10).

In each iteration of the global gradient algorithm, the full Newton step δ is attempted first. If the Newton step does not reduce the value of the function sufficiently, then backtracking along the Newton direction (i.e. the direction described by the elements of δ), aimed at obtaining a better approximate solution of f(Hn, Qp) = 0, is carried out. The acceptance criterion for the new iterate is (Press et al. 2007)

$$ g\left(\boldsymbol{H}{\boldsymbol{n}}^{k+1},\boldsymbol{Q}{\boldsymbol{p}}^{k+1}\right)\le g\left(\boldsymbol{H}{\boldsymbol{n}}^k,\boldsymbol{Q}{\boldsymbol{p}}^k\right)+\phi .\mathbf{\nabla}g.\boldsymbol{\delta}; 0<\phi <1 $$
(17)

where ϕ = 10−4(Dennis and Schnabel 1996; Press et al. 2007). g is the gradient of g(Hn, Qp)and δ = (δHn, δQp)T is the Newton step and direction. Thus, g.δ is the directional derivative or the rate of change of g(Hn,Qp) in the Newton direction δ. The initial rate of decrease of g(Hn,Qp) is given in Press et al. (2007) as

$$ \mathbf{\nabla}g.\boldsymbol{\delta} =\left(\boldsymbol{f}.\boldsymbol{J}\right).\left(-{\boldsymbol{J}}^{-1}.\boldsymbol{f}\right)=-\boldsymbol{f}.\boldsymbol{f} $$
(18)

where J is the Jacobian matrix that comprises the first partial derivatives of f = f(Hn, Qp) with respect to the nodal heads Hn i ,∀i, and pipe flow rates Qp ij ,∀ij.

Backtracking is carried out if g(Hn k + 1, Qp k + 1) fails to meet the acceptance criterion in Eq. (17). In the backtracking procedure, application of the updating scheme in Eq. (16) (i.e. Hn k + 1 = Hn k + λ . δ Hn; 0 < λ ≤1) converts g(Hn k+1, Qp k+1) into a function of λ only, g(λ). Backtracking seeks the value of λ that minimizes g(λ) and is accomplished by line minimization. In the first iteration of the line minimization, g(λ) is modelled as a quadratic function. If any additional iterations are required then g(λ) is modelled as a cubic function. The iterations continue until either Eq. (17) is satisfied or λ reaches a specified minimum allowable value λ min. Dennis and Schnabel (1996) and Press et al. (2007) employed λmin = 0.1 while Siew and Tanyimboh (2012a) used λ min= 0.2 to avoid excessively small steps. λ min= 0.2 was adopted herein. Details of the quadratic and cubic approximations of g(λ) and its solution are available in Press et al. (2007).

The flow chart in Fig. 1 shows the integration of the line minimization in the global gradient algorithm. The global gradient algorithm starts with initial estimates of the nodal heads and pipe flow rates. The nodal elevations are taken as the initial nodal heads while the initial pipe flow rates are derived from an assumed velocity of 1 ft./s (0.3048 m/s). In each iteration of the global gradient algorithm, the Euclidean norm of the energy and mass balance equations is checked.

Fig. 1
figure 1

Integration of line minimization in the global gradient algorithm (GGA)

It was observed that, in some cases, when λ reached λmin = 0.2, the norm failed to reduce in consecutive iterations. If this situation arises, the algorithm calculates a new Newton step i.e. δ = (δHn, δQp)T as a major iteration. Before doing so, however, the nodal heads are updated first with λ = λmin = 0.2 in Eq. 16 as shown Fig. 1. This additional measure was introduced to help prevent premature convergence as it enables the major iterations to resume from a different point by updating Hn without updating Qp at the same time. In the investigations herein, though rare, without this extra measure, there were instances of spurious convergence. False convergence may occur if a local minimum of Eq. 15, \( g={\scriptscriptstyle \frac{1}{2}}\boldsymbol{f}.\boldsymbol{f} \), is found that is not a root of Eq. 7, i.e. f = f(Hn, Qp) = 0 (Press et al. 2007).

The iterations of the global gradient algorithm continue until the convergence criteria are fulfilled. The EPANET-PDX convergence criteria of 0.001 ft. (3.048 × 10−4 m) for the maximum change in the nodal heads and 0.001 cubic feet per second (2.832 × 10−5 m3/s) for the maximum change in the pipe flow rates between successive iterations (Siew and Tanyimboh 2012a) were retained herein. The EPANET-PDX software was developed by upgrading the source code of EPANET 2.

4 Results and Discussion

Three examples are provided to illustrate the properties of the proposed algorithm. The first two are networks taken from literature, mainly to illustrate the performance in terms of the number of iterations and CPU time required for convergence. The third example demonstrates the effectiveness on a real-world network, based on extended period simulation under various operating conditions including extremely low pressure.

All the simulations were carried out on an Intel Xeon workstation (with two processors of CPU 2.4 GHz and RAM of 16 GB). For simplicity hereafter, the new algorithm is called EPANET-PDX (0.2) while the original EPANET-PDX is called EPANET-PDX (0.1). In all the simulations, the assumed head below which nodal flow is zero was taken as the nodal elevation. In all the examples considered, the previous and new algorithms yielded essentially identical solutions (i.e. nodal flows, nodal heads and pipe flows) while the latter required fewer, or the same number of, iterations of the global gradient algorithm, as illustrated in the Appendix (i.e. online supplementary data).

4.1 Steady State Analysis of Small Networks

Two examples were considered for illustration purposes, i.e. the six-loop and Anytown networks in Fig. 2. The first example relates to the network in Fig. 2a (Todini 2003) that has one source, 11 demand nodes, 17 pipes of length 500 m and Hazen-Williams roughness coefficient of 130. The elevations of the nodes are: 80 m for nodes 3 and 10; 85 m for nodes 4, 5, 7 and 9; 90 m for nodes 2, 6, 8 and 11; and 100 m for node 12. The demands in m3/s are: 0.01 for nodes 8 and 12; 0.04 for nodes 4, 9 and 11; and 0.05 for nodes 2, 5–7 and 10. The pipe diameters in mm are: 100 for pipes 7, 10, 13, 14, 16 and 17; 150 for pipes 3, 6, 9, 12 and 15; 200 for pipes 2, 5, 8 and 11; and 250 for pipes 1 and 4.

Fig. 2
figure 2

Topologies of the networks investigated

Steady-state simulations were performed as follows. (a) Simulations with assumed required residual pressures of 30 m, 20 m and 10 m at all the demand nodes with the source head fixed at 150 m. (b) Simulations with source heads of 150 m, 125 m, 100 m and 75 m with an assumed required residual pressure of 30 m at all the demand nodes. Table 1 summarises the computational performances of EPANET-PDX (0.1) and (0.2). Generally EPANET-PDX (0.2) required fewer iterations while the CPU times of both models were comparable. The nodal heads and flows of both models were essentially identical.

Table 1 Major iterations and CPU times for the network in Example 1

The second example is based on the “Anytown” network (Fig. 2b) used previously as a benchmark optimisation problem (Walski et al. 1987). Siew and Tanyimboh (2012a) modified the system and operational data to create a pressure-deficient condition. They set the diameter of pipes 10, 13, 14, 15, 16 and 25 as 0.3048 m (12 in); the diameters of the six pipes mentioned were to be determined in the optimization problem (Walski et al. 1987). Also, the demands at nodes 2, 4, 5, 9, 10, 12 and 15 were taken as 3.155 l/s. Additional data for the pipes and nodes are available in Walski et al. (1987). A water treatment plant supplies the network, with three identical pumps that operate in parallel. The water level in the treatment plant is fixed at 3.05 m (10 ft). The required pressure for all the demand nodes is 28.12 m (40 psi). The network has two storage tanks (Tanks 41 and 42). Herein, the pipes that connect the tanks to the network were closed.

Using the base demands, and taking the demand factors (i.e. the nodal demand multipliers) as 1.0, a steady-state simulation of the modified network with the tanks closed showed there was insufficient pressure, as only 87 % of the total demand was satisfied. Comparisons of the nodal heads and outflows for all the nodes showed that both EPANET-PDX (0.1) and (0.2) yielded essentially identical results. The number of iterations required by EPANET-PDX (0.1) and (0.2) to converge was 13 and 10, respectively. Both models required on average 0.04 s to complete the simulation.

4.2 Extended Period Simulation of Real World Network

An investigation was conducted based on a network that is a hydraulic demand zone (referred to hereafter as a water supply zone) in the UK. Figure 2c shows the network that comprises 251 pipes of various lengths, 228 demand nodes (including the fire hydrants), 3 demand categories and 29 fire hydrants; the pipe diameters range from 32 mm to 400 mm. The network obtains water entirely from the neighbouring water supply zones through five variable-head supply nodes (i.e. nodes R1-R5 in Fig. 2c). Details of the temporal variations in the demands and supply-node heads are available in Seyoum and Tanyimboh (2014). The range of variation in the heads at the supply nodes is insignificant. Therefore, here, to simplify the interpretation of the results, the supply nodes were modelled as constant-head nodes with water levels of 155 m each.

The water utility provided the network and dynamic operational data from a geographical information system database, and a calibrated EPANET model. The demand categories comprise domestic and 10-h commercial demands, and unaccounted for water (Kanakoudis and Gonelas 2016). There are 29 different fire demands of one hour each at the respective fire hydrants. The head loss in the pipes due to friction is derived from the Darcy-Weisbach formula (Rossman 2000). The required residual head at all the demand nodes is 20 m.

All the analyses reported on this network consist of extended period simulations of 31 h, with a hydraulic time step of one hour. For each of the three simulation models considered, i.e. EPANET 2, EPANET-PDX (0.1) and (0.2), 66 extended period simulations were carried out in total, for the normal and pressure-deficient conditions. The simulations included pipe closures (10 cases) and varying head levels at the supply nodes (56 cases).

4.2.1 Source Head Variations

The investigation covered all levels of demand satisfaction from zero to 100 %. Supply node heads from 75 m to 130 m in steps of 1 m were considered. Each model executed the 56 simulations without convergence failures. EPANET-PDX (0.1) and (0.2) gave identical results of flow and pressure. The computational performance was assessed considering three scenarios, i.e. normal, low and extremely low pressure.

Normal pressure was taken as 99.9 % demand satisfaction and above, for the network as a whole. This corresponds to heads at the supply nodes from approximately 116 m to 130 m. In the extended period simulation, the number of major iterations required on average per steady-state simulation was 7.00, 5.00 and 5.16 for EPANET-PDX (0.1), EPANET-PDX (0.2) and EPANET 2, respectively. Figure 3a compares the CPU times. On average, EPANET-PDX (0.1) and (0.2) required about 0.27 s and 0.29 s, respectively, per extended period simulation, compared to 0.15 s for EPANET 2.

Fig. 3
figure 3

CPU times as a function of pressure in the network in Example 3. DSR is the demand satisfaction ratio, i.e. the ratio of the available flow to the required flow

EPANET 2, in general, seemed more efficient and consistent. It is worth emphasizing, however, that EPANET 2 and EPANET-PDX apply convergence criteria that are different (Siew and Tanyimboh 2012a). The default criterion used in EPANET 2 is that the ratio of the sum of the absolute values of the changes in the pipe flow rates to the total flow in all the pipes should be less than 0.001. Therefore, it is worth emphasizing also that the EPANET 2 results serve as a reference rather than a direct comparison. The CPU times refer to extended period simulations of 31 h with a hydraulic time step of one hour. Burger et al. (2015) compared different demand-driven analysis solvers to EPANET 2 and concluded that EPANET 2 was the fastest for practical applications.

The pressure-deficient condition was assumed to include demand satisfaction of 9.23 % to 99.9 %, i.e. from just below satisfactory pressure to just above extremely low-pressure. The corresponding heads at the supply nodes were 88 m to 115 m approximately. EPANET 2 results are not included in this scenario and the next, as it is not suitable for operating conditions with insufficient pressure. The major iterations and CPU times were similar to the normal operating condition. On average, the number of iterations per steady state simulation was 7.00 and 5.04 for EPANET-PDX (0.1) and EPANET-PDX (0.2), respectively. The CPU times were comparable, i.e. 0.27 s and 0.29 s for EPANET-PDX (0.1) and EPANET-PDX (0.2) respectively, per extended-period simulation (Fig. 3b).

The performance under conditions of extremely low pressure is important from the perspective of evolutionary optimisation algorithms that may generate extremely infeasible solutions. Recent results have demonstrated the advantages of retaining nondominated infeasible solutions until the end of the optimization (Siew and Tanyimboh 2012b; Eskandar et al. 2012; Saleh and Tanyimboh 2013, 2014, 2016; Siew et al. 2014, 2016; Tanyimboh and Seyoum 2016) as infeasible solutions usually contain useful genetic materials (Herrera et al. 1998).

Supply node heads from 75 m to 87 m, approximately, with network demand satisfaction below 9.23 %, were deemed extremely low (Fig. 3c). EPANET-PDX (0.2) achieved significant improvements in both the number of iterations and CPU time. The average number of iterations was 6.85 and 4.08 for EPANET-PDX (0.1) and EPANET-PDX (0.2), respectively. The average CPU time was 0.38 s and 0.28 s for EPANET-PDX (0.1) and EPANET-PDX (0.2), respectively. For supply node heads from 75 m to 81 m, EPANET-PDX (0.2) was up to around 50 % faster.

4.2.2 Pipe Closures

In this scenario, the pipes from three supply nodes out of five (R1-R5) were closed. In total, 10 cases were considered and it was observed that the nodal demands were fully satisfied in each case. Table 2 provides a summary of the results. On average, there were 6.77, 5.22 and 4.90 iterations per steady state simulation for EPANET-PDX (0.1), EPANET-PDX (0.2) and EPANET 2, respectively. The corresponding average CPU times were 0.20, 0.21 and 0.14 s, respectively, per extended period simulation.

Table 2 Major iterations and CPU times for the pipe closures in Example 3

4.2.3 Effectiveness of the Line Minimization

Figure 4a shows the number of minor iterations as a function of the pressure. In general, under conditions of extremely low pressure, EPANET-PDX (0.1) applied one minor iteration per steady state simulation while EPANET-PDX (0.2) applied an average of 10.30. Figure 4b shows the number of minor iterations for the supply-node closures. On average, EPANET-PDX (0.2) performed 10.43 minor iterations per steady state simulation whereas EPANET-PDX (0.1) performed only 0.16. Overall, it seems that the line minimization in EPANET-PDX (0.1) served mainly as a safety net to avoid divergence of the major iterations.

Fig. 4
figure 4

Comparison of the minor iterations based on the network in Example 3

Figure 5 shows the norm of the constitutive equations at successive iterations, for three typical extended period simulations. Each simulation comprises 31 steady state simulations. It is worth mentioning that the norm in Fig. 5 is based on cubic feet per second and feet, for flow continuity and head loss, respectively. In SI units (m3 s−1 and m), the values would be much smaller.

Fig. 5
figure 5

The norm of the system of equations. Each extended period simulation shown comprises 31 steady state simulations of the network in Example 3

It was observed that for the network demand satisfaction of 0.01 % (Fig. 5c), the norm increased at the second iteration before decreasing consistently in subsequent iterations. Dennis and Schnabel (1996, pp. 129) discuss the circumstances in which the line minimization may loop indefinitely. This may arise if the Newton direction is not a descent direction. It may also be due to spurious convergence. The procedure proposed herein handles an increase in the norm by updating the nodal heads using a default minimum step length in the Newton direction that allows the algorithm to continue (Section 3).

5 Conclusions

An approach for integrating a line minimization procedure in the global gradient algorithm for pressure-driven modelling of water distribution networks is proposed. The algorithm’s performance was satisfactory when simulating two networks in the literature and a real-world network. For simulations based on the real-world network, the algorithm achieved significant improvements in both the number of major iterations (40 %) and CPU time (26 %), in conditions of extremely low pressure, compared to Siew and Tanyimboh (2012a). In particular, for supply node heads from 75 m to 81 m, the CPU time was reduced by up to 50 % approximately. It may be noted also, that the hydraulic and water quality modelling functionality of EPANET 2 has been preserved.

The algorithm proposed allows unimpeded application of the line minimization procedure and, as a result, the computational properties are more consistent under all operating conditions. Overall, the number of minor iterations (i.e. iterations of the line minimization algorithm) has increased substantially while the number of major iteration (i.e. iterations of the global gradient algorithm) has decreased. Where direct comparisons with EPANET 2 were possible, i.e. for operating conditions with satisfactory pressure, EPANET 2 was consistently faster.