Introduction

Rivers are an important source of water for drinking, industrial and agricultural utilizations. Population growth and consuming competition have led to an increase in conflicts and contradictions over exploiting the rivers. However, the environmental status of rivers can be affected by human activities due to urbanization and industrialization (Singh et al. 2005). On the other hand, the construction of dams on rivers alter the natural flow regime, slow the flow velocity, and weaken the water self-purification ability, which aggravate the water pollution (Topping et al. 2000; Kileshye Onema et al. 2006; Zhang et al. 2010). Thus, properly operation of rivers and dam reservoirs is necessary and inevitable to maintain the health of rivers and human life (Campolo et al. 2002). Currently, along with the negative impacts of dams on river ecology and environments in the basin becoming more apparent, some new operation modes have emerged (Reis et al. 2015), such as water quantity and quality joint operation (Froebrich et al. 2007), and ecological operation (Symphorian et al. 2003; Shirangi et al. 2008; Steinschneider et al. 2014).

In this vein, some studies have been conducted to incorporate both water quantity and quality into river basin modeling such as, Azevedo et al. (2000) presented a combined surface water quantity (MODSIM) and quality (QUAL2E) model within the framework of a decision-support tool in an application to Piracicaba River Basin in the state of Sao Paulo, Brazil. Their results showed that pathways for solution of the very complex problems in the basin require increased levels of wastewater treatment and flow augmentation to meet increasing water demands and to maintain the diversion to Sao Paulo. Da Silva and Albuquerque Alves (2016) integrated the WEAP and QUAL2K models to evaluate the effect of population growth on BOD concentration changes in the Descoberto River basin under different management scenarios. The results showed that treatment efficiency at WWTP of the river should be enhanced under the population growth scenario. Given the population growth and industry development, Jaramillo et al. (2016) integrated the WEAP and QUAL2K models to examine the effect of domestic and industrial wastewater on BOD and DO changes in the del Rio LA River. The results showed that the status of the river does not exceed the local standards of using river water. Mishra et al. (2017) analyzed water quality parameters (BOD and DO) to evaluate the sustainability of surface water resources of Kathmandu Valley. For this purpose, they implemented current and future wastewater production and treatment scenarios based on two important aquatic health indicators. In this study, the integrating tool of QUAL2K and WEAP models was used to simulate the water flow and quality parameters.

Nevertheless, a comprehensive and well-organized model has been not provided for operation of reservoir–river systems that its information can be easily update. One of the effective approaches for water pollution control and supply the demands of users is water quantity and quality joint optimal operation in reservoir- river basin. (Azevedo et al. 2000; Zhang et al. 2011; Piman et al. 2013). In this way, integrated optimization and simulation approach is economical and sustainable way for the proper management of water resources. Simulation methods make it possible to model the water resource system in full detail and quickly reach an overview of the desired system. On the other side, during the optimization process, the most appropriate values can be found for the decision variables in a problem, so that the objectives of the problem can be met with optimal utility for the values found.

In the last few years, with the development of optimization methods and the introduction of the meta-heuristic methods in general and genetic algorithm (GA) in particular, optimum operation of the water resources systems has been entered into a new stage. Using this algorithm, some researches have also been conducted in water and environmental engineering, such as Savic et al. (1999), Khu et al. (2001), Rabunal et al. (2007), Guven and Gunal (2008), Guven and Kisi (2010), Orouji et al. (2013), Sulis and Sechi (2013). Due to the capabilities of this algorithm, it can be used in quantitative–qualitative exploitation problems of water resources, which include complex relationships and equations, as well as different and conflicting objective functions. In the present study, a multi-objective non-dominated sorting genetic algorithm (NSGA-II) was used which has a faster convergence rate than the conventional genetic algorithm model (Deb et al. 2002).

The aim of this study involved: (i) optimizing the Dez reservoir operation; (ii) supplying of different demands (domestic, agricultural, industrial, and environmental) along the Dez river; (iii) maintaining water quality of the river, according to the world standards.

To this purpose we have developed a new simulation–optimization framework. The framework first establishes a coupling approach between the quantitative and qualitative models to identify and to simulate the existing condition of the problem. Second, it develops a meta-heuristic algorithm optimization, based on relevant decision variables. Then, it tries to link the coupled approach to the optimized multi-objective algorithm using a dynamic process. Finally, it reaches to an optimal reservoir operation, which considers water quality–quantity issue of the river as well as the environmental impact of the basin.

Materials and methods

QUAL2K model

Chapra et al. (2008) developed the QUAL2K model, which is a modern version of QUAL2e. QUAL2K is the latest model of QUAL model series which approved by the United States Environmental Protection Agency (USEPA) and widely used to simulate river water quality (Kannel et al. 2007). This model was selected based on available data and time, accuracy of calculation, desired output variables as well as the capability to couple with the Water Evaluation And Planning (WEAP) model to simulate water quality and pollution of Dez River. QUAL2K simulates the transport and fate of conventional (i.e., non-toxic) pollutants. The framework represents the river as a one-dimensional channel with non-uniform, steady flow, and simulates the impact of both point and non-point pollutant loadings. To determine the "concentration of qualitative parameters” in this model, the Finite difference method is used for the numerical solution of the Advection–Diffusion Equation (Chapra et al. 2008). The QUAL2K model is capable of simulating over 15 qualitative parameters including dissolved oxygen, biochemical oxygen demand, temperature, nitrate nitrogen, ammonia nitrogen, pH, EC etc. in the river.

WEAP model

The WEAP model was used for managing and planning the water resources in the study area. The Water Evaluation and Planning (WEAP) software is an advanced, integrated modeling software that simulates and models water supplies, water demands and environmental requirements as well as considering the effects of policies on water quantity, water quality and the ecosystem which was developed by the Stockholm Environment Institute (SEI 2012). It is a decision support system (DSS) for water planning and management which constructs a network consisting of water resources and demand sites connect by links that deliver water from resource node to demand sites. It considers water balance between demand and supply preferences, which are used in a linear programming (LP) heuristic to solve the water allocation problem as an alternative to multi-criteria weighting or rule-based logic approaches offering a possibility to integrate agricultural, industrial, and municipal water demands (Kaddoura and El Khatib 2017).

Due to its ability to couple with the QUAL2K, this model is also suitable for the purposes of this research, so that if properly coupled, the quantitative–qualitative trend of the river could be simulated according to different policies during the planning period.

Dynamic coupling of quantitative–qualitative models of WEAP and QUAL2K

The integration between the water quality model (QUAL2K) and the WEAP (SEI 2012) (decision support system) was evaluated considering its effectiveness to represent the water quality impacts on different river discharge and planning alternatives. The dynamic coupling of QUAL2K to WEAP requires preparation and calibration of a QUAL2K file outside of WEAP setup because preparation of an initial QUAL2K data file will entail significant effort (SEI 2012). Once QUAL2K is selected as a calculation method and linked WEAP’s constituents to QUAL2K’ s, and entered water quality data for river headflow, surface water and groundwater inflows, meteorological data, and distance marker, WEAP will be able to send data to QUAL2K, run QUAL2K and retrieve results for each time step. WEAP sends the headwater (flow rate and water quality), meteorological data, point sources (inflow, outflow rate and water quality from demand sites, net decreases and increases in reservoir storage) and diffuse sources (inflow and outflow rates from groundwater and surface water) to the QUAL2K model. If coupled correctly, the data and results can circulate between these two models. Consequently, the effects of quality changes in surface water, or changes in surface and groundwater withdrawal on the whole system can be observed.

Simulation–optimization modeling framework

After the dynamic coupling of the quantitative–qualitative models, the integrated model was linked to an optimization algorithm. In this study, the Non-Dominated Sorting Genetic Algorithm-II (NSGA-II) algorithm was used to optimize system operation. In the proposed structure, a series of decision variables were generated by the NSGA-II algorithm in ach iteration and entered as input variables in the coupled WEAP-QUAL2K model. After running the model based on the decision variables, the results were evaluated according to the objective functions and defined constraints. If the objective functions were not met after running the model, the new variables are introduced into the quantitative–qualitative coupled model by applying new management conditions and then the objective functions are re-tested. This cycle was repeated until optimal values were obtained. A simple flowchart is illustrated in Fig. 1 to better understand the process. The optimization objectives included maximizing supply water demands of project and minimizing river water pollution during the operation period. Moreover, monthly environmental flow rate downstream of the river was considered as the decision variables in the optimization problem. Thus, a total of 12 decision variables were considered for different months, and these variables were applied throughout the whole period of operation (5 years). At the end of the optimization process, the optimal environmental flow downstream of the river was determined in different months.

Fig. 1
figure 1

Simulation–optimization modeling framework

Study area

Dez River is the third largest basin in Iran which plays a fundamental role in the economic, social and environmental life of southwest Iran. Due to the various wastewaters (municipal, agricultural and industrial) which pollute the river, therefore, it is essential to develop a comprehensive quantitative–qualitative model for the operation of Dez reservoir and river as the most important source of water supply in the region. In this way, it would be possible to address both the issue of water supply, the impact of water withdrawal as well as the return of municipal, agricultural and industrial wastewater effluents in different parts of the river route on the qualitative process and pollution of the river.

The Dez river basin has area about 21,720 km2, which is divided by the Dez dam as upstream and downstream. It flows from north to south, with a basin average elevation of 1603 m. The present study focuses on the Dez reservoir and its downstream part (Dez dam downstream sub-basin) with a length of 173.78 km. The gross area of arable land around the Dez River from the Dez dam to BandeGhir is about 245,000 hectares. The source of surface water in this area is the Dez dam reservoir and river. Another source in the area is deep and semi-deep wells in the Dez plain. Both surface and groundwater sources are used to supply the agricultural, drinking and industrial requirements in the region. Figure 2 shows the study area, the location of the plains, cities, rivers and hydrometric stations. Due to the discharge of various wastewaters into this river, it is essential to develop a comprehensive quantitative–qualitative model for the operation of Dez dam reservoir and river as the most important water source in the region. Development of a comprehensive model for optimal operation of water resources and taking into account the interaction of quantitative–qualitative parameters and their changes along the river are of great importance for sustainable development of the region. In this way, it would be possible to address both the issue of water supply from the surface and groundwater resources for different uses and the impact of water withdrawal as well as the return of municipal, agricultural and industrial wastewater effluents in different parts of the river route on the qualitative process and pollution of the river.

Fig. 2
figure 2

Location of study area in Iran and Khuzestan province

Qualitative simulation

In this study, QUAL2K model was used for qualitative simulation of Dez River (From Dez dam to BandeGhir), which is bold in Fig. 2. All inflows to and outflows from this interval of river considered as point sources and point abstractions in the river boundary. The river section was divided into a list of fragments (143 sections) based on river's hydraulic conditions and pollutant discharge site as shown in Fig. 3. The general mass balance equation in the i water column for all constituent concentrations can be written as:

$$ \frac{{{\text{d}}c_{i} }}{{{\text{d}}t}} = \frac{{Q_{i - 1} }}{{V_{i} }}c_{i - 1} - \frac{{Q_{i} }}{{V_{i} }}c_{i} - \frac{{Q_{{{\text{ab}},i}} }}{{V_{i} }}c_{i} + \frac{{E^{\prime}_{i - 1} }}{{V_{i} }}\left( {c_{i - 1} - c_{i} } \right) + \frac{{E^{\prime}_{i} }}{{V_{i} }}\left( {c_{i + 1} - c_{i} } \right) + \frac{{W_{i} }}{{V_{i} }} \, + S_{i} + \frac{{E^{\prime}_{{{\text{hyp}},i}} }}{{V_{i} }}\left( {c_{2,i} - c_{i} } \right) $$
(1)

where Ci is the concentration of the quality parameter in the element i in terms of, g/m3, Vi is the volume of the element i in m3/d, t is the time according to d, Ei′ is the emission factor between the element i and i + 1, Qi is the flow of element i in m3/d, Wi is external loading on quality parameter for element i in terms of g/d, Si is production and consumption of quality parameter due to reactions and mass transfer mechanisms in element i in terms of g/m3/d, C2,i is concentration of the quality element in the hyperheic sedimentary zone and Qab,i is the discharge of output pollutant of the i-th interval in m3/d, which includes total point and non-point pollutants.

Fig. 3
figure 3

Detachment pattern of the proposed simulation

Data and pollution sources

Many parameters are required for river water quality simulation, including hydraulic data in fragments (headwater flow, river bottom slope, river side slope, river bottom width, and manning’s coefficient), meteorological data (temperature, wind speed, dew point temperature, solar radiation, and cloud cover percentage), and water quality of point sources and nonpoint sources (Temperature, pH, EC, DO, BOD, COD, NO3–N, NH4–N, and surface water inflow). The detailed requirement can be found from Chapra et al. (2008).

Kuzestan Water and Power Authority (KWPA) and Kuzestan Department of Environment (KDOE) are the main authorities of Dez river water quality monitoring and supervision (KWPA 2001). Hydrometric and quality data of, Dezful, Harmaleh, and Bamdezh stations were collected from KWPA and wastewater discharge (point sources) was gathered from KDOE. Table 1 represents average of quantitative and qualitative characteristics corresponding to the most important sources of pollutants in the study area. Moreover, hydrodynamic data were obtained from the Dezab Engineering Company (www.dezab.com).

Table 1 Average discharge and monthly wastewater of point sources pollutants along Dez river

QUAL2KW model calibration and validation

Calibration aims to minimize the difference between the predicted output by the model and the observational data, usually by accurate estimation of parameters or by optimization techniques. The QUAL2KW model minimizes the difference between observational and computational results using fitness relationships, for which the RMSE relation is most applicable. The fitness result is then used in the genetic algorithm for automatic model calibration. In the validation phase, the validated model is re-run with a new set of information to measure the error rate between the calculations and the observations.

The model was calibrated using monitoring data from three stations, namely, Dezful, Harmaleh, and Bamdezh. The water quality data of these stations are presented in Table 1. The field data from 2014 to 2017 were used for model calibration. The data in August 2018 were used for model validation.

The calibration and validation accuracy are based on the calculation of NSE (Nash and Sutcliffe Error), Standard Error (SE), and Mean Absolute Error (MAE) as shown in the following.

$$ {\text{NSE}} = 1 - \frac{{\sum\nolimits_{i = 1}^{n} {(X_{i}^{{{\text{obs}}}} - X_{i}^{{{\text{sim}}}} )^{2} } }}{{\sum\nolimits_{i = 1}^{n} {(X_{i}^{{{\text{obs}}}} - X_{{{\text{obs}}}}^{{{\text{mean}}}} )^{2} } }} $$
(2)
$$ {\text{SE}} = \frac{{{\text{RMSE}}}}{{X_{{{\text{obs}}}}^{{{\text{mean}}}} }} = \frac{{\sqrt {\frac{1}{n - 1}\sum\limits_{i = 1}^{n} {(X_{i}^{{{\text{obs}}}} - } X_{i}^{{{\text{sim}}}} )^{2} } }}{{X_{{{\text{obs}}}}^{{{\text{mean}}}} }} $$
(3)
$$ {\text{MAE}} = \frac{1}{n - 1}\sum\limits_{i = 1}^{n} {\left| {X_{i}^{{{\text{sim}}}} - X_{i}^{{{\text{obs}}}} } \right|} $$
(4)

where n is number of samples studied, \(X_{i}^{{{\text{obs}}}}\) is the observed value, \(X_{i}^{{{\text{sim}}}}\) is the simulated value, and \(X_{{{\text{obs}}}}^{{{\text{mean}}}}\) is the mean of observed data for constituent being evaluated.

Quantitative simulation

In this study, WEAP model was used for quantitative simulation and planning of water resources of Dez reservoir and Dez dam sub-basin. Mass balance equations are the foundation of WEAP's monthly water accounting: total inflows equal total outflows, net of any change in storage (in reservoirs and aquifers). Every node and link in WEAP has a mass balance equation, and some have additional equations which constrain their flows (e.g., inflow to a demand site cannot exceed its supply requirement, outflows from an aquifer cannot exceed its maximum withdrawal, link losses are a fraction of flow, etc.).

Each mass balance equation becomes a constraint in the LP.

$$ \sum\nolimits_{{{\text{Inflow}}}} = \sum\nolimits_{{{\text{Outflow}}\;{ + }\;{\text{Addition}}\;{\text{To}}\;{\text{Storage}}}} {} $$
(5)

This can be rewritten as Inflow–Outflow–AdditionToStorage = 0.

AdditionToStorage only applies to reservoirs and aquifers. AdditionToStorage is positive for an increase in storage and negative for a decrease in storage. Outflow includes consumption and losses. Every flow from one point to another is represented by a variable in the LP.

To determine the basic framework of the model, basic maps were prepared in the GIS environment and then introduced into the WEAP model. Accordingly, the route of Dez River, the location of the dam, hydrometric station, water withdrawal channels, inter-basin water transmission channels, towns, factories and industrial sites, urban water recycling channels, and agricultural drainages, etc. were identified. For further familiarity with all the resources and applications in the study area, the schematic and framework of the developed model are shown in Fig. 4. As shown in the framework, each regional water resource, both surface and underground, was connected by a transmission line to demand points or the node associated with each users. Then, a backflow line to the river was considered from each node that transported surface runoff and agricultural surplus water through the drainage. It should be noted that the water return points were specified based on satellite imagery and the coordinates of drainage discharge locations. The location of these points in the WEAP model is exactly in accordance with the location of drainage discharge in the QUAL2K model. The average monthly demands for each of agriculture and industrial applications are presented in Table 2.

Fig. 4
figure 4

Schematic and framework modeled in the WEAP model

Table 2 The average monthly demands for agriculture and industrial applications

To calculate urban and rural drinking water demands, demographic information of all cities, villages, and settlements in the plain area according to 2006, 2011 and 2016 censuses were obtained from Water and Sewer Administration of Khuzestan. Population growth rates between the two consecutive censuses were measured in each city and rural area and finally, the future population was estimated according to the population at the base year and the population growth rate. Then, urban and rural demands for drinking water were calculated based on the population and per capita water consumption in each region.

To simulate the flow discharged from the Dez dam as one of the sources of surface water supply, the required data including reservoir storage volume at the minimum and the maximum level, inactive volume of the reservoir, and hydropower plant capacity were defined in the model. These data are shown in Table 3.

Table 3 Operation characteristics of Dez dam during the simulation period

Environmental flow rate was estimated based on the natural flow regime of river in the desired nodes. The Tennant (or Montana) method, which is a hydrologic water allocating method, was employed to estimate the downstream (BandeGhir) environmental flow rate (Tennant 1976). From October to March, the minimum environmental flow rate was 28.7 (m3/s), and for April to September it was 86.2 (m3/s).

The structure of the proposed operation model

The quantitative–qualitative operation of the water resources in the study area was performed using a multi-objective algorithm. The first objective was to maximize the percentage of water supply (coverage) during the planning period, while the second objective was to minimize violations from permissible quantities of qualitative parameters during the operational period (in accordance with the qualitative utility function). Decision variables of the optimization problem included the monthly environmental flow rates in the BandeGhir which needed to be supplied from the surface water, within range of 28.7–86.2 m3/s. the maximum value was 86.2 m3/s for dry season, and the minimum value was 28.7 m3/s for wet season, which were determined using Tennant method. Given that, the amount of environmental flow rate was determined for the natural flow regime of river, this amount should be optimized in different months in the presence of dams and withdrawals from the river that change the natural regime of the river. The equations of the objective functions and constraints are defined as follows.

Objective functions

1. Maximize the coverage percentage of water demands for the whole period

$$ F_{1} = {\text{Maximize(Coverage}}) = {\text{Maximize}}\left(\sum\nolimits_{t = 1}^{n} {\sum\nolimits_{z = 1}^{{{\text{nz}}}} {\sum\nolimits_{d = 1}^{{{\text{nd}}}} {({\text{Cov}}_{{{\text{tzd}}}} )} } }\right) = {\text{Maximize}}\left( {\sum\nolimits_{t = 1}^{n} {\sum\nolimits_{z = 1}^{{{\text{nz}}}} {\sum\nolimits_{d = 1}^{{{\text{nd}}}} {\left( {\frac{{{\text{TAW}}_{{{\text{tzd}}}} }}{{{\text{DM}}_{{{\text{tzd}}}} }}} \right)} } } } \right) $$
(6)

Since the optimization algorithm attempts to minimize the objective functions, the above-mentioned function can be written as follows.

$$ F_{1} = Minimize\left(\sum\limits_{t = 1}^{n} {\sum\limits_{z = 1}^{nz} {\sum\limits_{d = 1}^{nd} {(1 - Cov_{tzd} )} } }\right ) = Minimize\left(\sum\limits_{t = 1}^{n} {\sum\limits_{z = 1}^{nz} {\sum\limits_{d = 1}^{nd} {(1 - \frac{{TAW_{tzd} }}{{DM_{tzd} }})} } }\right) $$
(7)

where \({\text{Cov}}_{{{\text{tzd}}}}\) is coverage, \({\text{TAW}}_{{{\text{tzd}}}}\) is the amount of water allocated to z zone in t period for d type, \({\text{DM}}_{{{\text{tzd}}}}\) is the water demand of z zone in t period for d type, \(n\) is the number of times planned, \({\text{nz}}\) is the number of zone, \({\text{nd}}\) is the number of water-demand type in each zone.

2. Minimizing the violations from permissible quantities of qualitative parameters over the whole period

$$ F_{2} = {\text{Minimize}}\left( {\sum\limits_{t = 1}^{n} {\sum\limits_{p = 1}^{q} {\sum\limits_{r = 1}^{{{\text{nr}}}} {\left( {\frac{{{\text{Concentration}}_{{{\text{tpr}}}} - {\text{Accepted}}\;{\text{Concentration}}_{p} }}{{{\text{Accepted}}\;{\text{Concentration}}_{p} }}} \right)} } } } \right) $$
(8)

where \({\text{Cocentration}}_{{{\text{tpr}}}}\) is the concentration of p parameter in t period at r river interval, \({\text{Accepted}}\;{\text{Concentration}}_{p}\) is the permissible concentration of each parameter, \(q\) is the number of simulated qualitative parameters, \({\text{nr}}\) is the number of river intervals.

Constraints

$$ V_{\min } (t) \le V(t) \le V_{\max } (t) $$
(9)

where \(V_{\min } (t)\) is the minimum storage capacity of Dez reservoir at t time, \(V_{\max } (t)\) is the maximum storage capacity below the flood-control water level.

$$ {\text{TAW}}_{{{\text{tzd}}}} = {\text{RS}}_{{{\text{tzd}}}} + {\text{RG}}_{{{\text{tzd}}}} \;\;t = 1, \ldots ,m \times y,\;\,\;z = 1, \ldots {\text{nz}},\;\;d = 1, \ldots {\text{nd}} $$
(10)

where \({\text{RS}}_{{{\text{tzd}}}}\) is the amount of surface water allocated to z zone in t period for d type, \({\text{RG}}_{{{\text{tzd}}}}\) is the amount of ground water allocated to z zone in t period for d type, \(m\) is the number of planning courses per year, \(y\) is the number of years.

$$ {\text{RS}}_{{{\text{tzd}}}} = \left\{ {\begin{array}{*{20}c} {{\text{DM}}_{{{\text{tzd}}}} } &\quad {{\text{if}}\left( {{\text{TSR}}_{t} - \sum\limits_{z = 1}^{z - 1} {\sum\limits_{d = 1}^{d} {{\text{DM}}_{{{\text{tzd}}}} - \sum\limits_{z = 1}^{z} {\sum\limits_{d = 1}^{d - 1} {{\text{DM}}_{{{\text{tzd}}}} } } } } } \right) \ge {\text{DM}}_{{{\text{tzd}}}} } \\ {\left( {{\text{TSR}}_{t} - \sum\limits_{z = 1}^{z - 1} {\sum\limits_{d = 1}^{d} {{\text{DM}}_{{{\text{tzd}}}} - \sum\limits_{z = 1}^{z} {\sum\limits_{d = 1}^{d - 1} {{\text{DM}}_{{{\text{tzd}}}} } } } } } \right)} & {{\text{Otherwise}}} \\ \end{array} } \right\} $$
(11)

where \({\text{TSR}}_{t}\) is the whole amount of surface water allocated in t period.

$$ {\text{TDF}}_{{{\text{tdz}}}} = {\text{DM}}_{{{\text{tdz}}}} - {\text{RS}}_{{{\text{tdz}}}} $$
(12)

\({\text{TDF}}_{{{\text{tdz}}}}\) is the amount of water shortage which not supplied by surface water.

$$ {\text{RG}}_{{{\text{tzd}}}} = \left\{ {\begin{array}{*{20}c} {{\text{TDF}}_{{{\text{tzd}}}} } &\quad {{\text{if}}\left( {G_{{t - {\text{Max}}}} - \sum\limits_{z = 1}^{z} {\sum\limits_{d = 1}^{d - 1} {{\text{TDF}}_{{{\text{tzd}}}} } } } \right) \ge {\text{TDF}}_{{{\text{tzd}}}} } \\ {\left( {G_{{t - {\text{Max}}}} - \sum\limits_{z = 1}^{z} {\sum\limits_{d = 1}^{d - 1} {{\text{TDF}}_{{{\text{tzd}}}} } } } \right)} & {{\text{Otherwise}}} \\ \end{array} } \right\} $$
(13)

where \(G_{t - Max}\) is groundwater withdrawal limit (this limitation was assumed to be equal to the current maximum withdrawal and not to exceed this value).

The maximum transfer capability of the Sabili, Dez shargi, Dez gharbi and Gotvand channels were defined as constraints in the model.

$$ {\text{R}}_{c - s} \le 16\frac{{m^{3} }}{s}\;\;R_{{c - {\text{sh}}}} \le 92\frac{{m^{3} }}{s}\,\;\;R_{{c - {\text{gh}}}} \le 157\frac{{m^{3} }}{s}\;\;R_{c - g} \le 60\frac{{m^{3} }}{s} $$
(14)

where \(R_{c - s}\) is the maximum transfer capability of the Sabili canal, \(R_{{c - {\text{sh}}}}\) is the maximum transfer capability of the Dez shargi canal, \(R_{{c - {\text{gh}}}}\) is the maximum transfer capability of the Dez gharbi canal, \(R_{c - g}\) is the maximum transfer capability of the Gotvand canal.

Model assumptions and scenarios

Given the capability of the simulator models, future conditions can be evaluated under different exploitation policies with different scenarios.

Reference scenario The Reference Scenario represents the continuation of existing conditions without major changes in future management policies in which quantitative–qualitative simulations were carried out for a 5-year period from 2018 to 2022. In this scenario, agricultural water demand in the study area were calculated based on the cultivation pattern of each plain and were considered to be constant over the following years. Drinking demand in the following years was calculated according to population growth rate and introduced into the model. According to the current exploitation status, the environmental flow rate downstream of the river was considered to be equal to the recorded flow rates at the end of the river route. In this scenario, drinking water is entirely provided by groundwater sources. The industrial, environmental, agricultural demands and Karkhe demand were defined to the model as the first, second and third priorities of surface water withdrawing, respectively. Surface water and groundwater are the first and second priority to supply water demands.

Optimal scenario This scenario was designed to optimize release from the reservoir, and optimize withdrawal of the river to control of water pollution along the river within range of class 1B (Temperature ≤ 22℃, 7 ≤ pH ≤ 8.5,400 ≤ EC ≤ 500 µmhos, DO ≥ 7 mg/L, 5 ≤ BOD ≤ 10 mg/L, 0.1 ≤ N–NH4 ≤ 0.5 mg/L, and N–NO3 ≤ 10 mg/L), and maximize of water demands. The last river node (BandeGhir) was considered as optimization control point to supply environmental demand. In this scenario, all demands, supply priorities and allocations were similar to the first scenario, with the difference that the first priority of the allocation is related to the environmental demand in BandeGhir. At the end of the optimization process, the optimal environmental flow rate values obtained for the downstream of the river were used to manage the exploitation of water resources in the study area.

Results and discussion

Models calibration and validation

The NSE, SE, and MAE calculations are presented to evaluate the simulation results, as shown in Table 4. According to the above-mentioned parameters, the closer the value of MAE and SE to zero and the NSE value to one, the more accurate the model will be. A very good NSE is noted in simulation for all parameters. The NSE for calibration and validation lies within the range of 0.779–0.995 and 0.916–0.996, respectively, which indicates a satisfactory simulation when using the preset model. For calibration, the highest SE is 16.16% for discharge in Bamdezh station, and the lowest SE value is 5.2% for Temperature. For validation, the highest SE is 6.40% for discharge in Harmaleh station, and the lowest value is 2.34% for N–NH4. The range of SE calculated from the present simulation is an indicator of how good the validated model is. Also, the low MAE indicates a good simulation when using the present models.

Table 4 The NSE, SE, and MAE criteria values for calibration and validation of the WEAP and QUAL2K models

The results of implementing scenarios

The results of optimal and the reference scenarios were compared. Due to the runtime limitation of the linked model, a 5-year period optimization from 2018 to 2022 was considered in these scenarios.

As mentioned above, the optimization process was performed using the NSGAII multi-objective algorithm. In this process, 12 decision variables (environmental flow rate at downstream of the river in different months) were optimized using a multi-objective function. Repeated running of the model showed that for best results, the initial number of Chromosome must be at least twice the number of decision variables; hence the initial population was set 24. The results showed that in lower repetitions, both the function of water supply (coverage) (F-1) and the function of violation from the permissible values of qualitative parameters (F-2) experience significant changes, while in the higher iteration, the variation amplitude of the coverage function was fixed, and the model focuses on the reduction of the violation from the permissible values of qualitative parameters. The number of algorithm iteration to achieve convergence was estimated to be about 500. Given the initial population (24), the quantitative–qualitative coupled model was implemented 12,000 times, totally. In the NSGAII algorithm, the best solutions in each repetition are selected based on the evaluation of the objective functions and stored as an optimal repository to move to the next step. In the last iteration, the optimal Pareto-Optimal Front curve was obtained between the optimization objectives. Figure 5 shows the Pareto optimal front graph where the points show the optimal solutions of the model and the axes represent the amount of objective functions. The last iteration of the model produced 10 optimal solutions, of which the best solution with highest percentage of coverage and lowest violation from the permitted values of the qualitative parameters was selected according to the evaluation of the objective functions, and the results of its implementation were evaluated in the quantitative–qualitative model.

Fig. 5
figure 5

Pareto-Optimal Front curve of objective functions (In iteration 500)

In the Reference Scenario, the system is first required to supply the industrial water demands in the Dez plain followed by the environmental demands of Dez river in accordance with the recorded flowrate at the Bamdezh hydrometric station. The average amount of monthly coverage percentage of water demand for each upstream user of the Dez Plain is shown in Fig. 6a. Since the first priority of this scenario is to respond to the demands of large industries (Haftape demand and P Mahi demand), these demands are fully supplied in all months. However, there has been some shortage in satisfying the agricultural land demands in some of the summer and autumn months, which are simultaneously supplied by surface and groundwater. The lowest percentage of coverage is related to Karkhe water demand (37.5%), which supplies only from the Dez River.

Fig. 6
figure 6

coverage percentage of Dez plain upstream (a), coverage percentage of Dez plain downstream (b), power coverage percentage of Dez dam power plant (c), environmental demand coverage (d). (Reference Scenario)

According to Fig. 6b, coverage percentage of agricultural water demands is lower in the downstream of the river than that of upstream due to the downstream users of the Dez Plain are supplied by surface water. Agri-Dehkhoda demand has been fully supplied throughout the year, since it is located at the end of the river and following the environmental demands of Bamdezh station. The lowest percentage of coverage is 34% for Agri-Emamkhomeyni and Agri-Shoeybye in September. Figure 6c represents the percentage of the Dez dam power coverage. The lowest percentage of power coverage was 46.35 in September; also, the reliability of the power generation was obtained by 58.3%. The lowest coverage percentage of environmental demand was 74.16 for September as shown in Fig. 6d.

The average percentage of monthly coverage for the upstream and downstream users of the Dez Plain is shown in Fig. 7a and b for the optimal scenario. The percentage of upstream coverage is over 90% for all users except for Karkhe demand. Figure 7c shows the percentage of power coverage, which generated by the Dez dam power plant in the optimal scenario. In this scenario, the power plant generates the power demands with 91.67% reliability overall months. The optimal scenario considers the environmental coverage as the first priority, and thereby the percentage of environmental coverage was calculated as 100% (Fig. 7D).

Fig. 7
figure 7

coverage percentage of Dez plain upstream (a), coverage percentage of Dez plain downstream (b), power coverage percentage of Dez dam power plant (c), environmental demand coverage (d). (Optimal Scenario)

The reliability of water supply for the study area, including urban, industrial and agricultural users as well as water transfer outside the plain, which are supplied simultaneously from surface and groundwater, is shown in Table 5. This table shows that, the reliability of the water supply is improved in most of the cases in the optimal scenario compared to the reference scenario.

Table 5 The reliability of the water supply in the Dez plain

Fluctuations in the reservoir storage volume of the Dez dam in the optimal scenario were compared with the fluctuations in the reference scenario. As seen in Fig. 8, because of applying the constraint of non-violation from reservoir storage minimum level (860 MCM) during the planning period, the reservoir storage in the optimal scenario has never been lower than the storage minimum level of the reservoir. This helps to manage the reservoir storage volume under severe drought conditions. In the reference scenario, however, the water level has fallen below the reservoir storage minimum level utilization in some months due to the lack of this constraint.

Fig. 8
figure 8

Fluctuations in the reservoir storage volume of the Dez dam during the 5-year operation period for the reference and optimal scenarios

Since most of the water withdrawal from the Dez River are to supply the agricultural demands of the plain, so the trend of the qualitative parameters changes of pollution including, Temperature (T), pH, Electrical Conductivity (EC), Ammonium nitrogen (N–NH4), Nitrate nitrogen (N–NO3), biochemical oxygen demand (BOD), and DO (dissolved oxygen) were investigated at the agricultural water withdrawal point, between Dez Dam and BandeGhir. Figure 9 shows the trend of each parameter changes at the agricultural water withdrawal site along the river under the reference scenario.

Fig. 9
figure 9

The trend of quality parameters in the water withdrawal points in Dez river from 2018 to 2022 (Reference Scenario)

According to the Fig. 9, the variations in BOD concentration, especially in the water withdrawal sites of Haftape and Mianab, are greater than the standard value considered for this parameter (standard Class1B), and thereby evaluated as undesirable. The amount of DO was higher than the permissible limit of this parameter in most months along the river; hence, the river status is relatively favorable in this respect. The EC of water exceeds the permissible limit of this parameter in Standard 1B in some months, especially at the water withdrawal site of Dehkhoda and the downstream flow, which is also considered relatively undesirable. Also, the results of this scenario show that the river status in terms of N–NO3 and N–NH4 concentrations is quite favorable according to Standard 1B. Moreover, the pH variations range was from 7 to 9 which were at desirable level. Finally, the results showed that temperature changes in the river are desirable during the whole simulation period.

In general, these figures show that the highest concentration of pollution parameters and the lowest water dissolved oxygen during the planning period were in the Mianab withdrawal and two adjacent intervals located at the downstream. This is because the Mianab water withdrawal site is located at the downstream of the Haftape industrial effluent drainage site. On the other hand, other agricultural drainage effluents are also discharged into the Dez River before this site, which in turn, increase the concentration of quality parameters at this point.

Figure 10 shows the trend of qualitative parameters including T, pH, EC, N–NH4, N–NO3, BOD, and DO, that was simulated separately under the optimal scenario at agricultural water withdrawal sites between the Dez Dam and BandeGhir. Due to using the optimization model and applying the qualitative objective function and the requirement of the system to supply the environmental flow along the river, the quality status of the river are more desirable in this scenario. This figure further show that in the optimal scenario, the highest concentration of quality and pollution parameters and the least dissolved oxygen during the planning period were related to the Mianab water withdrawal site located downstream of the plain, but the values of these parameters have significantly improved compared to the reference scenario. These changes are particularly evident for the parameters of BOD and pH. This demonstrates the efficiency of the optimization model in providing a solution that, in addition to supply the demands with an optimal reliability, also enhances the environmental status of the river in terms of quality changes and pollution. In other word, the amount of self-purification under optimal scenario increased compared to the reference scenario. As mentioned in the previous sections, flow release in accordance with the optimal scenario designed by the optimizer model has caused significant improvement of the quality and pollution status along the river as well as the reliability of demand supply of agricultural land in the Dez plain.

Fig. 10
figure 10

The trend of quality parameters in the water withdrawal points in Dez river from 2018 to 2022 (Optimal Scenario)

As mentioned earlier, among the upstream agricultural lands, the Dez Shargi, Dez Gharbi, and Shavoor plains withdraw the water from surface and groundwater resources, simultaneously. Figures 11, 12, and 13 show the percentage allocations of surface and groundwater resource under the reference and optimal scenarios in each of the Dez Shargi, Dez Gharbi, and Shavoor plains, respectively. Given the necessity of optimal environmental flow at the end of the river in the optimal scenario, the system improved withdrawing rate of the surface and groundwater resources based on the defined objective functions in the dry or humid season in comparison with the reference scenario.

Fig. 11
figure 11

Percentage of allocation from surface and groundwater sources of Dez Shargi demand under reference (a) and optimal (b) scenarios

Fig. 12
figure 12

Percentage of allocation from surface and groundwater sources of Dez Gharbi demand under reference (a) and optimal (b) scenarios

Fig. 13
figure 13

Percentage of allocation from surface and groundwater sources of Shavoor demand under reference (a) and optimal (b) scenarios

Conclusion

Due to the inefficiency of the current condition of water resources operation in the Dez reservoir–river system in Iran, the optimal operation of the reservoir–river system to control pollution and supply water demands along the downstream river of the reservoir was addressed. The optimal operation of the system was developed by dynamic coupling of quantitative and qualitative (WEAP-QUAL2K) models and linking it to a multi-objective optimization algorithm (NSGAII). The results showed that under the optimal operation, all the water demands of the plain were supplied with higher reliability than the current condition, while the storage capacity of the dam has been always above the minimum operating level. This helps to manage the reservoir storage volume under severe drought conditions. Comparison of the optimal and current conditions showed that not only the water quality along the river have improved but also the least violations from the quality standards of river water have occurred along the river, especially in agricultural water withdrawing sites. Additionally, the environmental demands, which have changed due to the construction of the dam and withdrawals from the river, were optimized and supplied. According to the results, dynamic coupling of WEAP and QUAL2K models and linking it to the body of NSGAII optimization algorithm can provide a better planning for proper operation of reservoir–river systems. This can be used as a model for water resource planners, especially in areas with different operations and a variety of pollutants.