*2.2. Hydraulic Transient Model and Faults in the Pipeline*

The unsteady pressurized flow in a pipe network with a known steady-state nodal head and flow rate can be described by a pair of partial differential equations, written as [50]

$$
\delta\_\epsilon \mathbf{g} A \frac{\partial \mathbf{H}}{\partial \mathbf{x}} + \frac{\partial \mathbf{Q}}{\partial t} + \frac{f}{2DA} \mathbf{Q} |\mathbf{Q}| = \mathbf{0},\tag{8}
$$

$$
\frac{\partial H}{\partial t} + \frac{a^2}{\mathcal{g}A} \frac{\partial \mathcal{Q}}{\partial \mathbf{x}} = 0,
\tag{9}
$$

where *g* is the acceleration of gravity, *A* is the pipe cross-sectional area, *H* is the piezometric head, *x* is the distance along the pipe, *Q* is the volume flow rate, *t* is the time, *D* is the diameter of the pipe, *a* is the wave speed, and *f* is the friction factor, which can be described in steady-, quasi-steady-, or unsteady-state conditions. The friction factor was considered to be steady with a value of 0.02, since this study was numerical verification-oriented. Readers can refer to related studies regarding unsteady friction [51,52]. Equations (8) and (9) are respectively the momentum and continuity equations. By means of the method of characteristics (MOC) and the finite difference method, both equations can be solved with appropriate initial and boundary conditions. Then the hydraulic transient heads and flow rates along the pipelines are solved.

Three kinds of faults (i.e., leaks, partial blockages, and distributed deterioration) are considered and discussed. Both leaks and blockages could be described by the simple orifice equation and implemented as an internal boundary condition in the MOC analysis as [53]

$$Q\_O = \mathbb{C}\_{dO} A\_O \sqrt{2g\Delta H\_{O}} \tag{10}$$

where *QO* is the volumetric flow rate through the orifice, *CdO* is the discharge coefficient of the orifice, *AO* is the orifice area, and Δ*HO* is the head loss across the orifice. The leaks represent the flow loss through the offline orifice with no head loss, while the blockages represent the head loss through the inline orifice with no flow loss.

The volumetric flow rate *QL* through leakage is denoted as [53]

$$Q\_L = \mathbf{Q}^{\mathrm{II}} - \mathbf{Q}^{\mathrm{D}} = \mathbb{C}\_{\mathrm{d}\mathbf{L}} A\_L \sqrt{2g(H\_P - H\_{\mathrm{Out}} - z)} \text{ with } H\_P = H\_P^{\mathrm{II}} = H\_P^{\mathrm{D}}.\tag{11}$$

where *QU* and *Q<sup>D</sup>* are the volumetric flow rates upstream and downstream of the leakage, respectively; *CdLAL* is the discharge coefficient of leakage times the leak area of the orifice; *HP* and *Hout* are respectively the heads at the leak and outside the leak; *z* is the pipe elevation at the leak; and *H<sup>U</sup> <sup>P</sup>* and *<sup>H</sup><sup>D</sup> <sup>P</sup>* are respectively the heads upstream and downstream of the leak. The outside head is generally considered to be the atmospheric pressure head and is hence set to zero [53]. The initial value of *CdL* is set to unity, and the elevation *z* is assumed to be zero.

Similarly, a discrete (partial) blockage is treated as an inline valve with a constant opening area. The upstream and downstream of the blockage satisfy the continuity conditions of the head and flux. The volumetric flow rate *QB* through the blockage is expressed as [53,54]

$$Q\_{\mathbb{B}}|Q\_{\mathbb{B}}| = 2\lg(\mathbb{C}\_{dB}A\_{\mathbb{B}})^2 \left(H\_P^{\text{LI}} - H\_P^{\text{D}}\right) \text{ with } Q\_{\mathbb{B}} = Q\_{\mathbb{B}}^{\text{LI}} = Q\_{\mathbb{B}}^{\text{D}}.\tag{12}$$

where *Q<sup>U</sup> <sup>B</sup>* and *QD <sup>B</sup>* are respectively the flow rates upstream and downstream of the blockage; and *CdBA*<sup>B</sup> is the discharge coefficient times the orifice area of the blockage. Note that Equation (12) is a simple model to approximate a blockage of any shape and length [53].

Deterioration (e.g., pipe wall damage or pipeline corrosion) often introduces a decrease in pipe wall thickness, which in turn introduces a change in the pipeline impedance and wave speed, defined as [39,43]

$$B\_i^{\text{sm}} = a\_i / (\text{g}A\_i)\_\prime \tag{13}$$

where *Bim <sup>i</sup>* , *ai*, and *Ai* are respectively the impedance, wave speed, and pipe cross-sectional area of *i*th reach. Their values are known in the MOC analysis.
