Hydraulic and economic analysis for rehabilitation of water distribution networks using pipes cleaning and replacement and leakage fixing

ABSTRACT Water distribution networks (WDNs) are designed to operate over a long period, however, it is expected that their capacity reduces over time. The large set of options that can be applied to improve their capacity, combined with their hydraulic complexity and the search for the most economical solution create a difficult problem to solve. Therefore, in this paper the hydraulic and economic benefits of three rehabilitation strategies: pipes cleaning, pipe replacement and leakage fixing. were evaluated individually first and then combined into two case studies, through a cost minimization using the PSO algorithm. Initially, the relation between the investment and the reduction in pressure deficit is analyzed for each alternative to identify the best strategy, and at which point the benefits are saturated. Then, an optimization considering the combination of the three intervention techniques is made to verify if there is a prioritization of any technique, and if it is related with the individual performance. in economic and hydraulic terms pipe replacement was the best intervention technique, followed by pipe cleaning and leak repair. For substitution, few interventions are sufficient to significantly improve the pressure. Moreover, it was observed that in the intervention - combined, the algorithm prioritizes joint solutions.


INTRODUCTION
Urban infrastructures such as roads, energy transmission lines, gas pipelines and water distribution networks (WDNs) are designed to operate under certain conditions.During the first years, an efficient operation, close to the optimal, can be achieved, as all the components are close to their best conditions.However, as high investment projects, the life cycle of these systems are long, usually 20 years (Tsutiya, 2004), but in practice, prolonged as much as possible, with reports of WDNs of more than 50 years (Pelletier et al., 2003;Berardi et al., 2008).Thus, it is expected the deterioration of the infrastructure and the reduction of its efficiency.In addition, the population growth can significantly affect the performance of water distribution systems, as they impose a higher demand to the system.These two aspects combined can lead to a collapse of the system, requiring its rehabilitation.
In WDNs this collapse is observed when an Intermittent Water Supply (IWS) operation starts.In these conditions, water is no longer supplied continuously, and daily and weekly cycles can be established to deliver a small amount of water to the users.In addition to the lack of water to supply the consumers, the following disadvantages are observed in IWS: increased risk of contamination (Preciado et al., 2021), increased risk of pipe bursts (Christodoulou & Agathokleous, 2012), reduction of operational efficiency (Souza et al., 2022).Klingel (2012) lists the following aspects that can lead to the IWS: increase in pipe roughness, increase in water demand, increase in water losses, deterioration of pump stations, severe droughts.
The rehabilitation of the WDN can be made applying different proposals or a combination of them, such as: increase in pump stations power (Souza et al., 2022), cleaning or replacing pipes (D'Ercole et al., 2018), fixing leakages (Haider et al., 2019), increase storage capacity (Viccione et al., 2019).Obviously, the proposal able to restore the WDN conditions with the lowest cost is desired, but this is not easy to find, since the combination of two or more approaches can significantly modify the hydraulic conditions of the WDN.
As described by Bubtiena et al. (2012) and Kleiner et al. (1998), in addition to the different options available to improve the WDN, the large size of the network, commonly seen in real cases, significantly increases the search space.Thus, even when robust evolutionary algorithms are used, local minimum solutions are often found, usually demanding a high computational effort.In addition, considering only the cost as the objective, different solutions can result in the same cost, and the decision in which is the best becomes harder.Mala-Jetmarova et al. (2018) highlight that this problem can be approached improving the optimization algorithms, developing new methodologies, or creating rules to adapt their parameters and the penalty function, or reducing the search space, creating a pre-selected optimal group of alternatives that has a more relevancy in the hydraulic conditions of the WDN (Yoo et al., 2014;Diao et al., 2022;Elshaboury & Marzouk, 2022).
Therefore, in this paper it was evaluated the cost-benefit of Three rehabilitation alternatives: clean pipes to restore its roughness, replace pipes to improve its hydraulic capacity and fix leakages, to increase the minimum daily pressure.First, each alternative is evaluated individually, with different levels of rehabilitation (budget), to identify the cost-benefit relation and if there is a saturation point, where additional investments provide insignificant improvements.
Following this analysis, the three intervention alternatives were combined, and the results are compared with the results of individual interventions, to identify if there is a single intervention that is implemented more predominantly than another, and if exists any correlation with the individual results.In all cases, the optimization process was implementing using the Particle Swarm Optimization (PSO) to find an optimal solution for the rehabilitation.

Pipe cleaning and replacement
The deterioration of pipes can be structural, where resistance is reduced, and consequently, it becomes more susceptible to bursts, increasing the WDN leakages (Berardi et al., 2008), and functional, where its resistance remains but its capacity to transport water is reduced due to the increased roughness, increasing the head losses observed, which reflects on the WDN pressures and the energy consumption of pump stations (Abd Rahman et al., 2019).According to Sharp & Walski (1988), this deterioration can be more or less severe according to pipe age, pipe material, pipe size, pipe location, soil conditions and water quality.
In this study, the increased risk of failure due to structural deterioration is not considered.Thus, only the functional benefits are accounted when a pipe is cleaned or replaced, i.e., only the increase in its transport capacity is evaluated.When the option of cleaning a pipe is made, it is considered that its Hazen-Williams coefficient is restored to a value close to that of the new pipes, as it is considered that the cleaning is not able to fully restore the pipe capacity.In this option, the original diameter of the pipe is maintained.For the replacement option, a new pipe is installed.Hence, a different diameter can be selected and the Hazen-Williams coefficient should be adjusted to the typical value of new pipes.Although this option can further increase the WDN capacity, it is also more expensive, and its cost-benefit can be lower than cleaning in some conditions.Table 1 shows the costs of pipe cleaning and replacement for the diameters available in this study.Osorio et al.

Leakage fixing
Leakages are a significant problem in the WDN deterioration, as it increases the demand of water resources, and increases the head losses in the network.It is usually the result of a pipe failure, when a small crack appears, that can increase to a complete rupture of the pipe.For the small leakages, the orifice equation can be used, adapted as shown in Equation 1, where the coefficients K and y can be calibrated according to the case study (Boian et al., 2019).
Although the Epanet software (Rossman, 2000) has this modelling implemented, the value obtained using Equation 1 was added to the base demand for each time step of the simulation.This approach was used to avoid reported problems when using Equation 1 for a WDN with negative pressures.Thus, the total base demand for each node is calculated as described in Equation 2.
(2) where: Q n, i [m 3 /s] -demand flow of node n at time step i, q n [m 3 /s] -base demand flow of node n, k n, i [dimensionless] -demand pattern coefficient of node n at time step i, Q Ln,i [m 3 /s] -leakage flow of node n at time step i and p n,i [m] -pressure of node n at time step i.
When repairing a leakage, the emission coefficient K of the node is set to zero.Note that leakages are assigned to the nodes, when, in fact, they are positioned along the pipe.Therefore, if the replacement option is selected, the leakage continues the same, as it is a representation of the water lost in its surroundings, not only in a specific pipe.To estimate the costs of repairing a leakage, the Equation 3 is proposed, using the orifice equation in a static condition, as it is expected that larger leakages occurs in higher pressure locations, usually with lower elevation.The LC factor was calibrated according to benchmarking values (European Commission, 2013).

OPTIMIZATION PROCEDURE
The optimization was developed in Matlab 2020 a programming language, by implementing the Particle Swarm Optimization algorithm, jointly with the hydraulic model Epanet 2.0, controlled by the EPANET-MATLAB Toolkit library (Eliades et al., 2016).
The results are evaluated both in economic and operational terms, comparing the cost of intervention in respect to the improvement of hydraulic conditions.

Particle Swarm Optimization
Particle Swarm Optimization is a meta-heuristic algorithm based on the cooperative behavior of species (Kennedy & Eberhart, 1995).The movement of particles in the search space is guided by individual and collective experiences, which are accelerated by the social (C 1 ) and cognitive (C 2 ) coefficients, as presented in Equation 4. In addition to the coefficients, the particle motion considers the inertia factor (ω), which can be described as the tendency of the particle to follow its current motion. where: V + is the velocity of particle i at time k+1, ω is the inertia factor, k i V is the current motion, C 1 and C 2 are social and cognitive coefficients and are the particle memory influence and swarm influence respectively.
In this case study, the PSO algorithm is configured as described in Table 2, emphasizing that the values of coefficients C 1 and C 2 were 1.49, the default values of Matlab.On the other hand, in the case of network A, the number of particles considered in each optimization was three times the number of elements to be optimized and in the case of the network B, the number of particles was randomly selected, always aiming to avoid an early stop.
When the goal was, for example, to optimize the cleaning of only four pipes in the Network A, a total of 12 particles was considered.Otherwise, in each case a maximum number of iterations was adopted to guarantee the convergence and avoid an early stop.

Objective functions
During the optimization process four objective functions (FO) were developed: one for each rehabilitation strategy individually, and one considering the three intervention options combined, as presented below: • FO 1 : This objective function aims to optimize the operating pressure of the network while minimizing the cost of pipe replacement.
( ) where: RBRH, Porto Alegre, v. 28, e6, 2023 4/15 Hydraulic and economic analysis for rehabilitation of water distribution networks using pipes cleaning and replacement and leakage fixing L i is the length of pipe i to be replaced [m], Nr is the number of pipes that can be replaced, PP is the pressure penalty, P is the minimum pressure in the network after the intervention [m] and P min [m] is the minimum operating pressure required in the network.
• FO2: this objective function optimize the operating pressure of the network while minimizing the cost of repairing leaks.
( ) ( ) where: IC is the intervention cost (R$), FL is the total leak repair cost (R$), z i is the elevation of node i (m), q i is the base demand of node i, and N l is the number of nodes with leakage that can be fixed, LC is unit leak repair cost (R$ /m 3 /s), PP is the pressure penalty.
• FO3: The third objective function goal is to optimize the network operating pressure while minimizing the cost of cleaning the pipes.
( ) where IC is the cost of intervention (R$), CC is the total cost of cleaning (R$), CCL i is the cost of cleaning the pipe i (R$/m), L i is the length of the pipe i (m), and N c is the number of pipes that can be cleaned.
• FO 4 : The fourth objective considers the three interventions previously described simultaneously to optimize the network operating pressure.
where: IC is the cost of intervention (R$), PS is the cost of pipe replacement (R$), FL is the cost of fixing leaks (R$) and CC is the total cost of cleaning (R$).

Cost intervention analysis
To identify if there is an optimal number of replacements, leak repairs or pipes to be cleaned, a cost-benefit analysis is made by increasing the number of interventions done in the network.Then, Pareto diagrams are developed and analyzed comparing the number of interventions with the total cost and the improvement of hydraulic conditions in the network, in terms of pressure and the daily leakage volume.The individual results are also compared with the alternative where all three interventions can be done simultaneously.

CASE STUDY
In the present case study, two modified fictitious networks were used, Network A and B, respectively composed of 21 and 268 nodes, 1 and 4 reservoirs and 41 and 317 pipes of PVC with diameters varying between 200 -750 mm and 100 -350 mm.The original condition of the networks presents severe pressure problems: respectively in Network A and B, 28.5% and 9.0% of the nodes operate with pressures lower than the minimum required operating pressure (P min = 10 m), while 71.5% and 91% present higher pressures as shown at Figure 1.The minimum and maximum pressures of the networks under study before rehabilitation were 2.18 m and 73.92 m for network A, and 5.35 m and 63.05 m for network B.
For each intervention alternative, was identified the maximum number of elements that could be involved in the optimization process.When evaluating the pipes conditions, 12 and 31 pipes were found to be severely deteriorated respectively for the network A and B, with roughness coefficient of 70.Thus, only these pipes were considered for the rehabilitation by cleaning (N C1 = 12 and N C2 = 31).For the replacement option, all pipes were considered in both Networks (N r1 = 41 and N r2 = 317).Finally, for the leakage fixing in the Network A, all nodes were considered, because all of them have emitter coefficient higher than 0, while in the network B, 35 junctions have leak problems (N l1 = 21 and N l2 = 35).Figures 2 and 3 show the deteriorated pipes and leaking nodes each case.
When all three interventions are considered simultaneously, the search space significantly increases, and different combinations among the alternatives can be done to achieve a higher pressure.Thus, to avoid biased results several runs of the optimization process were made: 100 for the network A and 5 for network B. Therefore, if a strategy is predominant, it should be prioritized in most of the runs.

Pipe replacement
In the case of the network A only the optimization from pipe replacement ensures higher minimum pressures in all nodes Osorio et al.

5/15
of the network when compared to rehabilitation from leak repair and pipe cleaning, as will be evidenced in the subsequent items.As presented in Figure 4 and Figure 5, in both networks the intervention cost varied according to the number of replacements and the projected replacement diameter, so the larger these are, the higher the intervention cost.
It is observed in Figure 4 that increasing the number of pipe replaced in network A does not correlate to an increase in the minimum pressure as expected.On the other hand, for the Network B this trend can be identified.This can be explained by the headlosses in each network.For network A, with only one water source, the pipes closer to the reservoir are more relevant   Hydraulic and economic analysis for rehabilitation of water distribution networks using pipes cleaning and replacement and leakage fixing for the average pressure of the network.In addition, the length of each pipe is high, producing higher headlosses.Thus, these pipes are prioritized for replacement, and after that, the impact of replacing less relevant pipes is small.In fact, a single replacement allows obtaining a minimum daily pressure higher than P min in all network nodes.On the other hand, in network B, which has four reservoirs, the flow is more equally distributed, and each pipe has more impact to the entire network.Even so, the minimum pressure is achieved with only two replacements.Figure 4 also shows that, if the replacement of pipes is done without a leakage control program, the volume of water losses can increase due to the increase in the network pressure.For the aturation points, one and two replacements respectively for networks A and B, the total cost of intervention were R$105,300.00(1,800 m of pipes replaced) and R$36,104.95(904.72 m of pipes replaced).
On the other hand, for both networks Figure 5 shows the prioritization of replacements for larger diameters, this prioritization should be related to the fact that replacing for larger diameters reduces the head losses and increasing the pressure in the network.In this sense, it was noted that in both networks the number of replacements for smaller diameters did not vary significantly presented a stable behavior.
Finally, it is important to note that in the case of network B, the maximum number of replacements was 186 replacements.Even if more pipes could be replaced, the algorithm achieved solutions with a smaller number of replacements, demonstrating its capacity to identify the best solution to achieve minimum pressures higher than P min in all nodes of the network.In Figure 6 the proposed interventions by saturation points are presented.

Pipe cleaning
In the case of Network A, it was observed that implementing cleaning as an intervention technique does not allow reaching minimum pressures higher than P min in all nodes.It is worth noticing in Figure 7 that cleaning only 5 pipes' results in the maximum number of nodes with pressure above the minimum required.Thus, further cleaning of pipes will increase the cost of intervention up to 130% with no hydraulic benefit, indicating a saturation point of five pipes for network A.
In the case of Network B, 20 interventions were necessary for reaching minimum pressures higher than P min in all of nodes (Figure 8).In this sense, 20 interventions can be considered as When analyzing and comparing the number of interventions with the minimum network pressure and the daily leaks, a direct relationship between these variables is evident, as shown in Figure 7 and Figure 8, which was expected, taking account that pipe cleaning increases network pressures by reducing head losses.Differently of the pipe replacement, there is no oscillations neither in the daily percentage leakage values and minimum pressure, as cleaning the pipes generates fewer changes in the hydraulic conditions of the network than replacement does.
Figure 9 shows the results of the best configuration achieved by cleaning pipes, for the networks A and B. It can be observed that in the case of network A one node remains with pressure problems.

Leakage fixing
In the case of Network A, it was observed that implementing repair of leaks as an intervention technique does not allow reaching minimum pressures higher than P min in all nodes.However, the saturation point for network A with this alternative is reached fixing six nodes, as further improvement in the number of nodes above the minimum required pressure is only achieved when all leakages are fixed, as observed in Figure 10.
In the case of Network B, 18 interventions were necessary for reaching minimum pressures higher than P min in all nodes.Thus, 18 interventions can be considered as the saturation point, since implementing a larger number of interventions produces similar results, but with higher costs.
In network A, the minimum pressure had a maximum increment of 2.48 m, going from 2.18 m to 6.43 m when six interventions were implemented, while in the case of network B the increment was 6.35 m, going from 4.69 m to 10.04 m, when 18 interventions were implemented.The intervention costs for the 6 and 18 interventions projected were respectively R$378,782 .16 and R$299,567.10.The difference between the values is associated with the base demand of the Networks, that in the network A is 463.08 l/s and in network B is 29.97 l/s.Hydraulic and economic analysis for rehabilitation of water distribution networks using pipes cleaning and replacement and leakage fixing From Figure 10 and Figure 11 it is possible observe that there is a constant increase at the minimum pressure and the intervention cost as the number of repaired leaks increase.At the same time, there is an inversely proportional relationship between the daily leaks and the number of planned interventions.
On the other hand, like in pipe cleaning, there is no oscillations in the daily minimum pressure, as the leakage fixing generates fewer changes in the hydraulic conditions of the network than replacement does.
Figure 12 presents the optimal solution achieved considering only leakage fixing as rehabilitation strategy.For the network A, the optimization process prioritized repair nodes in the two regions of lowest pressure, where the cost-benefit relation is the best for this case.Even so, three nodes remained with pressure problems.

11/15
For the network B, the repair was well distributed, and all nodes operate with pressures above the minimum required.

Comparison of individual intervention techniques
The implementation of pipe replacement as an optimization technique allows achieving higher minimum pressures in the network with fewer interventions and at a lower cost, followed by rehabilitation through pipe cleaning and leak repair.In economic terms, and taking network B as a reference, the results showed that, for the saturation condition, cleaning pipes and repair leaks have higher intervention costs by 56% and 2188% when compared to replacement.In this sense, in economic terms, replacement is the best alternative.
On the other hand, it was observed that the hydraulic conditions of networks A and B vary significantly with any alteration of their physical conditions.Therefore, substitution was the technique that generated the greatest variability of the minimum pressure in the networks.In the case of replacement, it was found that the PSO algorithm tends to prioritize the most economical solutions that guarantee minimum pressures close to P min , even in cases where a high number of interventions are planned.Finally, it was perceived that the leakage percentages are similar when pipe replacement and cleaning are implemented.
In the case of the optimizations performed for network A, a lower computational effort was noticed, with all processes of optimization being completed in approximately 120 hours, while for Network B 480 hours were required.This difference is associated with the size of the network, that is, the larger the network analyzed the higher the computational demand will be.It was also observed that the optimization through pipe replacement was the process with the highest computational demand, in terms of processing time, as the number of variables in this case is higher.

Rehabilitation -combined
As discussed in section 5.1, the replacement of few pipes allows significant improvements in networks pressure.In this sense, with the purpose of verifying if combining the three techniques the pipe replacement is prioritized due to its best cost-benefit, 100 optimizations were executed in network A, while in the case of network B only was possible to execute 5 optimizations due to the high computational effort.
This procedure was adopted to avoid bias the results due to the stochastic nature of the PSO. Figure 13 and Figure 14 presents the frequency of each rehabilitation alternative during the tests.
Figure 13 clearly show that pipe replacement is essential to rehabilitate the network, being present 100% of the time in Hydraulic and economic analysis for rehabilitation of water distribution networks using pipes cleaning and replacement and leakage fixing network A and B optimization.This was to be expected, since this alternative presented the best cost-benefit in both networks.
For Network A, 94% of the time a single substitution was proposed while in the case of network B, was observed that in 80% of cases was proposed between 1 and 2 substitutions, and only in 20% of the cases were proposed higher interventions than saturation point.
In the case of network B, all optimizations emphasized in joint interventions, 60% emphasized in cleaning-substitutionfixing leaks and 40% in substitution-cleaning, while in the case of network A, 16% of the proposed solutions contemplated replacement only, 57% contemplated cleaning-replacement, and 27% contemplated the implementation of all three techniques.
The above show that exists a difficult to prioritize a single technique, in this sense, the combination of techniques seems to be the best option that find the algorithm to reach the minimum required pressure.
In both networks, it was noticed that the number of projected leak repairs was low, with a maximum of 2 in the case of network A and 1 in network B, on the other hand, to the network A, it was noticed that in most cases the number of cleanups projected in joint solutions was lower than the saturation point of the individual evaluation (5 Network A), while in the case of network B they were always lower (20 Network B).
In both networks A and B, the intervention costs of the optimizations that contemplated more than one intervention alternative were up respectively 15.76% and 19.76% higher than those of the substitution saturation point.
Respect to the saturation point of cleaning and fixing leaking in the networks A and B, the cost of joint interventions was lower up 22,4% -25.19% (cleaning) and 203.02% -301.01%(fixing leaking) respectively.
No significant differences in minimum network pressure were found when joint or singles intervention alternatives were implemented.From the above, it is important to check the performance of individual intervention techniques before evaluating algorithms with more than one intervention alternative.

CONCLUSIONS
In this study, the rehabilitation of two fictitious WDNs was studied by repairing leaks, replacing and cleaning pipes.The Network A had a minimum pressure of 2.18 m before the rehabilitation, while the minimum pressure in Network B before the intervention was 5.35 m.In both cases, the goal was to guarantee minimum operating pressures greater than or equal to 10 m (P min =10).
In both networks it was evidenced that the implementation of pipe replacement as an optimization technique allows achieving higher minimum pressures with fewer interventions and at a lower cost, followed by rehabilitation through pipe cleaning and leak repair.The saturation points for the pipe replacement in networks A and B were 1 and 2, with minimum pressures of 11.92 m and 10.09 m respectively.
In the case of network A, it was not possible to guarantee the minimum pressure with the implementation of pipe cleaning and leak repair, with the saturation points respectively of 5 and 6.In the case of network B, the minimum pressure was achieved with the cleaning of 20 pipes and the repair of 18 leaks.
It was observed that the hydraulic conditions of networks A and B vary significantly with any alteration of their physical conditions.Therefore, substitution was the technique that generated the greatest variability of the minimum pressure in the networks for each intervention.Likewise, it was found that the PSO algorithm tends to prioritize the most economical substitution that guarantee minimum pressures close to P min , even in cases where a high number of interventions are planned.Finally, it is important to note that, if pipe replacement or cleaning are done without a leakage control program, the benefits of the increase in pressure can be diminished by the increase of water losses.
In Rehabilitation -Combined was perceived that exists a difficult to prioritize a single technique, in this sense, the combination of techniques seems to be the best option that find the algorithm to reach the minimum required pressure.
No significant differences in minimum network pressure were found when joint or singles intervention alternatives were implemented.Regarding the repair of leaks and pipe cleaning, contemplating more than one intervention option in the algorithm allows more economical solutions in most cases, but more costly

Figure 1 .
Figure 1.Layout of the networks used in the case studies: (a) Network A; (b) Network B.

Figure 4 .
Figure 4. Economic and operational results of implementing substitution as rehabilitation in the Network A (1) and Network B (2): (a) Total cost; (b) Minimum pressure; (c) Leakage rate.

Figure 6 .Figure 8 .
Figure 6.Optimal solution for pipe replacement: (a) Pipes replaced in the Network A; (b) Pressure in Network A; (c) Pipes replaced in the Network B; (d) Pressure in Network B.

Figure 9 .
Figure 9. Optimal solution for pipe cleaning: (a) Pipes cleaned in Network A; (b) Pressure in Network A; (c) Pipes cleaned in Network B; (d) Pressure in Network B.

Figure 10 .
Figure 10.Economic and operational results of implementing leakage fixing as rehabilitation for Network A: (a) Total cost; (b) Minimum pressure; (c) Leakage rate; (d) Nodes with pressure above minimum.

Figure 11 .
Figure 11.Economic and operational results of implementing leakage fixing as rehabilitation for Network B: (a) Total cost; (b) Minimum pressure; (c) Leakage rate; (d) Nodes with pressure above minimum.

Figure 12 .
Figure 12.Optimal solution for leakage fixing: (a) Fixed leaks in Network A; (b) Pressure in Network A; (c) Fixed leaks in Network B; (d) Pressure in Network B.

Table 1 .
Pipe cleaning and replacement costs employed in the case study.