Rehabilitation in Intermittent Water Distribution Networks for Optimal Operation

: Equitable distribution of water is a growing source of worry, and concerns water systems’ managers as water-stressed areas steadily increase and situations of water scarcity are becoming more frequent. The problem goes beyond just the water sector and globally affects many countries’ economies since water resources have multiple uses (i.e., power generation, irrigation, etc.). One of the various strategies to overcome periods of extreme events (e.g., water scarcity) is the adoption of intermittent operation. Intermittent operation can minimize water losses, and manages to supply the same water demand (in terms of volume) during a reduced period of time. However, despite minimizing water losses, the energy consumption necessary to cope with the increased ﬂows and head loss, due to the reduced number of operating hours, increases. This paper explores a strategy based on rehabilitation of the system’s main pipes. It also considers optimal selection and scheduling of pumps aiming at improving the system’s hydraulic parameters (e.g., velocity and head losses) and at reducing the operating costs. Both selection and scheduling of pumps and resizing of main pipes are optimized using Particle Swarm Optimization. The obtained results show that this strategy can signiﬁcantly reduce the energy consumed and can be economically feasible.


Introduction
Water is an essential resource for human survival and for the economic, social and health development of societies. However, in many regions of the planet, matching the required demand has become an arduous task due to water scarcity. It is estimated that 58% of the population were living in water-stressed areas in the early 2000s [1,2], and this number could reach 5 billion people by 2050 [2,3].
One of the aggravated problems is the intermittence of water supply, affecting 70% of consumers in Asia [4], 50% in Africa, and 33% in Latin America [5,6], totaling approximately one-third of the world population [7,8]. Brazil also has problems with water scarcity. As an example, in the years 2014 to 2016, the southeastern region of Brazil suffered from low rainfall, causing a serious shortage, especially in the metropolitan region of São Paulo. Judicious strategies for public water supply were adopted, focusing on consumption management, intensification in the leakage control programs and supplying less than 24 h a day or in less than seven days a week [9]. Brazil has an electrical matrix predominantly from renewable resources (83.0%), where the hydro generation corresponded to 64.9% of the domestic supply [10]. Commonly, the reservoirs of this system have multiple uses, besides water supply. Hence, water shortages can impact not only the public water supply, but also other important sectors of the economy, such as irrigation and power generation in Brazil [2]. speed at each time step are also defined during this optimization process, which minimizes the operational costs, represented by the energy consumption, water losses and the resizing of the main pipes. The results show that the energy costs in intermittent operation can significantly be reduced by resizing the main pipes of the network, while still remaining economically feasible. Considering the WDS life cycle, the cost found is lower than those for continuous operation and for the best scenario of intermittency found by [20]. Thus, the approach described herein could be a reasonable alternative to save energy and to reduce the overload in reservoirs, especially with multiple uses. Regions commonly affected by droughts could benefit from implementing the proposed strategy.

Materials and Methods
The methodology to optimize the IWS operation is based on the minimization of the joint cost function of: (i) operational cost; and (ii) cost for rehabilitation of the main pipes. The first is based on the energy consumption and volume of leaks in the system. The second aims to improve the existing infrastructure (i.e., replacement of pipes with high head loss) in an attempt to optimize the system's efficiency. Figure 1 summarizes the process to achieve the optimal operation. The following sections describe each of the processes presented in Figure 1.
Water 2022, 13, x FOR PEER REVIEW 3 of 15 velocity and head losses) and, consequently, to reduce the power demand. Both pumps' selection and resizing of the main pipes are optimized using Particle Swarm Optimization (PSO). The pumps' rotational speed at each time step are also defined during this optimization process, which minimizes the operational costs, represented by the energy consumption, water losses and the resizing of the main pipes. The results show that the energy costs in intermittent operation can significantly be reduced by resizing the main pipes of the network, while still remaining economically feasible. Considering the WDS life cycle, the cost found is lower than those for continuous operation and for the best scenario of intermittency found by [20]. Thus, the approach described herein could be a reasonable alternative to save energy and to reduce the overload in reservoirs, especially with multiple uses. Regions commonly affected by droughts could benefit from implementing the proposed strategy.

Materials and Methods
The methodology to optimize the IWS operation is based on the minimization of the joint cost function of: (i) operational cost; and (ii) cost for rehabilitation of the main pipes. The first is based on the energy consumption and volume of leaks in the system. The second aims to improve the existing infrastructure (i.e., replacement of pipes with high head loss) in an attempt to optimize the system's efficiency. Figure 1 summarizes the process to achieve the optimal operation. The following sections describe each of the processes presented in Figure 1.

Pump Selection
The optimal selection of pumps finds the operating point (Q and H) and the rotation speed (N i ) every hour of the day according to the water consumption pattern, keeping the pump operating as close as possible to the Best Efficiency Point (BEP). Thus, for each pump in the system, there are t + 2 variables to be optimized, corresponding to the respective rotation speed for each hour of the day and the pair of points in BEP (Q BEP and H BEP ), where t is the operating horizon.
With the BEP (Q BEP and H BEP ) defined through the optimization, a Single-Point Curve (Figure 2a) is created by Epanet 2.2 [21]. Two estimated points are added to the curve to achieve a function as shown in Equation (1)

Pump Selection
The optimal selection of pumps finds the operating point ( and ) and the rotation speed ( ) every hour of the day according to the water consumption pattern, keeping the pump operating as close as possible to the Best Efficiency Point (BEP). Thus, for each pump in the system, there are + 2 variables to be optimized, corresponding to the respective rotation speed for each hour of the day and the pair of points in BEP ( and ), where is the operating horizon. With the BEP ( and ) defined through the optimization, a Single-Point Curve (Figure 2a) is created by Epanet 2.2 [21]. Two estimated points are added to the curve to achieve a function as shown in Equation (1) For each rotational speed, the pump curve shifts as the speed changes ( Figure 2b). The new pump curve can be found from the Single-Point Pump Curve by the relationship between flow ( ) and Head ( ) at rotation speeds and described by the similarity laws, as in Equations (2) and (3) [22].
Lastly, as proposed by [23] and adopted as a methodology by [20], the pump efficiency can be modelled by a relation between flow ( ) and efficiency ( ) at the BEP, as shown in Equation (4) and Figure 3. It is important to highlight that this equation is obtained using the information on pumps available in the Brazilian market [24]. For each rotational speed, the pump curve shifts as the speed changes ( Figure 2b). The new pump curve can be found from the Single-Point Pump Curve by the relationship between flow (Q) and Head (H) at rotation speeds N 1 and N 2 described by the similarity laws, as in Equations (2) and (3) [22].
Lastly, as proposed by [23] and adopted as a methodology by [20], the pump efficiency can be modelled by a relation between flow (Q BEP ) and efficiency (η BEP ) at the BEP, as shown in Equation (4) and Figure 3. It is important to highlight that this equation is obtained using the information on pumps available in the Brazilian market [24].

Leakage Modeling
Hydraulic modeling of leakage can be derived from energy conservation, describing the conversion of pressure potential energy into kinetic energy, which results in the wellknown orifice equation. According to the one orifice equation, the leakage flow ( ) is proportional to the square root of the pressure differential (ℎ) over the leakage orifice, described as Equation (5), where is the discharge coefficient, the leak area and the acceleration due to gravity.
Nonetheless, it is difficult to measure the value of the leak area ( ), which can assume different values for different pressure ranges [25]. Therefore, Equation (5) is rewritten as a potential equation of generalized use in water supply given by Equation (6), where is the leakage coefficient and the leakage exponent.
The leakage exponent ( ) of Equation (6) is an empirical variable to be determined according to the hydraulic characteristics of each system and can vary between 0.36 and 2.95 [26], different from the constant value of 0.5 used in the orifice equation [27]. The leakage coefficient ( ) can be calibrated to achieve the leakage volume of the systems. So, the Epanet 2.2 can model the leakage flow by associating Equation (6) to each node of the network model. The daily leakage volume ( ) can be estimated by multiplying Equation (6) by the time step (∆ ) until reaching the total operating time ( ) to be simulated up to the th node of the system, given in Equation (7).

Main Network Modeling
According to [28], the main network corresponds to the pipes of the water distribution network (WDN) with larger diameters, which supply the other smaller diameter pipes responsible for supplying the consumption points. It is important to define the main network to be able to select some of its pipes and resize them. As larger pipes, they can transport larger flows, which can be significantly increased in IWS in order to supply the same volume in a shorter period. As a result, head losses are also increased, thus affecting the pumping energy consumption and possibly creating pressure problems, since the effects observed in the main pipes can affect the entire network. So, the system's resizing

Leakage Modeling
Hydraulic modeling of leakage can be derived from energy conservation, describing the conversion of pressure potential energy into kinetic energy, which results in the wellknown orifice equation. According to the one orifice equation, the leakage flow (Q L ) is proportional to the square root of the pressure differential (h) over the leakage orifice, described as Equation (5), where C d is the discharge coefficient, A the leak area and g the acceleration due to gravity.
Nonetheless, it is difficult to measure the value of the leak area (A), which can assume different values for different pressure ranges [25]. Therefore, Equation (5) is rewritten as a potential equation of generalized use in water supply given by Equation (6), where α is the leakage coefficient and β the leakage exponent.
The leakage exponent (β) of Equation (6) is an empirical variable to be determined according to the hydraulic characteristics of each system and can vary between 0.36 and 2.95 [26], different from the constant value of 0.5 used in the orifice equation [27]. The leakage coefficient (α) can be calibrated to achieve the leakage volume of the systems. So, the Epanet 2.2 can model the leakage flow by associating Equation (6) to each node of the network model. The daily leakage volume (DL) can be estimated by multiplying Equation (6) by the time step (∆t) until reaching the total operating time (t) to be simulated up to the nth node of the system, given in Equation (7).

Main Network Modeling
According to [28], the main network corresponds to the pipes of the water distribution network (WDN) with larger diameters, which supply the other smaller diameter pipes responsible for supplying the consumption points. It is important to define the main network to be able to select some of its pipes and resize them. As larger pipes, they can transport larger flows, which can be significantly increased in IWS in order to supply the same volume in a shorter period. As a result, head losses are also increased, thus affecting the pumping energy consumption and possibly creating pressure problems, since the effects observed in the main pipes can affect the entire network. So, the system's resizing consists of replacing some or all pipes of the main network in order to improve the system's hydraulic parameters (e.g., velocity and head losses) and, therefore, to reduce the power demand in pump stations.
Several parameters can be used to determine the main network of the WDN, such as pipe diameter, number of connections, and geographic position in the system. However, in complex systems, large ones and/or those with multiple sources of supply, the visualization of the main network is not clear and its determination becomes a complex task. In this regard, [29] uses graph theory to distinguish the levels of importance of each pipe and to determine the main network. The graph theory is a branch of mathematics dedicated to the study of structures integrated by vertices interconnected by edges. WDN have been modelled as graphs [30][31][32][33][34], where the nodes are represented by the vertices and the links by the edges.
As proposed by [29], by knowing the direction of the flows within the pipes, it is possible to calculate the Accumulated Shortest Path Value (ASPV). The ASPV represents the shortest path for water to reach node N F flowing from node N I . The ASPV is calculated for each pair of the n nodes of the network (N I and N F ) and compiled in an n × n matrix, as in Equation (8), where the rows represent the initial nodes (N I ) and the columns the final nodes (N F ). After calculating the ASPV for each pair of nodes, each element of ASPV matrix is weighted by the flow of the element linking both nodes, resulting in a new matrix (ASPV * ). In this way, pipes with small diameters and flow rates, which have small relevance to the hydraulic behavior of the system, are disregarded from the main network. Finally, it is possible to visualize the number of nodes/pipes that can be reached from each node, as well as sort them out by importance, where the pipes with higher ASPV * values are more relevant for the system.
Still, according to [29], the main network is integrated by the pipes with high values of ASPV * , which have a low relative frequency, while the secondary network pipes exhibit low values of ASPV * with high relative frequencies. Also, according to [29], approximately 80% of the pipes have high relative frequency and must be classified within the secondary network, while the remaining 20% integrate the main network. In this study, also 20% of higher ASPV * value pipes are considered as belonging to the main network.

Cost Modeling
The hydraulic results of each simulation (leakage and energy consumption) must be transformed into an operational cost by a cost function to be optimized (minimized). So, the cost parameters (hydraulic and energy tariffs) are very important, as they can make a solution more or less economically attractive. Table 1 shows the values of the electrical tariffs (Energy tariff te and power tariff tp) corresponding to the values of the hourly green tariff (wet period and green flag) practiced by Companhia Energética de Minas Gerais-CEMIG (Minas Gerais Energy Company, Minas Gerais, Brazil) and, also adopted by [20] for coverage of the study site, Minas Gerais. The peak hours (PH) were defined, also according to coverage, as the period between 5:00 p.m. and 7:00 p.m. and the other times as non-peak hours (NPH). Table 2 shows the average total expenditure amounts (IN003) of service providers participating in the Sistema Nacional de Informações sobre Saneamento-SNIS (National Sanitation Information System), in 2018, according to coverage. According to [11], the IN003 indicator reveals how much is spent per cubic meter of water billed.  It is clear the high variation in the water production tariff (tw) according to the coverage in Brazil, as shown in Table 2. Therefore, in this paper, three different scenarios are studied: scenarios 1 and 2 correspond, respectively, to the minimum and maximum values of the average total expenditure in Brazil, of 0.30 R$/m 3 and 7.82 R$/m 3 ; and, for scenario 3, the value of the average total expense of Brazil of 3.57 R$/m 3 is used. Thus, scenarios 1 and 2 correspond to extreme values, while scenario 3 to the average value.
It is important to highlight that the tariff values and scenarios studied in this paper refer to the same ones adopted by [20] for comparison reasons.

Optimization Procedure
The optimization of the system consists of replacing some pipes of the distribution network and the selection of pumps in order to improve the system's hydraulic parameters and, therefore, reduce operating costs. However, it is necessary to carry out an economic evaluation, since the cost of implementing new pipes and/or pumps represents a high monetary impact in the short term, but is diluted over the WDS life cycle, and can be surpassed by the improvements made in the operational efficiency.
The annual operating costs of the WDS life cycle are translated into a single payment according to the economic concept of Present Value (PV) [36] through the Present Value Factor (PVF). The PVF can be observed in Equation (9), where the project horizon (ph), was defined as 30 years, with an average interest rate (ir), of 12% p.a., common values used for the Brazilian reality.
Equation (10) describes the Objective Function (OF) to be minimized, in which the daily operating costs (C o , Equation (12)) of the project horizon are translated into a single payment by PVF, and added to the acquisition and installation costs of pipes and pumps (C i , Equation (11)). The implementation costs are obtained from Brazilian bases [37][38][39]. Finally, the penalty, presented in Equation (13), aims to deal with system constraints so that the optimized result is technically feasible. In this study, only the minimum pressure (p min ) of 10 m is adopted as recommended in [28]. The penalty coefficient ( ) adopted was 10 8 , a value tested and verified to quickly disregard solutions that violate the restriction. Equation (13) mathematically demonstrates the penalty due to violation of the adopted minimum pressure constraint, where p j,i is the pressure at node j at time i and n pen represents the number of nodes with pressures lower than the minimum pressure p min .
For finding the optimal solution, Particle Swarm Optimization (PSO) algorithm is applied. PSO was proposed by Eberhart and Kennedy in 1995 and consists of mimicking the collective response observed in flocks of birds [40,41].
The positions (X) of the particles represent the possible solutions to the problem, and their displacement occurs in search of the best position within the group. Basically, the particles move in the space searching for the best solution with a velocity (V). Positions (X) are randomly initialized and provide the starting iteration solution. In the next iterations, a particle trajectory evolves based on the own experience and on the collective experience. It happens through three components, namely: (i) inertia coefficient (ω): trend of the particle following its movement; (ii) cognitive coefficient (c 1 ): best position ever occupied by the particle; and (iii) social coefficient (c 2 ): best position ever occupied by any particle of the group. Equations (14) and (15) describe mathematically the search process, where the coefficients rand 1 and rand 2 represent uniformly random distributed values [0,1] to assign randomness to the process, in order to increase diversity, trying to cover the entire search space, and avoid premature convergence to local minima in search process.
X t+1 In this work, the inertia coefficient (ω) was set to 1.1 and the cognitive (c 1 ) and social (c 2 ) coefficients were set to 1.49, which are the values defined as default in the MATLAB ® software. The stopping criteria, with a number of particles adopted equal to 100, tested and proven to obtain optimized solutions, were: (i) a maximum number of 1000 iterations; or (ii) variation of the objective function equal to or less than 10 −10 for 20 consecutive times.

Case Studies
The case studies are the benchmark ZJ and OBCL-1 networks, both part of the database of a series of benchmarking networks of [42], and are the same ones studied by [20]. The first one, the ZJ network, is a model of Zhijiang City, located in the west of Hubei Province in China, and OBLC-1 is a model of the Oberlin community located in the city of Harrisburg, Pennsylvania, northeastern United States.
To better compare the results and visualize the improvements with the methodology proposed in this paper, the most efficient intermittent level for each case study found by [20] was adopted. Furthermore, the same demand pattern and leakage coefficients and exponent (α and β) were used.

Case Study 1: ZJ Network
The ZJ network is a model with 114 nodes and 164 pipes totaling approximately 126 km of the existing infrastructure supplied by gravity from a reservoir. Thus, only leakage is considered to calculate the operational costs. The leakage and exponent coefficients (α and β) are set as 0.65 and 0.5, respectively, for all nodes, and the daily demand is 110,870 m 3 . Figure 4 shows the ZJ infrastructure and its main pipes defined (20% of the total existing length-25.2 km).
In this work, the inertia coefficient ( ) was set to 1.1 and the cognitive ( ) and social ( ) coefficients were set to 1.49, which are the values defined as default in the MATLAB® software. The stopping criteria, with a number of particles adopted equal to 100, tested and proven to obtain optimized solutions, were: (i) a maximum number of 1000 iterations; or (ii) variation of the objective function equal to or less than 10 -10 for 20 consecutive times.

Case Studies
The case studies are the benchmark ZJ and OBCL-1 networks, both part of the database of a series of benchmarking networks of [42], and are the same ones studied by [20]. The first one, the ZJ network, is a model of Zhijiang City, located in the west of Hubei Province in China, and OBLC-1 is a model of the Oberlin community located in the city of Harrisburg, Pennsylvania, northeastern United States.
To better compare the results and visualize the improvements with the methodology proposed in this paper, the most efficient intermittent level for each case study found by [20] was adopted. Furthermore, the same demand pattern and leakage coefficients and exponent ( and ) were used.

Case Study 1: ZJ Network
The ZJ network is a model with 114 nodes and 164 pipes totaling approximately 126 km of the existing infrastructure supplied by gravity from a reservoir. Thus, only leakage is considered to calculate the operational costs. The leakage and exponent coefficients ( and ) are set as 0.65 and 0.5, respectively, for all nodes, and the daily demand is 110,870 m³. Figure 4 shows the ZJ infrastructure and its main pipes defined (20% of the total existing length-25.2 km).

Case Study 2: OBCL-1 Network
The OBCL-1 network is a model with 269 nodes and 294 pipes totaling around 60 km of the existing infrastructure supplied from a reservoir by a pump station. The leakage and exponent coefficients ( and ) are set as 0.03 and 0.5, respectively, for all nodes, and the daily demand is 14,270 m³. Figure 5 shows the OBCL-1 infrastructure and its main network defined (20% of the total-12.0 km).

Case Study 2: OBCL-1 Network
The OBCL-1 network is a model with 269 nodes and 294 pipes totaling around 60 km of the existing infrastructure supplied from a reservoir by a pump station. The leakage and exponent coefficients (α and β) are set as 0.03 and 0.5, respectively, for all nodes, and the daily demand is 14,270 m 3 . Figure 5 shows the OBCL-1 infrastructure and its main network defined (20% of the total-12.0 km). Water 2022, 13, x FOR PEER REVIEW 10 of 15  Table 3 shows a comparison of the hydraulic and economic parameters for the CWS, the IWS optimized operation proposed by [20], and the IWS optimized operation with the resizing of the main network. The economic efficiency ( ) is calculated according to Equation (16), where and are the project horizon cost of the CWS and IWS scenarios, respectively.

ZJ Network Results
As the supply is made by gravity, the resizing of the WDN in intermittent operation is an alternative to operate within a lower number of hours and guarantee the minimum pressure. The best solution found by [20] is an IWS of 15 h. When the 12 h scenario was simulated, pressure dropped below the minimum required, as shown in Figure 6. Thus, to achieve the minimum pressure of 10 m, as recommended in [28], it is necessary to resize the first pipe (next to the reservoir), with a length of 2013 m, due to the excessive velocity observed, and, consequently, high head loss. Despite this resizing, the velocity is still excessively high, around 6.0 m/s (Figure 7), wherein it must be around 3.0 m/s, according to [28], to avoid wear of pipes and valves, noises, and higher danger with transient regime due to high velocity. However, this is an infrastructure problem, since, both for the CWS and IWS of 15 h, the velocity is higher than 6.0 m/s ( Figure 7); so, attention to operation and/or interventions to correct this problem must be considered at any level of operation.
The IWS of 12 h shows a daily leakage of 14.1%, only 0.4% lower than the best-case scenario found by [20] for the IWS of 15 h. The reduction in actual leakage is not expressive with the decrease in the number of hours of operation from 15 h to 12 h due to the increase in mean pressure. Since the IWS of the 15 h scenario has the original pipes, the velocity above 6.0 m/s in pipes close to the reservoir worked as a pressure regulator in the system, providing an average pressure of 22 m. When the resizing is done for the IWS of the 12 h scenario, the diameter of the first pipe increases from 700 mm to 800 mm (+14.3%). So, a slight decrease in velocity is observed, but the average pressure increased to 33 m. In this case, the implementation of a Pressure Reducing Valve (PRV) could contribute even more to reduce leakage. Also, pump as turbines (PATs) could achieve better results as it could be an alternative to convert the excess of energy (pressure) into electricity. So, besides limiting the system pressure and reduce leakage, PATs could generate electricity, as highlighted by [18,19]. Neither PRVs nor PATs are implemented in this work. Despite this, it  Table 3 shows a comparison of the hydraulic and economic parameters for the CWS, the IWS optimized operation proposed by [20], and the IWS optimized operation with the resizing of the main network. The economic efficiency (E) is calculated according to Equation (16), where POC 24h and POC t are the project horizon cost of the CWS and IWS scenarios, respectively. As the supply is made by gravity, the resizing of the WDN in intermittent operation is an alternative to operate within a lower number of hours and guarantee the minimum pressure. The best solution found by [20] is an IWS of 15 h. When the 12 h scenario was simulated, pressure dropped below the minimum required, as shown in Figure 6. Thus, to achieve the minimum pressure of 10 m, as recommended in [28], it is necessary to resize the first pipe (next to the reservoir), with a length of 2013 m, due to the excessive velocity observed, and, consequently, high head loss. Despite this resizing, the velocity is still excessively high, around 6.0 m/s (Figure 7), wherein it must be around 3.0 m/s, according to [28], to avoid wear of pipes and valves, noises, and higher danger with transient regime due to high velocity. However, this is an infrastructure problem, since, both for the CWS and IWS of 15 h, the velocity is higher than 6.0 m/s ( Figure 7); so, attention to operation and/or interventions to correct this problem must be considered at any level of operation.

ZJ Network Results
is emphasized again that the role played by pipes in controlling the pressure, due to excessive velocity and head loss, is concerning from the point of view of the physical safety of the system, being a function of PRVs or PATs.
From an economic point of view, the resizing cost is 4.9 million reais. As this is a very expensive procedure, its feasibility is highly sensitive to the water production tariff, tw. Thus, for the lowest tariff, even with an economic efficiency of 49.6% over the CWS, the IWS of 15 h is still the best option, with an economic efficiency of 60.3%. In scenarios 2 and 3, where the production tariff is higher, the implementation cost is less representative, resulting in an economic efficiency of 60.9% and 60.4%, respectively, slightly higher than that observed for the same scenarios with the 15 h operation.    [20]. * Optimized scenarios. is emphasized again that the role played by pipes in controlling the pressure, due to excessive velocity and head loss, is concerning from the point of view of the physical safety of the system, being a function of PRVs or PATs. From an economic point of view, the resizing cost is 4.9 million reais. As this is a very expensive procedure, its feasibility is highly sensitive to the water production tariff, tw. Thus, for the lowest tariff, even with an economic efficiency of 49.6% over the CWS, the IWS of 15 h is still the best option, with an economic efficiency of 60.3%. In scenarios 2 and 3, where the production tariff is higher, the implementation cost is less representative, resulting in an economic efficiency of 60.9% and 60.4%, respectively, slightly higher than that observed for the same scenarios with the 15 h operation.    [20]. * Optimized scenarios. The IWS of 12 h shows a daily leakage of 14.1%, only 0.4% lower than the best-case scenario found by [20] for the IWS of 15 h. The reduction in actual leakage is not expressive with the decrease in the number of hours of operation from 15 h to 12 h due to the increase in mean pressure. Since the IWS of the 15 h scenario has the original pipes, the velocity above 6.0 m/s in pipes close to the reservoir worked as a pressure regulator in the system, providing an average pressure of 22 m. When the resizing is done for the IWS of the 12 h scenario, the diameter of the first pipe increases from 700 mm to 800 mm (+14.3%). So, a slight decrease in velocity is observed, but the average pressure increased to 33 m. In this case, the implementation of a Pressure Reducing Valve (PRV) could contribute even more to reduce leakage. Also, pump as turbines (PATs) could achieve better results as it could be an alternative to convert the excess of energy (pressure) into electricity. So, besides limiting the system pressure and reduce leakage, PATs could generate electricity, as highlighted by [18,19]. Neither PRVs nor PATs are implemented in this work. Despite this, it is emphasized again that the role played by pipes in controlling the pressure, due to excessive velocity and head loss, is concerning from the point of view of the physical safety of the system, being a function of PRVs or PATs.
From an economic point of view, the resizing cost is 4.9 million reais. As this is a very expensive procedure, its feasibility is highly sensitive to the water production tariff, tw. Thus, for the lowest tariff, even with an economic efficiency of 49.6% over the CWS, the IWS of 15 h is still the best option, with an economic efficiency of 60.3%. In scenarios 2 and 3, where the production tariff is higher, the implementation cost is less representative, resulting in an economic efficiency of 60.9% and 60.4%, respectively, slightly higher than that observed for the same scenarios with the 15 h operation.

OBCL-1 Network Results
In this case study, the resizing of the WDN in intermittent operation is an alternative to reduce the energy cost for the best IWS solution (15 h) found by [20], as well as a possible improvement for an IWS operation with fewer hours (12 h). The resized extensions for each scenario are presented in Table 4, and the results obtained from the hydraulic simulation of the optimized scenario have been compared with the results obtained by [20] in Table 5.  It is observed that the resizing (implementation/replacement) of 9513 m (15.8%) up to 12,057 m (20.0%) of the main conduit of a total of approximately 60 km of the existing infrastructure is necessary. The increase in velocity due to the intermittent regime is corrected by replacing some pipes in the main network and, only isolated points presented velocity above 2.0 m/s, as shown in Figure 8. Thus, there is a significant reduction in both power demand (kW) and energy consumption (kWh) in the optimized intermittency scenarios with resizing (15 h* and 12 h*) when compared to the scenarios with the same level of intermittency, but without any intervention in the infrastructure (15 h and 12 h). The reduction of energy parameters is due to the selection of pumps with lower head (H BEP ). This is possible due to the reduction in head loss of the new pipes, achieved from two aspects: (i) correction of high velocities; and (ii) correction of the low Hazen-Williams coefficient for old pipes. In addition, the smaller head of the pump also reduced the daily distribution and mean pressure, as also shown in Figure 9. Combined with the reduced number of hours operating, the leakage reduced from 29% for the CWS to 20% and 16% for the IWS of 15 h and 12 h, respectively. These values are also slightly better than the IWS without resizing.
From an economic point of view, the implementation cost ranged from approximately 5.0 to 8.0 million reais. Considering the WDS life cycle, the resizing option was more feasible than any other solution. The efficiency of IWS of 15 h and 12 h with resizing, respectively, in relation to the CWS is: (i) scenario 1: 10.0% and 14.0%; (ii) scenario 2: 36.0% and 47.4%; (iii) scenario 3: 29.2% and 44.5%. number of hours operating, the leakage reduced from 29% for the CWS to 20% and 16% for the IWS of 15 h and 12 h, respectively. These values are also slightly better than the IWS without resizing.
From an economic point of view, the implementation cost ranged from approximately 5.0 to 8.0 million reais. Considering the WDS life cycle, the resizing option was more feasible than any other solution. The efficiency of IWS of 15 h and 12 h with resizing, respectively, in relation to the CWS is: (i) scenario 1: 10.0% and 14.0%; (ii) scenario 2: 36.0% and 47.4%; (iii) scenario 3: 29.2% and 44.5%.   number of hours operating, the leakage reduced from 29% for the CWS to 20% and 16% for the IWS of 15 h and 12 h, respectively. These values are also slightly better than the IWS without resizing.
From an economic point of view, the implementation cost ranged from approximately 5.0 to 8.0 million reais. Considering the WDS life cycle, the resizing option was more feasible than any other solution. The efficiency of IWS of 15 h and 12 h with resizing, respectively, in relation to the CWS is: (i) scenario 1: 10.0% and 14.0%; (ii) scenario 2: 36.0% and 47.4%; (iii) scenario 3: 29.2% and 44.5%.

Conclusions
Water-stressed conditions can impact not only the public water supply but also important sectors of the economy, such as irrigation and hydroelectric power generation. The management of water resources becomes a fundamental strategy to minimize impacts in periods of water scarcity and to reduce the conflicts associated with multiple uses of water. This paper studied the rehabilitation of main pipes as a tool to control the increase of energy consumption in IWS, as highlighted by [20]. Therefore, in locations where energy is produced mainly by hydroelectric power plants, as in Brazil, the rehabilitation is a management strategy to further reduce overload in the reservoirs during periods of water stress, to minimize conflicts from multiple uses, and to maintain the power generation capacity. In addition, the proposed methodology could be used as a planning tool for CWS, as the resizing of pipes that have the best cost-benefit ratio to improve the system capacity could meet the increasing demand with lower operational costs.
In the first case study, the ZJ network, the resizing allowed to operate the system during a reduced period of 12 h per day. This was not possible with the original infrastructure, as negative pressures were observed. In addition, daily leakage was just slightly better than the best-case scenario found by [20] due to an increase in mean pressure. In the second case study, the OBCL-1 network, resizing allowed to correct the increase in velocity and, consequently, decrease the head losses. Therefore, a significant reduction in both power demand and energy consumption was observed with a slightly decrease in daily leakage due to the smaller pumps, which contributed for the rehabilitation to have excellent economic efficiency results. Despite the efficiency of the optimized IWS with the resizing of the main network (optimized scenarios), the positive and negative aspects of the strategy should be highlighted. The resizing provided an optimized operating cost, reducing energy costs and leakage, in addition to providing a reduction in average pressure and controlling the increase in flow velocity. This can be a good strategy for well-managed systems, but with a high tariff of energy and water production and/or in recurrent water scarcity conditions. Moreover, a high investment is necessary, which can make the solution unfeasible for managers with financial difficulties/deficits. Finally, it is also necessary to plan active campaigns to assess water quality, since the pipes remain partially or totally empty for a greater number of hours daily.