Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 781 ARID ZONE JOURNAL OF ENGINEERING, TECHNOLOGY & ENVIRONMENT ORIGINAL RESEARCH ARTICLE DEVELOPMENT OF A PIPE LEAKAGE DETECTION WITH SIMULATED ACOUSTIC MODEL FOR WATER DISTRIBUTION SYSTEM M. O. Arowolo1, A. A. Adekunle1, O. M. Olaniyan2, E. A. Fadiji3 and O.T. Oginni3* 1Department of Mechatronics Engineering, Federal University Oye, Ekiti State, Nigeria. 2 Department of Computer Science, Federal University Oye, Ekiti State, Nigeria. 3Department of Mechanical Engineering, Bamidele Olumilua University of Education, Science and Technology, Ikere- Ekiti, Ekiti State, Nigeria. *Corresponding author’s email: oginni.olarewaju@bouesti.edu.ng ARTICLE INFORMATION ABSTRACT The paper presents a method for detecting pipe leakage in a water distribution system using a simulated acoustic model. The study utilized Particle Swarm Optimization (PSO) to determine the optimal position for the leakage point in relation to the sensors. The objective function was created, and time delays were optimized using PSO simulated via MATLAB. The analysis focused on examining both vertical and horizontal flow configurations. The system was calibrated, data was extracted, and it was utilized for leakage automation. The study found that the optimal leakage point is 10.12 cm, measured to the left sensor1 in the horizontal configuration with a 0.02 second time delay. The second leakage point in the horizontal configuration has a time delay of 0.05 seconds, while the third point has a delay of 0.08 seconds. Eight false alarm frequencies were detected in the water flow and no leakage mode, with 100% of the false alarms indicating no flow or leakage. The system false alarm disappears when the system is pressurized for a long period of time. The study demonstrates the importance of detecting pipe leakage in water distribution systems using a simulated acoustic model in rural areas, developing countries, and small and medium-sized industries. Submitted 04 May, 2024 Revised 02 June, 2024 Accepted 10 June, 2024 Keywords: Pipe leakage Detection Acoustic model Water distribution Flow configuration © 2024 Faculty of Engineering, University of Maiduguri, Nigeria. All rights reserved. 1.0 Introduction A pipe distribution network is a network installation consisting of pipes and fitting structures like thrust blocks, various valves, and outlets installed in a system to supply either water, crude oil, natural gas, or petroleum products under pressure (Chen, 2019). Pipelines also permit the conveyance of water uphill against the normal slope of the land and, unlike open channels, can be installed on non-uniform grades. The use of buried pipes allows the most direct routes from the water source to fields and minimizes the loss of productive land. Major advances have been made in recent years in pipeline technology; however, typical pipeline distribution systems in many cities worldwide contain a large percentage of older pipes. In Nigeria, 60% of crude oil and petroleum pipelines are 30 years older. As pipes age, the problems of infiltration and exfiltration increase in sewer pipes, causing potential environmental problems, although in many cases these problems have yet to be quantified. Also, in water reticulation pipes, the failure levels increase with age, and consequently, the levels of unaccounted-for water (Neelem and Kalaga, 2022) and the associated lost revenue from water reticulation mains can also increase due to these failures and the associated water pipe leakage (Jianfeng, 2021). Pipe leakage is a costly problem, not only in terms of wasting a precious natural resource but also in economic terms. The primary economic loss due to leakage is the cost of raw water, its treatment, and its transportation. Leakage inevitably also results in secondary economic loss in the form of damage to the pipe network itself, such as erosion of pipe bedding and major pipe breaks, and in the form of damage to the foundations of roads and buildings (Fine and Millero, 2019). Diminution of supply security as a result of a reduction in water stored per capita may also represent a cost if such diminution requires augmentation of supply to maintain security. Besides the environmental and economic losses caused by leakage, leaky pipes create a public health risk, as AZOJETE December 2024. Vol.20(4):781-789 Published by the Faculty of Engineering, University of Maiduguri, Maiduguri, Nigeria. Print ISSN: 1596-2490, Electronic ISSN: 2545-5818 www.azojete.com.ng mailto:oginni.olarewaju@bouesti.edu.ng mailto:oginni.olarewaju@bouesti.edu.ng http://www.azojete.com.ng/ Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 782 every leak is a potential entry point for contaminants if a pressure drop occurs in the system. Thus, managing these problems has become an important aspect for managers of water supply networks. Acoustic listening and ground-penetrating radar devices are the physical inspections of the leak in the pipeline (Colombo, 2021). These techniques require shutting down and isolating the affected part or whole system. The complete process may take a few days to months, with plenty of significant water waste. The inspection of leaks is also done by observation on a routine basis. When the fluctuation in demand is increased from night to day consumption abnormally or major losses are suspected, leak detection techniques are applied. Model-based leak detection and isolation techniques have started with the influential research work of Pandey et al., (2021), which expresses the problem of least-squares estimation. The estimation of parameters in the water distribution network model is a difficult task. The non-linear equation caused difficulties in the water distribution network system, and for estimating the parameters, very few measurements are available, which causes the undetermined problem. Pérez et al. (2019) developed a model-based method for detecting and localizing the leaks. This method used pressure residual analysis and was compared with a given threshold. A threshold has been used to control the model's uncertainty and noise. The comparison of the residual against the threshold shows the possible leak present at nodes. Due to demand uncertainty at nodes and noise in measurement, the performance of this approach decreases, while in ideal conditions it shows good efficiency. In recent years, PSO-based methods have been applied to a wide variety of problems, leading to high efficiency (Bai, 2020). The PSO application depends on the MATLAB toolbox and introduced into MathWorks, where the presence or absence of a sensor at a given node is determined by a particle (Wang et al., 2019). This research therefore looks at the area of pipe leakage in water distribution networks (WDN) using particle swarm optimization (PSO). In PSO, possible solutions, called particles, fly through the problem space by following the current optimal particles. The PSO technique was used to find the minimal sensor placement for the identification of leaks in pipe networks. This technique was developed and integrated for accurate pipe leak detection in this study. 2. Materials and Method Two SEN0257 DFROBOT water pressure sensors, three 3-inch (76.2mm or 7.62cm) Polyvinyl Chloride (PVC) values, a 1 horse power (0.75KW or 746Watt) water pump, and an Arduino microcontroller (ATMEGA328) were bought and used for the construction of the leakage experimental rig. Other components were sourced locally in Akure, Ondo State. The SEN0257 DFROBOT has a pressure range of 0–1.6 MPa, a voltage range of 0.5–4.5 V, and an accuracy of 0.5–1%. The Arduino ATMEGA328 microcontroller is an 8-bit Automatic Voltage Regulator (AVR) controller; it is one of the many IDEs utilized for Atmel Automatic Voltage Regulator (AVR) controllers. Figure 1 shows the flowchart of the study methodology framework. The leakage detection scheme required identifying the optimum leakage location along the pipeline. Particle swarm optimization algorithm is used for easy leakage detection and position optimization Figure 1: Flowchart of the Study Methodology http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 783 2.1 Particle Swarm Optimization (PSO) Algorithm The algorithm is a meta-heuristic algorithm that can be implemented for optimization problems (Wang et al., 2019). It is an intelligent scheme developed to mimic the behavior of swarms of birds (particles’ population) in search of food in search space. The model involves solving two things: the swarm’s velocities (equation 1) and their positions (equation 2), which are subsequently updated until convergence is reached (Bai, 2020). 𝑉𝑖 𝑛+1 = 𝜔𝑉𝑖 𝑛 + 𝑐1𝑟1(𝑃𝑏𝑒𝑠𝑡𝑖 𝑛 − 𝑥𝑖 𝑛) + 𝑐2𝑟2(𝐺𝑏𝑒𝑠𝑡𝑖 𝑛 − 𝑥𝑖 𝑛) (1) 𝑥𝑖 𝑛+1 = 𝑥𝑖 𝑛 + 𝑉𝑖 𝑛+1 (2) Where 𝑉𝑖are the velocities of the particles in the search space, 𝑥𝑖 are the positions of the particles, 𝜔 is an inertia weight that balances the algorithm exploration, 𝑐1 and 𝑐2 are acceleration constants, and 𝑟1; 𝑟2 are random numbers usually between 0 to 1.The algorithm is shown in Figure 2, and PSO parameters utilized in this study are shown in Table 1. The algorithm solves equations 1 and 2 continuously until convergence is attained. A very important aspect of this algorithm is the objective function it optimizes, which is a function of the problem at hand. Figure 2: Particle Swarm Optimization Algorithm Flowchart Table 1: PSO Parameters Used for the Study S/N Parameters Values 1 Inertia weight (𝜔) 0.9 2 Acceleration constants (𝑐1 𝑎𝑛𝑑𝑐2) 1.5 3 Random numbers (𝑟1 𝑎𝑛𝑑 𝑟2) 0.5 4 Number of iterations 50 http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 784 2.2 Leakage Position Model (Objective Function) Applying the Particle Swarm Optimization algorithm for leakage detection requires an objective function. The objective function continues to solve until convergence is reached. In this study, the objective function has to do with optimizing the leakage points relative to one of the sensors. To model the relationship between leakage points and the sensors, the pressure sensors are positioned upstream and downstream of a pipe to gather negative pressure wave (NPW) signals to identify leakages, as shown in Figure 3. The precise position of the leakage point is estimated using the time difference between the detected signals and the propagation velocity in the medium as contained in Liao et al. (2019). Figure 3: Schematic Diagram of the Leakage Detection Process using Pressure Sensor From Figure 3, taking the distance between the two sensors as, 𝑑 the distance between the upstream sensor and the leakage point is, 𝑑1, and the distance between the downstream sensor and the leakage point is 𝑑2. Signal 𝑥1(𝑡) and 𝑥2(𝑡) are the measured signals from the two sensors. The position of the leakage relative to sensor 1, is then be expressed as 𝑑1 = 𝑑−𝑣𝜏 2 (3) Where 𝑣 is the pressure wave speed of the leakage along the pipe medium and 𝜏 is the time delay. The complexity of equation 3 is the time delay and the velocity of sound in the pipe medium, and these two parameters are central to the accuracy of a leakage detection scheme that uses the equation. An experimental rig, as shown in Figure 4, was constructed to predict leakages along water pipelines. The rig consists of water networks with leakage points as dictated by the outcome of the PSO, a water pump, and a water basin. Two modes of flow lines were studied: horizontal and vertical flow lines. This was aimed at improving the versatility of the leakage detection scheme. Figure 4: Leakage Detection Experimental setup http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 785 Calibration of the leakage detection scheme was done by installing the sensors along the length of the pipes for both orientations (the horizontal and vertical flow) and interfacing the sensors with the microcontroller, which was facilitated via the Arduino sketch (program) developed. When calibrating for any of the flow orientations, a valve was used to isolate the flow from passing through the other orientation, which is not of interest. Different leakage positions with respect to the sensors as obtained including no leakage condition, were investigated. In order to determine the flow parameter (basically negative pressure), which was used to automate the leakage detection scheme, the water flow network was pressurized, and data were recorded. The parameters regarding the calibration are shown in Table 2. Table 2: Water Pipeline Condition Used for the Study S/N Pipe conditions Horizontal flow pipe orientation Vertical flow pipe orientation Leakage points (cm) Leakage points (cm) 1 No leakage 0.00 0.00 2 Leakage point 1 10.00 11.50 3 Leakage point 2 25.00 - 4 Leakage point 3 35.00 - In automating the pipeline leakage scheme, data obtained from the calibration based on the different water pipeline conditions was used. A control system, as shown in Figure 5, involved a microcontroller, and the sensors were built and programmed. Figure 5: Leakage Detection Electrical Circuit Different conditions of the pipeline were used in the computer program to control the alarm state of the leakage system. After the automation, the system was tested in real time. http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 786 3. Results and Discussion The algorithm was utilized in determining the optimal position for the leakages with reference to the sensor, starting from the left for the horizontal orientation as shown in Figure 6. Different values of time delay were optimized, establishing the leakage positions that were used for the automation of the leakage detection scheme. The results of the leakage positions as obtained are shown in Figures 7. It reveals that the fitness value converges at 10.118 cm, which is measured to the left of sensor 1, as described in Figure 7 revealed the optimal time delay of 0.018 seconds, which represents the time taken for the two sensors to see the signal at the same moment. It shows a fitness value of 25.35 cm with an optimal time delay of 0.050 seconds. Pressure values were recorded for different cases of water flow in the pipeline. No leakage with no flow, no leakages with flow, leakage at 10 cm with flow, leakage at 25 cm with flow, and leakages at 35cm were investigated for the horizontal configuration. The water distribution line was pressurized for 60 seconds for each case considered. Figure 6: Leakage Position with Reference to the Sensor 1 Figure 7: Convergence Curve for the First Leakage Point for the Horizontal Configuration Figure 8 shows the profile of the pressure for no leakage with no flow. Both sensors maintained a uniform pressure of around 0.3 N/m2, except for a few occasions where pressure deviations were experienced. In case of sensor 1, a constant pressure peak of 2.2 N/m2 was observed at 11, 22, 42, and 57 seconds, respectively, and for sensor 2, a constant pressure peak of negative 1.7 N/m2 was observed at 46, 50, and 59 seconds, respectively. Consequently, Figure 9 revealed the pressure values for both sensors for water flow and no leakage along the pipeline. The pressure value decreases along the downstream. However, both sensor 1 and sensor 2 gave fluctuating pressure values, with sensor 1 registering a pressure value between 8 and 12 N/m2, and sensor 2 http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 787 registering a pressure value between 8 and 10 N/m2. The pressure value of 10 N/m2 as detected by sensor 1 is very pronounced, and for sensor 2, a pressure value of 8 N/m2 occurs most frequently. The automation of the leakage system was done, and the response was classified into three categories: no leakage, flow with no leakage, and leakage, with a focus on the horizontal configuration because the vertical configuration pressure variation for leakage and no leakage with flow is trivial. The flowchart of the automation is shown in Figure 10. The system's response was characterized by alarms, including false alarms. Subsequently, the system was run for 2 minutes, and tests were conducted 300 times. The algorithms were obeyed by the system for 90 cycles, and the false alarm frequencies are shown in Figure 10. 8: Pressure Values for Sensor1 and Sensor2 for no Flow and no Leakage Case (Horizontal Configuration) Figure 9: Pressure Values for Sensor1 and Sensor2 for Fluid Flow and Leakage Case (Horizontal Configuration) Figure 10: Automation Flowchart -2 -1 0 1 2 3 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 P re ss u re ( N /m 2 ) Time (seconds) Sensor_1 Pressure 0 5 10 15 1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 P re ss u re ( N /m 2 ) Time (seconds) Sensor_1 Pressure Sensor_2 Pressure http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 788 The system alarm response, as shown in Figure 11, revealed that the system does not give any false alarms for the no flow and no leakage modes as contained in Pérez et al. (2019). However, false alarms existed for both water flow and no leakage and water flow and leakage modes. In the case of the water flow and no leakage mode, the number of false alarms that were observed is 8, where 100% of these represent no flow and no leakage. Consequently, in the case of water flow and leakage mode, a total of 11 false alarms were observed, of which 55% represent no flow and leakage and 45% represent no flow and no leakage in line with Colomb (2021) report. Meanwhile, the system false alarm was observed to reduce significantly when the system is pressurized for a long period of time. Figure 11: System False Alarm Response 4. Conclusion The issue of pipeline leakages has been causing environmental challenges and water shortages, and it has led to spending huge amounts of money to clean the environment. Particle Swarm Optimization (PSO) has been used to optimize the best position to place the leakage point with respect to the sensors. An objective function was developed, and the time delays were optimized using particle swarm optimization (PSO) simulated via MATLAB. The developed experimental rig was placed on leakage points based on the PSO for leakage automation. The results showed that the best leakage point is 10.12 cm, which is measured to the left sensor1 for the first leakage point in the horizontal configuration with a 0.02 second time delay; 25.35 cm for the second leakage point in the horizontal configuration with a time delay of 0.05 seconds; and 37.25 cm for the third leakage point with a time delay of 0.075 seconds. This study outcome is ideal for households, industries, institutions, and construction companies that have the mindset of constructing to the required standard. The PSO model is recommended to be used in developed and developing countries that plan to venture into pipe leakage detection and control in water distribution networks using sensors. The developed model performed satisfactorily upon validation with real-life data, while human and technical risk factors were established as critical to safety management in the manufacturing industry. References Bai, Q. 2020. Analysis of Particle Swarm Optimization algorithm. Computer and Information Science, 3(1): 180-189. Chen, SM. 2019. Computational collective intelligence: semantic web, social networks and multiagent systems. Wroclaw University of Technology; Swinburne University of Technology; Natl Taiwan. University of Science and Technology, Lecture notes in artificial intelligence, 57(96): 608–619. Colombo, AF., Lee, P. and Karney, BW. 2021. A selective literature review of transient-based leak detection methods. Journal of Hydro-environment Research, 12: 212-227. http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng Arid Zone Journal of Engineering, Technology and Environment, December 2024; Vol.20(4):781-789. ISSN 1596-2490; e-ISSN2545-5818; www.azojete.com.ng Corresponding author’s email address: oginni.olarewaju@bouesti.edu.ng 789 Fine, RA. and Millero, FJ. 2019. Compressibility of water as a function of temperature and pressure. Journal of Chemical Physics, 59(10): 5529–5536. Jianfeng, G. 2021. Research on oil-gas Pipeline Leakage Detection Method Based on Particle Swarm Optimization Algorithm Optimized Support Vector Machine. Journal of Physics, 61(3): 453-462. Liao, Q., Castro, PM., Liang, YT. and Zhang, HR. 2019. New batch-centric model for detailed scheduling and inventory management of mesh pipeline networks. Computers and Chemical Engineering, 130(2): 106-116. Neelam, MK. and Kalaga, S. 2022. Elastic properties of PVC pipes. Journal of Structural Engineering, 29(2): 91– 96. Pandey, SK., Mohanty, SR., Kishor, N. and Catalao, JP. 2021. Frequency regulation in hybrid power systems using Particle Swarm Optimization and linear matrix inequalities based robust controller design. International Journal of Electrical Power and Energy Systems, 63(4): 887–900. Perez, R., Puig, V., Pascual, J., Quevedo, J., Landeros, E. and Peralta, A. 2019. Methodology for leakage isolation using pressure sensitivity analysis in water distribution networks. Control Engineering Practice, 19(10): 1157- 1167. doi: 10.1016/j.conengprac.2019.06.004. Wang, D., Tan, D. and Liu, L. 2019. Particle swarm optimization algorithm: an overview. Soft computing, 22(2): 387–408. http://www.azojete.com.ng/ mailto:oginni.olarewaju@bouesti.edu.ng