1 Introduction

WDNs are expected to deliver adequate water, with desirable pressure and quality, from the source to the consumers. Distribution, especially in large cities, is now faced with numerous challenges, such as unsuitable nodal pressures, low network reliability, excessive energy consumption and high leakage. Leakage is one of the components of water loss, and comprises physical loss from pipes, junctions and fittings as well as overflow from reservoirs (Zidan et al. 2017). Due to leakage in WDNs, a considerable portion of the treated drinking water does not reach the consumers and causes losses in revenue. Pressure management is therefore known as an important way to increase network reliability and reduce leakage and energy consumption, as it can minimize the unwanted water demand. Pressure in WDNs can be adjusted via the use of valves (pressure or flow control valves) (De Paola et al. 2017; Dini and Asadi 2019; Dai 2021), turbines, Pumps Working as Turbines (PATs) (Venturini et al. 2017; Tahani et al. 2020; Latifi et al. 2021), water level control in storage tanks (Nazif et al. 2010), the optimal design of a District Metered Areas (DMAs) (Güngör et al. 2019), FSP and VSP pumps (Hashemi et al. 2014), and the simultaneous scheduling of VSPs and valves (Gupta and Kulat 2018; Page et al. 2019).

Pumps are versatile devices in industry and cover more than 20 percent of the world's electric motor energy demand (Torregrossa and Capitanescu 2019) and can be divided into rotary and positive displacement pumps. Rotary pumps are dynamic devices in which the pressure is generated by rotating impellers and can be further divided into Fixed Speed Pumps (FSPs) and VSPs. In a VSP, the relative rotational speed of the impeller can be adjusted, whereas in FSPs they cannot. The main benefits of VSP pumps are flow and pressure control improvements, energy savings, increase in pump reliability, and a decrease in water leakage and pipe damage (Bakker et al. 2014; Gao et al. 2017). However, VSPs do incur high operational and maintenance costs which is negligible in the evaluation of the total cost (Wu et al. 2012). Several researchers are focusing on VSP pump scheduling to achieve better pressure management, leakage reduction, and energy cost minimization. Hashemi et al. (2013, 2014) introduced daily VSP pump scheduling in WDNs. They showed that, using the VSP in an optimized pump scheduling could lead to greater savings in the energy costs, water loss and excess pressure compared with the FSP. Walski and Creaco (2016) provided an estimation into the selection of pumping configuration for closed distribution systems with no storage capacity. Results show that using a large number of pumps can have lower operational and total costs because it operates closer to their best efficiency point. Makaremi et al. (2017) presented a multiobjective optimization problem with the objective functions of energy cost and the number of pump switches. By optimal scheduling of pumps, the total number of pump switches decreased while the energy cost increased. Abdallah and Kapelan (2019) developed a new optimization method to optimize energy cost and water quality in WDNs with a mixture of FSPs and VSPs. They showed that using VSPs instead of FSPs improves the water quality and decreases the related energy and maintenance cost in water networks. Mehzad et al. (2020) presented optimal operation of pumping stations in WDNs based on three conflicting objectives, including pumping energy costs, hydraulic reliability, and quality reliability. The results show that it is necessary to consider hydraulic and quality reliability as two separate objective functions in WDNs with storage tanks and the combined form of the two reliability indicators in the WDNs without any storage tanks. Cimorelli et al. (2020) compared two optimal pump scheduling techniques, optimal regulation of FSPs by an optimal ON/OFF sequence and optimal regulation with a VSPs. They demonstrate that the use of VSPs help to reduce the yearly operating costs.

The aim of this paper is to determine the optimal number of active pumps in a pump station while optimizing pump settings using VSPs to maximize pressure reliability. For this purpose, an Active Pumps Index (API) is proposed to optimize the NAPs at each time step, to avoid concurrent VSPs with low efficiency, an operational problem not addressed by previous studies such as Hashemi et al. (2014) or other modeling software currently used in consulting. To address the mentioned gaps, a single objective PSO algorithm is developed in MATLAB R2017b in combination with EPANET2.0 as the hydraulic simulator. The method is applied to a sample and a real WDN with a large number of pumps to address the challenge in real-world pump stations and to show potential improvements in the NAPs, network reliability, leakage, and energy costs.

2 Methods

2.1 Simulation of Leakage

While EPANET2.0 uses Demand Dependent Analysis (DDA), it considers Pressure Dependent Analysis (PDA), to estimate leakage in pipes. The leakage is calculated by Eq. (1) (Gupta and Kulat 2018).

$${\mathrm{Q}}_{\mathrm{l}.\mathrm{ij}}={\mathrm{C}}_{1}{\mathrm{L}}_{\mathrm{ij}}{\left[0.5\right.\left({\mathrm{H}}_{\mathrm{i}}-{\mathrm{GL}}_{\mathrm{i}}+{\mathrm{H}}_{\mathrm{j}}-{\mathrm{GL}}_{\mathrm{J}}\right)]}^{\upbeta }$$
(1)

where \({\mathrm{Q}}_{\mathrm{L}.\mathrm{ij}}\): is the leakage flow at pipe l with start node i and end node j, Lij: is the length of the pipe, C1: is the leakage coefficient, which is a constant value for each network and depends on the network characteristics, Hi and Hj: are the pressure heads in nodes i and node j; GLi and GLj: are the ground levels in nodes i and j, and β is the pressure to leakage exponent usually 1.18. C1 at each node is calculated by iterations to satisfy the pre-determined level of leakage, which in this study is 20% of demand.

2.2 Simulation of Pumps

Consumed power by each pump, even though not directly considered as an objective function in this study, will be significantly improved as a result of optimal pump scheduling. Therefore, it is evaluated by the Horsepower relationship, Eq. (2):

$${\mathrm{P}}_{e}=\frac{\rho gQH}{\eta }$$
(2)

where \({\mathrm{P}}_{e}:\) is the electrical power consumed to turn the shaft (kW), ρ: is the density of the fluid (kg/m3), g: is acceleration due to gravity (9.81 m/s2), Q: is discharge of pump (m3/h), H: is head of pump (m) and η: is the pump efficiency (%). Hashemi et al. (2013) expanded upon the variations of η against Q, and showed how lower and upper flow/rotary speed than the pump capacity reduce pump efficiencies.

2.3 Optimization Algorithm

PSO is a population-based search algorithm that has been inspired by the concept of swarm intelligence, often seen in animal groups, such as birds and fishes (Kennedy and Eberhart 1995). PSO presents some advantages compared with other optimization algorithms, first, it is being conceptually very simple, requiring low computation time and fewer parameters to adjust, second the parameters that must be set have been widely discussed in the literature, and finally it is appropriate to optimize complex problems in the engineering (Sarkar et al. 2013). The formulation of PSO is illustrated through Eqs. (3) and (4) (Wang et al. 2019).

$${\mathrm{V}}^{\mathrm{i}}\left(\mathrm{t}+1\right)={\mathrm{WV}}^{\mathrm{i}}\left(\mathrm{t}\right)+{\mathrm{C}}_{1}{\mathrm{r}}_{1}\left({\mathrm{x}}^{\mathrm{i}.\mathrm{best}}\left(\mathrm{t}\right)-{\mathrm{x}}^{\mathrm{i}}\left(\mathrm{t}\right)\right)+{\mathrm{C}}_{2}{\mathrm{r}}_{2}({\mathrm{x}}^{\mathrm{g}.\mathrm{best}}\left(\mathrm{t}\right)-{\mathrm{x}}^{\mathrm{i}}\left(\mathrm{t}\right))$$
(3)
$${\mathrm{x}}^{\mathrm{i}}\left(\mathrm{t}+1\right)={\mathrm{x}}^{\mathrm{i}}\left(\mathrm{t}\right)+{\mathrm{v}}^{\mathrm{i}}(\mathrm{t}+1)$$
(4)

where vi(t + 1): is the velocity of each particle at time step t + 1, W: is the inertia coefficient, vi(t): is the velocity of each particle at time step t, r1 and r2: are randomization factors, C1 and C2: are acceleration coefficients for individual and collective positions, xi.best(t): is the best global position of the particles, xg.best(t): is the best local position of the particles, xi(t + 1): is the position of each particle at time step t + 1, xi(t): is the position of each particle at time step t. To run the PSO model, all the parameters such as W, C1, C2, the population size (PS), and the number of iterations (NI) have been chosen by sensitivity analysis, and also results of Sedki and Ouazar (2012) researches that are as follows: W = 0.8, C1 = 2.0, C2 = 2.0, PS = 200, and NI = 100.

2.4 Objective Function

In the previous studies, to achieve pressure improvements using pump scheduling, pressure minimization is considered as an objective function alongside with a minimum pressure requirement, which causes Boolean Logic problems as addressed by Dini and Asadi (2019). In this paper, however, to more smoothly score pressure, a Fuzzy-based objective function, proposed by Dini and Tabesh (2019) is used. Network Pressure Reliability Index (NPRI) can be calculated by Eqs. (5) and (6).

$$\mathrm{NPRI}\left(\kern 0.1500em j,t\right)=\left\{\begin{array}{c}0 {P}_{j,t}<10\\ \frac{1}{32}\left({P}_{j,t}-10\right) 10<{P}_{j,t}<26\\ \frac{1}{10}\left({P}_{j,t}-26\right)+0.5 26<{P}_{j,t}<31\\ 1 P=31\\ -\frac{1}{38}\left({P}_{j,t}-31\right)+1 31<{P}_{j,t}<50\\ -\frac{1}{40}\left({P}_{j,t}-50\right)+0.5 50<{P}_{j,t}<60\\ 0.25 60<P\end{array}\right.$$
(5)
$$\mathrm{NPRI}=\frac{\sum_{\mathrm{j}=1}^{\mathrm{NN}}{\mathrm{Q}}_{\mathrm{j}.\mathrm{t}}^{\mathrm{req}}(\mathrm{NPRI }\left(\mathrm{j}.\mathrm{t}\right))}{\sum_{\mathrm{j}=1}^{\mathrm{NN}}{\mathrm{Q}}_{\mathrm{j}.\mathrm{t}}^{\mathrm{req}}}$$
(6)

where Pj,t: is the nodal pressure in node j at time t, NPRI (j,t) is the pressure reliability index of node j at time t, NPRI: is the network pressure reliability index, NN: is the number of nodes, Qreq: is the required demand in node j at time t. This fuzzy function favors pressures higher than, but close to 30 m, with better scores, in order to optimize nodal pressures.

2.5 Active Pump Index (API)

At the Pumping Stations (PS) several pumps can be operating simultaneously. Hence, it is necessary to find the minimum required NAPs at each time step, using a new index, proposed by Eq. (7).

$$\mathrm{API}_t=\frac{NP(\left( {^1/_{DP_m}}\right)DP_t+\left(^1/_{V_{t,m}}\right)\sum_{i=1}^{NP}{V}_{t,i})}{NP+1}$$
(7)

where APIt: is the active pumps index to find NAPs at time t, NP: is the number of pumps in each PS, DPt: is the demand pattern coefficient at time t, DPm: is the maximum demand pattern coefficient at 24 h all day long, Vt,m: is the maximum pump speed that can be chosen during each time step, Vt,i: is the speed of pump i at time t.

2.6 Procedural Steps

Table 1 summarizes the procedure in this study. In step one, all hydraulic simulation and optimization initial parameters are defined. In step two, initial optimal pump scheduling is developed and accordingly the optimal NAPs are determined. Lastly, in step three, the final optimal scheduling is evaluated by reliability, leakage, and pumping electrical power.

Table 1 Procedure Summary

3 Case Studies

The proposed method is examined in two case studies. The first case study is a sample network introduced by Larrok et al. (1999), including 12 pipes, 7 nodes and 2 PSs and 3 reservoirs, one of which operates by gravity and the other two by pumping. This network, shown in Fig. 1, serves an average daily demand of 500 l/s, including 20% loss to leakage, when assuming a total of 10 pumps across the two PSs. Also, the total network length is about 3.75 km and the maximum and minimum nodal pressure of the network is about 39.8 and 8.3 m respectively without pumps in PSs.

Fig. 1
figure 1

Sample network (Larrok et al. 1999)

The second case study is a real WDN in the City of Ahar, with a population of 105,000, which is located in East Azerbaijan Province, Iran. Figure 2 shows this skeletonized network including of 254 pipes with a total length of 49.6 km and an average age of 25 years, 223 nodes with a maximum and minimum pressure of 76.1 and 11.9 m respectively, one reservoir, 5 tanks with total capacity of 21,000 m3 and 4 PSs. PSs 1 and 2 pump water from the reservoir to storage tanks, and therefore are not considered in the optimization process because optimal scheduling for PSs between two storage units proved to be ineffective. However, PSs 3 and 4 pump directly to the network and thus need to be scheduled. The normal operation of this system constitutes pumps running constantly at full speed, and the hydraulic and quality calibrated model of this network by Dini and Tabesh 2017 is used. This system serves an average daily demand of 245 lps including an annually 7.9 million cubic meters of total input water to the network and 6.3 million cubic meters of total authorized consumption with approximately 20% leakage. The demand pattern coefficient of both case studies is shown in Fig. 3.

Fig. 2
figure 2

Ahar Network (Dini and Tabesh 2017)

Fig. 3
figure 3

The demand pattern coefficients of case studies

4 Results and Discussion

Results and discussion for both case studies in the following sections are presented under three scenarios. In the first scenario, all pumps are constantly running at full speed (FSP scenario). In the second, all pumps are running with optimal schedules using VSPs (VSP scenario). In the third, required NAPs, using API, is determined and then the VSP setting is optimized for each active pump (API scenario). Optimization results in each scenario/mode are shown for the best of five optimization runs.

4.1 Sample Network

Pump scheduling optimization becomes a challenge as the number of pumps, or decision variables, increases in real-world PSs. Therefore, this case study is examined under three modes of operation: two-pump (2P) mode with one pump in each station, five-pump (5P) mode with two pumps in the first PS and three in second, and ten-pump (10P) mode, with four pumps in the first PS and six in second. Except for the two-pump mode, all pumps in the model are identical. This way, PS 2 is always of a bigger pumping capacity, in different modes.

4.1.1 FSP Scenario

According to Table 2, in FSP scenario, the average NPRI for the three modes with two, five and ten pumps are 36.8, 44.6 and 60.1 percent respectively. Corresponding leakage is 179.4, 130.3 and 98.6 l/s respectively while electrical power is 590.3, 352.3 and 275.6 kW respectively. The daily variations of NPRI, leakage, and electrical power are shown in Figs. 4a–c. It is inferred that the increase in number of pumps improves NPRI, leakage, and electrical power, because of the higher flexibility of the pump stations to comply with any changes.

Table 2 Result summary for the sample network
Fig. 4
figure 4

The variations of NPRI, leakage and electrical power for the FSP scenario

A comparison of reliability, leakage, and electrical power variation for the three modes shows that the maximum leakage and electrical power, and minimum reliability occur at midnight, while the minimum leakage and electrical power, and maximum reliability occur at noon. This is because of higher pressures at midnight as water demand is lowest and lower pressures (closer to minimum required, 31 m) at noon, as demand is highest. Extremely high demands at 1 pm however, induce excessive headloss and pressures lower than 31 m, and therefore undesirable NPRI, as shown in Fig. 4a.

Generally, during off-peak demand periods, the increase in number of pumps in the pump stations suggest better NPRI, leakage, and electrical power performance, due to more flexibility to accommodate changes in the system.

4.1.2 VSP Scenario

The VSP scenario is similarly run under three modes. For each mode, all pumps are on throughout the day and the pump settings are optimized by PSO. The optimal setting results are shown in Figs. 5a–c for the three modes. Also, the daily variations of the NPRI, leakage, and electrical power are shown in Figs. 5d–f. The average NPRI for the three modes with two, five and ten pumps are 83.7, 83.6, and 83.3 percent respectively. Corresponding leakage is 88.8, 92.7, and 89.4 l/s l/s respectively while electrical power is 257.0, 251.0 and 196.8 kW respectively.

Fig. 5
figure 5

The optimal setting of two pumps (a), five pumps (b) and ten pumps (c), and variation of NPRI, leakage and electrical power for the VSP scenario (d, e and f)

Figures 5d–f may not suggest a clear pattern in improvement of NPRI, leakage, and electrical power between the three modes, comparing FSP and VSP scenarios. However, Table 2 shows that NPRI is higher, while the leakage and electrical power are lower, for the VSP scenario. On average, the NPRI across the three modes in the FSP and VSP scenarios is approximately 47.2 and 83.5 percent, while the leakage is 136.1 and 90.3 l/s, and the electrical power is 406.1 and 234.9 kW respectively. This confirms the efficacy of the VSP scenario in improving NPRI, leakage, and electrical power. Table 2 indicates tangible improvements not only for each mode of operation compared to FSP, but also within the scenario, as the size of the PS is increased. The authors attribute these improvements to the flexibility in the pump station due to the existence of more pumps.

4.1.3 API Scenario

In the API scenario, the NAPs are first determined by API, and the scheduling is then optimized as shown in Figs. 6a–c for three modes. Also, the variations of NPRI, leakage, and electrical power are shown in Figs. 6d–f.

Fig. 6
figure 6

API and the optimal setting of two pumps (a), five pumps (b) and ten pumps (c), and variation of NPRI, leakage and electrical power for API scenario (d, e and f)

Figure 6a indicates that in 2P mode, both pumps are working all day long, because there is no choice to determine the NAPs in each PS. While according to Figs. 6b, c, as a result of using the API in the two other modes, the maximum and the minimum number of active pumps occur at noon and midnight, respectively. Figure 6b indicates that, in 5P mode, there is only one pump running in each PS from 11 pm to 7 am, while all are (two in PS1 and three in PS2) at other times. Finally, optimal scheduling of active pumps, in Figs. 6a–c suggests higher pump speeds at around noon and lower ones at midnight. Similar trends can be observed for the 10P mode.

The variations of NPRI, leakage, and electrical power are shown in Figs. 6d–f for API scenario. The average NPRI for the three modes with two, five and ten pumps are 83.7, 83.9, and 83.8 percent respectively. Corresponding leakage is 88.8, 90.8, and 88.6 l/s respectively while electrical power is 357.0, 239.2 and 176.4 kW respectively. Similar to the VSP mode, there is no clear pattern of improvement for NPRI and leakage moving through the modes. This is potentially due to the increase in the number of decision variables in 10P mode, as compared to the 2P and 5P modes, which potentially weakens the optimization algorithm when searching for optimal solutions.

As indicated in Table 2, NPRI, leakage, and electrical power improve steadily from FSP to VSP and API scenarios. These improvements prove the efficacy of first using API in optimizing the number and setting of active pumps, especially in large pump stations, which makes it more operationally acceptable.

As a conclusive note on Table 2, when comparing VSP and API scenarios, in some cases NPRI and leakage improvements may seem marginal compared to NAPs and electrical power. This is because these solutions are directly optimized for NPRI, which directly impacts leakage.

4.2 Ahar Network

Similar to the sample network, the Ahar network is examined for FSP, VSP and API scenarios, however, only for the original number of pumps. Table 3 summarizes the results of all scenarios.

Table 3 The summary of results for Ahar WDN

4.2.1 FSP Scenario

In this scenario, all pumps run constantly at full speed. The daily average NPRI, leakage, and electrical power are 0.508, 42.1 lps and 76.9 Kw, respectively. The leakage and electrical power are highest while the NPRI lowest in this scenario, due to having all pumps on and excessive pressure delivery.

4.2.2 VSP Scenario

VSP scenario optimizes (reduces) the pumping speeds during the day. However, it assumes all pumps all running constantly. The daily average NPRI, leakage, and consumed power are 0.638, 32.2 lps and 23.8 Kw, with 25.5, 23.5 and 69% of improvement, respectively. The optimal pump schedules in Fig. 7a indicate that the highest pump speeds generally occur at noon and the lowest at midnight, according to the diurnal demand pattern. However, it is noticed that pumps P3 and P4 run concurrently with relatively low speeds, which is not operationally well received or energy efficient. To address this issue, the next scenario, API, is used.

Fig. 7
figure 7

The schedule in VSP scenario (a), the number of active pumps and the settings in API scenario (b), the variation of the NPRI, leakage and electrical power of the network (c, d, e)

4.2.3 API Scenario

This scenario determined the efficient number of pumps required while optimizing the schedule. According to Fig. 7b, there is only one pump running at a time in PS 3. In this PS, P3 is larger than P4, therefore running from 9 am to 3 pm during peak demand, while P4 runs at other times. In PS 4, with three identical pumps, from 2 to 6 am there is only one pump running, while other pumps kick in during higher demand periods. According to Table 3, when compared to the FSP Scenario, the daily average NPRI, leakage, and consumed power are 0.641, 31.0 lps and 18.3 Kw, with 26.3, 26.5 and 76.2% of improvement, respectively.

Also, hourly variations of NPRI, leakage, and electrical power are shown in the Figs. 7c–e, to highlight the improvements from FSP to VSP and API scenarios.

Similar to the first network, improvements are marginal for NPRI and leakage from VPS to API, while more tangible for electrical power, as seen in Table 3, because they are optimized for NPRI which directly affects leakage. However, the value of API is truly reveled when power consumption and the NAPs are also added to the whole comparison.

5 Conclusion

This paper presented a new approach to determine the optimal number of active pumps in a pump station while optimizing pump settings using VSPs to maximize pressure reliability. To determine the optimal number of active pumps, a new index was developed, and the particle swarm optimization algorithm that is linked with EPANET as the hydraulic simulator in a MATLAB code was used to optimize the pump setting. Three scenarios of FSP, VSP and API were considered in two case studies. The results showed that the optimal operational scheduling of pumps has been improved the network reliability, leakage and electrical power consumption. In both case studies, the best improvement was achieved in the API scenario, so that, in the real case study, when the API scenario was compared to the FSP and VSP scenarios, the daily average reliability, leakage, and consumed power improved 26.3, 26.5, 76.2 and 0.5, 3.7, 23.1 percent respectively. Therefore, the pump optimal operational scheduling suggested by the API scenario is not only hydraulically improved but also operationally feasible, as it reduces the number of concurrent pumps in a pump station, which is not currently addressed in widely used commercial software packages with optimal scheduling toolboxes. However, the authors maintain that this paper was a part of an extended study in pump optimal operational scheduling, and there is more work to be done to fully understand these issues. For instance, even though this study does reduce the number of active pumps, it does not suggest an identical VSP setting for identical pumps if running concurrently.