## Abstract

Dividing a water distribution network (WDN) in the optimal district metered areas (DMAs) formation is one task that usually troubles water utility managers. The present paper utilizes optimization methods to achieve desired segmentation conditions in terms of (a) operating pressure reduction, thus reducing the system's real water losses and (b) residual chlorine concentration reduction thus preventing disinfection byproducts' growth. Exploiting the numerous possibilities offered by the inter-connection of Matlab and EPANET software tools, an algorithm is developed in C++ language. The algorithm reads all significant data of a WDN as an output of EPANET. The first algorithm calculates the optimal allocation of a given number of closed isolation valves in terms of water losses' reduction, considering restrictions for network's proper operation. The second algorithm calculates the optimal formation of DMAs in terms of water quality improvement. Both algorithms can be applied in any WDN. The outcome is the optimal set of closed pipes that leads to the optimal formation of DMAs in a given network. The closing of pipes (by installing isolation valves) determines the optimal formation of DMAs. The basic concept of both algorithms and their application in a case study network's hydraulic model are presented.

## INTRODUCTION

Dividing a water distribution network (WDN) in district metered areas (DMAs) is widely acknowledged as one of the most efficient and cost-effective methods to optimize a WDN's operation regarding the reduction of real water losses rates (Farley & Trow 2003; Puust *et al.* 2010; Kanakoudis & Gonelas 2014). It is usually a prerequisite in order for other water loss reduction techniques to be considered by water utility managers worldwide. The sectorization of a network provides several significant benefits (Gonelas & Kanakoudis 2016; Savić & Ferrari 2015) such as increased system control and contributes to the mitigation of water losses. Implementation of DMAs can be carried out under several perspectives with different goals each time. The issues arising from the separation of a network in hydraulic isolated zones (DMAs) are linked to either water quantity or water quality problems. The constraints of minimum operating pressure, meeting customer demand and the residual chlorine concentration (within predetermined value levels usually set by the ruling legislation) should always be satisfied (Karadirek *et al.* 2016). Moreover, in real cases, the optimal formation of DMAs may be very challenging due to the intriguing complexity of the WDN (Charalambous 2005; MacDonald & Yates 2005; Rogers 2005; Laucelli *et al.* 2017). Therefore, a suitable methodology is needed to support the decision water utility managers have to make. In recent years, an increasing number of studies have addressed this problem, and sophisticated optimization approaches have been introduced (Araujo *et al.* 2006; Alvisi & Franchini 2014; Wright *et al.* 2015). Some of the techniques developed so far suffer from limitations and drawbacks, which are mainly based on the limited number of design criteria and the dependence on the network's size (Galdiero 2015). To optimize the DMAs' formation in a WDN, the aims, among others, are to reduce its operating pressure, maintain residual chlorine concentration within acceptable limits, optimize the water freshness, etc. Chlorine is widely used as a disinfectant for the treatment of microbial infections and their proliferation. The residual chlorine concentration is reduced due to the flow in water pipes mainly due to the water's reaction: (a) in terms of the water's natural organic matter (bulk decay); and (b) with the pipe walls (wall decay) (Monteiro *et al.* 2014). Chlorine residual concentration must not be too low in order to safeguard its role in preventing harmful microbial infections. It should not be too high either as that results in disinfection byproducts' growth, such as total trihalomethanes (TTHMs), which are blamed for cancer (WHO 2011). Therefore, during the optimal DMAs' formation modeling (through the WDN's hydraulic simulation model), the upper and lower limits of residual chlorine concentration should be strictly considered.

To tackle the above-mentioned problem, a widely used approach is to apply an optimization process based on genetic algorithms (GAs) to reach an optimal solution. During the last two decades, a great deal of progress has been made on water network optimization using GAs (Abuiziah & Shakarneh 2013), with a variety of optimization goals set such as the diameter of the pipes (Jung & Karney 2004) or the pump characteristics for a small distribution network (Abkenar *et al.* 2015). The successful attempt to link Matlab and EPANET software tools (Eliades *et al.* 2014) offers the possibility to develop an algorithm that collects data from the network and provides results as well as algorithms that run tests on the network. The combination of these two software tools forms an expert tool that can be used to optimize the DMAs' formation in terms of total number and specific borders. Two algorithms in Matlab were developed in the present study to optimize the DMAs' formation considering the operating pressure of the WDS and the chlorine residual concentration as the design criteria. The first algorithm aims to define the most appropriate pipes to be closed in order to optimize the system's operating pressure in terms of reducing real water losses. The second algorithm uses GAs optimization, to produce all the possible combinations of closed pipes towards optimizing the chlorine residual concentration.

The application of both algorithms was performed on the hydraulic and water quality model of a small network in order to demonstrate the variations on the DMAs boundaries derived from: (a) the optimization of the network's operating pressure, thus reducing the real water losses and the non-revenue water levels; and (b) the optimization of the residual chlorine concentration in the pipes in order to be within the acceptable limits. Scenarios for both cases for a number of closed pipes ranging from 4 to 9 were checked using the WDN's hydraulic model. Both algorithms developed, the case study network used, the results and discussion, are presented below.

## METHODS

### Case study WDN

Both of the algorithms were tested in a demo WDN, including one reservoir that provides water to the entire network, two boosters providing the required operating pressure, and one tank to store water and supply it back to the network (Figure 1) (Korkana *et al.* 2016). The network's model consists of 100 pipes and 76 nodes. Both the size and the complexity of this network are considered to resemble a real network of any small town. The specific case study demo network comes from Bentley's lessons library and is a verified and calibrated example of a real network. EPANET software tool was used for both the hydraulic and water quality analyses. In the present study, two variable water demand patterns (residential and commercial) were considered over a 24-hour period, and the hydraulic time step was set equal to 1 hour. Hydraulic and water quality analyses were both performed over a 168-hour period of time (i.e., for 7 consecutive days).

### Operating pressure algorithms

*et al.*2016), while EPANET is used to simulate the hydraulics of the case study network. Hourly nodal water demand and pressure values were collected and Equation (1) calculated: where

*i*is a custom node of the network;

*n*is the maximum number of nodes; is the water demand of node i for each time step

*t*[m

^{3}/min]; is pressure of node

*i*for each time step

*t*[kPa].

The optimization of the DMAs' formation process is based on the concept to check every possible combination of closed pipes, in order to select the ones that end up with the best pressure management results. Thus, a second algorithm was developed in Matlab, to select combinations of pipes (to be closed). After counting all network pipes, the program closes one pipe and tests its pressure management impact. Each pipe is tested alone and the one that reduces the ‘P*D’ product the most is chosen to be permanently closed. Then, the algorithm tries out all the remaining pipes and closes the one that further reduces the ‘P*D’ product the most. This hierarchical procedure continues until the optimal number of closed pipes is determined. The scenarios tested for the ‘P*D’ optimization ranged from 1 to 14 pipes closed. It was proven that for scenarios with more than 9 pipes closed the objective function was not further reduced more than 0.1% (Korkana *et al.* 2016). Thus, after determining the optimal number of closed pipes, every new pipe closed will not reduce the product ‘P*D’ through Equation (1) any further. Although this optimization process might demand great computational power/time, it can reach a reliable optimal solution.

The greatest disadvantage of this process is that it requires a great deal of computational time, as already stated above, to test each different combination/scenario of closed pipes. In order to reduce the time needed and make things easier for the program, certain pipes are excluded from the process. Thus, pipes that supply water to ending nodes cannot be part of the process. By closing those pipes, the ending nodes will not be supplied with water at all. Pipes supplying large water volumes and water mains should also be excluded from the optimization process (Laucelli *et al.* 2016), as they should be working around the clock. Based on the above, many pipes can be excluded from the pipe list of the program. Combinations are considerably reduced and calculation time is cut down too. Reduction of pipes being checked depends on the morphology of the network chosen and may not apply to every case to the same extent. A group of pipes has to cover some prerequisites in order to be accepted as the optimal solution resulting from the optimization process. A closed pipe may not produce any negative pressures on the network's nodes. In an EPANET model, negative nodal pressures occur when water does not reach one or more nodes. In Greece, the pressure in each node has to be kept above a minimum threshold of 200 kPa (according to the Greek legislation).

### Chlorine residual optimization algorithm

*i*is a node in the network,

*t*is the time step of the quality analysis (in hours),

*Cl*is the chlorine concentration, and

*N*is the maximum number of nodes in the network.

*t*= 0 to

*t*= 24) results were omitted as the initial values of the network affected the outputs of the model, which had to be stabilized during the continuous operation of the hydraulic model over a longer period of time. Thus, the remaining simulation period (i.e., 6 days or

*t*= 25–168) was the actual time frame to define the optimal solution if

*t*is in hourly time step. As already stated, the operating pressure at any node of the WDN should be kept above the Greek legislation threshold (Equation (3)):

Thus, the optimization produced a network, in which no pipe had, at any given time, chlorine residual concentration less than 0.20 mg/L for each of the scenarios to be checked. The computational time needed for each optimization scenario ranged from 5 to 12 hours.

### Water quality simulation model

The Greek legislation (YM/5673/57) does not provide an upper boundary for the chlorine residual concentration in water networks, but only a minimum, which is set equal to 0.20 mg/L at the network's dead-end points. The World Health Organization sets a maximum of 5 mg/L while the US law is 4 mg/L. The equations for water quality analysis in water distribution systems are based on the ‘conservation of mass’ principle and the reaction kinetics equations. When chlorine is present in the pipe, it reacts with both the water column (bulk flow reaction) and the pipe walls (pipe wall reaction) (Georgescu & Georgescu 2012). Another important factor when modeling chlorine concentration in water networks is the diffusion potential, which measures the rate at which particles or fluids can spread. Table 1 presents the values for water quality simulation chosen during the present study.

Water quality simulation factor | Value |
---|---|

Diffusivity | 1.2 × 10^{−9} m^{2}/sec |

Bulk reaction rate | −0.1 (mg/L)/day |

First order wall reaction rate | −0.024 m/day |

Initial chlorine residual concentration (junctions, tank) | 0.5 mg/L |

Constant chlorine residual concentration (reservoir) | 0.5 mg/L |

Water quality simulation factor | Value |
---|---|

Diffusivity | 1.2 × 10^{−9} m^{2}/sec |

Bulk reaction rate | −0.1 (mg/L)/day |

First order wall reaction rate | −0.024 m/day |

Initial chlorine residual concentration (junctions, tank) | 0.5 mg/L |

Constant chlorine residual concentration (reservoir) | 0.5 mg/L |

## RESULTS AND DISCUSSION

### Forming DMAs considering the operating pressure as the design criterion

Regarding the optimization process, in order to calculate the ‘P*D’ product according to Equation (1), the execution of the first algorithm took place. This was performed as described above in order to identify the characteristics of the network being studied and measure its nodal pressure level. The initial ‘P*D’ product was estimated at 40.969 kPa*m^{3}/min. Before the execution of the second algorithm, a careful observation of the network took place. As mentioned before, several pipes could be excluded from the second algorithm's tests as they could not be optimal solutions (i.e., pipes that could be closed). Therefore, 20 pipes (P-1, P-2, P-3, P-4, P-5, P-6, P-7, P-9, P-10, P-11, P-18, P-241, P-242, P-247, P-248, P-250, P-251, P-252, P-253, P-259) were left out of the optimization process, significantly reducing the number of combinations to be tested and the computational time needed. The number of excluded pipes may significantly differ from one WDN to another, but it is a procedure that should take place before the optimization process.

The first algorithm, for the operating pressure optimization was executed step by step, meaning that it was only used to find one optimal closed pipe at each step. In this way the test results could be better monitored and controlled. After several tests and trials, the program was ready to perform the optimization process. Numerous combinations were tested in order for the program to reach a certain result and specifically address which pipes should be closed. Figure 2 highlights the pipes that were chosen by the algorithm as the optimal ones to be closed. The program performing the optimization process is able to ‘reveal’ the impact of each pipe being closed in terms of ‘P*D’ product reduction. Based on Table 2, every new pipe chosen to be closed reduces the ‘P*D’ product less than the pipe that was (chosen to be) closed during the previous step. This too is significant, as in cases of limited resources available for such interventions the program is able to pinpoint the most important ones. Figure 2 presents the pipes that were chosen to be closed based on how much each one (successively) reduced the ‘P*D’ product. Figure 3 presents the optimal formation of the DMAs resulting from the piped chosen to be closed. Four DMAs were formed.

Pipes (numbering in algorithm) | Pipes (name in EPANET) | P*D (KPa * m^{3}/min) |
---|---|---|

– | – | 40,970 |

7 | P-17 | 38,268 |

7,12 | P-17, P-36 | 36,290 |

7,12,21 | P-17, P-36, P-90 | 35,510 |

7,12,21,38 | P-17, P-36, P-90, P-229 | 35,465 |

7,12,21,38,22 | P-17, P-36, P-90, P-229, P-93 | 35,424 |

7,12,21,38,22,50 | P-17, P-36, P-90, P-229, P-93, P-254 | 35,418 |

7,12,21,38,22,50,41 | P-17, P-36, P-90, P-229, P-93, P-254, P-232 | 35,413 |

7,12,21,38,22,50,41,48 | P-17, P-36, P-90, P-229, P-93, P-254, P-232, P-240 | 35,382 |

Pipes (numbering in algorithm) | Pipes (name in EPANET) | P*D (KPa * m^{3}/min) |
---|---|---|

– | – | 40,970 |

7 | P-17 | 38,268 |

7,12 | P-17, P-36 | 36,290 |

7,12,21 | P-17, P-36, P-90 | 35,510 |

7,12,21,38 | P-17, P-36, P-90, P-229 | 35,465 |

7,12,21,38,22 | P-17, P-36, P-90, P-229, P-93 | 35,424 |

7,12,21,38,22,50 | P-17, P-36, P-90, P-229, P-93, P-254 | 35,418 |

7,12,21,38,22,50,41 | P-17, P-36, P-90, P-229, P-93, P-254, P-232 | 35,413 |

7,12,21,38,22,50,41,48 | P-17, P-36, P-90, P-229, P-93, P-254, P-232, P-240 | 35,382 |

Successively closing the eight pipes pinpointed by the program, the ‘P*D’ product was decreased to 35,382 kPa*m^{3}/min, reduced by 13.64% compared to its initial value (40,970 kPa*m^{3}/min) where no pipes were closed (Table 2). After the first eight pipes suggested to be successively closed, the algorithm continued the optimization process and kept on suggesting new pipes to be closed. Thus, other six pipes (i.e., *Ρ*-231, *Ρ*-258, *Ρ*-256, *Ρ*-146, *Ρ*-262, *Ρ*-227) were suggested to be successively closed following the first eight pipes. Nevertheless, as successively closing each one of these new pipes resulted in a negligible further reduction of the ‘P*D’ product (less than 0.1%), the decision to keep on closing pipes was not cost-effective (increased implementation costs with no clear benefits related), and the pipes were left open. Additionally, the closing of these six pipes did not alter the boundaries of the DMAs that resulted by closing the first eight pipes. Thus, the optimization stepwise process was terminated after the selection of the first eight pipes to be closed.

The optimization process analyzed above can be applied to solve the same problem in any WDN. Its main disadvantage is that it depends a great deal on the size of the WDN under study. As the number of the network pipes increases, the complexity of the problem increases too, as more alternatives/combinations have to be tested. This may demand too much computational power and time. One more disadvantage of the process is that the second algorithm provides only a group of closed pipes. Some of these pipes may determine the DMAs to be formed, while others may not end up with a similar suggestion. This has to be figured out by thoroughly studying the network, after indicating which pipes are closed. Optimization of DMAs' formation (in terms of operating pressure reduction) is based on two algorithms developed that select the group of closed pipes. Through the selection of closed pipes, guidance is offered to design DMAs' boundaries. The optimal solution resulted from this process was verified and then accepted. Closed pipes did not produce any negative nodal pressure and pressure level did not fall below 200 kPa in any node.

### Forming DMAs considering the chlorine residual concentration as the design criterion

Following the formation of the objective function and the constraints concerning both the minimum acceptable chlorine residual concentration and the minimum acceptable nodal pressure, the network's model was tested for various scenarios using the optimization algorithms. The scenarios tested included closed isolation valves in groups of 4, 5, 6, 7, 8, and 9 pipes resulting in the subsequent formation of DMAs' boundaries. Figure 4 presents the groups of pipes (4 to 8), that if closed, optimize the objective function for the residual chlorine concentration. Table 3 includes the values of the objective function for each scenario. Figure 5 presents the DMAs' formations resulting from the groups of pipes being closed. The results revealed that the value of the objective function remains practically constant even if the number of pipes being closed increases, thus revealing that the water retention in the network did not significantly alter, due to the small change in the total number of the DMAs formed.

Number of closed pipes | Pipes (name in EPANET) | Summed chlorine residual concentration (mg/L) |
---|---|---|

4 | P-32, P-34, P-45, P-126 | 25.33 |

5 | P-32, P-213, P-229, P-233, P-150 | 25.23 |

6 | P-31, P-45, P-231, P-233, P-150, P-130 | 25.34 |

7 | P-31, P-46, P-232, P-237, P-260, P-125, P-148 | 25.52 |

8 | P-16, P-31, P-90, P-229, P-238, P-263, P-130, P-141 | 24.71 |

9 | P-31, P-34, P-45, P-225, P-234, P-239, P-261, P-130, P-141 | 25.63 |

Number of closed pipes | Pipes (name in EPANET) | Summed chlorine residual concentration (mg/L) |
---|---|---|

4 | P-32, P-34, P-45, P-126 | 25.33 |

5 | P-32, P-213, P-229, P-233, P-150 | 25.23 |

6 | P-31, P-45, P-231, P-233, P-150, P-130 | 25.34 |

7 | P-31, P-46, P-232, P-237, P-260, P-125, P-148 | 25.52 |

8 | P-16, P-31, P-90, P-229, P-238, P-263, P-130, P-141 | 24.71 |

9 | P-31, P-34, P-45, P-225, P-234, P-239, P-261, P-130, P-141 | 25.63 |

### Comparing the two approaches

The size of the DMAs formed was studied in terms of: (a) total number of nodes in each DMA expressed as percentage of the total number of nodes in the network (Figure 6); and (b) the water demand in each DMA expressed as percentage of the total water demand in the network (Figure 7). The above values were calculated for all the scenarios regarding the residual chlorine concentration optimization but also for the scenario regarding the entire network's operating pressure optimization.

Subsequently, the influence of the residual chlorine concentration optimization results in the entire network's operating pressure was examined and vice versa. The concepts of both the optimization approaches are almost identical. On the one hand, the optimization of the operating pressure is based on the longest path (route) the water follows in the network pipes in order to reduce pressure (but kept over 200 kPa) due to the friction and the minor losses occurring. On the other hand, the optimization of the residual chlorine concentration is based on the longest path the water follows in the network in order to reduce (but kept above 0.2 mg/L) the residual chlorine concentration to prevent TTHMs' growth.

Figure 8 shows the (simulated) mean value of the minimum chlorine residual concentration at the nodes of the network for the different scenarios tested. The summed values of residual chlorine concentrations at the nodes of the network do not actually differ when the quality optimization scenarios take place.

Figure 9 shows the mean values of the minimum operating pressures (*P _{min}*) at the nodes of the network. The smallest

*P*value appears when the operating pressure optimization scenario takes place, something absolutely logical/expected as the particular algorithm optimizes an expression of the pressure nodes. The variation of

_{min}*P*mean value for the various water quality optimization scenarios tested is interesting. The network's operating pressure should always be taken into account during the DMAs' formation process. Otherwise it is quite possible for high nodal pressures to appear even after the formation of the DMAs.

_{min}## CONCLUSIONS

Two algorithms were developed to link EPANET with Matlab and perform the desired optimization process. Results were produced after checking/testing every possible scenario of combined closed pipes regarding the specific case study network. The reduction of the ‘P*D’ product was used as the decisive criterion in order to define the optimal operating pressure (leading to reduced real water loss rates). Although pressure reduction actually derived from this optimal solution, it does not reflect real figures since the analysis is not pressure driven (water demand is not pressure dependent). In order to reduce the numerous tests of closed pipe combinations, some pipes that could not be closed (for operational reasons) were excluded. Although this ‘trick/smart move’ resulted in significantly reduced needs of both computational power and time, their actual high levels are still regarded as the main disadvantages of the current/suggested optimization process.

An algorithm was developed to form the optimal DMAs, considering the quality of the water and especially the optimal concentration of the residual chlorine as the design criterion. The objective was to minimize this concentration as much as possible, while keeping it, at any time, above 0.20 mL/L, to prevent disinfection byproduct (like TTHMs) growth.

Although after comparison of the two approaches analyzed in this study, no safe conclusion was derived, the authors suggest that it is probably wise to consider both factors to optimally form DMAs in a water network. The proposed method can be considered universally applicable as it works well for any given WDN topology. For bigger networks though, the complexity and the optimization time are both significantly increased. The novelty of this study is that it uses for the first time the chlorine residual concentration level as the main design criterion to form the optimal DMAs in a water pipe network. This work can be considered a first step to form DMAs, considering water quality, while the research continues, aiming towards the integration of the hydraulic part of the network with quality analysis to work in tandem and provide a robust solution.

## REFERENCES

*.*

*Proceedings of the IWA Specialized Conference Leakage*

*Proceedings of the IWA Specialized Conference Leakage*

*.*

*,*4th edn.

*.*

Proceedings of the IWA Specialized Conference Leakage