1. Introduction
Water pressure management is one of the main issues in water distribution networks (WDNs) as it is related to water and energy saving [
1]. High-pressure values are directly connected to leaks, water losses, and damage of pipes, especially in old WDNs [
2]. Given that the hourly water demand changes significantly during 24 h, corresponding changes are created in the pressure of the network nodes. The problem becomes more acute during the hours when water demand is low. There are several papers in the literature on the relationship between pressure and water loss [
3,
4,
5], as well as strategies and methodologies for reducing pressure using control valves (PRV) [
6,
7,
8] aiming at leakage reduction through the minimization of the water pressures. Metaheuristic algorithms such as the harmony search algorithm have also been used to optimally set and position pressure reduce valves [
9]. This group of algorithms has proven to be very effective in solving nonlinear problems without requiring high computational resources [
10,
11,
12].
Each node of the network has a minimum pressure requirement, depending on the altitude, the height of the buildings, the losses in the pipes, etc., and when this is satisfied a strategy for managing the extra pressure at the nodes is necessary. The most common solution for pressure management in the literature is to maintain a constant pressure at specific nodes; although, various real-time applications that use monitoring pressure sensor measurements in order to adjust the pressure of the nodes according to demand have been proposed [
13,
14]. The pressure needs to be set high enough to still satisfy customers’ needs subject to a minimum pressure target.
However, a head drop in any PRV is an energy dissipation that could be an opportunity to generate electricity power [
15,
16,
17,
18]. Power potential recovery from water networks can be implemented in various ways in order to allow both an efficient power conversion and a reliable network pressure regulation [
19,
20]. A popular methodology is PATs (Pumps As Turbines). The function of a PAT is to convert the kinetic energy and pressure energy of the fluid into mechanical energy of the rotor according to the pressure requirements at the nodes of the downstream network. During the day, when the needs for water and pressure at the nodes are greater than at night, the PAT acts as a pump ensuring the required flow and pressure, especially at the highest nodes of the network. During the evening hours when water needs are lower the PAT can operate as a power turbine exploiting the daily excess water in the tanks. In this case, the PAT should be placed downstream of the tank so that it generates gravity energy at night. In addition to generating electricity, PATs contribute significantly to reducing node pressure and thus minimize water loss and pipeline failure. The most common practice for limiting high pressure is to use pressure relief valves (PRV). Replacing them or operating in parallel with PAT can effectively control pressure even if the power recovery is low. In particular, installing PAT on existing WDNs can be a viable option to reduce the consequences of high pressure without excessive installation costs and if combined with another renewable energy source, can have significant energy benefits [
21]. A pump system that works both as a pump and as a turbine can be used as micro-pump storage. In this case, the micro-pump system is connected with water tanks. Operating as a pump, the micro-pump system transports water from low to high potential storing energy, while operating as a turbine, it uses the stored water to generate electricity [
22]. The most important advantages of PAT are the simplicity of installation instead of a conventional turbine for this kind of application and the low investment cost. Usually, in WDN, the water supplies range between 0.01 and 0.5 m
3/s and the pressure load between 1 and 100 m. In these ranges, the conventional types of turbines (Pelton, Francis, Kaplan, etc.) can be barely functional [
23]. In the literature, the financial analyses show a payback period of the installation cost of a PAT system of about 2 to 3 years; although, the efficiency of PATs is lower than that of conventional systems. [
24] In order to evaluate investment proposals in energy recovery systems, cost classification systems have been developed using corresponding cost groups from hydropower plants. [
25] In addition, many computational models and methods of financial evaluation have been developed. These models predict the cost of PAT from the nominal water flow and the available hydraulic head [
26] or choose PATs whose operating point gives the minimum payback time [
27]. As PATs replace or operate in parallel with PRVs, another approach is to choose the most economical solution between PATs and PRVs using the Net Present Value [
28].
The idea of using pumps as turbines dates back to the 1930s and studies focus on predicting the operation curve of the turbine from the pump curve. Some of these studies use experimental data for pump reverse operation [
29], but most use mathematical models to predict the turbine curve in contrast to costly laboratory experiments. For this purpose, in the literature, there are various methods for predicting the operation curve of the turbines that use artificial neural networks [
30,
31] or various optimization methods in combination with statistical correlations. Simplified theoretical models as well as physics-based models are also quite common in trying to predict the reverse operation of the pump [
32,
33,
34]. Most of the malfunctions of PATs are related to the lack of performance data during the reverse hydraulic operation of the pumps by the manufacturers and consequently the need to generate experimental data or to develop models for predicting the turbine performance from the pump data. Most models aim to predict the PAT Best Efficiency Point (BEP) of the PAT by knowing the BEP of the pump from the manufacturer’s manuals. However, the use of PATs or the replacement of PRVs by PATs does not constitute an immediate recovery of lost energy and the main reason for this is the difference between the operating curves of pumps and turbines. In other words, a pump with the best possible efficiency may display small efficiencies during a reversal mode. For these reasons the use of PATs in existing WDNs should be implemented in the context of integrated financial planning and feasibility studies, which should prove the viability of the installation. However, there are many case studies of PAT technology on water distribution networks.
Table 1 shows some important publications on PAT applications in WDNs
In the present paper, a combined method of real-time monitoring of the pressure value with methods of artificial intelligence and metaheuristic optimization methods is proposed, which searches for time opportunity “windows” of electricity production during the operation of the water supply network in real time. The hierarchical flow diagram of the methodology proposed in the present work is presented in
Figure 1. The novel proposed methodology looks for power generation opportunities from WDNs during their operation. The three main issues analyzed in the methodology are: at which nodes the PATs will be placed, at which time steps they will be activated within 24 h, and how much theoretical energy is available for recovery without creating problems in the operation of the network. In the literature, similar strategies for real-time management of energy production using AAN have been proposed [
49]. The innovation elements of the proposed method are: the combined use of an artificial intelligence method with a metaheuristic algorithm at the same model and an attempt to answer the three questions mentioned above: PAT position, activation time, and how much pressure to exploit.
2. Benchmark Water Distribution Network
The proposed methodology in this paper will be applied to the WDN studied by Jowitt and Xu [
50], which is reproduced in
Figure 2. This network is a benchmark Water Distribution System, which is very often used to verify optimization methods in water supply networks such as optimal valve location in [
51,
52,
53] and PAT localization problems in [
54]. The network consists of 37 links, 22 nodes, and 3 reservoirs. The characteristics of each link are given in
Table 2, and the elevation of each node in
Figure 2. The minimum pressure for each node is set at 20 m and the Hazen Williams formula is used to calculate the friction losses. In the literature, the water demand is usually taken as an hourly average with the highest peaks at noon. Given the hourly demand, the average daily is also obtained. From the average daily demand is calculated the maximum daily usually with some peak rates [
55], which depend on the population that serves the network. However, the most critical parameter for the failure of a water supply network is the instantaneous demand [
56]. That is, the percentage of the population that will use water at the same time. Various methods have been proposed for instantaneous demand calculation, but the stochastic generators are considered to approach the real value in a more rational way. The water demand at the nodes is a parameter that will be predicted by the neural networks based on the pressure at specific nodes. Therefore, for the training of neural networks, it is necessary to create a set of data on hourly water demand. For all the above reasons, the random normal distribution with a base value of 5 L/s is chosen, which is described in Equation (1).
where
μ = 1 is the mean and
σ =2 is the standard deviation.
This ensures training of the neural network in several combinations of instantaneous water demand and therefore a better response to the demand forecast from the pressure values at the critical nodes.
3. Critical Nodes
In order to monitor the pressure values in real time, it is necessary to install a network of sensors (WSN). Each sensor should have a wireless communication system with a sink node, which is then connected to a gateway that can collect data from various networks. The gateway transfers data to a data center where they are stored, processed, analyzed, and received by the user. A typical WSN is shown in
Figure 3. A real-time WSN to be effective, all the necessary computing processes must be performed in the shortest possible computing time. This is not always possible when complex and time-consuming calculations are required.
An ideal situation for monitoring node pressures in real time would be to install sensors at each network junction. This is not economically acceptable due mainly to the high cost of the initial installation of the network, so a strategy should be sought that will select the least possible and most representative nodes for the installation of sensors. A strategy for finding the critical nodes of a WDN is to consider the network as a connected G (V, E) graph where V is the set of nodes and E is the set of links. According to graph theory, the most reliable graph structure is considered to be where each node has the same number of connected edges (pipes). However, in real water-supply networks, especially when new sections are added, the grid may have a random structure. Two graph theory functions are used to select the pressure sensor mounting nodes: closeness centrality and betweenness centrality. Closeness centrality indicates how close a node is to all other nodes in the network. It is calculated as the average of the shortest path length from the node to every other node in the network by Equation (2). The betweenness centrality captures how much a given node u is in-between others. This metric is measured with the number of shortest paths between any couple of nodes in the graphs that pass through the target node u. It is calculated by Equation (3) [
57].
where
d (
v,
u) is the shortest-path distance between
v and
u, and n is the number of nodes in the graph.
where
V is the set of nodes,
σ(s, t) is the number of shortest (
s,
t)-paths, and
σ(
s,
t|
v) is the number of those paths passing through some node u other than
s,
t.
The results from the application of the two functions in the network are presented in
Figure 4.
The process is organized by the NetworkX [
58] python library. It is selected to predict the WDN pressures from 20% of the nodes, i.e., for five nodes. This procedure implements by following three rules based on graph theory functions response.
Two nodes are selected with the minimum absolute difference between the closeness centrality and the betweenness centrality of the nodes. These nodes are 1 and 12. This rule represents a similar response on both graph theory functions.
Two next nodes are selected with the maximum absolute difference between the closeness centrality and the betweenness centrality of the nodes and small values for the betweenness centrality. These nodes are 7 and 14. This rule represents the domination of closeness centrality
The last node is a random selection. This rule introduces randomness in the way that nodes are selected, which is necessary if the methodology is applied to existing WDNs. In this case, it is possible that PATs are already installed on a node that does not comply with the two previous rules.
Finally, nodes 1, 7, 12, 14, 20 are selected.
6. Energy Production
During the evening hours, the water demand decreases resulting in increased pressure at the network nodes. Since the pressure inside the network and at the consumers cannot exceed certain limits, there has to be an excess of pressure in the networks to recover. Increasing the pressure causes damage to the pipes as well as increases water leakage. For this reason, break pressure tanks (BPT) or pressure reduce valves (PRV) are installed at critical points in the network in order to waste pressure excess [
60,
61]. In the present approach, it is proposed to install turbines at critical node locations, which will recover the dynamic energy when the pressure forecasting system decides that this is possible. This approach proposes the installation of turbines at critical node locations, which will recover the dynamic energy when the pressure forecasting system decides that this is possible. The forecasting system is connected in real time to the sensors so that in live connection, the possibility of excess pressure at any time is predictable. The turbines can be installed in existing networks with the bypass system using PRVs. In order to work in real time, the methodology of the present work must be connected wirelessly to the PRVs of the by-pass system. The addition of by-pass piping changes the hydraulic flow conditions and consequently changes the characteristic operating curve of the PAT. As mentioned in the introduction, a significant disadvantage of PATs is the different operating curve between pump and turbine. The operating curve of the turbine is unknown, as the manufacturers provide information only about the pump. The lack of operating curve data for the turbine mode makes the use of experimental or computational methods necessary to predict the degree of efficiency with specific attention to the off-design operating conditions. For these purposes, combinational models of computational fluid dynamics with experimental tests are developed. In this way, the model is able to predict the performance of PAT with a small error [
62,
63]. Based on the assumption that the Best Efficiency Point (BEP) of turbine mode is the same as that achieved in pump mode, formulas that evaluate the flow rate and the head exploited by the PaTs have been developed [
64,
65]. An important tool of recent research is computational fluid dynamics to investigate the internal flow and turbine performance as most studies focus on operation at a constant angular velocity, while there is a need to calculate the performance of the system in conditions of variable rotation [
66]. Changes in flow conditions play an important role in the performance of PATs systems, as pump function is more sensitive at the high-pressure side in the spanwise direction than the turbine mode. A comprehensive approach includes CFD simulations and verification of results through experimental data. The simulations include constant flow and rotation conditions as well as variable ones; they can also include different types of pumps [
67]. A more multidisciplinary analysis must also take into account the geometric characteristics of the machine. Thus, multi-objective optimization algorithms have been developed, which look for groups of optimal solutions (Pareto Front), replacing the one single optimal answer [
68,
69]. In addition, CFD simulations are necessary when investigating the effect on the efficiency of specific hydraulic phenomena. For example, the cutwater effect generates local flaws in the flow field, which limit the machine performance or slip phenomenon, which creates deviation of the fluid flow. Computational models that take into account such phenomena allow the identification of the best geometric and hydraulic characteristics of PAT, making its implementation in the field realistic [
70,
71]. The proposed method concerns the preliminary estimation of the PAT installation, as well as the actual activation time in relation to the daily variability of the pressures through a system of pressure sensors. For this reason, a hypothetical water distribution network has been used without further consideration of PAT performance. In this way, after completing the optimization algorithm, which is presented in the next chapter, using a suitable real-time controller, the pressure percentage of the node that is directed to the turbine is adjusted. The installation is shown schematically in
Figure 9. The theoretical power potential of the source is calculated as a function of the hydraulic head and the flowrate by Equation (4).
Εturbine: The potential power
ρ:The density of water
g: The acceleration of gravity
H: The water head
Qturbine: The flowrate across the turbine
7. Optimization Model
Finally, an optimization model is developed using the harmony search algorithm. In order to simulate the above system, the turbine is replaced by a PΒV. The network is properly configured and a PRV is placed at each critical node. The network is shown in
Figure 10. The optimization model has as variables x1, x2, x3, x4, and x5, which correspond to the percentage of pressure that can be removed from the network per step in order to generate electricity, i.e., the model has 24 × 5 120 variables. The objective function is defined as the sum of the variables and its maximization is requested. The constraints of the model are the minimum pressure on the network nodes in order for the network to serve the consumers. Therefore, for each node, a minimum value of pressure is defined. constrains should also be placed on the maximum pressure in the pipes to prevent damage and water leaks.
The optimization model is presented in
Table 3.
To calculate the maximum possible pressure that can be removed from the network, the harmony search algorithm is used in combination with the python WNTR library.
8. Harmony Search Algorithm
The Harmony Search Algorithm is a stochastic meta-heuristic method based on the sequential production of possible solutions. It belongs to the category of “neighborhood meta-heuristics” that produces one possible solution (called “harmony”) in each iteration. Every possible solution consists of a set of values of the decision variables of the function that needs to be optimized. During the optimization process, a number of “harmonies” equal to the “Harmony Memory Size” are stored in the “Harmony Memory” (HM), a database that includes the produced set of solutions. The optimization process is completed as soon as the predefined total number of iterations has been achieved [
72]. Following the definition of the decision variables, the Harmony Memory matrix is formulated. Harmony Memory is m×n matrix, where m is the Harmony Memory Size and n, the number of decision variables included in the objective function. Then, the algorithm begins producing and evaluating new “Harmonies” through the application of HSA’s basic mechanisms:
Harmony Memory Consideration uses variables’ values already stored in the Harmony Memory. This mechanism ensures that good solutions located during the optimization process will contribute to the formation of even better solutions.
Some of the solutions selected by the Harmony Memory Consideration mechanism will be slightly altered. This is the second mechanism of the algorithm, named Pitch Adjustment, and it is performed by selecting neighboring values of the decision variables
The third mechanism is Improvisation, which introduces new, random elements to the solutions. The probability of introducing such random values is (100-HMCR)%. In this way, the variability of solutions is enriched.
After the creation of a new “Harmony”, its performance is evaluated according to the corresponding value of the objective function. If this performance is better than that of the worst “Harmony” stored in the Harmony Memory, it replaces it. This procedure is repeated until the ending criterion is reached.
For the application of the harmony search algorithm, the parameters of the method were given the following values: HMCR = 0.7, PAR = 0.5, and HMS = 10.
The flowchart of the algorithm is shown in
Figure 11.
The code is implemented in Python language. A small section appears in
Figure 12.
9. Results
The whole process is performed for each time step, i.e., for each hour of the 24 h, and the results for the excess pressure that can be exploited for the energy production are presented in
Table 4 and
Table 5.
Excess pressure can be converted to energy by installing PAT on each selected node (1, 7, 12, 14, and 20) as long as the harmony search algorithm has ensured that the pressure removal from nodes (
Table 4 and
Table 5) will not cause the water supply network to collapse. Each candidate solution vector, as shown in the optimization model (
Table 3) ensures a minimum demand pressure for each network node. In this way, we can remove all the excess pressure at any time. The excess pressure and, therefore, the energy produced change significantly during the 24th, depending on the water demand at the nodes of the network. Therefore, the success of the method requires a real-time adjustment of the PATs using a controller that will determine the percentage of the pressure of the node to produce energy based on the result of the optimization model. The aim of this paper is to propose a real-time methodology for exploiting the excess pressure of WDNs. A famous benchmark water network was used for the applicability of the method and, therefore, the results of
Table 4 and
Table 5 also refer to the benchmark test WDN. Nevertheless, the results confirm the success of the method as it discovers excess pressure capable of producing energy in real time and confirm the applicability of the method, by describing all the steps in
Figure 1. Based on Equation (4), we can calculate the potential power.
Figure 13 shows the theoretical power that can be generated by the PATs for each critical node as well as the total power during the 24th. The diagram shows that theoretical power can be generated with a maximum hourly peak of 9 kW, while the minimum value is 3.8 kW. Of course, in order for the power to be exploitable, the pressure consumed by the PATs in real time must be adjusted, because, as shown in
Figure 13, there is a significant variation in the power produced. In any case, those potential power data refer to the benchmark network in order to validate the methodology.
Figure 14 shows a whisker power-producing chart for each critical node of the network.
Figure 13 and
Figure 14 show that the contribution of node 12 to energy production is significant but has a huge hourly deviation from the median. Something similar is observed in node 7. On the contrary, nodes 1, 14, and 20 have a small but stable contribution to power generation. This conclusion must be taken into account in the way that the energy produced will be used. This could be a weak point of the method in case we want stable energy production, i.e., in the case that the network directly supplies an energy consumption system such as a street lighting network. In order to make the best use of high energy production peaks, we may need to store the energy produced.
Another important consideration when evaluating the method is the reasonable computational time required to select the percentage of pressure removed from each node. Since the problem is considered to be of high computational complexity and the algorithm should respond in real time, during the simulations the method responded within a reasonable time.
As implied by the simulation results, there is a possibility of generating electricity from existing water supply networks even during peak hours of water demand. In order to apply the method to real networks, a large volume of data is required, so that the artificial intelligence can correctly predict the pressures of the nodes and the water demand. In any case, the installation of mini hydroelectric power plants has increased in recent years in an effort to save energy. Ιn Switzerland, for example, there are 90 small hydropower plants installed in the water supply system. Similar facilities exist in Italy and Austria. Therefore, such a methodology as the one described in the previous chapters could make a significant contribution to energy policy by recovering energy from existing infrastructure projects.
10. Conclusions—Discussion
The proposal of this work is a computational methodology that combines artificial neural networks and metaheuristic algorithms of optimization to apply to a theoretical water distribution network. The algorithm aims to create a sub-network of pressure sensors consisting of 25% of the total nodes of the original network, which is able to predict, using neural networks, the daily changes in the pressures of the rest of the network in real time and without overfitting as presented in
Section 5. Properly predicting the pressure from a small subnet of sensors makes the future application of the method economically attractive, as no sensors are required at each node of the original network. Additionally, artificial intelligence drastically reduces network hydraulic computing time, as most calculations are performed during the learning process. In this way, real-time operation of the algorithm is also possible, provided that the subnet sensors are connected wirelessly and the exchange data with a central server. During the future installation of the system on an existing water network after the critical nodes are selected according to
Section 3, a reasonable period of training of the algorithm is required, which depends on the number of nodes, but also on the variability of the conditions. In the present work, 10,000 daily values were used, which corresponds to approximately 417 training days. A second network of sensors can be used to confirm the values during the training time, which will be withdrawn after the completion of the process. Alternatively, EPANET software (
https://www.epa.gov/water-research/epanet) can be used to calculate unknown pressure values by correcting and training the neural network. This last practice was also used in the present work. After completing the training (either with a second network or EPANET), the algorithm will be able to predict all the pressures in a minimum computational time, which is a critical part of the methodology. Training time can be significantly longer in multi-node networks, but in the process of AΝΝ training data can be shared with another procedure in combination or not with micro-electric power generation. For example, the method could be combined with a leak detection process on WDNs [
73]. PATs are placed at critical node locations with a by-pass layout. The aim of this methodology is for the operation of PATs to be possible in all possible opportunities and not only during the hours when the network pressures are high. This is the main question that the proposed methodology tries to answer, if it is possible to activate the power generation system even for a while if there is an opportunity for high pressure in the network. For example, if during the hours when the water pressure is usually low (noon), a possibility of power generation occurs, then the method is able to detect it and activate the PAT, as shown in the tables in
Section 9. Of course, the current methodology does not analyze the further operation of the PATs and the problems that arise due to the change in flow. This could be the subject of an extension of the present study. To find the “window” of PAT activation, the harmony search algorithm was used, which decides when the PAT can be activated and how much energy we can remove from the node without the collapse of the rest of the network. The algorithm decides which times and how much pressure can theoretically be recovered from the nodes in 24 h, while ensuring the smooth operation of the rest of the network. According to the optimization model, the maximum possible pressure per time step can be recovered without a pressure lack at the other nodes. In this way, the real-time operation of the system is possible. According to the results tables, which concern a benchmark network, there are time steps (hours) available for energy recovery. The performance of PATs and how they take advantage of hourly stress opportunities could also be an extension of the present study.