1 Introduction

Hydropower is a clean, renewable, low-cost, and flexible source for energy production which plays an important role in power systems worldwide. Optimal design and operation of a hydropower reservoir is a complex nonlinear non-convex optimization problem. Mathematical programming models are widely used for hydropower projects design and operation. Hydropower optimization studies consist of three types of work: design, operation and simultaneous design-operation of the plan.

Hreinsson (1990), Najmaii and Movaghar (1992), Anagnostopoulos and Papantonis (2007), Rahi et al. (2012) and Hatamkhani and Alizadeh (2018) are among studies that have investigated the optimal design of hydropower projects. More recently, Hatamkhani et al. (2020) studied optimal design of a hydropower system to maximize the economic benefits of the projects. In these study, two different economic analysis approaches including market price method and alternative thermal power plant method were considered. Hatamkhani and Moridi (2019) investigated optimal long-term planning at the basin scale. Therefore, two objectives for the problem were considered: 1) maximizing the cultivation area of agricultural development sectors for more food productivity and 2) optimal design of hydropower project maximizing the energy production at the basin.

Several studies have addressed the optimal operation of hydropower projects (Wu et al. 2011; Zhao et al. 2012; Zhang et al. 2016; Li and Qiu 2015; Si et al 2018; Asadieh and Afshar 2019; Tan et al. 2020). Azizpour et al (2016) studied optimal operation of hydropower reservoir systems using weed optimization algorithm. Results were compared with the existing results obtained by particle swarm optimization (PSO) and genetic algorithm (GA). The results show that the IWO is more efficient and effective than PSO and GA. Niu et al. (2021) applied the HGWO (hybrid grey wolf optimizer) method to resolve the optimal operation of a real-world hydropower system with the goal of maximizing the total generation benefit. The simulations indicate that the HGWO method produces satisfying scheduling schemes than several control methods in terms of all the statistical indicators.

There are limited studies that investigated simultaneous design-operation of hydropower reservoirs. Mousavi and Shourian (2010) employed particle swarm optimization algorithm in combination with the sequential streamflow routing simulation model for the optimal design and operation of a hydropower project. Afsharianzadeh and Mousavi (2016) presented an optimization formulation for reliability-based optimal design and operation of a hydraulically coupled cascade hydropower system. The objective function of problem was to maximize the system’s firm energy generation while controlling the reliability level of hydro-energy production.

In most of the previous studies, the common objective is only to maximize the generation of energy or revenue of selling the generated energy while one of the most important purposes of construction of the dams is to control the floods. But, this function is generally ignored in researches done on the design and operation of hydropower reservoirs. In the present study, for optimal design and operation of a hydropower plant, two objective functions are considered. These objective functions are to maximize the generated energy and to minimize the flood damage at the downstream of the reservoir. For solving this problem, a simulation–optimization approach is employed where the WEAP software is used to develop the hydro-energy model.

In spite of the capabilities and advantages of WEAP in simulation of complex basin systems, it has shortcomings in considering the details of hydro-energy analysis and calculation of the energy generation. Because of these limitations, WEAP is rarely used in the optimal design and deriving operation policies of hydropower reservoirs. In this regard, a hydro-energy calculation module is used with two important components of allocations based on the hydro-energy demands and simulation of energy production which is developed using scripting capabilities within the WEAP environment. The hydropower simulation module in WEAP is employed to simulate the generated energy of the hydro plant, and the energy indices of the power plant were calculated. In order to obtain the optimal values for the variables, the Invasive Weeds Optimization (IWO) algorithm is coupled with WEAP as a metaheuristic algorithm to solve the problem. Hydro-energy simulation model and the IWO algorithm are combined in an integrated simulation–optimization platform for the optimum design and operation of the Bakhtiari power plant and the results are discussed.

2 Case Study

Bakhtiari Dam is located on the Bakhtiari River in west of Iran and 80 km southeast of the Khorramabad city. The main purposes of reservoir are energy generation and flood control. Figure 1 shows the Bakhtiari River basin and the Bakhtiari hydropower dam location in Iran. In the following, the most important data required to simulate the reservoir and hydropower plant in the WEAP and hydro-energy simulation routine are presented.

Fig. 1
figure 1

Location of the Bakhtiari river basin and the Bakhtiari hydropower dam in Iran

Figure 2 illustrates the historical annual inflow of the river at the Bakhtiari dam site from 2001 to 2015 while Table 1 and Fig. 3 show monthly evaporation and geometric relations of the reservoir, respectively. Some important characteristics of the Bakhtiari dam and power plant are presented in Table 2.

Fig. 2
figure 2

Annual Inflow to the Bakhtiari reservoir during 2001–2015

Table 1 Average monthly evaporation in the Bakhtiari reservoir during 2001–2015
Fig. 3
figure 3

Elevation-Volume-Area curves for the Bakhtiari reservoir

Table 2 Basic characteristics of the Bakhtiari Dam and power plant system

3 Formulation of the Problem

The mathematical program for the optimal design and operation of a hydropower dam and power plant is presented. Two objective functions for maximization of energy generation and minimization of flood damage cost were considered as an objective function in Eq. 1. The objective function is designed based on costs of damage and the benefits related to energy generation. The design decision variables include storage capacity (Smax), minimum storage (Smin) and installed capacity (IC), and operation decision variables are release from the reservoir at each time step. Accordingly, the formulation of the mathematical program for the design and operation of the dam and hydropower plant is presented as follows:

$$Max \left(\Sigma {E}_{t}\right)*\mathrm{PE }-\Sigma \left({R}_{t}-{Q}_{safe}\right)*\mathrm{w}$$
(1)

Subject to:

$${S}_{t+1,d}={S}_{t,d}+{I}_{t,d}-{EV}_{t,d}\left({S}_{t+1,d},{S}_{t,d}\right)-{R}_{t,d}$$
(2)
$$S_{\min,d}\left({MOL}_d\right)\leq S_{t,d}\leq S_{\max,d}\left({NWL}_d\right)$$
(3)
$$R_{t,d}=R_{HP,t,d}+R_{Oth,t,d}+R_{\textit{Spil},t,d}$$
(4)
$${H}_{t,p}={El}_{t,p}\left({S}_{t+1,p},{S}_{t,p}\right)-{H}_{f,p}\left({R}_{HP,t,p}\right)-{TWL}_{p}\left({R}_{t,p}\right)$$
(5)
$${E}_{t,p}=\left\{\begin{array}{cc}\frac{9.81\times {\xi }_{p}+{H}_{t,p}\times {R}_{HP,t,p}}{3600\times {10}^{6}}& {H}_{\mathrm{min},p}\le {H}_{t,p}\le {H}_{\mathrm{max},p};{R}_{HP,\mathrm{min},p}\le {R}_{HP,t,p}\le {R}_{HP,\mathrm{max},p}\\ \frac{9.81\times {\xi }_{p}+{H}_{t,p}\times {R}_{HP,t,p,\mathrm{max}}}{3600\times {10}^{6}}& {H}_{\mathrm{min},p}\le {H}_{t,p}\le {H}_{\mathrm{max},p};{R}_{HP,t,p}\le {R}_{HP,\mathrm{max},p}\\ 0& otherwise\end{array}\right.$$
(6)
$$H_{\min,p}=H_{\min,p}\left({DH}_p\right)$$
(7)
$$H_{\max,p}=H_{\max,p}\left({DH}_p\right)$$
(8)
$$R_{HP,\min,p}=R_{HP,\min,p}\left({DF}_p\right)$$
(9)
$$R_{HP,\max,p}=R_{HP,\max,p}\left({DF}_p\right)$$
(10)
$${FE}_{p}={F}_{{E}_{p}}^{-1}\left({\gamma }_{p}\right)$$
(11)
$${SE}_{p}={\stackrel{-}{E}}_{p}-{FE}_{p}$$
(12)

where, \(t\): time step index from 1 to T, \({S}_{t}\): storage volume of the reservoirs at the beginning of the time step, \({I}_{t}\): inflow to reservoir, \({EV}_{t}\left({S}_{t+1}.{S}_{t}\right)\): volume of net evaporation, \({R}_{t}\): release from the reservoir, \({S}_{min}\): dead storage volume of the reservoir, \(MOL\): minimum operation level, \({S}_{max}\): storage capacity of the reservoir, \(NWL\): normal water level, \({R}_{HP.t}\): reservoir release for energy generation, \({R}_{Oth.t}\): reservoir release for downstream demands, \({R}_{Spil.t}\): spill release from the reservoir, \({El}_{t}\left({S}_{t+1},{S}_{t}\right)\): Storage elevation in month t, \({H}_{t}\): net head, \({H}_{f}\left({R}_{HP.t}\right)\): head loss, \(TWL({R}_{t})\): tail water level, \({E}_{t}\): generated energy in month t, \(\mathrm{e}\): power-plant efficiency, \({H}_{min}\): minimum allowable head power plant, \({H}_{max}\): maximum allowable head of power plant, \({R}_{HP.min}\): minimum turbine discharge, \({R}_{HP.max}\): maximum turbine discharge, \(DH\): design head, \(DF\): design discharge, \({F}_{E}^{-1}\left(\gamma \right)\): inverse probability distribution function of power plant energy generation \(\gamma\): reliability index, \(\overline{E}\): annual energy generation, \(FE\): firm energy, \(SE\): secondary energy.

Equation (1) is the objective function of the mathematical program that aims to maximize net benefit (earnings from energy sale minus the cost of flood damage at the downstream). Equation (2) is the monthly balance equation of the reservoir. Equation (3) satisfy lower and upper bounds levels on the reservoirs storage volumes. In Eq. (4), release from the reservoir is divided into three parts. Equations (5) to (6) are related to the hydro-energy production. Equation (5) represents the net head as a function of storage elevation, losses, and tail water level. In Eq. (6), the monthly energy production of plants is formulated as a conditional relationship of the head and discharge in the allowable range. The minimum and maximum allowable head and discharge (operating range of power plant) are expressed by Eqs. (7) to (8) and as a function of design head and design flow. Equation (11) also formulates the firm energy of power plant using the inverse of the probability distribution function of annual energy generation. According to Eq. (12), the secondary energy is calculated by the difference of the total energy and the firm energy.

4 IWO-WEAP Simulation–Optimization Model

In the following, the tools and methods employed in the simulation–optimization approach in this study are presented. Figure 4 shows the flowchart of the proposed model.

Fig. 4
figure 4

Flowchart of the proposed IWO-WEAP simulation–optimization model

The decision variables of problem include three design elements: storage capacity (Smax), minimum allowable storage (Smin) and installed capacity (IC), and 180 operation decision variables, which include the water released from the reservoir at each monthly step during the simulation period (15 years). Table 3 presents the range considered for each of the decision variables (mcm: million cubic meters, Mw: megawatts).

Table 3 Upper and lower bounds of the decision variables

In this research, two types of problems are studied. The first one (Model 1) is an optimal design problem, in which Smax, Smin and the installed capacity of power plant are optimized while reservoir releases are determined using a predefined operating policy. In the second problem (Model 2), the problem is solved with simultaneous consideration of design and operation variables; therefore, optimal values for a total of 183 decision variables (3 design and 180 operation variables) are searched.

4.1 Hydro-Energy Simulation Routine

WEAP (Water Assessment and Planning System) model is a surface and groundwater simulation tool for water resources planning with an integrated approach which developed by Stockholm Environmental Institute (SEI). Various features make this model popular and widely used, including: user-friendliness, accuracy and flexibility of the model, ability to connect with other software such as GIS, MODFLOW, considering a wide range of demand nodes such as urban, rural, agricultural and environmental demands with all the details. WEAP solves a water balance equation at each node for each time step and determines water allocation based on supply and demand priorities (Sieber and Purkey 2012).

In spite of the various potentials of this model, hydropower simulation has some limitations. For this reason, a hydro-energy simulation module based on sequential streamflow routing (SSR) method (developed in scripting environment of WEAP) has been employed. More details on the SSR method and implementing it in WEAP could be found in Hatamkhani and Alizadeh (2018).

4.2 Invasive Weeds Optimization (IWO)

The invasive weed optimization algorithm (IWO) is a population-based evolutionary optimization method inspired by the behavior of weed colonies (Mehrabian and Lucas 2006).

This algorithm, while simple, is very effective and fast in finding optimal points—and works on the basic and natural characteristics of weeds such as seed production, growth and survival in a colony.

First, a limited initial population is randomly generated and dispersed in the problem solving space. Each member of the population then generates seeds according to their abilities. The number of seeds that each weed can produce varies linearly from the lowest number of seeds possible to the highest number, and the weeds with better adaptation to the environment produce more seeds. The relationship of the number of seeds produced is as follows.

$$S= \left[{S}_{min}+ \left({S}_{max}- {S}_{min}\right)* \frac{F- {F}_{worst}}{{F}_{best}- {F}_{worst}}\right]$$
(13)

S is the number of allowable reproduced seeds, \({F}_{best}\) and \({F}_{worst}\) are the best and the worst fitness values, Smin and Smax are the minimum and the maximum number of seeds; respectively; and F is the fitness of the considered seed.

At this point, the generated seeds are randomly scattered in the multi-dimensional space of the problem. The random distribution function is a normal function which means that its average value is zero and its standard deviation varies at different stages and ensures that the randomly newly produced seeds are close to their parent. The standard deviation is started from a initial value (\({\sigma }_{initial}\)) and reduced to a final value (\({\sigma }_{final}\)) calculated by Eq. (14).

$${\sigma }_{t}= {\left(1-\frac{iter}{itermax}\right)}^{n}*\left({\sigma }_{initial}-{\sigma }_{final}\right)+{\sigma }_{initial}$$
(14)

Here, σt is the standard deviation of the current iteration, itermax is the maximum number of iterations, and n is the predetermined nonlinear modulation index.

In the invasive weed algorithm, after several iteration, the number of plants in the colony are maximized (Pmax) as a result of reproduction and then a mechanism is used to eliminate the weak plants. Once all seeds found their positions (new plants and their parents), they are ranked by their fitness and plants with lower ranking are removed. This process is continued until the convergence criteria are met. A flowchart of IWO is illustrated in Fig. 5.

Fig. 5
figure 5

Flowchart of the IWO algorithm

5 Results and Discussion

In this section, the simulation–optimization model is used to obtain the optimal design of main components of the Bakhtiari power plant as well as the optimal reservoir monthly releases. Convergence of the best objective function in different iterations for the models is shown in Fig. 6. It is seen that in Model 2 (the design and operation model), the objective function starts with large negative values and converges to the optimal answer but in Model 1 (the design model), convergence towards the optimal solution is much faster. This is because of the vaster domain of the search space in the design and operation mode.

Fig. 6
figure 6

Convergence trend of the objective function: a Model 1 and b Model 2

In this study, three different values are considered for the damage weight factor (W) in Eq. 1 to show how much the sensitivity of the downstream damage affects the optimal design and operation. The results obtained by the IWO-WEAP model are shown in Table 4. For further investigation, the results presented in the plan’s consulting engineering company studies (as the present condition) are also reported in Table 4.

Table 4 Results of the IWO-WEAP model with various values for the weight of the flood mitigation objective (W)

As seen in Table 4, values of the decision variables such as NWL and installed capacity are obtained higher in Model 1 compared to Model 2. However, when the operation decision variables are considered (Model 2), the value of the objective function is improved compared to when only decision variables are considered (Model 1). For example, by W = 0 and W = 20, the value of the objective function is improved 7.5% and 11%, respectively.

Another point that extracted from Table 4 is the low impact of the damage weight factor (W) on the design decision variables. W = 0 occurs when the downstream damage is not taken into account. In this case, as expected, the value of the objective function is maximized. The storage capacity and the minimum storage value are also slightly bigger than the other two cases. The amount of annual energy generation was also found higher than in the other two cases. The results of the other two cases are very similar, However, the value of the objective function decreases with increasing value of the damage weight and the objective function has the highest value at W = 0 and the lowest value at W = 20. The objective function is reduced by 54% in the case of no flood (W = 0) comparing with the high damage effect (W = 20).

In Fig. 7, the release values are compared in Model 1 (SOP) and Model 2 (optimal values obtained by the IWO algorithm) with W = 20. However, the difference between the optimal values of two models is not as much as expected. These results shows that reservoir standard operating policy (SOP), in which the reservoir release in each time period equals water demand, maybe optimal or near-optimal operation solution.

Fig. 7
figure 7

Comparison of the optimal releases from reservoir in Model 1 and Model 2

On the other hand, W has a significant impact on the operation variables. Figures 8 and 9 show the monthly release and the amount of monthly energy generation for W = 0 and W = 20 cases, as well as in current condition.

Fig. 8
figure 8

Optimal monthly reservoir release in various cases

Fig. 9
figure 9

Optimal monthly generated energy in various cases

It is seen that in existing condition, the release rate is very large in a few of time steps which in addition to damage, reduces reservoir water storage and the discharge in the subsequent time steps. At time steps in which there is a huge amount of energy generated disregarding damage, the rate of release and the energy generation significantly decreased in optimal states when the damage was taken into consideration. For comparison in the flood frequency curve, a line is plotted to show the Qsafe value and illustrate the comparison with the release rate. In the case with no damage (W = 0), number of time steps that the amount of release is bigger than the safe flow (Qsafe) is much more than the case with considering the flood damage (W = 20). However, in both cases, the releases are smaller than Qsafe in most time steps. The flood frequency plot is shown in Fig. 10 to better demonstrate this issue.

Fig. 10
figure 10

Flood frequency curve in various cases

As shown in Fig. 10, by W = 0, the release is greater than Qsafe in about 20% of the time steps. With W = 20, the release is greater than Qsafe in less than 10% of the time steps. The energy generation duration curves for these two cases are shown in Fig. 11, which indicates that energy generation levels by considering damage and not considering damage cases are significantly different in 20% of the time steps.

Fig. 11
figure 11

Energy duration curve in various cases

6 Conclusion

In this research, simultaneous design and optimal planning of hydropower projects operation were studied. After formulating the problem, its solution tools were described, which include simulation model (the WEAP model and the sequential stream routing method) and the IWO optimizer algorithm. Two objective functions included the maximization of energy generation and the minimization of flood damage at the downstream of the reservoir, which was combined in the main objective function. The decision variables included design variables as the storage capacity (Smax), minimum allowable storage (Smin) and the installed capacity (IC), and operation variables including the release rate at each time step. The developed model was used for the optimal design and operation of the Bakhtiari hydropower plan. In solving this problem two approaches were considered. In the first approach, only design variables were optimized while releases from reservoir are determined by standard operating policy. In the second approach, the problem was solved with simultaneous consideration of design and operation variables. The results illustrated that there is no significant difference in two approaches’ solutions. Therefore, two important conclusions were obtained: 1) optimization of the design variables has more impact on the system performance than the operational ones; 2) standard operating policy (SOP) is an optimal or near-optimal operation solution for hydropower generation.

Results were obtained in the cases with and without consideration of flood damage, as well as the present situation. They indicated that consideration of flooding, although it does not have a great impact on the design variables, but significantly affects the operation variables. The design parameters of Smax and Smin are greater when damage is not taken into consideration (W = 0), which leads to a higher energy generation. If the flood damage is considered, releases from the reservoir and the generated energy are higher than the case without considering the flood damage in about 20% of the time steps.