1 Introduction

Water leakage is a significant problem worldwide and hence calls for an urgent and effective solution. It is also a difficult one to address as most pipelines are buried underground, thus making detection and repairs problematic and time-consuming. In the Kingdom of Saudi Arabia alone, water losses in cities account for around 35% of the total water supply (Al-Zahrani and Baig 2011). Worldwide, the problem is more severe with up to 70% of the supplied water being lost in some cities. Since water is a scarce resource, it is desirable to quickly and effectively detect, locate and repair leaks in a pipeline. Leak localization is a major problem in the water industry and, as such, remains an active area of research, with various methods (Steffelbauer and Fuchs-Hanusch 2016) having been developed recently to localize leaks in water pipeline networks. The success of these methods is due to their use of artificial intelligence techniques and the recently available extensive computing power to localize leaks in pipe networks using pipe network models and pressure sensors only. In addition to pressure-based leak localization, the past years have also witnessed the use of acoustic-based leak localization methods (Fuchs and Riehle 1991; Hunaidi and Chu 1999) to locate underground leaks which were difficult or impossible to locate using conventional methods. For acoustic localization the leak noise is transmitted acoustically through the pipeline and picked off by sensors located at different distances. Then, cross-correlation between the signals sensed by a pair of sensors would give us an estimate of the time the leak signal had taken to travel from one sensor to the other, which is used to determine the leak location.

Usually hydrophones and accelerometers are used for this purpose. An acoustic model for sound propagation in plastic pipes was experimentally developed in (Almeida et al. 2014). It was noted in this research work that the sound propagated mainly through the fluid and the speed at which it propagated depended upon the physical properties of the fluid and pipe. It was also noted (Almeida et al. 2014) that at large distances, hydrophones would work better as the sound is better detected using measurements in fluid because the vibrations were greatly attenuated, as compared to the acoustic signatures, when they are transferred through the pipe wall. Conversely, the experiments also showed that accelerometers were less susceptible to environmental and pipeline noise.

With regard to the issue of leak noise propagation and detection in pipelines, experimental work was also carried out in (Martini et al. 2014) to detect leaks in pipelines using accelerometers, and it was found that the spectral content of the signal decreased with an increasing distance between the sensors used and that the pipe acted like a low pass filter with a similar spectral response to the pipe model in (Almeida et al. 2014).

Pipeline simulators like EPANET usually generate pressure and flow data for a certain simulation scenario. If other data types, for example vibration or acoustic based data are needed for a simulation along with pressure and flow data, an integrated simulation environment is unfortunately not available. This has provided us with the major impetus to fill out this gap in order to remedy this situation by providing such an integrated environment for leak localization algorithms.

For the problem described previously, we therefore need to integrate the simulation environment for EPANET (Rossman 1999) with the pipe propagation model for sound. Specifically this paper will deal with the integration of the pipeline vibration model into the EPANET model as this would then allow us to include more types of measurement variables in a simulation environment. From a simulation point of view, we can then attempt to use multiple types of data to locate leaks, instead of relying only on pressure and flow data that are available in EPANET. This will then allow us to have an integrated multi-sensory monitoring environment capable of accurately detecting and localizing leaks.

The sections of the paper are divided as follows, in Section 2 the proposed leak localization scheme is introduced along with the system model that we aim to use in the simulation. Section 3 reports on the pipeline simulation results. In Section 4, the leak localization algorithm described in Section 2, is included in the simulation work to localize the leak. Section 5 concludes the paper.

2 Leak Localization Scheme

The leak localization algorithm is split into two main parts. In the first part of the algorithm, the leak is detected, and then, it is localized in the second part of the algorithm. Leak detection utilizes the Head Loss Ratio (HLR) algorithm proposed in (Ishido and Takahashi 2014). We aim to show that we will use the HLR to detect the leak and then further extend the work proposed in (Ishido and Takahashi 2014) to attempt to locate the pipe section in which the leak has occurred. Then we will use vibration data to further pinpoint accurately the leak location within this pipe section. The proposed algorithm has the following steps.

  1. 1.

    Detection of the leak using pressure data

  2. 2.

    Finding the most probable measuring nodes nearest to the leak using pressure data

  3. 3.

    Finding the two nearest nodes to the leak location using vibration data

  4. 4.

    Applying the cross correlation-based leak localization technique to the 2 nearest nodes, using vibration data

Since the first two steps utilize the HLR to detect the presence of a leak and then localize the leaky pipe section. The next section will then deal with the description of the HLR algorithm itself.

2.1 Detection of Leaks Using Pressure Data

Leak detection using pressure sensors can be achieved using the HLR algorithm that determines between which two measuring nodes the leak has occurred.

The leak detection method in (Ishido and Takahashi 2014) is described by the Eq. (1) for the pressure readings obtained from three sensors, indexed as i, j, and k:

$$ H\left({p}_i,{p}_j,{p}_k, t\right)=\frac{p_i(t)-{p}_j(t)}{p_j(t)-{p}_k(t)}\kern11em $$
(1)

For four sensors the equation is similarly defined as follows:

$$ H\left({p}_i,{p}_j,{p}_k,{p}_l, t\right)=\frac{p_i(t)-{p}_j(t)}{p_k(t)-{p}_l(t)}\kern9.75em $$
(2)

Using either Eqs. (1) or (2) the leak can be detected according to the theory and simulations showed by the authors in (Ishido and Takahashi 2014). If the network has only one exit and one inlet then in order to detect the leak in the network, using Eq. (1) we can assign the first pressure signal as the inlet pressure of the network and the last pressure signal as the outlet pressure of the network. The middle value can be the pressure at any point measured in the network. Using only these 3 pressure values leak detection can be achieved in a network.

Further on, the HLR algorithm can be used to localize between which two sensing locations the leak is present. To do this, all the possible HLRs between 3 consecutive sensing locations in the network will be computed before and after the leak. Then we will use a suitable performance metric to find out the most probable location for the section in which the leak has occurred. This method is expected to work because the pressure gradient in the pipeline changes (Mysorewala et al. 2015) when the leak is occurring in the network and it is expected the HLR will also be maximum in the pipe section where the leak has occurred.

After the leak has been detected and the most probable section within which the leak has occurred has been localized, we will then switch over to the use of vibration signals to further pinpoint the leak location with a reasonable accuracy. The next section deals with the vibration propagation and detection of leaks using the vibration signals and cross correlation.

2.2 Leak Localization Using Vibration Signals

To localize the leak using vibration signals we would have to use vibration measurements on either side of the leak. Such a scheme (Almeida et al. 2014) is shown in Fig. 1 with sensors on either side of the leak.

Fig. 1
figure 1

Physical diagram of leak localization scheme (Almeida et al. 2014)

The system shown in Fig. 1 uses the cross-correlation method. The leak signal takes different times to reach the vibration sensors if they are at different distances from the leak. Using this time difference, we can find the location of the leak when both the speed of sound in the pipe and the distance between the nearest 2 sensors on either side of the leak are known, i.e.:

$$ {d}_2=\frac{d- c{T}_0}{2}\kern19.5em $$
(3)

Here c is the speed of sound propagation in pipe and T 0 is the time delay at which the sensor correlation reaches its peak value. The time delay T 0 is estimated at the peak value of the cross correlation function between the two signals measured by the sensors on either side, since at time T 0 the statistical similarity between these two signals reaches its maximum.

To find out the two sensors nearest to the leak, we will need to sense the vibrations at different measurement points across the network. The system model for acoustic sound propagation was introduced in (Brennan et al. 2016) based on the work done in (Almeida et al. 2014). This model gives frequency response functions for the pipe, sensors and leak noise to find the leak signature at different points on the pipe.

Additionally we have to consider vibrations due to flow (Blotter and Stephens 2004) in our model. In (Blotter and Stephens 2004) the authors have constructed an empirical formulation for flow-based vibration for a relatively wide variation of pipe materials, diameters and fluid flow rates. Using this formulation we can generate vibrations at different points in the pipeline as shown in the scheme in Fig. 2.

Fig. 2
figure 2

Vibration generation scheme to be used

In Fig. 2, the Pipe Sound Propagation model is shown by (4) based on work in (Almeida et al. 2014). This equation is shown for a specific position s 1 but will be similar for different positions on the network with only the value of the distance s 1 changing.

$$ P\left(\omega, {s}_1\right)={-\frac{a^2{\omega}^2}{Eh} e}^{-\omega \beta {s}_1}{e}^{- j\omega {s}_1/ c}\kern11.5em $$
(4)

In (4), c is the speed of sound in pipeline, E is the Young Modulus of the pipe, h is the thickness of pipe, ω is the frequency and a is the mean radius of the pipe. The equation is explained in detail in (Brennan et al. 2016).

To recover the leak signal from the pipe model, we will need the signal parameters used to generate such a signal, as described in detail in (Papastefanou et al. 2012). This signal is a noise that follows the ω −1 power law until a specific frequency for a specific leak and flow velocity. Numerous experiments were conducted for discrete diameter values and a relationship was derived for the leak noise spectrum. A signal based on this spectrum can be readily implemented in MATLAB.

The empirical mathematical expression for the frequency spectrum that was derived in (Papastefanou et al. 2012) is shown by Eq. (5):

$$ {S}_{ll}\left(\omega \right)=\Big\{\begin{array}{c}\frac{A\left( V, d\right)}{\omega}\kern9em \omega \le {\omega}_c\\ {}\frac{A\left( V, d\right){\omega}_c^{n-1}}{\omega^n}\kern7.5em \omega \ge {\omega}_c\end{array}\operatorname{}\kern8.75em $$
(5)

In (5), A(V, d) is the magnitude of the sound pressure level in dB for a given exit velocity V and hole diameter d in units of meter, ω is the frequency. ω c is the critical frequency after which the attenuation factor of the sound n increases by more than 1.

In previous works (Brennan et al. 2016) the range of 0–250 Hz is used by the authors for leak noise as the higher bands get highly attenuated by the pipe, so only the low frequency components of the signal are used and the first part of (5) is used, as the sampling frequency used is below the critical frequency ω c , for all cases of leaks.

This leak signal will then be passed through the pipeline model to generate the vibration due to the leak at discrete points on the pipeline. As discussed previously there will be vibrations due to flow involved. This flow-based vibration model has been developed in (Blotter and Stephens 2004) using a non-trivial derivation. Using this theory, Pittard et al. (Pittard et al. 2004) derived an empirical formula based on experiments to determine the vibration as a function of flow in pipes.

Modeling for vibration due to flow was performed in (Pittard et al. 2004) by Pittard et al. and an empirical formulation based on flow was developed as shown in the following Eq. (6):

$$ {A}^{\prime }{\left(\frac{p_m}{p_w}\right)}^{0.5}\left(\frac{t}{D}\right)=3.5 e-5+\left(7.36 e-18\right){Re}^{2.55}\kern7em $$
(6)

Here t is the thickness of the pipe, D its diameter, p m the density of pipe material, p w the density of water, Re the Reynolds number and A the standard deviation of the noise signal in units of g. Thus, the standard deviation of vibrations can be calculated and incorporated in the time series for the leak vibration data. It was noted that the vibrations became very low at low fluid velocities.

The vibrations due to flow and leak are summed up at each sensor location to give the total vibration signal at that point, as shown in (7):

$$ {x}_n(t)={s}_n(t)+{n}_n(t)\kern14.75em $$
(7)

Here x n (t) is the time series data for the total signal available at node location n. The leak signal time series data is shown by s n (t) and is generated by passing the leak noise model Eq. (5) through the pipe response Eq. (4) for a particular distance. The noise in the signal is shown by n n (t) and represents the vibrations due to flow that are occurring in the background. The standard deviation for this noise is modelled by Eq. (6). Using this standard deviation, we can generate a random signal of the same length as the leak signal and sum the 2 signals (leak and noise) to get the complete signal at a particular sampling location.

Applying this procedure of generating the complete vibration signal, we will proceed to the implementation of our simulation model in MATLAB, as discussed next.

3 Simulation Using Pressure and Vibration Data

To simulate and validate the proposed sensor integration and simulation augmentation method, the scheme of Fig. 3 is proposed which comprises EPANET where the desired pipeline characteristics and conditions are first set and then fed into MATLAB which simulates the EPANET environment and generates the required vibration data for the set pipeline conditions.

Fig. 3
figure 3

MATLAB-EPANET co-simulation scheme

More specifically, the simulation is initiated by creating a simulation environment in EPANET specifying the pipe length, diameter and flow rate through the pipe. This is then accessed from EPANET using a toolkit developed in (Elíades 2009) using MATLAB. This allows us to control the simulation and apply the leak localization algorithms to the pipe network simulated in EPANET. Furthermore using the flow information from EPANET, we can simulate the vibration in a pipeline. The vibration simulation block calculates the vibration based on the flows and leaks that are present in the system using the method described by (7) and gives the result for discrete measuring points that are defined in the EPANET simulation. Since the vibration can be measured at any point, an arbitrary point can also be defined in the pipe for vibration measurement purposes. In our simulation, the pressure sensor and vibration sensors are mounted at the same point. For the vibration signal, the length can be set arbitrarily depending on the signal length requirement of the algorithm, by setting the sampling frequency and the sampling time. In our case, a 1-s and 5-s signal length are used. Longer signal lengths can be generated but they would increase the algorithm computation time.

In the simulation process, we are taking the signal spectral range as 0–400 Hz (Papastefanou et al. 2012) since a sampling rate of 800 Hz would be used.

For the leak to be generated in EPANET, we will be using the emitter property of the nodes available. In EPANET, emitters are used as leaks which use the power law (Ferrante et al. 2014):

$$ Q= C{p}^{\gamma}\kern21em $$
(8)

Here C is the emitter coefficient for discharge, γ is the emitter exponent which is usually set to a default value of 0.5, p is the pressure at the node and Q is the leak flow rate.

For leak modelling purposes, we will further use the following Bernoulli equation for fluid flow through an orifice of a known diameter (Munson et al. 2009):

$$ Q={C}_n{A}_n\sqrt{\frac{2\left({p}_1-{p}_2\right)}{\rho \left(1-{\beta}^4\right)}}\kern14em $$
(9)

In (9), (p 1 − p 2) is the difference in pressure between the inside and outside of the pipe, β is the ratio of the leak diameter to the pipe diameter, ρ is the density of the fluid, A n is the area of the orifice, C n is the flow coefficient which is equal to 1 for ideal cases but it usually has a lower value. In our case, we have taken it to be equal to 0.6, which is a reasonable assumption for a leak from a sharp-edged hole (Munson et al. 2009).

If we take (p 1 − p 2) equal to p then C in (8) can be written in terms of (9):

$$ C={C}_n{A}_n\sqrt{\frac{2}{\rho \left(1-{\beta}^4\right)}\kern2.75em }\kern12.25em $$
(10)

Using (10), the emitter coefficient in EPANET for a certain diameter can be approximated. This would give us the node demand which would enable us to calculate the exit flow velocity which in turn can be used to calculate the leak noise for propagation in the pipeline model.

The pipeline parameters used in the simulation are shown in Table 1.

Table 1 Simulation parameters

An example of a pipeline network is considered, and simulated in EPANET using the conditions given in Table 1, such as pipe length, hydraulic pipe diameter, flow rate, distance between sensors to run the flow- and pressure-based simulation using MATLAB. The leak propagation model, as shown in (4), will be used to propagate the leak signatures from the leak location. In the example considered in Fig. 4(a), there are 19 nodes (labeled as nodes 1 to 19) for pressure data acquisition. The small rectangle labeled A is modeled as a 3 mm-leak according to (8–10).

Fig. 4
figure 4

a EPANET Model of pipeline, the rectangular position is the leak location and the triangle node is the network exit node with demand of 40 l per minute and b the average pressures in the pipe network before and after the leak at different nodes

The pipeline is then simulated for leak and no leak conditions. The pressure measured at various nodes is shown in Fig. 4(b) for no leak and for 3 mm leak at position A as shown in Fig. 4(a). We can see the overall pressure in the network is lower compared to no leak in the network.

The simulation runs for one hour, with pressure sensors sampling every 15 s with a sampling rate of 2 KHz, the 1 s samples are averaged to give one value of the pressure signal at the node. There will be 240 pressure readings (4 samples/min for one hour) for each node in the network. The leak occurs at point A after 30 min so there will be equal number of samples for both the leak and no-leak cases. The accuracy of the pressure sensors are assumed to be 0.08% of full scale range (1 bar).

Using the flow readings and leak parameters considered in EPANET simulation, the vibrations due to flow and leak are also simulated in MATLAB, using (4)–(6) as discussed in section 2. Figure 5 shows the vibration readings at some selected nodes (i.e. nodes 7, 8, 10, 14 and 18) that are at different distances from the leak (position A). Here the vibrations at different locations for two different conditions, before leak and after leak are shown, for a single reading of 5 s sampled at 800 Hz. We can see in Fig. 5(a) that the vibration magnitude is less than of Fig. 5(b) for Node 10, similarly the effect of the leak on Node 14 in the vibration signal as the signal variance is increasing. Further on, for nodes which are further out more than 70 m from the leak location the vibration signal is approximately the same before and after the leak. Using the standard deviation of the vibration readings (Martini et al. 2014), it is observed that before the leak it is 0.0033 in Fig. 5(a) and 0.0041 in Fig. 5(b). This is similar for Node 14 as in Fig. 5(c) where the vibration standard deviation is 0.0027 before leak and 0.0033 after leak in Fig. 5(d). For the other vibration signals which are further than 70 m, the standard deviation doesn’t change by a significant margin and it is also visibly apparent that the signal composition doesn’t change before and after leak for them.

Fig. 5
figure 5

Simulated vibrations at different nodes in the network due to the leak at position A

After the pipe network simulation has been completed and the relevant data acquired, we intend to use the leak localization algorithm proposed in Section 2 to localize the leak in the network. The next section is related to the application of this algorithm.

4 Leak Localization Using Proposed Scheme

In this section, the scheme proposed in section 2 is implemented. First, the leak will be detected, then the most probable nodes will be identified using pressure data. Then we will switch to vibration data to select nodes closest to the leak and finally apply cross correlation to find the leak location.

4.1 Leak Detection and Node Selection Using Pressure Data

To detect leaks in the system, only the entry and exit nodes and any intermediate node in the network are needed since the leak, if any, will have to occur between the two end nodes of the network. Figure 6(a) shows the plot of HLR H(p i , p j , p k , t) for 240 samples, if the entry nodes is i = 1, intermediate node is j = 9, and exit node is k = 15.

Fig. 6
figure 6

Head loss ratio calculated between nodes 1, 9 and 15. Mean value before leak is 1.321 and after leak is 1.427

In Figure 6(a), it can be seen that after the 120th sample the mean value of the computed HLR increases from 1.321 to 1.427 indicating a leak has occurred as we are looking at a consistent increase in the HLR value over a period of time compared to steady state variations. This step only requires the entrance node, the exit node and an intermediate node in the network.

We will then compute the HLR of adjacent nodes in the network using (1) and then assign to each node used in the HLR algorithm a value based on the percentage change in the mean value of the HLR before and after the leak, so as to identify the leaking node as the one having the highest percentage change.

Prior to using the algorithm, the pressure data is first passed through a moving average filter of length. It was found that data between nodes 12, 13, 16 and 17 cannot be used in the algorithm because all these nodes are at the same pressure level as there is no flow between them. In Figure 6(b), (c), (d) and (e) four different possible HLR combinations from the network are shown. This way, the HLR is computed for all valid possibilities in the network for adjacent nodes.

Also shown in Figure 6(f) the percentage change from the valid 29 HLR values is computed for the different node combinations and tabulated for the each node before and after the leak. It was noted that Node 10 has the highest value in all three metrics used, with, Nodes 8 and 7 coming as second and third, respectively. From this analysis we can safely say that we can start taking vibration samples from Nodes 10, 8 and 7 in order to localize the leak. In the next section, the best nodes for leak localization will be selected based on the simulated vibration readings.

4.2 Vibration Based Node Selection and Leak Localization

Recall that we have already plotted vibration signals before and after the leak in Section 3 for some nodes. We know that Node 10 in subfigures 5(a) and (b) is 23 m from the leak and Node 14 in subfigures 5(c) and (d) is 27 m from the leak. Also, the effect of the leak on the vibrations is most noticeable in these two nodes only as the other three nodes are more than 70 m away from the leak which therefore, does not affect the vibrations of these faraway nodes. Basing our observations on the results of Figure 5, we can safely conclude from data that Nodes 10 and 14 are most eligible for the final step of the leak localization algorithm, where their corresponding data would be cross-correlated, since the effect of leak based vibrations at these two nodes is the most pronounced of all the results in Figure 5.

The cross correlation result of 1-s long signals sampled between Nodes 10 and 14 is shown in Figure 7(a), where the cross correlation peak is obtained and used in (3) to localize the leak at 23.1223 m from Node 10, whereas the actual location of the leak is 23 m from Node 10. From the sampling frequency of 800 Hz and the speed of sound in the water pipeline taken to be around 429 m/s, in our simulation the theoretical error in the leak localization using cross correlation is within theoretical limit of 0.53 m, which corresponds to the distance travelled by the sound signal in one sample period (Stoianov et al. 2007). As far as simulation is concerned, this error may be taken as the smallest non-zero error that can occur in the leak localization phase, and hence may be used as an optimum reference result that experimental results should target when validating the proposed scheme.

Fig. 7
figure 7

a Cross correlation result of 1-s long signals of Nodes 10 and 14. b Leak localization error for different values of Young’s Modulus. Actual leak location is 23 m (from node 10) as shown by the blue line

It should be noted that the results of localization error given above are for the assumption specified in Table 1, since varying environmental conditions would give a different result of localization error (Almeida et al. 2014). For example, if the temperature changes due season or time of the day, then this will consequently change both the Young’s modulus and the speed of sound, and hence the vibration-based localization accuracy. Therefore, we need readings of the environmental parameters that are very accurate if we are to achieve an accurate leak location. For a nominal operating temperature range, Young’s Modulus is between 2GPa and 3GPa (Kendall and Siviour 2014). Consequently, we show the effect of the variation of the parameters for this range, in Figure 7(b) where the simulation runs for 3 different values of Young’s modulus (i.e. 2, 2.4 and 3 GPa). It is found that if we assume the value to be 2GPa while the actual value is 3Gpa, then the error in leak localization is up to 0.4 m. Similarly, if the actual value is 2GPa while we assume it to be 3GPa, then localization error is 0.25 m. In all cases, the error in localization is significantly low.

5 Conclusion and Future Work

In this paper we have introduced a novel multi-modal multi-scale leak detection and localization scheme which uses both pressure and vibration measurements for detection and localization of leaks in a pipeline network. Our scheme does not require an extensive knowledge of the network parameters, such as diameters of all pipe sections and flow rates. The results achieved are fairly accurate under given broad assumptions, as compared to other techniques which would require extensive computation as well as relatively more knowledge of the network under study.

The success of our proposed novel multi-scale and granular approach, hinges on the judicious use of different types of sensors. We showed through extensive simulation, how HLR values are used first to detect the leak, and by identifying the most probable nodes that are near the leak. Once the leaky segment of the pipe has been identified, the vibration data is used to select the best possible nodes around the leak and then cross-correlated to localize the leak.

The results were shown to give an error in localization of 0.12 m, which is within the acceptable theoretical limit of 0.53 m, considering under the assumptions specified for the sampling rate of vibration signal and the speed of sound. It is also shown that the error is significantly low even if values of the parameters, such as Young’s modulus, change within a realistic range, due to environment-induced changes in the operation conditions.

The proposed system allows us to have a framework in which a thorough simulation-based study can be carried out based on theory. In future, we plan to experimentally validate the detection and localization schemes on complex pipeline networks, and these will involve other environmentally-induced uncertainties such as external noise and demand variations that would affect the accuracy of the localization. There is much scope for future work in our proposed framework that also allows for the investigation of more elaborate leak detection and localization theories, including the use of optimization techniques for accurate leak localization.