Introduction

Based on the statistics on many river conditions, it can be seen that the concentration of pollutants exceeds the river’s self-purification capacity and disturbs the balance of water bodies. One of the commonly used methods to manage and improve river water quality is reducing the river pollution by waste load allocation (WLA) and carrying out the treatment process through simulation and optimization models. Maximizing economic benefits, waste load, and water quality factors are common objectives used in water quality management (Liu et al. 2014). Regardless of the optimization advantages, the beneficiaries involved in water systems do not necessarily have the same interests, thereby leading to conflict between them. The optimization approach reaches optimal solutions, but they are not the most workable or agreeable ones. Therefore, researchers developed conflict resolution approaches and game theory to contribute to the beneficiaries' opinions and find practical solutions. Game theory and conflict resolution approaches have proved that they can address the behavior of stakeholders and enable decision-makers to develop more effective strategies (Liebman and Lynn 1966; Burn and McBean 1985, 1986; Burn and Lence 1992; Warwick and Roberts 1992; Herrero and Villar 2001; Ansink and Weikard 2012; Nikoo et al. 2013; Estalaki et al. 2015; Bozorg-Haddad et al. 2018). Several game theories have been developed in water resources management during the last decades and have been compared with each other in some cases. Cooperative and non-cooperative methods like bankruptcy and Nash–Harsanyi bargaining solutions have found an appropriate water allocation function in hydro-environmental conflicts. Their reliability has been proved in multi-criteria and multi-objective decision-making problems. In the non-cooperative games, each player attempts to maximize their welfare by minimizing the cost and maximizing the benefit. Still, cooperative games such as the bankruptcy method are based on maximizing the overall welfare by maximizing the accumulated use and minimizing the accumulated cost. This matter can help the players gain more benefits. Cooperation enables decision planners to create a win–win situation for all players (Wei and Gnauck 2007; Madani and Hipel 2011; Madani and Lund 2012).

The bankruptcy approach creates justice and makes compromises among stakeholders in water resource allocation conflicts. Cooperation happens due to the fairness of the allocation process among the beneficiaries. But the definition of fair is variable in the bankruptcy approach, which includes several rules, each of which has a separate definition of fair. This is why one rule might be more convenient for either small or large creditors (Madani and Lund 2012; Aghasian et al. 2019; Moridi 2019; Li et al. 2020). The bankruptcy method is an easy approach to understand, and a practical way for many water resources faced with claims that exceed the available supply in reality (Herrero and Villar 2001; Ansink and Weikard 2012; Saberi and Niksokhan 2017), and both reasons verify the use of bankruptcy rules in water allocation.

In a study by Kampas and White (2003), scenarios of controlling agricultural pollution using bargaining solutions and bankruptcy rules were introduced for WLA. The results indicated that the Piniles (Pin) rule or Adjustable Proportional (AP) was selected according to the bargaining power, which proved the efficiency of bankruptcy rules. Then, Madani and Zarezadeh (2012) studied bankruptcy rules in a hypothetical groundwater system for allocating water to farmers. Although the concept of equity was different in each rule and caused distinct results, the methodology met the stakeholders' claims. Research continued, and Madani et al. (2014a) investigated the distinct rules of bankruptcy approach for solving the conflicts over Caspian Sea fossil sources among the riparian countries around it. The final results showed that the order of selected rules was influenced by considering the involved parties' power. The bankruptcy approach could be used as an optimal resolution for sharing assets. Madani et al. (2014b) addressed the riparian demands of a trans-boundary river using a new bankruptcy method and nonlinear optimization programming to allocate water. In this study, the bankruptcy allocation stability index (BASI) was used for finding the most acceptable solution, and various scenarios manifested that their acceptability relied on available water and claims.

Zeng et al. (2017) compared three allocation methods, including just bankruptcy rules with hydrological constraints, and multi-criteria decision-making (MCDM) with the second method mentioned above. They applied the Proportional (P), Constrained Equal Award (CEA), and Constrained Equal Loss (CEL) rules and showed that combining bankruptcy rules with constraints is more operational than using mere bankruptcy rules. The bankruptcy with the MCDM method assigned weights to claims, which led to more allocation to large claims.

Bozorg-Haddad et al. (2018) used bankruptcy theory for water allocation in the Urmia Lake. The uncertainty of stakeholders’ decisions was considered to employ nonlinear programming (NLP) and genetic programming (GP) optimization algorithms. The BASI stability index examined the acceptability of bankruptcy rules. The comparison of GP and NLP results showed that the GP water allocations were closer to the optimal allocation values.

Degefu et al. (2018) presented a framework for allocating water and welfare in transboundary river basins, including bankruptcy games, resource allocation, and bargaining theory. Sustainability, equity, and efficiency were used to reach reasonable and equitable solutions. The results showed sustainable cooperation among involved countries. Eventually, the study combining water allocation, water reallocation, and welfare distribution provided a comprehensive method for allocating water and the welfare generated from it efficiently, fairly, and sustainably.

Li et al. (2020) improved the bankruptcy rule for water allocation issues using water-use efficiency, agent contribution, and minimal satisfying water demand. The methodology was completed by assigning weight coefficients to the contribution and efficiency factor. According to the flexible and reasonable solutions, it was a useful approach for complex water allocation problems.

Janjua and Hassan (2020) developed a stochastic model for water allocation utilizing the bankruptcy method under scarcity. In the research, allocating water to users was based on their agricultural productivity, and the preference was given to higher ones. The study had two stages. First, the water distribution among provinces was done in terms of bankruptcy rules, and then, the users’ allocation was determined based on their agricultural productivity.

Although the bankruptcy approach had always been utilized to allocate water quantity in previous studies, Moridi (2019) started adapting the concepts of this approach for water quality management. In the developed bankruptcy rules, the terms of claims and assets were replaced with the river pollutant and Dissolved Oxygen (DO) concentration.

This study develops a methodology that employs bankruptcy rules through a probabilistic and deterministic simulation–optimization model for the first time. The purpose is to improve water quality considering parties’ interests and show the positive impact of uncertainty on the BOD5 released from each discharger and the DO concentration at the checkpoint. Four bankruptcy rules are applied as waste load allocation scenarios. The best strategy is selected based on the optimal waste load that meets both parties’ interests: Environmental Protection Agency (EPA) and polluters. To gain this goal, a combination of QUAL2Kw, Particle Swarm Optimization (PSO), bankruptcy method, and a real case study (Zarjub River in the North of Iran) is used to find the deterministic result. The probabilistic model is developed by combining the deterministic model and the Monte Carlo (MC) techniques. The MC is employed for generating river flows to calculate the possibility of reaching different DO concentrations at the checkpoint in terms of each cooperative allocation scenario. This research is prepared based on the results of an MSc thesis at Shahid Beheshti University, Tehran, Iran.

Methodology

In this paper, a probabilistic model is suggested for WLA in river systems based on bankruptcy rules. Because of the non-uniform temporal and spatial variation in water flows and wastewater that enters the river, a probabilistic nonlinear optimization model is used for solving water quality problems along the river. To gain this goal, a river water quality model (QUAL2Kw- version 5.1) is linked with the optimization model to simulate and increase the water quality parameter by reducing the pollutants based on bankruptcy rules.

Figure 1 shows the proposed methodology procedure in a flowchart. As can be seen, gathering data for preparing the simulation model and investigating the bankruptcy approach are the first steps. Then, the river is simulated, calibrated, and verified using QUAL2Kw. Next, the simulation–optimization model is drawn up by linking QUAL2Kw to PSO through MATLAB. The river flow uncertainty is considered by generating inputs with MC and Latin Hypercube Sampling (LHS). The model evaluates a probabilistic and deterministic approach using different bankruptcy rules. CEA, CEL, P, and Talmud (TAL) are the four bankruptcy rules used as the four allocation scenarios. Minimizing DO violation is the objective function, and the searching procedure of PSO continued until the best solution, or the end of the iteration steps is reached. In the deterministic approach, the developed simulation–optimization model runs for a specific amount of upstream inflow and optimizes the permitted pollutant and reaches the best possible DO at the checkpoint. However, in the probabilistic condition, the model finds the best solution that minimizes the objective function based on the river flow uncertainty. The probabilistic model presents the DO series, and a proper distribution function is fitted to them. DO with a 90% probability of occurrence is chosen as a criterion in the probabilistic model, and the more closer it is to the standard level, the better it is. In the last step, all results are analyzed and compared.

Fig. 1
figure 1

Proposed methodology flowchart

Materials and methods

Case study

As shown in Fig. 2, the area under study includes a part of the Siyahrud River called the Zarjub River. It is 24-km long and passes through the suburbs and inside the city of Rasht and runs from the south to the north. It flows into the Anzali Lagoon and eventually into the Caspian Sea. The river annual discharge is 59 million cubic meters, and it can supply the water needs of the agricultural sector. The Zarjub River's pollution is mainly due to the direct reception of urban effluent and then the agricultural wastewater associated with toxic substances and fertilizers runoff without the treatment process. They contaminate the Anzali lagoon and the Caspian Sea. The pollution load that is released from agricultural areas is far less than the domestic waste in terms of concentration and flow. Also, the industrial pollution discharged from factories is negligible because there are not significant industrial activities in that area. The main reason for the decline in Zarjub River water quality is the huge amount of \({\text{BOD}}_{5}\) that point sources discharge into the river. In this research, polluters’ available information is limited to inflow, DO, \({\text{BOD}}_{5}\), alkalinity, and pH (IWPC Technical Report, 2013). Because the records of (Chemical Oxygen Demand) COD are unavailable, it is not considered in the simulation process, which could affect DO concentration at the checkpoint. However, this lack of information has not influenced the whole process significantly, and the model calibration and verification are done to be sure.

Fig. 2
figure 2

Zarjub River location and the pollution sources along the river

The point and non-point source pollutions are shown on the left-hand side of Fig. 2. Many pieces of researches have been conducted on this river because of reasons such as severe pollution, the river’s role in supplying demands, and the economic influence of this river on tourism, fishery, and downstream lagoon (Mesbah et al. 2009; Abed-Elmdoust and Kerachian 2012; Zolfagharipoor and Ahmadi 2017; Moridi 2019).

According to Fig. 3, pollution sources include the 11 point sources and seven non-point sources located in different places across the river. The high concentration of BOD5 discharged from point sources indicates the influence of these polluters as the main ones. In addition to Fig. 3, polluters’ DO and BOD5 (before and after optimization) are presented in Tables 1 and 2 (IWPC Technical Report, 2013). In this study, the checkpoint is chosen at the end of the river with the least DO concentration.

Fig. 3
figure 3

Scheme of point and non-point sources of pollution across the Zarjub River

Table 1 Discharged \({\text{BOD}}_{5}\) (mg/L) from polluters based on bankruptcy rules under the deterministic model
Table 2 Discharged \({\text{BOD}}_{5}\) (mg/L) from polluters based on bankruptcy rules under the probabilistic model

Monte Carlo simulation and uncertainty analysis

In hydrology, hydrogeology, and water resources, MC is an efficient method for applying an uncertainty analysis using the optimal probability distribution. Using the inputs of probability distributions leads to the generation of uncertain outputs by a probabilistic distribution function. The following procedure is performed to generate random X:

  1. 1.

    Draw Y ~ Uniform distribution (0,1)

  2. 2.

    Set \(X = F^{ - 1} (Y)\)

where \(F(Y)\) is the cumulative distribution function of the variable Y, and F−1(Y) is the inverse function of Y (Steyvers 2011).

MC model’s characteristic feature is producing a large number of inputs and taking a lot of time for running the model based on all of them. After developing the MC in the form of the LHS technique, Manache and Melching (2004) showed that LHS could be substituted for MC to reduce the number of samples and run time. In this method, to generate N random variables, the range of variables is divided into N intervals. The variables' corresponding probabilities are equal to \(\frac{1}{N}\), while each random value of the variable is selected per each interval based on Eq. (1):

$$ z_{i} = F^{ - 1} \left( {\frac{{(p_{i} - \varepsilon_{i} )}}{N}} \right) $$
(1)

where F is the cumulative distribution function of the variable, pi is a random permutation of 1…N, and \(\varepsilon_{i}\) is a uniform distribution random number ϵ [0,1] (Pebesma and Heuvelink 1999). LHS is used with a low number of samples to reach the mean and stable variance; it is efficient for multivariate models (Manache and Melching 2004; Rajabi et al. 2015).

QUAL2Kw simulation model

In water quality management, the application of a proper simulation model is inevitably essential. Numerous river water quality simulation models, including free public and commercial codes, have been developed, such as Water Quality Analysis Simulation Program (WASP), CE-QUAL-W2K, QUAL2Kw, MIKE11, Water Quality for River–Reservoir Systems (WQRRS), and HEC5Q. QUAL2Kw is a free public package software and an enhanced version of the QUAL2E model [developed by Environmental Protection Agency (EPA) 1997] that has been proved to be an efficient, fast, and user-friendly model via various case studies.

The QUAL2Kw is a one-dimensional model that includes a general mass balance equation for the concentration of constituents in the reaches of rivers. The mass balance equation for each element calculates the qualitative parameters of the model per different time steps, and the governing numerical method is finite difference. The governing equation relies on factors such as time, flow rate, element volume, longitudinal propagation coefficient, external loading, and sources and sinks. It uses the Streeter–Phelps equation for calculating DO and biochemical oxygen demand (BOD5). In addition to the above-mentioned water quality variables, it can simulate temperature, pH, ammonium (NH‏4), nitrate (NO3−), nitrogen dioxide (NO2−), organic and inorganic phosphorus (OP, IP), phytoplankton, and bottom algae. All the above parameters, along with the river geometric properties like channel width and slope or manning coefficient, pollution loads, and meteorology parameters, are the main input data of this model. Besides, QUAL2Kw has an automatic calibration system based on the genetic algorithm, which is used to increase the fitting goodness of calculated and observational results. QULA2Kw considers the uncertainty of many parameters such as oxidation rate and nitrification rate. This option increases the accuracy of model and decreases the margin of error that may occur. Finally, after simulating the river based on the above inputs, outputs are achieved; these include the values of water parameters such as DO, BOD5, temperature, pH, NH‏4, and NO3− that describe the river condition (Pelletier et al. 2006; Kannel et al. 2007).

Although QUAL2Kw is only capable of simulating in one-dimensional, it is a suitable choice to be used for the Zarjub River due to its morphology, length, width, and location in a small sub-basin. For instance, the cross section of this river is narrow along most of its 24 km length. This model has proved its efficiency in simulating narrow and little rivers like the Zarjub River and wide ones, including the Karoon and Dez River (Ghorbani et al. 2020; Shojaei et al. 2015). The QUAL2Kw can simulate this river’s response with the non-uniform and steady flow to the point and non-point pollution sources employing the advection–diffusion equation. In this study, point sources (domestic wastewater) are the main factors that reduce the Zarjub River water quality, and the pollutants are limited to specific parameters like DO and BOD5. So, regarding the availability of data, the river condition, and the model’s calibration system, QUAL2Kw is able to accurately simulate the Zarjub River.

Bankruptcy theory in water pollution

Justice and efficiency of water resources allocation methods among stakeholders are involved and controversial issues. Finding strategies for allocating shares among creditors based on relative equity and impartial adjustment of conflicting claims without favoritism is one of the recent management programs’ aims. One of the analytic methods used in resource allocation conflicts is the bankruptcy theory. The purpose of this approach is to divide the system property, including water quantity or quality, as the asset among creditors, when the asset is not sufficient to pay the total claims. So the procedure of distributing the asset among beneficiaries can be fair enough to satisfy all of them. Several bankruptcy rules have been developed over the years, such as CEL, CEA, P, and TAL rules, which cause equal losses and awards. These methods provide acceptable results in addition to simplifying the calculations with distinct definitions of justice (Herrero and Villar 2001; Mianabadi et al. 2014; Zeng et al. 2017).

Four bankruptcy rules are used in this study as follows, and some of the basic concepts are changed to apply to water quality conflicts. In the allocation of water quantity, the asset and claims are water amounts, whereas, in this quality problem, the asset refers to DO of the river, and pollution loads, namely BOD5 concentration, are assumed to be claims of stakeholders that are discharged into the river. In quantity allocations, the claims should be provided based on available assets, but in this study, they have to be met in a way that does not exceed the rivers’ self-purification capacity (Aghasian et al. 2019; Moridi 2019).

In this study, DO concentration at the checkpoint is the asset, and the polluters' BOD5 serves as the claims. The aim of applying the bankruptcy method is to reduce discharged pollutant load and provide sufficient DO concentration because it is hugely affected by the BOD5 concentration. The transformation of assets and claim into DO and BOD5 does not follow the mass balance that is established in quantity water allocation. The CEA, CEL, P, and TAL are used as scenarios of WLA to investigate their performance and efficiency and effect on satisfying all parties. The procedure of each rule is defined in the following subsection.

The constrained equal award (CEA)

The CEA rule determines the asset allocation as per the following steps:

  • The initial allocation to all beneficiaries starts with the lowest possible amount.

  • If the creditors receive all of their claims with the initial allocation, they would be excluded.

  • Next, an allocation amount that is more than the initial amount must be assigned to the remaining creditors, and then, step 2 must be carried out again. This cycle of steps 2 and 3 continues until the asset is over (Madani and ZareZadeh 2012; Zeng et al. 2017).

The original equation of this rule is as follows [Eq. (2)]:

$$ c_{i}^{{{\text{new}}}} = \min (\lambda ,c_{i} )\;{\text{where}}\;\sum {\min (\lambda ,c_{i} ) = E} $$
(2)

where \(c_{i}^{{{\text{new}}}}\) is the final allocation share of creditor \(i\), \(\lambda\) is an equal share of an asset, \(c_{i}\) is the initial claim of the creditor i, and E is the asset (Ansink and Weikard 2012; Mianabadi et al. 2014; Zeng et al. 2017).

By defining the above variables’ concepts of the above variables in a water quality problem, the DO concentration indicates the asset, and the BOD5 concentration is the polluters’ claim to release. Pollutant concentration increases from zero up to the maximum BOD5 concentration of each polluter gradually until enough DO concentration is reached at the checkpoint (Aghasian et al. 2019; Moridi 2019).

The constrained equal loss (CEL)

The resources allocation in terms of the CEL rule is done as per the following steps:

  • First, a specific amount is subtracted from the initial claims of all polluters.

  • Then, if a creditor's claim reaches zero, they are excluded.

  • Steps 1 and 2 are repeated until the asset is over.

The CEL rule foundational equation is defined as follows [Eq. (3)]:

$$ c_{i}^{{{\text{new}}}} = \max (0,c_{i} - \lambda )\;{\text{where}}\;\sum {\max (0,c_{i} - \lambda ) = E} $$
(3)

This rule allocates each creditor an equal share of \(E\) (Ansink and Weikard 2012; Mianabadi et al. 2014; Zeng et al. 2017). Regarding DO concentration in this study, the system reduces the amount of BOD5 concentration released from each pollution source equally. Besides, it has to increase DO concentration up to a standard level at the checkpoint. In this case, the BOD5 concentration of each polluter decreases from the primary claim to a proper minimum level (Aghasian et al. 2019; Moridi 2019).

Proportional (P)

According to the P rule, a determined percentage is allocated to all beneficiaries while the sum of the new shares is less than the asset. The percentage is equal to dividing the asset by the accumulation of claims.

The primary equation of the P rule is defined as follows [Eq. (4)]:

$$ c_{i}^{{{\text{new}}}} = \lambda \times c_{i} \;{\text{where}}\;\lambda = \frac{E}{C} $$
(4)

in which \(C\) and \(E\) indicate the total amount of claim and asset, respectively. It assigns a percentage to all creditors. P rule reduces the BOD5 concentration of each polluter by a similar proportion. It represents an approach that all polluters release a specific proportion of their pollution load into the river in order to provide enough DO concentration at the checkpoint (Ansink and Weikard 2012; Mianabadi et al. 2014; Zeng et al. 2017). In this water quality management, the percentage is a random number because the material of assets and claims are different and cannot follow Eq. (4).

Talmud (TAL)

The resources allocation based on the TAL rule is done according to the following steps:

  • First, half of all claims must be allocated to beneficiaries. If the asset is less than half of the accumulated claims, the CEA method will be applied, while the final claims of each stakeholder do not exceed half of their claim. On the other hand, if half of the accumulated claims are less than the asset, the CEL method will replace the claims with half of them.

  • Based on step 1, the allocation is done under CEL or CEA rule with half of the claims.

Moreno-Ternero and Villar (2006) specified that the TAL rules behave like one of CEA or CEL according to the result of half-claims instead of claims. If the asset is less than half of the total claim, CEA, and otherwise CEL, is utilized as follows [Eq. (5)]:

$$ {\text{TAL}}(E,c) = \left\{ {\begin{array}{*{20}l} {CEA(E,0.5c)} \hfill & {{\text{if }}\;{\text{E}} \le {\text{0}}{\text{.5C}}} \hfill \\ {{\text{0}}{\text{.5c + CEL(E - 0}}{\text{.5c,0}}{\text{.5c)}}} \hfill & {{\text{if }}\;E \ge 0.5C} \hfill \\ \end{array} } \right. $$
(5)

Generally, accepting just one of the bankruptcy rules is rarely possible for all stakeholders. Therefore, the most desirable method is different for different stakeholders. On the other hand, there are several solutions to assess the sustainability and acceptance of a game (Mianabadi et al. 2014; Zeng et al. 2017).

Optimization model

The optimization model is used in this study for allocating the share of the waste load, as much as possible, to each pollution source while enhancing the water quality, which is the primarily goal. The optimization algorithm finds the allowable BOD5 concentration for each discharger (point and non-point source) to reduce the pollution load that enters the river. Also, the DO concentration at the checkpoint has to be increased from less than 1 mg/L to up to 5 mg/L.

In this paper, DO concentration is the water quality factor used in the objective function equation. It is identical for the deterministic and probabilistic models, as written in Eq. (6). This research aims to decrease the DO concentration difference from standard DO, and the best answer is \({\text{DO}} \ge 5\) mg/L if the model reaches. Since the probabilistic and deterministic models aim to improve water quality, the best solution would be DO ≥ 5 mg/L. Equation 6 means that the square of the difference between DO and standard DO and should be closer to zero. Even if the model would not reach DO ≥ 5 mg/L, the scenario that reached DO value that is closer to the standard level would be chosen. The simulation–optimization model finds decision variables in the searching space and the decision variables are not limited to the point sources; 500 iterations seem sufficient to give the model enough space and time for searching for the optimal solution under each scenario. The BOD allocated to pollution sources (point and non-point) is optimized under each bankruptcy rule as a scenario. These rules are defined mathematically through Eqs. (7)–(10) as four scenarios. Although \(\lambda\) is the decision variable of each scenario (rule), its concept and effect are different in each one. Equation (7) refers to the CEA rule and shows that the optimized BOD5 concentration of the polluter \(i\) is the minimum concentration between the initial BOD5 and the decision variable of the optimization algorithm. Equation (8) indicates that in the CEL method, all pollution sources must reduce their pollution load equally, and it can continue until their pollution is over. Equation (9) presents that all pollution sources have to decrease their released pollutant concentration with the same percentage in the P rule. According to Eq. (10) that represents the TAL rule, if the simulated DO concentration of half-claims is less than the standard level, CEA is applied with \(0.5{\text{BOD}}_{i}^{{{\text{initial}}}}\). Otherwise \({\text{BOD}}_{5}\) is allocated by the \(0.5{\text{BOD}}_{i}^{{{\text{initial}}}} + {\text{CEL}}(0.5{\text{BOD}}_{i}^{{{\text{initial}}}} )\) equation that refers to the CEL rule.

$$ {\text{Min}}\;{\text{OF}} = ({\text{DO}} - {\text{DO}}_{{{\text{standard}}}} )^{2} $$
(6)

subjected to:

$$ {\text{BOD}}_{i}^{{{\text{new}}}} = \min (\lambda ,{\text{BOD}}_{i}^{{{\text{initial}}}} ) $$
(7)
$$ {\text{BOD}}_{i}^{{{\text{new}}}} = \max (0,{\text{BOD}}_{i}^{{{\text{initial}}}} - \lambda ) $$
(8)
$$ {\text{BOD}}_{i}^{{{\text{new}}}} = \lambda \times {\text{BOD}}_{i}^{{{\text{initial}}}} $$
(9)
$$ {\text{BOD}}_{i}^{{{\text{new}}}} = \left\{ {\begin{array}{*{20}l} {{\text{CEA}}\left( {0.5{\text{BOD}}_{i}^{{{\text{initial}}}} } \right)} \hfill & {if\;{\text{DO }}(0.5{\text{BOD}}_{i}^{{{\text{initial}}}} ) \le {\text{DO}}_{{{\text{standard}}}} } \hfill \\ {0.5{\text{BOD}}_{i}^{{{\text{initial}}}} + {\text{CEL}}(0.5{\text{BOD}}_{i}^{{{\text{initial}}}} )} \hfill & {if\;{\text{DO }}(0.5{\text{BOD}}_{i}^{{{\text{initial}}}} ) > {\text{DO}}_{{{\text{standard}}}} } \hfill \\ \end{array} } \right. $$
(10)

where \({\text{DO}}\) = DO concentration at the checkpoint; \({\text{DO}}_{{{\text{standard}}}}\) = standard DO concentration that is equal to 5 mg/L; \({\text{BOD}}_{i}^{\text{new}}\) = the allocated \({\text{BOD}}_{5}\) concentration of polluter i; \({\text{BOD}}_{i}^{\text{initial}}\) = the initial \({\text{BOD}}_{5}\) concentration of polluter i; and \(\lambda\) = the decision variable based on bankruptcy rules.

Evolutionary algorithms (EA) have shown a noticeable efficiency compared to classical ones, especially when one runs a simulation model linked with the optimization model to calculate dependent variables (Anile et al. 2005). Using search-based algorithms, such as PSO, can help approach the near-global optimal solution even in situations where the solution space suffers from discontinuity, multimodality, nonlinearity, and non-convexity.

Since linking QUAL2Kw (the water quality simulation model) with classical optimization models (linear or nonlinear optimization methods) is more complicated than searched-based optimization algorithms, the EA was chosen as the optimization model. The PSO solves the problems in which answers are a point or surface in n-dimensional space. The particles move in the response space with an initial speed, and then, the algorithm calculates results based on a "merit factor" (Clerc 2006). According to Eqs. (11) and (12), the movement of the best particles in the search space is led by specific relationships under the best position found by themselves or the whole group:

$$ v_{i} (t) = v_{i} (t - 1) + c_{1} r_{1} ({\text{Localbest}}(t) - x_{i} (t - 1)) + c_{2} r_{2} ({\text{Globalbest}}(t) - x_{i} (t - 1)) $$
(11)
$$ x_{i} (t) = x_{i} (t - 1) + v_{i} (t) $$
(12)

Search is done through space while \({\text{Localbest}}\) and \({\text{Globalbest}}\) implicate the best position of each particle and the best position of all particles, respectively. In the above equations, \(v_{i} (t)\) = velocity of the particle \(i\), \(x_{i} (t - 1)\) = the position of the particle \(i\) in the search space at time step \(t\), \(c_{1}\) and \(c_{2}\) = learning factors, and \(r_{1}\) and \(r_{2}\) = random values. The objective function of each iteration is evaluated based on decision variables, and this process continues until the termination condition of the optimization algorithm is met (Rini et al. 2011).

Waste load allocation optimization using bankruptcy approach

Combining of the optimization model with bankruptcy rules can reduce the discharged pollution in terms of various scenarios and policies based on fairness. This framework helps find a solution that all beneficiaries would agree with because it uses a cooperative method. The advantage of applying an optimization model in water resource issues is that optimum solutions could be found in a shorter time. Also, the bankruptcy approach is a way that makes beneficiaries negotiate on their claims and interests and achieve consensus over their opposite objectives in the conflicts. The result will be applicable after considering both sides of the conflict (Aghasian et al. 2019; Moridi 2019).

Bankruptcy rules have various notions of fairness and do not benefit the claimants similarly, so one rule might be more beneficial to some stakeholders, and others might reject some. According to the mentioned flaw, there is a need for evaluating the acceptability under bankruptcy solutions based on a criterion. The applicability of policies depends on the parties' decision and agreement. Since the bankruptcy index, BASI, cannot be used for this water quality issue, \(\sum {({\text{BOD}}_{5} \times Q)}\) has been chosen as a criterion in this research, and the pollution sources, point and non-point, would accept the scenario that leads to less treatment and more \(\sum {({\text{BOD}}_{5} \times Q)}\), which is more beneficial to them.

Results and discussion

Model calibration and verification

Based on the water quality monitoring studies of the Zarjub River, the wastewater of 11 points and seven non-point sources of pollution that are located across the river causes a reduction in DO concentration from 6 mg/L in upstream to 0.9 mg/L in downstream.

As shown in Fig. 4, DO, and \({\text{BOD}}_{5}\), the qualitative and quantitative information of October 2005 is the analyzed parameters in both calibration and verification procedures. The coefficient of determination (\({\text{R}}^{2}\)) serves as the factor of evaluating model precision, and it is equal to the square of Eq. (13) as follows:

$$ r_{{X_{{{\text{obs}}}} ,X_{{{\text{sim}}}} }} = \frac{{\sum {(X_{{{\text{obs}}}} - \overline{X}_{{{\text{obs}}}} )(X_{{{\text{sim}}}} - \overline{X}_{{{\text{sim}}}} )} }}{{\sqrt {\sum {(X_{{{\text{obs}}}} - \overline{X}_{{{\text{obs}}}} )^{2} \sum {(X_{{{\text{sim}}}} - \overline{X}_{{{\text{sim}}}} )^{2} } } } }} $$
(13)
Fig. 4
figure 4

Zarjub River water quality calibration (October 2005)

where \(r_{{X_{{{\text{obs}}}} ,X_{{{\text{sim}}}} }}\) = correlation coefficient; \(n\) = number of data; \(X_{{{\text{obs}}}}\) = observed data; and \(X_{{{\text{sim}}}}\) = simulated data. The \(R^{2}\) of \({\text{BOD}}_{5}\) and DO is equal to 0.80 and 0.70, respectively, for calibration.

Then, September 2005 data are utilized for the verification of the model (Fig. 5) and \(R^{2}\) is calculated similarly to the calibration. The value of \({\text{R}}^{2}\) equal to 0.87 and 0.72 for \({\text{BOD}}_{5}\) and DO, respectively, in the verification, reveals that the model is in agreement with the measured data with several exceptions (IWPC Technical Report, 2013).

Fig. 5
figure 5

Zarjub River water quality verification (September 2005)

The results of the optimization with bankruptcy approach

As mentioned in previous sections, this study aims to improve the river water quality at the checkpoint by pollution load reduction. The simulation–optimization models used the inflow data from August–October months.

The pollutant, BOD5, consumes DO and decreases its concentration to 0.9 mg/L in the Zarjub River. Decreasing the BOD5 concentration is one of the solutions imposed by bankruptcy rules for water quality management. Four rules have been used to control the waste load discharged from each point and non-point source pollution in the deterministic and probabilistic models.

Tables 1 and 2 illustrate the concentrations of BOD5 permitted to be discharged from pollution sources in terms of four scenarios. Pollution sources include 11 points and seven non-point sources with various BOD5 concentrations.

Table 1 shows the result of the deterministic approach in which the lowest river flow in October does the simulation–optimization model. The DO and initial BOD5 presented in the third and fourth columns are the information of pollution sources before the allocation process. Based on the CEA rule, none of the pollution sources can discharge pollutants more than 5 mg/L of BOD5 to meet DO at the checkpoint. So, only small pollution sources benefit from this method. The CEL rule subtracts 99.1 mg/L from the BOD5 of all sources, and those that have a concentration of less than 99.1 mg/L are not permitted to discharge their contaminants into the river. So, major polluters benefit from CEL rule. The P method determined that 10 percent of BOD5 is allowed to be discharged from each pollution source, point and non-point. So, all polluters cannot dispose of more than 10% of their BOD5 into the river. The final scenario is the TAL rule, which is a bit complex and depends on one condition. First, the simulation has to be run in terms of \(0.5{\text{BOD}}_{i}^{{{\text{initial}}}}\) of all polluters, and the DO concentration of the control point has to be checked. Since it is less than the standard level, the CEA rule is applied with half of the claims. The discharged BOD5 is restricted to zero and half of the initial BOD5 concentration.

Then, the uncertainty of river flow and its effect is employed in the probabilistic model. The dry month’s river flow is generated through MC and LHS to investigate their efficiency and influence on results. The mean and variance of the generated data through MC are equal to 0.7 and 1.15, respectively. Subsequently, the values are equal to 0.9 and 1.4 in the LHS technique, and lognormal distribution is used due to its appropriate function for dry season streamflow simulation (Bowers et al. 2012; Langat et al. 2019).

Table 2 shows that the BOD5 allocation trend seems quite the same as the deterministic model. Though the bankruptcy rules have similar performance, the BOD5 discharged from polluters increased due to the river flow variation and increment. Indeed, considering river flow uncertainty resulted in optimal solutions that allow the contamination sources to discharge more BOD5 into the river than the deterministic model. Comparing Tables 1 and 2 makes it obvious that the scenarios work similarly for deterministic and probabilistic models. However, the BOD5 values that are allowed to be released are different. The value of decision variables for CEA, CEL, P, and TAL was equal to 4.5, 99.1, 0.1, and 2 in the deterministic model and equal to 14.9, 91.9, 0.1, and 4.4 in the probabilistic model.

Figure 6 explains the effect of bankruptcy rules on WLA in terms of their nature. The CEA rule starts allocating BOD5 by small amounts at first. Then, the allocated pollution increases equally among pollution sources step by step until providing the water quality based on the objective function. In this way, small pollution sources achieve their claim sooner than the major ones. Since most of the pollution sources of this case study are large polluters, only one point and three non-point sources benefit the most. This proves that CEA is in favor of small polluters. The CEL rule is against CEA. It reduces an amount from each polluter’s BOD5 and permits them to release the remaining. Hence, small sources have to treat all or most of their BOD5, whereas larger ones can discharge a considerable amount of their BOD5 into the river. In the third method, the P rule, all point and non-point sources are allowed to release a certain percentage of their BOD5, so this rule does not have a similar effect on all polluters. For applying TAL in the simulation–optimization model, an extra step must be taken in advance. First, QUAL2Kw runs with half of the initial BOD5 concentration to simulate the DO concentration at the checkpoint. If the DO is less than the standard level, the CEA rule must be employed because allocating half of the initial BOD5 does not meet water quality. Still, if DO is more than the standard level, there would be another equation for calculating the BOD5 concentration. Since this case study’s condition leads to the DO that is less than the standard level, the CEA rule is applied, and it benefits the large polluters. The application of bankruptcy rules is utterly similar in both probabilistic modeling and deterministic modeling. The only difference between these two models is the influence of streamflow uncertainty that results in more released BOD5 for all scenarios.

Fig. 6
figure 6

Comparison of discharged \({\text{BOD}}_{5}\) under the status quo, probabilistic and deterministic model

The optimized DO concentrations of the deterministic method are shown in Table 3. According to the results, all of the scenarios are capable of improving DO concentration. Except for CEA, all rules resulted in the required DO. This affects the choice of the favorable scenario because if DO concentration is less than the standard level, that scenario is not qualified to satisfy the EPA’s interest. Table 3 shows that the CEA rule cannot be addressed and counted due to a lack of DO concentration at the checkpoint.

Table 3 DO concentration at the checkpoint based on the bankruptcy rules under deterministic model

Figure 7 represents DO concentration at the checkpoint in the probabilistic simulation–optimization model. The graph shows the comparison of the DO variations influenced by generated streamflows under the bankruptcy rules. The range of DO concentration under CEA, CEL, P, and TAL rules is equal to [3.6, 4.7], [4.7, 5], [4.7, 5], and [5.4, 5.8], respectively. According to the graph, the range of DO range under P and CEL rules overlaps, whereas the CEA and TAL results do not. Unlike P and CEL, the DO-probability graph of CEA and TAL approaches 5 mg/L gradually. Two probability values are used as the comparison criteria: \({\text{DO}}_{50\% }\) and \({\text{DO}}_{90\% }\) (DO concentration with 50% and 90% probability of occurrence).

Fig. 7
figure 7

DO-probability distribution under bankruptcy rules and MC at the checkpoint

The \({\text{DO}}_{50\% }\) refers to the DO concentration with a 50% probability of occurrence. It should almost be near the DO concentration, which is achieved in the deterministic model. The final results show that the \({\text{DO}}_{50\% }\) and deterministic DO values are virtually identical. This justifies the accuracy of the model because the deterministic model used the common streamflow. The \({\text{DO}}_{90\% }\) is the measurement criterion of water quality because it presents the DO concentration in 90% of the time. According to the \({\text{DO}}_{90\% }\), the TAL rule proves that it can achieve the DO concentration better than other rules.

In addition to MC, a series of streamflow is generated by the LHS technique. Figure 8 displays the DO-probability graphs to compare the results that are obtained through MC and LHS. The close values of MC and LHS graphs in each sub-figure prove LHS and MC’s similar performance of. Moreover, the LHS efficiency in the probabilistic model is demonstrated by reducing the frequency of model performance. The \({\text{DO}}_{50\% }\) values are close to each other, and the LHS method leads to larger amounts of \({\text{DO}}_{90\% }\) due to the uniform input distribution. The \({\text{DO}}_{90\% }\) obtained from LHS is higher than the MC ones under all rules.

Fig. 8
figure 8

DO-probability based on LHS and MC under bankruptcy method

Table 4 shows the influence of bankruptcy rules on waste load reduction. Since the BASI equation cannot be used for water quality issues, \(\sum {({\text{BOD}}_{5} \times Q)}\) is chosen as a criterion in this research. \(\sum {({\text{BOD}}_{5} \times Q)}\) is calculated as a measurement criterion for selecting the optimal scenario for the stakeholders based on the BOD5 of each polluter and the corresponding wastewater flow (Q). The table manifests that bankruptcy rules reduced the river waste load by 65–91% through the deterministic model. Also, those scenarios reduced waste load by about 79–94% under the probabilistic approach. The CEA is the most agreeable scenario for pollution sources in both deterministic and probabilistic models. This rule allows the polluters to release their wastewater more than any other scenario. However, according to the DO concentration at the checkpoint, CEA cannot meet the standard DO. The TAL rule acts similarly to CEA with a small limitation. Considering polluters desire, the Tal rule is the second most desirable scenario because it allows them to discharge their wastewater more than the two remaining bankruptcy rules. Since TAL can ensure the water quality factor, it seems the most suitable scenario of all. In the probabilistic model, CEL leads to 23 and P results in 23.2 units of the waste load, which does not satisfy pollution sources' interest as much as TAL, so they are rejected. The deterministic outputs illustrate that bankruptcy reduces the river waste load by around 79–94% and increases the DO concentration to near standard DO (5 mg/L). Besides, the usage of streamflow uncertainty reduces the waste load by about 65–91%.

Table 4 Waste loads criterion of bankruptcy rules under the deterministic and probabilistic models

This study introduces a new methodology for solving conflicts among pollution sources of a river by bankruptcy method. The allocation is based on the new concepts of assets and claims in the bankruptcy method for allocating pollution to the sources. The river’s DO that is influenced by self-purification was considered the asset, and the pollution loads were the claims that had to be met with through the bankruptcy rules. This method assisted in the allocation of pollution share for each pollutant. Applying uncertainty on river flows in this method led to finding the proper pollution shares in a realistic situation. Application of the bankruptcy approach and the simulation–optimization model has shown that favorable DO concentration can be almost achieved with all of the four rules. This approach can be utilized more efficiently when the parties do not cooperate, or the information is not reliable.

The MC and LHS methods are powerful tools in showing the effect of parameters on final results’ uncertainty. Although the inflow uncertainty is investigated in this study, LHS can be employed for considering the other influential factors, simultaneously. The bankruptcy rules showed sufficient flexibility to be used for quality issues as well as quantity ones. They can be utilized as strategic management for the conflict resolution between parties. In future studies, any quality variable can be assessed instead of the BOD5 and DO. This cooperative approach can prevent many unequal struggles among involved parties in a conflict.

Conclusion

In water resources management, the conflicts among beneficiaries can be solved by planning strategies that combine efficient allocation methods. The researches with optimization approaches reach the optimal solution, but all stakeholders do not always accept them. In other studies, the use of conflict resolution approaches and game theory can determine the effect of stakeholders' choice and preference and finds a way that stakeholders agree with, even if it is not optimal.

This study contains a combination of bankruptcy rules and an optimization algorithm to find optimal, applicable, and agreeable water quality management scenarios. This methodology is developed to allocate the waste load to all pollution sources with various bankruptcy rules as scenarios in probabilistic and deterministic models. Two main parameters of bankruptcy refer to stakeholders' claims and the system asset. In this study, the concept of an asset refers to the river’s DO concentration, and the discharged waste load (BOD5) is the claims that must be allocated fairly to polluters.

The results indicate that the bankruptcy rules are applicable in river water quality management as various scenarios that include pollution load reduction for decision-making and negotiation among beneficiaries. However, the probabilistic approach brought more benefits for dischargers by releasing more \({\text{BOD}}_{5}\) into the river. According to the deterministic results, the bankruptcy method reduces the river waste load by around 79%–94%, and the use of streamflow uncertainty reduces it by about 65%–91%. Based on the dischargers' interest, although CEA and TAL rules are beneficial for the pollution sources due to BOD5’s the higher permitted to discharge, the CEA is the rejected scenario because it cannot reach the standard level of DO. Therefore, the TAL rule was chosen with higher DO values than other scenarios and favors small polluters. Comparing MC and LHS results in the probabilistic method reveals that MC can be replaced with LHS to achieve similar results in a shorter time.

Considering economic objectives such as treatment cost or penalty functions can further promote the research. Applying other bankruptcy rules and other uncertainty methods such as fuzzy theory can provide a comprehensive methodology for continuing the current study.