Articles | Volume 13, issue 2
Research article
21 Sep 2020
Research article |  | 21 Sep 2020

Prelocalization and leak detection in drinking water distribution networks using modeling-based algorithms: a case study for the city of Casablanca (Morocco)

Faycal Taghlabi, Laila Sour, and Ali Agoumi

The role of a drinking water distribution network (DWDN) is to supply high-quality water at the necessary pressure at various times of the day for several consumption scenarios. Locating and identifying water leakage areas has become a major concern for managers of the water supply, to optimize and improve constancy of supply. In this paper, we present the results of field research conducted to detect and to locate leaks in the DWDN focusing on the resolution of the Fixed And Variable Area Discharge (FAVAD) equation by use of the prediction algorithms in conjunction with hydraulic modeling and the Geographical Information System (GIS). The leak localization method is applied in the oldest part of Casablanca. We have used, in this research, two methodologies in different leak episodes: (i) the first episode is based on a simulation of artificial leaks on the MATLAB platform using the EPANET code to establish a database of pressures that describes the network's behavior in the presence of leaks. The data thus established have been fed into a machine learning algorithm called random forest, which will forecast the leakage rate and its location in the network; (ii) the second was field-testing a real simulation of artificial leaks by opening and closing of hydrants, on different locations with a leak size of 6 and 17 L s−1. The two methods converged to comparable results. The leak position is spotted within a 100 m radius of the actual leaks.

1 Introduction

Climate change is a major global issue, more and more important on the international scene. It affects all components of the hydrological cycle. The situation of water resources in Morocco is already critical with a state of water scarcity forecasted for 2020. This problem is accentuated by the effects of climate change and may hinder any further sustainable development. The expected climate change for Morocco would have direct and indirect harmful consequences on the water resources potential, in terms of both quantity and quality, on the water demand, and on the efficiency of use of this resource by the different users. An anticipation of the adaptation to the effects of this climate change must pass by the valorization of the use of the resources and especially the minimization of the water losses. In this regard, in Moroccan urban areas, drinking water distribution networks have particularly low yields. The location and prioritization of leaking areas is a major concern for the public authorities to optimize the use of water resources, reduce losses, and improve continuity of service.

To guarantee the high-level service of pressure, the detection and repair time of leaks is certainly the most common factor used in the analysis of decreases in contract pressures.

For most of the time, before starting a leak detection campaign in a discrete hydraulic sector (DHS) we start with the analysis of the flows into and out of the sector, in particular the minimum night flow (MNF) between 02:00 and 04:00 local time (UTC+1), as well as the volumes of major consumers (Alkasseh et al., 2013).

In the literature it is possible to detect leaks in the DHS. Usually the leakage rate is permanent over time. If the DHS records an increase in night flow, this increase should also appear during normal consumption time (Oasen, 2015). According to research by Farley et al. (2008), an increase in minimum night flow can be used for targeting all “DHS” where leakage is more likely. It is therefore possible to detect leaks in a DHS by making a hydraulic balance between the volume of billed consumption and the volume distributed, by comparing the expected demand and the actual water consumption (Bakker, 2014).

Once new leaks by DHS are identified, various techniques are used to locate the leaks. Acoustic leak detection is a technique which has evolved a lot in recent years and is developing rapidly (Farley and Trow, 2003). Some of these techniques require partitioning a drinking water distribution network (DWDN) into smaller DHS, by closing certain valves on the network, which can sometimes shut down the system (Colombo et al., 2009).

In addition, various research projects noted that it is difficult to apply the leak detection to certain areas due to the complexity of isolating and partitioning (Andrea et al., 2011). Through the applied works in modeling leakage, in particular, those of Babel et al. (2009) and Sebbagh et al. (2018), a reduction in pressure at the inlet of DHS induces a reduction in leakage rate. For Al-Ghamdi (2011), a 25 % reduction in pressure contributes to a leakage flow reduction of about 25 % for a 50 % rigid 50 % plastic network.

Our approach, as we will see through the following paragraphs, is to do a virtual leak search without partitioning a DWDN into smaller DHS.

The deficiency of leak management is one of the key problems, given its impacts on production cost and resource exhaustion.

The scope of this paper will be mainly focused on the application of the two approaches in two different leak events. The case study is a pilot sector in the city of Casablanca (Morocco), which has around 24 000 inhabitants, as displayed in Fig. 1.

Figure 1Delimitation of the study area. Please note that 1 mi = 1.609344 km.

The study area is a micro-modulated sector with a single critical pressure point that is continuously monitored. It has 3 inlets, 493 nodes, and 42 km of pipes. Each of the three inlets of the zone has its own flow meter in diameter 300, and the hydraulic model was calibrated at each inlet. The network flow and pressure are monitored through a flow meter in diameter 300 mm and pressure sensors at each inlet. Figure 2 shows the daily average of measured water demand.

Figure 2Daily average water demand of the study area.


Figure 2 shows a significant minimum night flow around 40 L s−1 between 02:00 and 04:00 local time (UTC+1), which implies a high probability of the presence of physical losses.

Figure 3 reveals that the network consists mainly of grey cast iron (40 %). The average age is 40 years, increasing vulnerability and promoting leaks.

Figure 3Types of materials constituting the network.


2 Materials and methods

2.1 Software

EPANET is a free software developed by the US Environmental Protection Agency (US EPA). From the representation of the distribution network (nodes, pipes, tank, valves, pump, etc.), it allows the hydraulic balancing of the network by the calculations of pressure losses, flow velocity, flow in the pipes, and pressure at the nods (Rossman, 2000).

In practice EPANET is used by water utilities (EPA, 2005) and in the literature (Farina et al., 2014).

The basic demand for the hydraulic modeling software EPANET 2.0 is defined as a water output at each node. We consider that there are two main methods to simulate a water leak in EPANET: as an additional demand or even water flow rate through a valve, the formula to calculate the head loss (Darcy–Weisbach) was used with the default values for the roughness (Brown, 2011).

2.2 Method

2.2.1 Relationships between pressure and leakage rates in distribution networks

Pressure management involves not only reducing pressure but also other pressure control and optimization methods without compromising customer service. A definition of pressure management in its broadest sense is given by Thornton and Lambert (2005): “pressure management is about controlling the pressure of the system to achieve a level of optimal service, to ensure an efficient supply to consumers while avoiding the unnecessary excesses of this pressure which would unduly increase leaks”.

Water utilities often take to design their distribution networks the minimum pressure that occurs at the critical point at maximum demand. Understanding this concept is of great importance as pressure regulation can significantly reduce leakage without compromising the level of customer service.

Empirical research has repeatedly shown that the Fixed and Variable Area Discharges (FAVAD) principle demonstrates the fact that most discharges from pressurized pipelines vary with pressure to a greater or lesser extent. This concept, via the definition of an exponent N1, defines the relationship between the leakage rate and the pressure in case of pressure modulation.

According to Lambert (2001) and Rozental (2010) the relationship between pressure and flow leaks is given by Eq. (1):

(1) L 1 = L 0 × P 1 / P 0 N 1 ,

where L1 and P1 are respectively the leakage rate and the average pressure in the DHS during the day; L0 and P0 are respectively the leakage rate and average pressure at the minimum night flow (MNF) time, between 02:00 and 04:00 local time (UTC+1).

According to Al-Ghamdi (2011) and Cobacho et al. (2014), the main method for representing leaks in a hydraulic network model is through adding a leakage valve for each node, the emitter parameter is used to model flow rate through a valve. These emitter devices permit the modeling of flow evacuated to the atmosphere through a nozzle.

The equation below represents the concept of FAVAD, through a flow rate, pressure, and emitter coefficient Eq. (2):

(2) Q leak j = C × P j N ,

where Qleak is the flow rate at node j, C is the emitter coefficient, P pressure at node j, and N is the pressure exponent.

The exponent N of the above equation varies according to the material of the pipeline (mainly its elasticity), for a circular opening on a rigid pipe (cast iron, steel), N1 is of the order of 0.5, whereas it reaches 1.5 or more for longitudinal slots on plastic materials (PVC, PEHD). However, international feedback shows a variation of N1 between 0.36 and 2.95 depending on the networks experienced (Rozental, 2010).

The data collection relative to the various components of the drinking water networks (pipes, reservoirs, well, drilling, pumps, valves) is made by means of shapefile exported from the database Cart@jour. It is an interface GIS (Geographical Information System) available for consultation in intranet which includes three networks managed by the drinking water operators as well as all of the hydraulic structure which constitutes them. The interface allows extracting all the desired layers while geometrically targeting the study area (zone of study). Table 1 illustrates the roughness values used during modeling (Chadwick et al., 2013).

Table 1Roughness coefficient of materials (values from Chadwick et al., 2013).

Download Print Version | Download XLSX

The elevations are extracted from the digital elevation model (DEM) layer and automatically assigned to network nodes.

The annual average consumption for 2017 in addition is distributed into each node in the model according to the geographical distribution of subscribers within the tour. Once the network template is prepared using ArcGIS, it is transferred to the EPANET software in an INP file.

The EPANET hydraulic simulation model calculates node pressure and pipe flow for a fixed reservoir level and variable water demands over time and space. It predicts the dynamic hydraulic behavior within a drinking water distribution system operating over an extended period of time. The pressure changes due to discharge, pressure calculating, and changes according to base demand and daily consumption patterns at each node. The pressure drop during a peak period of consumption is due to higher consumption patterns in the DHS (The pattern provides multipliers that are applied to the base demand to determine actual demand in a given time period.)

Figure 4Daily consumption patterns in the study area.


Figure 4 shows an example of daily consumption patterns in the study area.

Several simulations using the EPANET software were used to determine the roughness coefficients of the pipes to obtain calculated pressures which indicate the actual pressures in different nodes of the hydraulic system.

Different factors are attributable to the uncertainty of the pressure measured on the network, the most important of which is the fluctuation of the pressure in the network. According to the pressure differences observed on the ground when determining roughness, according to the work of Paquin et al. (2000) this error is estimated at 0.3 m of H2O. Regarding the error in modeling the reference pressures, a value of 0.2 m of H2O is considered realistic. The total uncertainty related to the pressure difference between the measured pressure and the reference pressure is therefore 0.5 m of H2O.

Various factors including the measuring devices and the state of equilibrium of the network can influence the accuracy of the value of the roughnesses measured in the field, as well as for the estimation of roughness for the other conduits of the network.

Figure 5 presents three curves which correspond to the pressure drop caused by a leak in the middle of a pipe without a junction: one with roughness as measured in the field and two others with limit values taking into account a ±10 % error related to this parameter (ε+10 %, ε−10 %).

Figure 5Influence of the error on the roughness of the pipe.


When the roughness is increased, the pressure difference caused by a leak is greater. Conversely, when the pipes are smoother (plastic), the pressure difference decreases. Leak detection by the method studied therefore seems more promising on networks whose hydraulic capacity is weakened by corrosion rates.To solve this localization of leakages we will use the random forest algorithm (R learning and prediction algorithm).

Algorithm 1 (Sect. 2.3.2) illustrates briefly the suggested leakage detection procedure.

The leakage localization methodology displayed in Fig. 6 is based on data mining algorithms; the starting point of the algorithm is the learning of the data obtained by simulation using EPANET simulator. Then four training data elements are used to predict the location of the leak:

  • the distance between simulation node and the sensor

  • the leakage flow

  • emitter coefficient

  • pressure at the sensors.

Figure 6Leak prelocalization procedure.


In order to estimate the network flow, the leakage outflow at each node, and the distance of leak from sensors, a leakage model is implemented within a classical hydraulic simulation model (EPANET).

There are two ways to model a water leak in a hydraulic network model EPANET: (i) as an additional nodal demand and (ii) by adding a leak valve to each, as shown in Fig. 7, where QDi is the node base demand (consumption), QADi is the node additional demand, Pi is the node pressure, Ci is the leak valve coefficient, and Qi is the leakage flow.

Figure 7Ways to model a water leak in a hydraulic network model (Sebbagh et al., 2018).

According to Cobacho et al. (2014) the best way to represent leakage in a hydraulic network model is not by means of an additional demand but rather by adding a leak valve to each node. The dynamic behavior of leakage is appreciated in this case rather than the case as an additional demand.

In EPANET, the closest element to a leak valve is the emitter, which presents an open valve to the atmosphere. The emitter behavior equation is as shown in Eq. (2).

The emitter coefficient is placed at the junctions. Four emitter coefficients (0.8, 1.6, 2.4, and 3.2) were used in this simulation step at each node, which correspond respectively to approximate flow leaks: 5, 10, 15, and 20 L s−1. The objective of this simulation step is to vary the leak rate at nodes, to calculate and generate the new profile of pressures at each change in flow rate.

The simulation results obtained constitute the training data for our machine learning model.

2.2.2 Leak simulation in EPANET

These training data are obtained by using EPANET toolkit available at (Eliades et al., 2016) for use in MATLAB. It is an open-source software that provides programming interface for EPANET within MATLAB framework. It is easy to modify, simulate, and plot the result produced by EPANET libraries (Eliades et al., 2016). Figure 8 reveals that 493 nodes were defined to simulate leaks with different emitter coefficients: 0.8, 1.6, 2.4, and 3.2, which correspond approximately to leak rates of 5, 10, 15, and 20 L s−1 as per Eq. (2).

Figure 8Leak simulation nodes in sector 1. Please note that 1 mi = 1.609344 km.

Table 2Result of model leak simulations.

D1: the distance from the simulation node to the P14. D2: the distance from the simulation node to the P57. D3: the distance from the simulation node to the P58. D4: the distance from the simulation node to the PC. Q: the leakage. C: emitter coefficients. Pmax1: the maximum pressure during low consumption period at P14. Pmin1: the minimum pressure in rush hour period at P14. Pmoy1: average daily pressure at P14. Similarly, for the indices 2, 3, and 4, which correspond respectively to the P57, P58, and PC.

Download Print Version | Download XLSX

Thus, at each node, we simulated four leaks with emitter coefficients equal to 0.8, 1.6, 2.4, and 3.2, for a total of 1972 simulations. The purpose of these 1972 simulations was to stimulate the pressure behavior at each node. The area contains 493 nodes; thus, we simulated four leaks with emitter coefficients equal to 0.8, 1.6, 2.4, and 3.2. This makes a total of 1972 simulations. Each time, the leakage rate, the emitting coefficient, the location of the leak, and the distances from the four sensors P14, P57, P58, and PC are noted, as well as the maximum, minimum, and average pressures at these measuring points. The authors would like to record the maximum data of pressure variations in the case that even the leaks are triggered in the looped far part on the network. This is a completely new base for data learning. The results are reported in Table 2. The table thus constructed constitutes the input data of our algorithm.

2.3 Location and simulation of leaks on the ground

2.3.1 Leak prelocating

In this section we reiterate the existing techniques of leak detection. The technique used to search preventive leakage on distribution networks is organized around three distinct but complementary operations: sectoring, prelocation, followed by localization. These methods must be adapted according to the dimensions and the degree of knowledge of the targeted. Figure 9 summarizes the existing prelocalization stages; these stages make it possible to go from hundreds of kilometers of network to tens of meters, by proceeding by elimination: in the identified leaky zones, the night flow of sectors is measured then subsectors to identify leaking sections and precisely guide acoustic detection and then the location of leaks.

Figure 9Stages of sectorization.


The objective of sectorization is to define priorities between different sectors and to estimate or even quantify the level of leakage. It defines fugitive areas larger than the linear kilometer.

The objective of the prelocation is to check the presence of leaks in a given sector and to determine their position with a precision of the order of magnitude of a hundred meters. The correlation is sometimes used to confirm leak position. It consists in positioning two sensors on access points of the network (if possible on both sides of the leak) and to seek the similarities between the noises which they record. When a leak noise is identified, it is possible to calculate its position knowing the distance between the two sensors.

The objective of this correlation is to define the position of a leak with a precision of the order of 1 m, to avoid the extra cost of earthwork without leaks.

The objective of this research was to skip some of the steps, especially all the steps of sectorization, presenting a high day operation cost of the network, and to achieve directly the last step of prelocalization. The purpose was to prelocalize a leak within a radius of a hundred meters.

2.3.2 Prelocalization of leaks by learning data

Random forest

The type of learning we apply to anomaly detection in this article is supervised learning. In Zhang et al. (2008), decision tree forests are used to detect intrusions from the network.

To execute the anomaly detection method by supervised learning, we used the statistical software R (Zhang et al., 2008).

Random forest is a type of tree-based supervised learning algorithm (Ho, 1995). It uses many decision trees to aggregate the answer. In this paper, the supervised random forest algorithm was used as a technique to detect the leaks (Breiman, 2001). In addition to its efficiency, this algorithm is famous for its ability to treat big data.

The random forest optimization principle is based on the combination of multiple decision trees to extract different classes from the original raw dataset. Then, the average classes are determined based on the classes outputted by the decision trees used. Thus, the performance of the resulting model is enhanced and compared to one decision tree model, and the ability to apply the resulting model in other datasets is acquired.

Leakage detection algorithm

The input data are training data (train): sensor node number, the distance between simulation node and the sensor, the leakage flow emitter coefficient, and pressure at the sensors.

The process engaged in the proposed leak detection is concisely discussed in the following algorithm:

2.4 Preparation of input data for the algorithm

Several pressure profiles for reference (without leaks) are required to attain satisfactory level of prediction from the data analysis algorithms. These pressure profiles are obtained by using EPANET. Around seven references cases are added to Table 1. A first case is the pressure reference that has been simulated; the others constitute a translation of the reference curve of +0.1, +0.2, +0.3, −0.1, −0.2, and 0.2 m, forming an envelope with 0.6 m amplitude, as shown in Fig. 10 in the case of the P14 measuring point.

Figure 10The reference pressures profile at P14.


We imposed this error range to avoid false results. According to the field tests we carried out, a leak of 6 L s−1 implies a minimum pressure drop of 0.3 m. The band is a translation of ±0.3 m. Those seven reference cases are added to pressure profiles without leaks.

For each measurement point we considered seven reference curves. This envelope is the area of variation of the daily pressure; it was calculated from several measurements of pressure spread over several days.

To simulate the artificial leaks in the study area, the leakage rate was created by opening fire hydrants on three locations at three times (during nighttime hours, peak time, and during off-peak periods of the day) with a leak size of 6 and 17 L s−1. During the leak simulation, the results are recorded and localized with four pressure measurement sensors placed on fire hydrants.

We then simulated these leaks on EPANET model by taking stock of the time interval of real simulations, taking a time step of 5 min equal to the recording step of the sensors in the field.

A total of four leaks were simulated by opening fire hydrants rated A, B, and C; the artificial leak locations are shown in Fig. 11.

Figure 11Sensor and leak locations. Please note that 1 mi = 1.609344 km.

The leak localization method depends on the head loss, which itself depends, among other factors, on the size of the leak. Thus, if we have a limited leak, the sensors could not detect the small head loss; a leak of 6 L s−1 is chosen as a lower simulation limit. As an upper limit, we have chosen the 17 L s−1 leak, and we presume that those bypassing this limit finish by surfacing and therefore do not require any localization process (Pérez et al., 2014a).

Table 3Leak information in the study area. All times are local time (UTC+1).

Download Print Version | Download XLSX

At “PI A” we simulated two leaks of 6 and 17 L s−1, for “PI B” a small leak of 6 L s−1, and for “PI C” a leak of 17 L s−1 (Table 3).

The flow rate at each fire hydrant was controlled by using a pressure measurement and flow meter for fire post (PFP). The hydrants were kept opened for around 30 min to collect data. The time of simulation was limited to 30 min for reasons of water conservation and safety considerations.

3 Results and discussion

3.1 Data-reading pressure at sensor

The performance of the pressure for the artificial leak simulation on 3 May is shown in Fig. 12. The blue line in Fig. 12 shows the daily pattern of pressure at P14.

Figure 12Pressure profile of 3 May 2017 at P14.


The red circle shows the decrease of the pressure during the real simulation. These leaks were simulated on the EPANET model by choosing the same time slot of the real simulations. The model was calibrated without errors. It was tested and validated by comparing the measured and simulated pressures.

Figure 13Pressure profile at P14.


Figure 14Pressure profile at PC.


The results are shown in Figs. 13 and 14. The figures show an example of comparison between modeled pressure and measured pressure in the study area at sensor P14 and PC. The red line is the simulated pressures in EPANET, and the green squares are the measured pressure. The comparison shows that the results of the simulation are very close to what is measured; the model is calibrated and is ready for simulation.

Figure 15Flow rate calibration.


The calibration is also made against the flow at the three inputs of the study area. The results of the flow simulation (red line) are very close to what is measured by the green squares as shown in Fig. 15.

To calculate the magnitude of the leak for each time and node, Eq. (2) was used. Table 4 shows the emitter coefficients simulated on each network node.

Table 4Emitter coefficients corresponding to simulated leaks.

Download Print Version | Download XLSX

Table 5 resumes where the leaks are spatially spotted and the value of leakage flow at each node of the network, using the random forest algorithm.

Table 5Quantification of the leaks.

Download Print Version | Download XLSX

Note that for the four last leaks we have L=1, which means that the algorithm classified them as leaks. However, the leak is overestimated. The algorithm shows the days of 23 and 26 April as being cases of leaks.

The results of these two days are not used because the change in pressure profile during these days was not because of a leak but because there was closure of some valves in the area to do some work.

For other days we have indeed L=0.

The data analysis confirms that, for an emission coefficient of at least 2, the leak prelocalization via the adopted method is possible in particularly for flows passing 10 L s−1. Indeed, these values of flow provoke important “head loss” easily detected by the pressure sensors implemented within the acting zone, which confirms the hypothesis made at the beginning of this study.

Two phenomena can explain the limits of the current method in terms of its capacity to detect leaks with low flow values. First of all, according to Jarrige and Gancel (2017) several factors may influence the leak noise propagation to the sensors, such as the material type, the pipe diameter, and more importantly the pipe roughness. In fact, the mis-evaluation of this last factor influences the reference pressure calculation. According to Paquin et al. (2000) the results prove that it is necessary to measure the real roughness in order to interpret correctly a simulated and a measured pressure.

The second reason beyond the limited performance of the proposed method to spot leak characterized by low flow was highlighted by a study of Mirats-Tura et al. (2014). In their paper the authors demonstrated that a mis-calibrated hydraulic model (in terms of the topographic structure and its parameters), the precision regarding the estimation of the spatial water need distribution within the sector of application, and the precision of the sensors embedded in the network are all eventual causes of the mentioned detection issues.

In fact, like the Mirats-Tura et al. (2014) study, our proposed method is mainly relying on the sensitivity analysis of the pressure measures to the water demand fluctuation in the network nodes. The only difference is that we simulated leak flow series at the level of fire hydrant according to different buffer (radius of 100, 200, 300 m), and the only aim is to study the influence radius of each sensor to detect the real flow simulated. This analysis permitted an optimal distribution of sensors in the network. For Mirats-Tura et al. (2014), although the sensors were narrowly installed, the leak position was determined within a 150 m radius, compared to the 100 m radius of our method.

The presented results are outputted from a model established using measures from the network. Some of these measures are considered to have a good precision, and others have a certain level of uncertainty. For instance, the roughness and the nodes' elevations measures are highly impacted by uncertainties. Another factor that impacts the precision of the proposed method is the measuring devices in terms of their recording interval (the pressure is measured each 5 min). In order to optimize the detection, and to focus on the leaks with high head losses spotted by standard sensors, it is recommended to use sensors with high frequency, capable of recording a high number of samples. This will help detect the small pressure variation caused by low leak flow.

3.2 Displaying results

The proposed method outputs are not always reliable. In fact, instead of a deterministic mapping of the leaks, there is a probabilistic output that maps the probability of occurrence of leaks in space (Pérez et al., 2014b).

If the forecast indicates a leak, which is estimated to locate it on the map, we have four distances from the four pressure sensors. Around each sensor we draw a circle of radius corresponding to the given distance by the prediction (Fig. 16). Ideally, these four circles intersect at a single point which corresponds to the leak point.

Figure 16The spatial intersection of circles. Please note that 1 mi = 1.609344 km.

The intersection of these four circles will then be at the maximum at 12 points if all the circles intersect with each other at two points. Considering two circles, there are three cases:

  • The circles intersect at two points, one corresponding to the leak point and the other symmetrical with respect to the line passing through the centers of the two circles.

  • Circles tangent to each other intersect at a single point that corresponds to the leak point.

  • The circles do not cross, but if the forecast is good, they can get closer in the leaking zone.

By drawing all the points of intersection, around each of them, the leakage location is identified within a 100 m radius.

There is a good performance with highest probability of having the location of leak when there is a big agglomeration of the circle that has a more intersect point. This agglomeration corresponds to the cumulative probability of the given nodes to experience a leakage (Fig. 17).

Figure 17Spatial location of the leak LC. Please note that 1 mi = 1.609344 km.

Our research objective was the purpose of discovery-appropriate solution for detection and localization of leakages and estimation of the size of leakages for a water distribution system. The results obtained using this approach are satisfying. The leak is identified within a 100 m radius.

That said, the detection of a leak is extremely related to its location within the network. For instance, one located in the looped section of the network is less likely to be spotted in nighttime. In the mesh part of the network the pressure fallen at the sensor levels is too low, which could lead to a disturbance by uncertainties in the model. The measured pressures obviously involve significant errors, which reduce, in the analysis, the possibility of detecting leaks of lesser importance.

4 Conclusions and perspectives

Our research objective was discovering an appropriate solution for detection and localization of leakages and estimation of the size of leakages for a water distribution system. The FAVAD parameters were optimized via a prediction algorithm, to constitute the core of our adopted procedure. The adopted approach necessitates a coupled hydraulic–GIS interface by means of the random forest algorithm.

This work helped to spot critical leaking points and therefore to contribute in the effort of physical loss reduction. Although the detection results were not always accurate in terms of space localization, the radius of search is reduced substantially, which makes the detection rates during field campaigns more successful and less time-consuming.

Data availability

The research data generated and/or analyzed during the current study can be obtained by contacting the corresponding author. These training data are obtained by using EPANET toolkit available at (Eliades et al., 2016).

Author contributions

FT contributed to the design and implementation of field and laboratory work, data collection, conceptualization, methodology, analysis of the results and their validation, and writing the manuscript and its revision. LS and AA contributed to the conceptualization, methodology, analysis of the results and their validation, and supervision of the writing of the article and its revision.

Competing interests

The authors declare that they have no conflict of interest.


The authors thank Said Rhouzlane and the anonymous reviewer, whose comments helped significantly improve the quality of the paper.

Review statement

This paper was edited by Luuk Rietveld and reviewed by Said Rhouzlane and one anonymous referee.


Al-Ghamdi, A. S.: Leakage–pressure Relationship and leakage detection in intermittent water distribution Systems, J. Water Supply Res. Technol. Aqua, 60, 178–183,, 2011. 

Alkasseh, J. M. A., Adlan, M. N., Abustan, I., Aziz, H. A., and Hanif, A. B. M.: Applying minimum night flow to estimate water loss using statistical modeling: A case study in Kinta Valley, Malaysia, Water Resour. Manag., 27, 1439–1455, 2013. 

Andrea, C., Giuseppe, C., Egidio, B., and Nicola, G.: A New Method for Detecting Leaks in Underground Water Pipelines, IEEE Sens. J., 12, 1660–1667,, 2011. 

Babel, M. S., Islam, M. S., and Gupta, A. D.: Leakage Management in a low-pressure water distribution network of Bangkok, Water Sci. Technol. Water Supply, 9, 141–147,, 2009. 

Bakker, M.: Optimised control and pipe burst detection by water demand forecasting, Doctoral dissertation, TU Delft, Delft, the Netherlands, 2014. 

Breiman, L.: Random Forests, Mach. Learn., 45, 5–32, 2001. 

Brown, G. O.: The history of the Darcy-Weisbach equation for pipe flow resistance, in: Proceedings of the 150th Anniversary Conference of ASCE, 3–6 November 2002, Washington, D.C., USA, edited by: Fredrich, A. and Rogers, J., American Society of Civil Engineers, 34–43,, 2011. 

Chadwick, A., Morfett, J., and Borthwick M.: Hydraulics in civil and environmental engineering, 5th edn., CRC Press, London, UK, 648 pp., 2013. 

Cobacho, R., Arregui, F., Soriano, J., and Cabrera Jr., E.: Including leakage in network models: An application to calibrate leak valves in EPANET, J. Water Supply Res. Technol. Aqua., 64, 130–138,, 2014. 

Colombo, A. F., Lee, P., and Karney, B. W.: A selective literature review of transient-based leak detection methods, J. Hydro-Environ. Res., 2, 212–227, 2009. 

Eliades, D. G., Kyriakou, M., Vrachimis, S., and Polycarpou, M. M.: EPANET-MATLAB Toolkit: An Open-Source Software for Interfacing EPANET with MATLAB, in: Proc. 14th International Conference on Computing and Control for the Water Industry (CCWI), 7–9 November 2016, Amsterdam, the Netherlands, p. 8,, 2016. 

EPA: Water Distribution System Analysis: Field Studies, Modeling and Management, U.S. Environmental Protection Agency. EPA/600/R-06/028, Cincinnati Ohio, USA, 2005. 

Farina, G., Creaco, E., and Franchini, M.: Using EPANET for modelling water distribution systems with users along the pipes, Civ. Eng. Environ. Systems, 31, 36–50, 2014. 

Farley, M. and Trow, S.: Losses in Water Distribution Networks, IWA Publishing, Hue City, Vietnam, 296 pp., 2003. 

Farley, M., Wyeth, G., Ghazali, Z. M., Istandar, A., Singh, S., Dijk, N., Raksakulthai, V., and Kirkwood, E.: The manager's nonrevenue water handbook: a guide to understanding water losses, Ranhill Utilities Berhad and the United States Agency for International Developement, Bangkok, Thailand, 2008. 

Ho, T. K.: Random Decision Forest. Proceedings of the 3rd International Conference on Document Analysis and Recognition, 14–16 August 1995, Montreal, Canada, 278–282, 1995. 

Jarrige, P. A., and Gancel, G.: Method for detecting anomalies in a distribution network, in particular a water distribution network, United States Patent Application, US2017/0205267A1, Suez Groupe, Paris, France, 2017. 

Lambert, A.: What do we know about pressure-leakage relationships in distribution systems, in: Proceedings of the IWA Conference in Systems Approach to Leakage Control and Water Distribution System Management, 16–18 May 2001, Brno, Czech Republic, 2001. 

Mirats-Tura, J. M., Jarrige, P. A., Meseguera, J., and Cembrano, G.: Leak detection and localization using models: field results, Procedia Eng., 70, 1157–1165, 2014. 

Oasen: Eerste successen met DMA's in voorzieningsgebied Oasen behaald, available at:, (last access: 20 February 2020), 2015. 

Paquin, P., Babineau, D., Brissette, F., and Leconte, R. : Développement d'une méthodologie de repérage des conduites d'aqueduc présentant des fuites, Can. J. Civ. Eng., 27, 151–159, 2000. 

Pérez, R., Cugueró, M.-A., Cugueró, J., and Sanz, G.: Accuracy assessment of leak localisation method depending on available measurements, Procedia Eng., 70, 1304–1313, 2014a. 

Pérez, R., Sanz, G., Puig, V., Quevedo, J., Cuguero, Escofet, M. A., Nejjari, F., Meseguer, J., Cembrano, G., Mirats-Tura, J. M., and Sarrate, R.: Leak localization in water networks: A model-based methodology using pressure sensors applied to a real network in Barcelona, IEEE, 34, 24–36, 2014b.  

Rossman, L. A.: EPANET 2 User's Manual, US Environmental Protection Agency. Water Supply and Water Resources Division, National Risk Management Research Laboratory, Cincinnati, OH, USA, 2000. 

Rozental, M.: La modulation de Pression Intérêts Bénéfices et Mise en œuvre, SUEZ Environnement, Paris, France, 86 pp., 2010. 

Sebbagh, K., Abdelhamid, S., and Zabot, M.: Pre-Localization Approach of Leaks on a Water Distribution Network by Optimization of the Hydraulic Model Using an Evolutionary Algorithm, Proceedings, 6, 59–66,, 2018. 

Thornton, J. and Lambert, A.: Progress in practical prediction of pressure: Leakage, pressure: Burst frequency and pressure: Consumption relationships. Proceedings of IWA Special Conference, Leakage 2005, 12–14 September 2005, Halifax, Nova Scotia, Canada, 2005. 

Zhang, J., Zulkernine, M., and Haque, A.: Random-Forests-Based Network Intrusion Detection Systems, Systems, Man, and Cybernetics, Part C: Applications and Reviews, IEEE T. ER, 38, 649–659,, 2008. 

Short summary
In this study, we investigate numerically, using EPANET code, the leaks in a water distribution network (WDN). The old part of Casablanca (Morocco) is used as a case study. The first episode is based on a simulation of artificial leaks on the MATLAB platform using EPANET. The second was a real simulation of artificial leaks. The results obtained are compared with those of a real simulation of artificial leaks caused by the opening and closing of hydrants.