ABSTRACT
Leakages in water supply networks can be minimized through pressure reduction or by repairing the resulting damage. The effective implementation of the latter approach necessitates the localization of leaks, for which various methods exist. This paper presents a specific software and hardware configuration for constructing a digital twin of pressurized piping systems that can be utilized for this purpose. The proposed method can identify both the flow and position of leaks and is based on solving an equivalent optimization problem, where the objective function depends on the difference between the measured pressure values at specific points and those predicted at the same points under the same boundary conditions by a computational model. Given the multimodality of the formulated problem, particle swarm optimization is implemented for this task. To enable real-time localization, the measured pressure values are transmitted to a microcontroller, which processes the data and sends it to a Python script. This script employs a while loop to continuously monitor the criteria for leak detection, and when these criteria are met, it initiates a procedure for leak localization. The theoretical aspect of the procedure, as well as its practical implementation, is presented below as an example.
HIGHLIGHTS
Simple hardware and software solution for a digital twin of a pressurized piping system.
Real-time water leak detection by its position and flow.
Leakages detection by solving an equivalent optimisation problem.
Leakages localisation by particle swarm optimisation algorithm.
Laboratory validation of the leakage localization algorithm.
INTRODUCTION
Leakage in water supply systems is a very prominent water management problem that impedes the rational management of water resources, which, in turn, has numerous negative impacts on various social and environmental aspects. More recently, it can easily be placed in the context of climate change (by considering the principle of rational water use and the paradigm of sustainable development). The efforts being made to address this problem are more than justified, especially when considering that, according to some estimates (Liemberger & Wyatt 2019), over 126 billion m3 of water are lost from water supply systems globally each year. Although there are different types of water leakage (such as the intentional release of water from the system to preserve water quality), the former primarily refers to leakage caused by damage to pipes or failure of pipe joints. Moreover, experience generally confirms that there is a strong positive correlation between the amount of water loss and the age of the system in question, which can be understood as a consequence of damage accumulated over time due to inadequate system maintenance. Since the replacement of the entire infrastructure is usually not a rational solution, the reduction of water losses is usually carried out by adequate water loss management (Skworcow et al. 2009; AbdelMeguid et al. 2010; Berardi et al. 2013). In this regard, it is important to note that pressure reduction in the system is most commonly used to minimize losses, as it decreases the pressure gradient across the flow area and, consequently, reduces leakage flow. However, it should be recognized that pressure reduction (AbdelMeguid & Ulanicki 2011; AbdelMeguid et al. 2011) can only be carried out to a certain extent, i.e. until the minimum pressure conditions prescribed by fire protection are compromised. In this way, it can be concluded that this approach does not address the underlying problem but temporarily alleviates its symptoms and thus is not in the spirit of sustainable development. A more adequate approach, to be applied continuously, relies on selective infrastructure repair that requires leakage localization. In this way, the maintenance challenge is reduced to two tasks: (i) leakage detection, which is relatively easier and involves determining the difference between the volume of water delivered and the volume that entered the system, and (ii) leakage localization, which proves to be a significantly more challenging endeavour.
In general, methods for leakage localization can be classified into two main groups: (i) physical methods, which involve direct system inspection (e.g. visual, acoustic, and infrared thermal inspections), and (ii) theoretical methods, which rely on analysing data collected from field measurements, typically water flow and pressure. Since the methods in the first group require an inspection of the entire infrastructure, or at least a larger part, i.e. a suspicious part, their application is often costly. Consequently, there is a greater focus on improving and developing methods from the second approach. These approaches based on data analysis can further be categorized into three basic groups: transient-based approach, data-based approach, and model-based approach (Chan et al. 2018).
Transient-based approaches are based on analysing the time derivative of flow characteristics (usually pressure fluctuations), which will propagate through the system as a sound wave affecting leakage flow (Ayati et al. 2019). Although this approach is very attractive for relatively large systems, the high speed of sound propagation in pipes (typically between 400 and 1,500 m/s, depending on the mechanical properties of the water and pipes) makes its application complex. It requires sophisticated measuring equipment that must be sensitive to very small pressure changes and capable of high-speed response and sampling frequency (Lee et al. 2006). This is crucial because these approaches rely on applying a Fourier transform, where the temporal change in pressure induced by controlled valve maneuvers is used to construct the system's frequency response. Specifically, the frequency response diagram of a system with water leakage will exhibit additional resonant pressure amplitude peaks that are lower than the resonant amplitude peaks in a system without leakage. Furthermore, the location and magnitude of leakage can be estimated based on this difference (Mpesha et al. 2002).
Data-based approaches are based on the recognition of specific patterns in large datasets collected under various flow conditions in a steady-state flow regime. Namely, the position of a water leak can be determined by identifying anomalies in the collected data, specifically by detecting deviations from the expected patterns characteristic of a functional system without leaks. For this purpose, various data mining techniques can be employed for pattern recognition. For instance, machine learning or deep learning methods can be utilized to pinpoint the location of water leaks using flow data in pipelines (Shravani et al. 2019). Considering that the selective measurement of flow in pipes can be challenging, pressure data in the system is often used for this purpose, and the pattern recognition in this case is performed using neural networks. Moreover, this approach has been proposed for detecting multiple water leak locations (Fang et al. 2019), which represents a particularly complex task (Kim 2018) for real systems; many will agree that it is still out of reach (or at least for practical application).
Model-based approaches, such as the procedure presented in this paper, are used to approximate the location of water leaks by comparing measured data with predictions from a hydraulic model at the same flow positions and under identical flow conditions (pressures are typically compared, though tracer concentration may also be used). The comparative analysis in this context can be performed in various ways. One method involves constructing the so-called pressure sensitivity matrix , with components
that describe the change in pressure
at location i in response to a change in flow
at location j due to a unit water leakage (Pérez et al. 2011). This matrix thus describes how system pressure varies with changes in leak location, where columns j represent potential leak locations, and rows i correspond to pressure measurement points. The comparative analysis is performed by constructing a residual pressure vector
, whose components are the differences between measured and predicted pressures at the same points. This vector is then compared to the columns of the pressure sensitivity matrix
, and various criteria can be applied to assess the degree of match, thereby identifying the leak location (Casillas Ponce et al. 2014). Another interesting localization approach is based on the application of Bayesian classifiers (Soldevila et al. 2017). In this method, the leak localization process is relaxed, i.e. leakage localization is seen as a task that does not have a deterministic solution but a probabilistic one. A hydraulic model is employed to simulate potential leak scenarios, after which the Bayesian classifier is used to analyse the differences between measured and predicted pressure data to indicate the probable location of the leak. It is also important to note that mixed approaches can be utilized; for example, combining hydraulic models with a database (Soldevila et al. 2016).
This paper presents a model-based methodology for localizing water leakage. The approach is framed as an equivalent optimization problem in which the objective function should be minimized, as it represents a measure of the difference between measured and predicted pressures at the same points within the system and under the same flow conditions. While this procedure is already established (Wu & Sage 2006), it is important to note that this can lead to a multimodal problem, characterized by multiple equivalent solutions. Consequently, the formulated problem will be addressed here using a specific swarm-based meta-heuristic optimization algorithm (Simon 2013), which is suitable for these cases. Moreover, this procedure will aid in forming a digital twin of the physical system in consideration, which will be used to process the pressure and flow data obtained in real time to identify the position and magnitude of potential water leakages (theoretically more than one leak). A particularly interesting aspect of this procedure lies in the fact that it can be relatively easily applied to existing systems with a limited number of leakages, thereby allowing for the timely recognition of new damages and motivating the direction of system development towards the establishment of digital twins (Brahmbhatt et al. 2023).
It must be noted that there is a limited number of research studies dealing with the establishment of a digital twin of a water distribution network, including various applications such as improving management (Conejos Fuertes et al. 2020), evaluating the effects of changing water demands (Pesantez et al. 2022), or state estimation (Bonilla et al. 2022). In terms of leak localization, Brahmbhatt et al. (2023) rely only on conducting computational experiments for benchmark networks, while in work by Gómez-Coronel et al. (2023), the digital twin methodology for leak detection and localization was tested on a real hydraulic system, but with leaks occurring only in the main pipeline section, allowing only three leak locations. Therefore, to the best of the author's knowledge, there is no previous research with the methodology proposed in this paper; the novelty lies in establishing a digital twin based on laboratory experiments with optimization approach for leak localisation allowing smaller leaks that can occur anywhere in the considered model of the water distribution network.
METHOD
A specific model-based approach is presented below, which requires the modelling of stationary flow through pipe j, with known water demands at junctions i, where the pipes converge. It should be noted that solving the problem framed in this manner essentially involves inverse modelling of the system. In the conventional case, system modelling is reduced to solving the matrix equation , where A is a known matrix that describes the system characteristics, x is an unknown vector of pressures
at the junctions i, and b is a given vector of water demands
at the same junctions.
In contrast, when localizing water leakage, the system matrix A is not known in advance because the location of the leakage, that is, the flow area from which the water is leaking, is also unknown. Moreover, it is important to note that the flow rate from this area varies with changes in system pressure (Clayton & Van Zyl 2007), meaning the unknown in question is the surface flow area of the leakage. However, for a given arrangement of water demands at the junctions i, localizing water leaks can be approached as an iterative process in which measured system pressures (which account for leakage losses) are compared to pressures obtained by a calibrated hydraulic model of the system. This model, while accounting for overall system demands
, includes one or more additional consumptions
that simulate leaks.
































The inertia factor w typically decreases as the number of iterations increases, under the assumption that the optimal solution is being approached over time. This parameter is used to balance global exploration (with relatively high values, e.g. 1.0, modelling space exploration, while relatively low values, e.g. 0.2, model space exploitation). The second term on the right side of Equation (5) can be interpreted as the particle's reliability in the search for the best solution, with its magnitude modelling the preference for the particle's best position obtained so far. On the other hand, the last term on the right side of Equation (5) can be interpreted as the significance of trust in other particles' searches, favouring the global best solution obtained so far. Accordingly, the first term on the right side of Equation (5) is usually interpreted as a diversification term, modelling the preference for searching unexplored areas, while the sum of the other two terms is typically interpreted as an intensification factor, modelling the preference for searching in known areas where the particle has moved (with individual and collective components).
In the presented approach, it is particularly important to note that additional constraints can be easily added to narrow down the search space or to focus on specific parts of it. For instance, this can be useful if the analysis excludes new pipes (due to their presumed low probability of leakage). Additionally, the approach allows for the straightforward inclusion of multiple potential water leak locations. However, with each additional leak location, the dimensionality of the search space increases, which in turn raises the computing power requirements.
The presented methodology was used to develop a digital twin designed for real-time localization of water leaks in a physical system, and some related hardware and software aspects are discussed as follows.
DIGITAL TWIN
First of all, a digital twin of a physical system requires a calibrated computer model of that system (Koppel & Vassiljev 2009). In this case, this entails a hydraulic model of the water supply system, where the pipe roughness and local loss coefficients
are calibrated so that, under the same water demand
at junctions i, the measured and modelled pressures coincide (Vassiljev et al. 2015). It is particularly important to note that model calibration establishes the initial state of the system, assuming no existing water leaks. If leaks are present, however, their effects will be reflected in the calibrated values of the parameters
and
.
















Even in cases where there are small pre-existing leaks, i.e. relatively small leaks that are unknown in advance, it should be recognized that the application of the presented pipe roughness calibration procedure will also account for their influence in leak localization. These leaks will cause an increase in flow within the pipes, which in turn leads to higher flow velocity and greater pressure drop, ultimately resulting in a higher roughness value. In other words, the presented procedure can also be used in cases of pre-existing small leaks that have not been previously recorded to localize these leaks when they become larger – which is inevitable to occur with time.
Once the pipe roughness's are determined, the local loss coefficients
can be calibrated by treating their value
at junctions i as design variables and resolving the optimization problem by searching for a solution that will minimize the difference between the measured
and predicted pressure
in junctions i. It should be noted that the procedure can be conducted for more than one scenario of water demands
at junctions i so that the objective function is defined as a sum of all L2 norms of vectors with components given by the difference of the measured
and predicted pressure value
at junctions i. Same as before, the PSO algorithm can be used for this purpose.
Some remarks on hardware features
It should be recognized that model-based approaches require (i) known water demands at all points where water is delivered to consumers and (ii) pressure values at specific pre selected points. In water supply networks, water demands at junctions i are generally available; however, this information is typically provided as cumulative monthly usage data for billing rather than as instantaneous, real-time data. This limitation imposes a restriction, as water demands at junctions are essential for predicting the pressure distribution using the system's hydraulic model, which is then compared with measured pressures at the same locations. Given that real-time water demand data is typically unavailable, analyses are often conducted using average values of water demand and pressure, though this may reduce the accuracy of leak localization. Therefore, in the following discussion, it is assumed that real-time water demand data is available, as the development of water supply networks is progressing towards such capabilities, enhancing feasibility for future applications.
Although it is not necessary to measure system pressures to preserve the functionality of the water supply system, these measurements are required for system maintenance, which can help in locating potential water leaks. When pressure gauges are installed for this purpose, their number and positions should be carefully selected to maximize their effectiveness in detecting leaks. This ensures that each gauge's reading accurately represents the pressure in its surrounding area and that these areas complement one another. This topic has received considerable attention (Blesa et al. 2015), and more recently, pressures in areas without sensors have been reconstructed using various interpolation techniques based on surrounding known pressures (Soldevila et al. 2018).
It should be noted that implementing the necessary hardware prerequisites for constructing a digital twin of the water supply system is not straightforward for several reasons, one of which is the requirement for a complex telemetry infrastructure. While these challenges complicate the development of such systems, they do not prevent it. The benefits of these systems have been recognized on several occasions (Pesantez et al. 2022), and their use should be encouraged for more rational and responsible management of water supply systems.
Some remarks on software features
Once the water demand at all junctions i and pressure values
at some junctions i have been collected and transmitted in real-time to some central computational unit, they can be processed using the previously described calculation procedure to localize a possible water leak. Among the many different programming languages that can be used for the computer implementation of the related calculation procedure, defined by Equations (1)–(5), Python (Van Rossum & Drake 2009) stands out as a particularly attractive alternative. Namely, in that case, the wntr package can be accessed (Klise et al. 2020), which was originally designed to simulate and analyse the resilience of water supply networks. Moreover, the commands of the wntr package can be used to access the hydraulic model previously developed in the EPANET programme (Rossman 2000), which is commonly used for analyzes of practical importance, i.e. for real water supply systems. In this way, Python provides an attractive programming environment in which the previously illustrated calculation algorithm can be implemented using a while loop that tests various amounts and positions of water leaks until the objective function, as defined by Equation (1), is minimized. Some detailed implementation aspects of this procedure are illustrated below, focusing on an example of a digital twin of such a system.
EXPERIMENTAL SETUP
(a) A plan of the pressurized pipeline system is used to illustrate the application of a digital twin in water leak localization, with indications of the position and dimensions of all characteristic elements, and (b) a photograph of the constructed pressurized pipeline system showing all characteristic elements and measuring devices, such as pressure gauges and flow meters, as well as the position of the inlet flow from the elevated red bucket.
(a) A plan of the pressurized pipeline system is used to illustrate the application of a digital twin in water leak localization, with indications of the position and dimensions of all characteristic elements, and (b) a photograph of the constructed pressurized pipeline system showing all characteristic elements and measuring devices, such as pressure gauges and flow meters, as well as the position of the inlet flow from the elevated red bucket.
At the midpoint of each side of the formed octahedron, pressure gauges with a measurement range from 0 to 0.35 bar, an accuracy of 1% of full scale, and an output voltage range from 0 to 5 V were installed (Figure 1(b)). These pressure gauges were connected to a microcontroller equipped with a 10-bit resolution analog-to-digital converter, allowing pressure head changes of only a few millimetres to be measured. It should be noted that the pipes were carefully levelled in advance, ensuring all pressure sensors were aligned in the same plane perpendicular to the local gravity vector. To maintain a constant and known pressure at the system's inflow, located at the midpoint of one pipe (Figure 1(a)), the inflow point was connected by a rubber tube to the bottom of an open tank positioned at a specific height and continuously refilled with water (red bucket in Figure 1(b)). Since the tank is open on the upper side, any excess water overflows, so the pressure at the system's inlet is determined by the height difference between the inlet and pipe elevation, along with previously measured pressure head losses along this flow path. By adjusting the tank's position, different pressure conditions in the system can be tested.
To measure the flow at the exit of the system, which represents the water demands at junction i, the corners of the two opposite sides of the formed octahedron are equipped with flow meters and output regulation valves to control the outflow (Figure 1). For this purpose, flow meters with a measuring range from 1 to 30 l/min, an accuracy of 2% of full scale, and an output voltage range from 0 to 5 V were used. Additionally, one such flow metre was placed at the entrance to the system (Figure 1) to measure the difference between the water inflow and outflow, which represents the flow related to leaking. This difference was used to verify the predicted leakage amount determined by the previous calculation procedure.
To simulate water leakage in the system, circular openings with a diameter of 5.0 mm (with an area of 20 mm2) were created on the pipes and covered with rubber closures. The openings were positioned on the outside of the formed octahedron to allow water to flow freely into the pool where the entire installation is located (Figure 1(b)). Starting from the inlet flow position in the system (Figure 1(a)), the openings were made at a constant distance of 12.5 cm, resulting in a total of 64 openings, which were numbered in a counterclockwise direction. These openings were used to simulate water leaks in different positions by simply removing some of the rubber closures. The previously illustrated procedure was employed to locate the position of the leaks and to identify their flow values. Moreover, to examine the influence of the size of the opening through which the water leaks, modular shutters were prepared that can cover only a segment of the formed opening. In this way, leakage was made possible through openings with surface flow areas of 2, 4, 6, and 12 mm2, as well as in the case without a cover (20 mm2), which was interesting for considering the influence of leakage flow on the ability to localize the leak.
Localization of water leaks is carried out in real-time so that the collected data of water demands at junctions (collected in a vector variable q_measured) and pressures at the midpoint of pipes (collected in vector variable p_measured) are continuously delivered via the microcontroller to the central computing unit (PC), where a while loop is continuously executed, within which the difference between the measured pressures and those predicted by the hydraulic model (for the same water demands and collected in vector variable p_predicted) is computed and stored in a variable p_residual.
Hydraulic model of the considered pressurized piping system, displaying the arrangement and numbering of junctions used to simulate water leakage.
Hydraulic model of the considered pressurized piping system, displaying the arrangement and numbering of junctions used to simulate water leakage.
For embedding the previously illustrated computational instructions into a Python script, it is important to note that the indexing of vector elements in Python starts from 0, while the numbering of junctions taken from the hydraulic model generated in EPANET (saved in the file model.inp) starts at 1. This means that the position of some vector components should be increased by one, while others should be decreased by one.
If the sequence numbers of the junctions where pressure measurements were taken are stored in the measurement_junctions vector, which contains a total of n_measurements components, the following Python script can be used with some commands from the wntr package to determine whether there is a leak in the system or if the difference p_residual between the measured pressure and the predicted by the hydraulic model exceeds a predetermined tolerance. If so, the algorithm for localizing water leakage is executed, which is based on the subsequent process of minimizing the objective function given by Equation (1) using the PSO algorithm.
# Loading the hydraulic model from EPANET
wn = wntr.network.WaterNetworkModel(’model.inp’)
# Loading data for pressures and water demands
while (p_residual > tolerance):
import measured_pressures as p_measured
import water_demand as q_measured
# Assigning the loaded water demands to the junctions
for i in range(0,n_junction):
junction = wn.get_node(str(i + 1))
junction.demand_timeseries_list[0].base_value = q_measured[i]
# Evaluating pressures in the system
sim = wntr.sim.EpanetSimulator(wn)
results = sim.run_sim()
pressure = results.node[’pressure’]
for i in range(0,n_junction):
p_predicted[i] = pressure.loc[0,str(i + 1)]
# Evaluating pressure residuals
p_residual = 0.0
for i in range(0,n_measurements):
junction = measurement_junctions[i]-1
p_residual = p_residual + abs(p_measured[junction]-p_predicted[junction])
RESULTS AND DISCUSSION
Illustration (a) represents the tested configuration of system parameters, with leakage set at junction 42 and an inflow pressure head of 1.64 m. Illustrations (b)–(f) show the predicted location of water leakage for five different leakage openings (effective leakage areas from 2 to 20 mm2). Each illustration reflects the results of 30 successive localization attempts, where the size of the circle (diameter) indicates the number of times leakage was identified at the circle centre, and the colour of the circle represents the leakage flow according to the colour bar.
Illustration (a) represents the tested configuration of system parameters, with leakage set at junction 42 and an inflow pressure head of 1.64 m. Illustrations (b)–(f) show the predicted location of water leakage for five different leakage openings (effective leakage areas from 2 to 20 mm2). Each illustration reflects the results of 30 successive localization attempts, where the size of the circle (diameter) indicates the number of times leakage was identified at the circle centre, and the colour of the circle represents the leakage flow according to the colour bar.
Water leakage was introduced at junction 42 (Figure 3(a)), and the effective leakage area was varied between experiments as previously specified. Since leakage flow has a nonlinear relationship with the pressure at the leakage point, it was calculated based on the measured difference between the inlet flow at junction 1 and the measured outflows at the junctions where water demands were simulated. In this way, for the tested effective leakage areas of 2, 4, 6, 12, and 20 mm2, the following water leakage flows were determined: 0.013, 0.020, 0.040, 0.049, and 0.059 l/s, respectively. It should be noted that the choice of leak location and leakage amount was not random. Specifically, the leakage flow rate for the smallest effective leakage area aligns with water demands on that side of the pressurized piping system, making both detection and localization of the leak particularly challenging. Namely, note that the flows in question are difficult to distinguish because they are relatively small (compared to other flows in the system) and cause only a minimal drop in pressure head.
To localize the leak, the previously presented application of the PSO algorithm was used with a total of 50 particles, and the model parameters were selected with the following values: c1 = 1.5, c2 = 2.0, Ir = 0.01, and w = 0.8. It is important to note that the parameters of the model remained constant during all experiments and that for each effective leakage area, a total of 30 consecutive localization attempts were carried out, which was primarily necessary given that the application of the PSO method is of a stochastic nature (for vectors and
) and therefore regularly validated statistically. The obtained results are shown in Figure 3, where the localization results for all examined cases are illustrated with coloured circles. At the same time, the size of the circle indicates the number of localization attempts that localized the same leakage point, and the colour of the circle indicates the determined leakage flow.
It should be noted that only in the first case, i.e. for the smallest effective leakage area (Figure 3(b)), most localization attempts correctly identified the branch of the pressurized piping system but did not precisely pinpoint the leakage junction. However, they did accurately predict the leakage flow, that is, the range of leakage flow (between 0.012 and 0.014 l/s). This is understandable, given that the leakage flow was of a similar order of magnitude to the neighbouring water demands. In contrast, for all other cases where the leakage flow exceeded the neighbouring water demand (Figures 3(c)–3(f)), it can be reasonably concluded that all localization attempts successfully identified both the location and the amount of water leakage. Namely, higher amounts of leakage flow will require higher water velocities in the pressurized piping system, which will then leave a larger ‘trace’ in the pressure field and thus facilitate the minimization of the objective function given by Equation (1).
To evaluate the success of leak localization regarding the amount of leakage flow, the previously presented data can be systematized and displayed as a group using violin plots. Namely, a violin plot is a data visualization tool that combines elements of a box plot and a density plot, making it useful for understanding both the distribution and shape of a dataset. Each ‘violin’ represents a data group and shows density across values; the width of the shape indicates where data points are concentrated. Accordantly, wider sections suggest higher density, while narrower sections indicate fewer data points in that range. By comparing violins side by side, it is easy to establish differences in data distributions across multiple groups.
Violin plot showing predicted leakage locations (junction numbers) for 30 successive attempts conducted across five different effective leakage areas at junction 42.
Violin plot showing predicted leakage locations (junction numbers) for 30 successive attempts conducted across five different effective leakage areas at junction 42.
Violin plot showing predicted leakage flow (l/s) for 30 successive attempts conducted across five different effective leakage areas at junction 42.
Violin plot showing predicted leakage flow (l/s) for 30 successive attempts conducted across five different effective leakage areas at junction 42.
For further validation of the proposed methodology, different pipeline system configurations, including more complex pipe network configurations, multiple leaks, and varying pipe diameters, should be explored. Future work should also include conducting specialized tests on the localization of longitudinal cracks – i.e. extending over a longer area – since such cracks have been observed in some cases as a result of water hammer. Multiple leaks for PSO optimization will be straightforward to implement, with the increasing need for computational resources. Considering that the methodology proposed in the work provides a fast optimization procedure, important for the fast system response necessary for establishing a digital twin, this expansion will require special attention, including parallelization to obtain a proper strategy for real-life application.
Sensor placement and the number of sensors influence leak localisation efficiency, which is particularly important in asymmetric configurations of pressure systems with complex topological characteristics. Initially conducted tests with fewer pressure gauges measurements led to a reduction in the effectiveness of localization, which was expected. In this case, laboratory tests were conducted on a symmetrical pipe system, and thus the positioning of the pressure gauges was symmetrical, and optimal positioning of pressure measurement probes was not investigated; however, it is something that will be considered in future work.
It must be noted that scaling up the procedure to real-world water supply systems requires addressing several factors that were not as evident in the presented tests. Notably, pressure measurements in real-world systems are likely to be influenced by additional factors not prominent in the laboratory tests. For example, the sensitivity of measuring devices to pressure field oscillations, caused by changes in the velocity field, may impact accuracy. To account for these effects, linear regression was incorporated into the software solution for data acquisition, smoothing collected data over a time window of several seconds to minimize potential measurement oscillations. Although laboratory tests indicated that this was unnecessary due to (i) controlled measurement conditions, (ii) minimal temporal variations in flow velocity, and (iii) high-pressure measurement accuracy, such data smoothing will be essential for real water supply systems. Additionally, an effective noise reduction procedure will be required, which can be achieved by integrated low-pass filters. Although applying the presented method to real-world systems will require addressing additional practical challenges (such as installing complex telemetry equipment and parallelizing the software solution to accommodate a larger swarm of particles for the PSO algorithm), the conducted tests have demonstrated that the proposed methodology, which leverages a digital twin, can, in principle, be used to localize water leaks in pressure systems. Moreover, installing pressure and flow measurement equipment on existing water supply systems – currently used primarily for monitoring key parameters rather than for advanced data processing in leak localization – understandably leads to the development of digital twins, which could significantly enhance the efficient management of such systems.
CONCLUSION
A specific model-based approach for leak localization is illustrated and utilized to develop a digital twin of an actual pressurized piping system, enabling real-time leak detection. The proposed procedure addresses the leakage localization problem by formulating it as an optimization problem, where the objective function measures the difference between the observed and predicted pressures at predefined control points, assuming an identical distribution of water demands at the junctions. This procedure requires detailed calibration of the hydraulic model of the pressurized piping system under consideration and is primarily intended for detecting and localizing leaks that may subsequently occur but are not currently present. In other words, the approach assumes that any existing leaks are negligible, and their influence is incorporated into the calibration parameters (pipe roughness and local loss coefficients). For hydraulic model calibration, a procedure based on the indirect measurement of pipe roughness and the calibration of local loss coefficients using the PSO method is proposed. The PSO method is also applied to solve the formulated optimization problem for water leak localization, demonstrating high flexibility and effectiveness in finding solutions. This approach allows for the identification of leaks by both position and flow, and it has been tested under laboratory conditions. For the selected scale of the physical model of a pressurized piping system, results indicate that the digital twin can detect leak locations and flow rates with a pressure head change of as little as 2 mm or less, ensuring relevant localization success, especially in terms of predicting the value of leakage flow. The concept of the methodology is relatively straightforward and will soon be tested on a real water supply system.
ACKNOWLEDGEMENTS
This research article is part of the project Hydrology of Water Resources and Risk Identification of the Consequences of Climate Change in Karst Areas (23–74), funded by the University of Rijeka.
AUTHOR CONTRIBUTIONS
V.T. conceptualized the study, wrote the Python programme, calibrated the model, and wrote the article, E.G. constructed a physical model of the pressurized system and installed all the sensors, I.L. and E.Z. participated in the realization of the digital twin and reviewed the article.
DATA AVAILABILITY STATEMENT
All relevant data are included in the paper or its Supplementary Information.
CONFLICT OF INTEREST
The authors declare there is no conflict.