Introduction

Nowadays most of the rivers around the world are highly polluted because many wastewater streams are discharged to the rivers without an adequate treatment. Usually central treatment facilities have been considered to clean the polluted rivers, where the treatment technologies have been installed at the end of the rivers (Best et al. 1998; Kennish 1999). Recently, the concept of distributed treatment system has been investigated systematically, and several methodologies have been developed and applied with excellent results to reduce the treatment costs of industrial effluents (e.g.,, Wang and Smith 1994; Kuo and Smith 1997; Doyle and Smith 1997; Galan and Grossmann 1998; Alva-Argaez et al. 1998, 1999; Benko et al. 2000; Savelski and Bagajewicz 2000, 2001, 2003; Hernandez-Suarez et al. 2004; Gunaratnam et al. 2005; Gabriel and El-Halwagi 2005; Karuppiah and Grossmann 2006; Teles et al. 2008; Putra and Amminudin 2008; Ng et al. 2009; Ponce-Ortega et al. 2010; Nápoles-Rivera et al. 2010). The aforementioned methodologies have demonstrated that the distributed treatment system is better than the centralized treatment system; however, such methodologies have only considered the process and environmental constraints on the industrial wastewater streams for treating them before discharge, without evaluating how the resulting discharges affect the sustainability of the surrounding watershed even if it meets the environmental regulations imposed by the authorities.

On the other hand, the rivers in many countries receive increasing amounts of untreated wastewaters from industries, residential areas, and agricultural zones. These discharges have a great impact on the surrounding environment, affecting not only the water quality and ecological integrity in a watershed but also the social and economic development in that region. Therefore, there is a need to develop models for the sustainable management of watersheds. In this context, Cooper (1986) employed the Streeper–Phelps model, which considers the river as a plug flow reactor for the oxygen dynamics in the system. Drolc and Zagorc-Koncan (1996) used the water quality model QUAL2E to evaluate the impact of the wastewater discharges on the dissolved oxygen concentration in the river Sava near to Ljubljana. The material flow analysis (MFA) technique has been particularly useful for tracking chemical species that cause pollution in the rivers. The MFA has also been used to analyze the causes of pollution problems in a region considering all relevant activities, such as water supplies, water uses, discharges of polluted streams, physical phenomena, and chemical and biological processes that impact the rivers. In this regard, Baccini and Brunner (1991) developed an MFA model to analyze ecosystems with human activities that exchange mass and energy with their surroundings. In addition, Lampert and Brunner (1999) proposed an MFA model to track the major nutrients in the Danube River. Drolc and Zagorc-Koncan (2002) completed a study using the strategy of MFA for the Krka river in Slovenia, where they determined that agriculture contributes significantly to the total annual phosphorus load in the macroscopic system in addition to the wastewater treatment plants. El-Baz et al. (2005a) combined a simulation tool with the MFA technique to provide a complete analysis and useful information for the transport and destination of the key pollutants in a watershed. This methodology was used in the Egyptian drainage system Bar-El Baqar, where the targeted species were ammonium ions. Then, El-Baz et al. (2005b) developed a systematic approach to provide solution strategies joining an MFA model with synthesis tools to detect alternative optimal solutions. Lovelady et al. (2009) inverted the environmental quality model (MFA) and included it into an optimization formulation to determine the maximum allowable target for the process discharges while meeting the overall environmental requirements of the watershed. The above mentioned works have produced significant advances in understanding the characteristics of watersheds and the interactions between watersheds and their surroundings. However, those authors have not provided a general framework for designing distributed treatment facilities for integrated watersheds with the goal of supporting their sustainable management. Therefore, developing an efficient methodology for selecting the optimal location of effluent treatment and optimal treatment units from a large pool of feasible ones then becomes necessary.

This paper presents a general optimization formulation for designing distributed treatment systems of effluents discharged into the rivers at the lowest possible cost to satisfy the sustainability of the watershed system (i.e., the total discharges do not exceed the self-purification capacity of rivers). The proposed model provides appropriate and economical locations for the effluent treatment tasks to achieve specific targets for the water quality through the watershed. The model considers the optimal selection of the tributaries to be treated (configuring the distributed treatment system), identifying the removal efficiency for the treatment units required along the macroscopic system, which depends on the restrictions for the water quality along the river. The model is based on the MFA technique to track all discharges through the river and to consider the sustainability for the final disposal. In addition, the model can incorporate water quality constraints for the different sections of the watershed that are established by the users of water such as agricultural, industrial and residential sectors. Because the economic (i.e., total annual cost of the distributed treatment system) and environmental (i.e., the desired characteristics of the discharge to the final disposal of the watershed) objectives contradict each other, the Pareto sets for different water quality requirements are generated.

Problem statement

Figure 1 shows a typical watershed system, where the main river is fed by several tributaries (T i,j ), and the concentration of the river (CQ i,j ) is changing along its path due to the existence of loadings from point sources such as industrial and domestic wastewaters, and non-point sources that are related to atmospheric deposition and adjacent agricultural areas. These effluents can have high concentrations of pollutants, decreasing the self-purification capacity of the system and causing an adverse impact on the environment (e.g., the excess of nitrates and phosphates from fertilizers or sewage yields eutrophication, which represents the depletion of the oxygen in the water and induces reductions in specific fish and other animal production; another example is the arsenic from the herbicides that causes the death of the wildlife in the rivers and lakes). A set of treatment operations is available for each effluent to achieve the environmental limits imposed on the different sections of the watershed. This approach gives a distributed treatment of effluent streams so that the volumes to be treated can be reduced. Each treatment operation has a removal ratio for each one of the n different components present in the effluents. A fictitious treatment unit can be used to model the case when the effluent does not need to be treated or if only a percentage of it needs to be treated to meet the maximum permissible concentration in the catchment area (CQdis). There are intermediate restrictions in the places where certain conditions are required to water use. For example, if the water from a specific site is used for agriculture, restrictions are placed to allow meeting the required water quality (CQdesired); the same is made for domestic and industrial uses. To satisfy these constraints, the behavior of the river is simulated taking into account all input and output flows through the MFA technique.

Fig. 1
figure 1

Superstructure for the distributed treatment system

The objective function is to minimize simultaneously the total annual cost (TAC) and the environmental impact, which is obtained by minimizing the discharge concentration to the main river and to the catchment area. Therefore, this is a multi-objective optimization problem. The capital and operational costs for the treatment units depend on the type of unit selected, the flow rate treated, the inlet and outlet concentration of pollutants, the configuration, and the operating conditions. To avoid numerical complications during the optimization process, in this paper, several treatment units with given configurations and operating conditions are simulated prior to the optimizations process, taking into account only treatment technologies that are appropriate for removing the pollutants in the watershed. This approach provides removal efficiencies for the pollutants and cost expressions that depend only on the flow rate treated. To consider the effect of the inlet concentration to the treatment units, a set of constraints for the inlet concentration for each discretized unit can be imposed to the model, and the exit concentrations are related to the removal efficiencies determined by the simulation process. To consider the economies of scale, the capital cost for the treatment units includes the fixed and variable costs as well as an exponential factor.

Model formulation

First, the sets used in the model formulation are defined for a better understanding. i is a subscript used to denote any section of the river, whereas Ni corresponds to the total number of sections of the river defined for a specific problem; I is a set that contains all i. j is a subscript used for the effluents discharged to the river, J is a set that contains all j. x is a subscript used to denote the treatment units (including the fictitious interceptor used for modeling the bypass streams), and the subscript l is used for the number of contaminants.

The MFA model considers all the inputs to the main river, the use and discharge of agricultural activities, and the discharges with and without treatment of wastewater from industrial and domestic sectors. Also, the model takes into account the natural phenomena of precipitation, filtration, and evaporation. These events can alter significantly the composition of the materials transported in the river; therefore, to provide an adequate follow-up to the average composition of the hazardous components, it is required to divide the river into sections called reaches where the average concentration can be considered constant (these sections are represented in Fig. 2a). The flow rate and concentration in each section of the river differ from those of another part of the river, due to the inlet and outlet flows. This corresponds to a series of CSTR reactors, as shown in Fig. 2b. The effluents are discharged into the main river, which receives effluents with and without treatment from industrial and agricultural sources. The flows (T i,j ) and concentration (CT i,j ) of the tributaries change the flow and concentration of the section of the river into which they are discharged.

Fig. 2
figure 2

MFA model representation

Furthermore, the model involves reaction terms to take into account the chemical and biochemical reactions that are carried out by the flora and fauna through the river, which can degrade or produce hazardous components. Therefore, it is very important to consider these terms to track the pollutants through the watershed.

The model formulation allows considering the balance between the concentration of the discharge to the catchment area and the associated total cost, which is strongly related to the location and selection of the treatment systems; then, stricter environmental restrictions yield higher total annual cost.

Each available treatment unit is characterized in terms of the type of contaminants present in the effluents, the design parameters and operating variables, the inlet concentrations, the outlet concentrations (i.e., the environmental limits specified in the watershed), and the amount of effluent that is treated. Therefore, the removal efficiency for each contaminant in the treatment units and the cost of a treatment unit can be expressed by the following functions:

  • α x,l  = α x,f (OperatingParameters, Configuration, InletConditions, OutletConditions, FlowrateTreated), ∀l ∈ Lx ∈ X

  • Cost x,l  = Cost x,l (OperatingParameters, Configuration, InletConditions, OutletConditions, FlowrateTreated), ∀l ∈ Lx ∈ X

In order to simplify the optimization process, a series of simulations for specific treatment units (depending on the pollutants) are performed before the optimization (for given configurations and operating conditions) to provide the required data to estimate the removal efficiency and the unit cost for each available treatment technology involved in the superstructure. As a result, the concentration at the outlet of the treatment operation can be expressed as a function of the selected treatment unit and the inlet concentration C out x,l  = C in x,l α x,l , ∀l ∈ Lx ∈ X; also, the total cost of each available treatment unit can be represented as a function of the treated flow rate (i.e., for the capital costs Ccap x  = CF x  + VC x fs γ x x ∈ X and for the operational costs Cop x  = Cu op x fs x x ∈ X). Therefore, the parameters for the cost functions for the treatment units (i.e., CF x , VCx, Cu op x , and γ) are determined before the optimization process, which only must select the treatment units used and the treated flow rates, thus yielding the models that can be easily optimized.

The equations for the model are described as follows:

Overall mass balance for each reach

The exit flow rate from each reach i (Q i ) is equal to the inlet flow rate to the reach (Q i−1) plus the industrial discharges (IND i ), direct discharges (D i ), the average precipitation (P i ), the sum of all effluents inlet to the reach \( \sum\limits_{j = 1}^{{N_{{{\text{Ef}}l,i}} }} {T_{i,j} } \) minus the extractions for filtration and evaporation (L i ) and the use of water in that section of the river (U i ).

$$ Q_{i} = Q_{i - 1} + P_{i} + D_{i} + {\text{IND}}_{i} + \sum\limits_{j = 1}^{{N_{{{\text{Ef}}l,i}} }} {T_{i,j} - L_{i} - U_{i} } , \quad \forall i \,\in\, I $$
(1)

Notice that the proposed model considers different points (i.e., industrial discharges, direct discharges, treated and untreated discharges) and non point (i.e., precipitation, agricultural discharges and untreated discharges) discharges.

Component balance for each reach

The exit flow rate from each reach for the hazardous compound (Q i CQ i,l ) is equal to the inlet flow rate to the reach (Q i−1CQ i−1,l ), plus precipitation (P i CP i,l ), direct discharges (D i CD i,l ), industrial discharges (IND i CIND i,l ), effluents \( \sum\limits_{i = 1}^{{N_{{{\text{Ef}}l,i}} }} {T_{i,j} } {\text{CT}}_{i,j,l} \), minus the loss (L i CL i,l ) and the use (U i CU i,l ), and minus the degradation for the component in the reach (\( \mathop \int \limits_{V = 0}^{{V_{i} }} r_{i} dV_{i} \)). Therefore, the component balance for each reach is stated as follows:

$$ Q_{i} {\text{CQ}}_{i,l} = Q_{i - 1} {\text{CQ}}_{i - 1,l} + P_{i} {\text{CP}}_{i,l} + D_{i} {\text{CD}}_{i,l} + {\text{IND}}_{i} {\text{CIND}}_{i,l} + \sum\limits_{i = 1}^{{N_{{{\text{Ef}}l,i}} }} {T_{i,j} } {\text{CT}}R_{i,j,l} - L_{i} {\text{CL}}_{i,l} - U_{i} {\text{CU}}_{i,l} - \mathop \int \limits_{V = 0}^{{V_{i} }} r_{i,l} dV_{i} ,\quad \forall i\, \in\, I,l\, \in\, L $$
(2)

The last term of Eq. 2 corresponds to the reaction for each reach, and it can be expressed as a first-order kinetic reaction as follows:

$$ \int\limits_{V = 0}^{{V_{i} }} {r_{i,l} } dV_{i} = K_{i,l} \:{\text{CQ}}_{i,l}\:V_{i} $$

where K i,l is the Arrhenius rate constant that must be determined experimentally, and V i is the volume for the section i of the river. The reactive term \( \int\nolimits_{{V_{i} = 0}}^{{V_{i} }} {r_{i,l} } dV_{i} \) is very interesting because it considers the chemical and biochemical reactions that take place in the river by the flora and fauna inside the system, which can produce or eliminate the components.

Mass balances for tributaries

The mass balance for the tributary j that discharges to the reach i is described as follows:

$$ T_{i,j} = S_{i,j}^{\text{untreated}} + S_{i,j}^{\text{treated}} + {\text{IND}}_{i,j} + P_{i,j} + D_{i,j} - L_{i,j} - U_{i,j} ,\quad \forall i\, \in\, I,\,j\, \in\, J $$
(3)

The total flow rate that leaves the tributary j and enters to the reach i (T i,j ) is equal to the sum of the discharge with or without treatment (S treated i,j S untreated i,j ), industrial wastewater (IND i,j ), the flow of precipitations (P i,jj ), the agricultural discharges (D i,j ) minus the loss by evaporation and filtration (L i,j ), and the use or extraction streams (U i,j ).

Component balances for each tributary

The flow rate for each component leaving each tributary j and directed to the reach i is calculated as follows:

$$ T_{i,j} {\text{CT}}_{i,j,l} = S_{i,j}^{\text{untreated}} {\text{CS}}_{i,j,l}^{\text{untreated}} + S_{i,j}^{\text{treated}} {\text{CS}}_{i,j,l}^{\text{treated}} + {\text{IND}}_{i,j} {\text{CIND}}_{i,j,l} + P_{i,j} {\text{CP}}_{i,j,l} + {\text{D}}_{i,j} {\text{CD}}_{i,j,l} - L_{i,j} {\text{CL}}_{i,j,l} - U_{i,j} {\text{CU}}_{i,j,l} - \mathop \int \limits_{V = 0}^{{V_{i,j} }} r_{i,j,l} dV_{i,j} ,\quad \forall i\, \in\, I,\,j\, \in\, J,\,l \,\in\, L $$
(4)

Notice that the component balances for each tributary include the reaction term \( \int\limits_{V = 0}^{{V_{i,j} }} {r_{i,j} dV_{i,j} } \) to consider the natural degradation of the components in the system. To determine this reactive term, usually first-order kinetic reactions are considered.

Agricultural discharges and uses

The agricultural discharges D i,j and uses U i,j are proportional to the agricultural areas surrounding the watershed. These discharges and uses are calculated as follows:

$$ D_{i,j} = \lambda_{i,j} A_{i,j} ,\quad \forall i\, \in \,I,\,j \,\in\, J $$
(5)
$$ U_{i,j} = \beta_{i,j} A_{i,j} ,\quad \forall i\, \in \,I,\,j\, \in\, J $$
(6)

where λ i,j is the flow rate per unit of area in m3/acre s, β i,j is the agricultural use of water per unit of area for the tributary j in m3/acre s, and A i,j is the area that covers the tributary j in acres.

Design for the distributed treatment system

There are several regeneration units that can be used to treat the different tributaries discharged to the main river (see Fig. 3). For a macroscopic system, usually the number of tributaries is large; many of these tributaries can be treated to satisfy the environmental constraints and to ensure the sustainability of the system. Therefore, the problem consists in determining the flow rate of the tributaries that must be treated and the removal efficiency that must be used for accomplishing these constraints at the minimum cost. To design this distributed treatment system, the following disjunction is used for each tributary j that discharges to the reach i:

Fig. 3
figure 3

Superstructure for n interceptors for any effluent

$$ \left[ \begin{gathered} Y_{i,j} \\ T_{i,j} = \sum\limits_{x \in X} {{\text{fs}}_{i,j,x} } \\ \sum\limits_{x \in X} {{\text{fs}}_{i,j,x} } (1 - \alpha_{x,l} ){\text{CT}}_{i,j,l} = T_{i,j} {\text{CT}}R_{i,j,l} ,\forall l\, \in \,L \\ \left[ \begin{gathered} Z_{i,j,x} \hfill \\ {\text{fs}}_{i,j,x} \ge \Upomega_{i,j,x}^{\min } \hfill \\ {\text{fs}}_{i,j,x} \le \Upomega_{i,j,x}^{\max } \hfill \\ \end{gathered} \right] \vee \left[ \begin{gathered} \neg Z_{i,j,x} \hfill \\ {\text{fs}}_{i,j,x} = 0 \hfill \\ \end{gathered} \right],\forall x\, \in \,X \\ \end{gathered} \right] \vee\left[ \begin{gathered} \neg Y_{{i,j}} \\ {\text{CT}}R_{{i,j,l}} = CT_{{i,j,l}} ,\forall l \in L \\ fs_{{i,j,x}} = 0,\forall x \in X \end{gathered} \right] \quad \forall i\, \in \,I,\forall j\, \in \,J $$

In previous disjunction, CT i,j is the concentration for the tributary j that discharges to the reach i without any treatment, whereas CTR i,j is the concentration after the treatment. Previous model has a nested disjunction. In the first level, the Boolean variable Y i,j is associated to the existence of the treatment plant. If it is true, then the design equations of the treatment plant apply; otherwise, if it is false (Y i,j ), then there is no treatment unit, and the final discharge concentration is equal to the inlet concentration in the effluent. In this case, also the cost of the treatment unit (interceptor) is zero. In the second level, the Boolean variable Z i,j,x is associated with the existence of the segregated flow in the treatment plant; when the segregated flow exists, Z i,j,x is true. The segregated flow rate must be greater than the lower limit Ω min i,j,x and lower than the upper limit Ω max i,j,x . In addition, CTR i,j.l is the final concentration discharged from the tributary j to the reach i for component l.

To reformulate previous disjunction as a set of algebraic equations, the Boolean variables are transformed into binary variables. This way, when the Boolean variable is true, the associated binary variable is equal to one, and when the Boolean variable is false, the associated binary variable is equal to zero. Finally, previous disjunction is modeled using the convex hull reformulation (see Raman and Grossmann 1994; Ponce-Ortega et al. 2009a) to obtain the following set of equations.

First, the continuous variables are disaggregated for each disjunction as follows:

$$ {\text{CT}}R_{i,j,l} = {\text{CT}}R_{i,j,l}^{d1} + {\text{CT}}R_{i,j,l}^{d2} ,\quad \forall i\, \in \,I,j\, \in \,J,l\, \in \,L $$
(7)

Then, the equations inside each disjunction are stated in terms of the disaggregated variables:

$$ y_{i,j} T_{i,j} = \sum\limits_{x \in X} {fs_{i,j,x}^{{}} } ,\quad \forall \,i \in \,I,j \,\in\, J $$
(8)
$$ \sum\limits_{x \in X} {{\text{fs}}_{i,j,x} \left( {1 - \alpha_{x,l} } \right){\text{CT}}_{i,j,l} } = T_{i,j} {\text{CT}}R_{i,j,l}^{d1} ,\quad \forall i\, \in \,I,j\, \in \,J,l\, \in \,L $$
(9)
$$ {\text{CT}}R_{i,j,l}^{d2} = {\text{CT}}_{i,j,l} (1 - y_{i,j} ),\quad \forall i\, \in \,I,j\, \in \,J,l\, \in \,L $$
(10)

Upper limits are required for the disaggregated variables:

$$ {\text{CT}}R_{i,j,l}^{d1} \le {\text{CT}}_{i,j,l} y_{i,j} ,\quad \forall i\, \in I,j \,\in\, J,l \,\in\, L $$
(11)
$$ {\text{CT}}R_{i,j,l}^{d2} \le {\text{CT}}_{i,j,l} (1 - y_{i,j} ),\quad \forall i\, \in \,I,j\, \in \,J,l\, \in \,L $$
(12)

And the equations for the nested disjunctions are stated as follows:

$$ fs_{i,j,x} \ge \Upomega_{i,j,x}^{\min } z_{i,j,x} ,\quad \forall i\, \in \,I,j\, \in \,J,x\, \in \,X $$
(13)
$$ fs_{i,j,x} \le \Upomega_{i,j,x}^{\max } z_{i,j,x} ,\quad \forall i\, \in I,j \,\in\, J,x \,\in\, X $$
(14)

Finally, the following logical relationships are required to ensure that any treatment unit can be used only when the location is selected to treat the tributary:

$$ (1 - y_{i,j} ) + \sum\limits_{x} {z_{i,j,x} \ge 1} ,\quad \forall i\, \in\, I,j \,\in\, J $$
(15)
$$ y_{i,j} + (1 - z_{i,j,x} ) \ge 1,\quad \forall i \in I,j \,\in\, J,x\, \in\, X $$
(16)

In the above relationships, if the Boolean variable (Y i,j ) is true, then the associated binary variable y i,j is one. In this case, CTR d2 i,j,l must be zero and CTR i,j,l is equal to CTR d1 i,j,l according to Eqs. 12 and 7, respectively; therefore, Eqs. 9 and 10 are correctly applied. On the other hand, when the Boolean variable Y i,j is false, then the associated binary variable y i,j is zero, and the disaggregated variable CTR d1 i,j,l also is zero because of relationship (11); as a result, Eqs. 8 and 9 do not apply, and only Eq. 10 is applied. Similarly, when y i,j is one, then at least one z i,j,x must be one (see relationship (15)), and the relationships (13) and (14) apply. On the other hand, when y i,j is zero, all z i,j,x must be zero because of relationship (16), and fs i,j,x is zero because of relationship (15).

Constraints for the quality of specific reaches

Through the watershed, water is extracted for several types of uses like industrial, agricultural (including different types of agriculture) and domestic (for different purposes). Therefore, water is extracted from specific places for these different activities, and the water quality required depends on the type of use for this water. This way, the composition for specific pollutants is restricted according to the water use in specific sections of the watershed. The proposed model is able to consider these constraints through the following relationships:

$$ {\text{CQ}}_{n\left( i \right)} \le {\text{CQ}}_{n\left( i \right)}^{\text{desired}} ,\quad \forall n\left( i \right) \,\in\, N\left( I \right) $$
(17)

where N(I) represents a subset of reaches n from all the reaches r that require a specific water quality.

Objective function

The model is formulated as a multi-objective optimization problem for the simultaneous minimization of the total annual cost and the final concentration for the hazardous compound at the final disposal for the watershed as follows:

$$ {\text{OF}} = \{ \min {\text{TAC}};\min {\text{CQ}}^{\text{dis}} \} $$
(18)

Notice that these two objectives contradict each other; in other words, when the concentration in the final disposal decreases, the total annual cost to treat the effluents increases; whereas, when the concentration at the final disposal is relaxed, the total annual cost decreases.

The total annual cost objective function is expressed as follows:

$$ {\text{TAC}} = k_{\text{f}} \sum\limits_{i} {\sum\limits_{j} {\sum\limits_{x} {\left[ {{\text{FC}}_{x} z_{i,j,X} + {\text{VC}}_{x} {\text{fs}}_{i,j,x}^{{^{\gamma } }} } \right]} + H_{\text{Y}} \sum\limits_{i} {\sum\limits_{j} {\sum\limits_{x} {{\text{Cu}}_{x}^{\text{op}} {\text{fs}}_{i,j,x} } } } } } $$
(19)

In previous equation, TAC is the total annual cost ($/year), which is equal to the capital cost for the treatment units required to treat any effluent (including the fixed cost and variable cost) and the operating cost for the treatment units. k f is a factor used to annualize the capital costs (year−1), H Y is the number of hours that the plant operates per year (hours/year), FC x is the fixed cost and VC x is the variable cost for the interceptor x, Cu op x is the unitary cost for the operation of unit x and, finally, γ is the exponent for the capital costs to consider the effect of the economies of scale.

To determine the Pareto set of optimal solutions that compensate both objectives, the constraint method is used in this paper (see Haimes et al. 1971). In this method, the basic strategy is to transform the multi-objective optimization problem into a series of problems with a single target by choosing only one of the objectives as the objective to be minimized (in this case, the TAC) and defining the others as constraints (in this case, the discharge concentration CQdis to the final disposal). This strategy allows identifying the minimum cost required for a given concentration in the final disposal; at the same time, this methodology allows identifying the additional investment required to satisfy stricter environmental constraints, which is very useful when it is important to take governmental decisions associated with these problems.

Remarks for the model

  • The model formulation presents the possibility to select the optimal distributed treatment system for the watershed and it consists of a mixed integer non linear programming problem (MINLP).

  • The model allows for the optimal selection of different treatment technologies through the selection of different removal efficiencies and their corresponding unit costs.

  • The multi-objective formulation allows one to identify the set of optimal solutions that are very useful for governmental decisions.

  • The model for the watershed is based on an MFA formulation, and it considers the main extractions and discharges to the rivers, which are necessary to determine the mean flow rates and concentrations for the hazardous compounds through the watershed.

Result and discussions

Three case studies are presented to show the application of the proposed model. The three case studies are solved as MINLP problems with the help of solver DICOPT (Viswanathan and Grossman 1990) included in the software GAMS (Brooke et al. 2006). The first one (single key component problem) and the second one (multi-component problem) correspond to the Bahr El-Baqar drainage located in Egypt, which is one of the major drains in the Nile Delta, and the third one is a multi-component problem for the Balsas river that is one of the largest rivers in Mexico. Prior to the optimization process, depending on the pollutants to be removed for each case study, several treatment units with given configurations and operating conditions were simulated to determine the removal efficiency, as well as the capital and operational unit costs. These three examples are presented as follows:

Example 1

The Bahr El-Baqar drainage (see Fig. 4) is the longest drainage in the east of the Nile Delta in Egypt. The starting point originates from the intersection of the drainage Qalyoubia and the drainage Belbies beginning in the northern part of Cairo. The end point is the entrance on the south side of the Lake Manzala, which has an area of 1000 km2 and an average depth of 1 m. The drain receives several types of discharges including agricultural drainage, domestic wastewater treated and untreated, and industrial wastewater streams. The details of the drainage system have been reported by Lovelady et al. (2009). For this case, the phosphorus has been considered as the key compound to control the eutrophication problem due to the many agricultural areas and fertilizers plants that are located around this drainage; in addition, this allows us to apply the proposed methodology to a single key compound problem. The flows of treated sewage and untreated streams from agricultural, industrial, and municipal sources are discharged into the tributaries, and the flows of the water using activities supplied for each tributary are considered, being the response variables the concentration discharged to each reach and the flows for the tributaries that discharge to the reaches. The characteristics of the Bahr El-Baqar system are used as input data of the MINLP model presented in this paper.

Fig. 4
figure 4

Representation for the Bahr El-Baqar drain

The distributed treatment system can be placed along the river to assist the removal of phosphorus and thereby to decrease the final concentration in the catchment area, which has a value of 1.3 ppm before the installation of the treatment system.

To solve this case study, the following assumptions have been considered (Lovelady et al. 2009):

  • Negligible precipitation: The flow of precipitation has been eliminated according to the climate of Egypt.

  • Insignificant loss: Evaporation of water is very small compared to convective flows.

  • The phosphorus concentration for existing wastewater treatment plants (WWTP) takes a value of 9 mg/L. This assumption is based on laboratory tests for different treatments.

  • The concentration of phosphorus for the wastewater without treatment is 15 mg/L.

  • The phosphorus concentration for the treated water is 9.75 mg/L.

  • The phosphorus concentration of the agricultural wastewater streams is 1.5 mg/L.

  • The chemical reaction term for the degradation of phosphorus in the reaches takes the following form:

$$ \int\limits_{V = 0}^{{V_{i} }} {r_{i} dV_{i} = k {\text{CQ}}_{i} V_{i} } ,\quad \forall i\, \in \,I $$

where k is the reaction rate constant determined experimentally (Lovelady et al. 2009), CQ i is the concentration of the phosphorus in the reach, and V i is the volume of the section of the river.

On the other hand, the chemical reaction term for the effluents takes the following form:

$$ \int\limits_{V = 0}^{{V_{i,j} }} {r_{i,j} dV_{i,j} = k{\text{CT}}_{i,j} V_{i,j} ,\quad \forall i\, \in\, I,j\, \in\, J} $$

where k = 9.041909 × 10−6/s for all reaches and effluents. In addition, the value for λ i,j is 0.000066 m3/acre s for all reaches, for reaches 1–6, 8, 12–15 β = 0.000023 m3/acre s, and for reaches 7, 9–12 β = 0.000011 m3/acre s. The operating time of the plant (H Y) is 8000 h/year, and the factor used to annualize the capital costs (k f) is 0.25 year−1. Table 1 shows the unitary costs and efficiencies for the interceptors considered.

Table 1 Treatment units data for the Example 1

The model consists of 360 binary variables, 831 continuous variables, and 920 constraints, and it is solved in 0.16 s of CPU time for each point of the Pareto curve.

Figure 5 displays the optimal Pareto curve. The conflict between the two objectives is shown in this figure; by decreasing the concentration of discharge CQdis to the catchment area, the TAC increases considerably. This is a consequence of increasing the number of effluents to be treated, which also increases the number of treatment units required. From this Pareto curve, the solution corresponding to a discharge concentration to the final catchment lower than 0.40 ppm has been selected, because for this case a reasonable cost for a good water quality is obtained. This solution is represented in Fig. 6, which illustrates the distributed treatment units required to satisfy the environmental constraints at the lowest cost. Figure 6 shows that 7 treatment units located along the macroscopic system are needed to satisfy the environmental constraints along the river and that the final disposal has a concentration lower than 0.40 ppm. It is important to note that when the environmental constraints become stricter, the number of treatment units and the associated costs increase exponentially.

Fig. 5
figure 5

Pareto curve for Example 1

Fig. 6
figure 6

Optimal configuration for Example 1 for a concentration lower than 0.40 ppm

Example 2

In this case, the same system of the drainage Bahr El-Baqar and Lake Manzala has been considered; however, it has been extended to include two hazardous pollutants: phosphorus (indicated as pollutant number 1) and sulfur (indicated as pollutant number 2), to show the applicability of the proposed methodology to a multi-pollutant problem (both are key compounds to avoid environmental problems). The concentrations for the different inlet and outlet streams for this case study are shown in Table 2. The reactions for the degradation of the pollutants follow first-order kinetic models, and the constants for the phosphorus are the same than in the Example 1; whereas, for the sulfur the constant k 2 = 0.8832452E − 5/s has been considered. The operating time of the plant (H Y) is 8000 h/year and the factor used to annualize the capital costs (k f) is 0.25. Table 3 shows the unitary costs and efficiencies for the interceptors considered.

Table 2 Concentrations of the key components for Example 2
Table 3 Unitary costs and efficiencies for interceptors for Example 2

The concentration in the final disposal must be lower than the one that naturally the system is able to degrade avoiding the accumulation of pollutants. Originally, without the distributed treatment system, the concentrations that leave the system are 1.3 mg/L for phosphorus and 1.132 mg/L for sulfur. This problem consists of 459 binary variables, 1151 continuous variables, and 2910 constraints. The solution of the MINLP problem for each point of the Pareto curve consumes approximately 1.2 s. Figure 7 shows the optimal solutions for various constraints placed on the final disposal for the key components. Each curve represents different upper concentrations in the final disposal for the sulfur compound. As expected, the curve for the strictest constraint for the sulfur (i.e., CQ2 ≤ 0.4 ppm) has the highest cost, because it requires more treatment units for treating bigger effluents and, consequently, higher capital and operational costs that increase the total annual cost. The curves for discharges with sulfur concentrations of CQ2 ≤ 0.6 ppm, CQ2 ≤ 0.8 ppm, and CQ2 ≤ 1.132 ppm present the same behavior, because they use the same number of treatment units to satisfy the constrains imposed at the final disposal but changing the location to place them.

Fig. 7
figure 7

Pareto curves for Example 2

The decision maker can select the solution that best satisfies his specific requirements. On the other hand, the governments can identify the additional investment required for a given concentration in the final disposal. Two scenarios have been selected to be presented in this paper, in which the concentrations for the key components are reduced so that the system is able to degrade the contaminants in the tributaries.

First scenario (solution A)

The Pareto curve generated for the strictest limit, CQ2 ≤ 0.4 ppm, for the discharged concentration of sulfur is shown in Fig. 7. This solution satisfies the requirements for the decision maker. Table 4 shows the location of the treatment units, the efficiency of the interceptors, and the concentration discharged to the reaches (CTR i,j,l ). 28 units are required to satisfy these constraints yielding a total annual cost of $1,800,000/year.

Table 4 Optimal configuration for the Case A for Example 2

Second scenario (solution B)

Solution B is a point selected from the three curves generated for the discharge concentrations of CQ2 ≤ 0.6 ppm, CQ2 ≤ 0.8 ppm, CQ2 ≤ 1.132 ppm, because they have the same behavior (i.e., they use the same number of units to meet the constraint placed on the final disposal). The point B is in equilibrium because if we move to the left of the graph, then the environmental impact is reduced but the cost increases exponentially; on the other hand, if we move rightward, then the cost is reduced but the environmental impact increases. Figure 8 shows the optimal solution for the concentrations discharged of CQ1 ≤ 0.4 ppm for the key component 1 and CQ2 ≤ 1.132 ppm for the key component 2. The optimal solution indicates that six treatment units are required to satisfy the restriction imposed in the catchment area with a total annual cost of $1,250,000/year.

Fig. 8
figure 8

Optimal configuration for the Case B for Example 2

Notice that when more stringent constraints on the final disposal are needed, more treatment units are required for treating the effluents that are discharged into the main river. Furthermore, the proposed approach allows one to distribute the treatment units (optimizing the location, type of treatment unit, and the treated flow rate) to yield the solution with the minimum cost for a given water quality through the watershed and to ensure the sustainability for the final disposal.

Example 3

The Balsas watershed system (CONAGUA 2008, 2009) is considered for this example. This system is one of the largest rivers in Mexico, which supplies several water flows with different qualities for attending the water using activities that take place around this macroscopic system. Figure 9 shows the main streams for the Balsas system where two components are considered as the key pollutants. The following assumptions are made for the pollutants of this example:

Fig. 9
figure 9

Balsas system

  • The concentrations of the sanitary discharges without treatment (CS untreated i,j ) are 0.5 ppm for the first pollutant and 0.35 ppm for the second pollutant.

  • The concentrations of the sanitary discharges with treatment (CS treated i,j ) are 0.03 ppm and 0.09 ppm for pollutants 1 and 2, respectively.

  • The concentrations of the industrial discharges (CIND i,j ) for pollutants 1 and 2 are 0.06 ppm and 0.03 ppm, respectively.

  • The concentration of the precipitation (CP i,j ) is 0 ppm for both components.

  • The concentration of the agricultural discharges (CD i,j ) is 0.055 ppm for the first component, and for the second component, it is 0.065 ppm.

  • The concentrations of the industrial and sanitary discharges (CH i ) are 0.07 ppm and 0.1 ppm for pollutants 1 and 2, respectively.

  • The concentrations of the direct discharges (CD i ) are 0.075 ppm and 0.095 ppm for pollutants 1 and 2, respectively.

Table 5 shows the data for the treatment units considered for the Example 3. Besides, the chemical interaction between the pollutants and the environment is represented by a first-order reaction with kinetic constants of k 1 = 0.9041909E − 5/s and k 2 = 0.8832452E − 5/s for pollutants 1 and 2, respectively. In addition, in this case λ i,j  = 0.000148 m3/ha s and β i,j  = 0.000296 m3/ha s, the operation time is 8400 h/year and the factor used to annualize the capital costs is 0.1 year−1. The constraints for the discharge concentrations at the final disposal for the key components are 0.037 ppm for the component 1 and 0.07 ppm for the component 2.

Table 5 Data for the available interceptors for Example 3

This problem consists of 2530 binary variables, 8515 continuous variables, and 9205 constraints. Each point of the constraint method is solved in an overage time of 300 s. The main river is divided into 23 reaches to quantify and track the key elements along the macroscopic system. Specific restrictions for the water quality for the reaches 5 and 16 are imposed to the model because the water using activities (see Fig. 9). Three scenarios are presented to show the model behavior for the given constraints in the final disposal.

Case A

To achieve the sustainability of the system, it is necessary to reduce the concentration of the contaminants that are initially in the system. In the case A, the concentration in the final disposal for component 2 is manipulated as a constraint (i.e., CQ2 ≤ 0.07 ppm), whereas the concentration for the component 1 is restricted between lower and upper bounds to produce the Pareto curve shown in Fig. 10. One solution of the set of optimal solutions is selected and marked as solution A, which has the following discharged concentrations for the key components: CQ1 = 0.017 ppm and CQ2 = 0.04 ppm. It requires 53 treatment units placed throughout the system with a total annual cost of $9,338,352/year.

Fig. 10
figure 10

Pareto solutions for Example 3

Case B

In this case, the concentration of the key component 1 is manipulated in the same way as the previous case, and the limit for the discharged concentration of the key component 2 in the final disposal is CQ2 ≤ 0.05 ppm. The solutions obtained are represented in the Pareto set shown in Fig. 10, where the final optimal solution (point B) has a discharged concentration for the key component 1 of 0.019 ppm and it requires 20 treatment units that represent a total annual cost of $2,947,392/year. This is 68% lower than the total annual cost for the case A, but with a lower water quality.

Case C

For this case, the concentration for the key component 1 is manipulated as in the previous cases, and the discharged concentration for the key component 2 is stated as CQ2 ≤ 0.07 ppm. The optimal solutions obtained for these restrictions are shown in the Pareto set of Fig. 10. Notice in this case a very similar behavior for the Pareto curve respect to the case B; this is because the limits for the concentration for the pollutant 2 (CQ2 ≤ 0.05 ppm and CQ2 ≤ 0.07 ppm) require the same number of treatment units for the reason that the constraints for the key pollutant 1 become active, which deactivates the constraints for the pollutant 2.

The results were validated through the mass and component balances in the watershed, as well as by simulating the selected treatment units after the optimization.

Conclusions

This paper presents a multi-objective MINLP model for the optimal design of distributed treatment systems of integrated watersheds to guarantee their sustainability. Economic (i.e., the total annual cost) and environmental impact (i.e., the concentration of pollutants in the discharge of the watershed) criteria are simultaneously minimized over a superstructure involving a number of possible combinations of effluent treatment locations and types of treatment units. The model is based on a disjunctive programming formulation and considers all inputs and outputs that are associated with the watershed through an MFA model. To avoid numerical complications, a discretization approach (i.e., given configurations and operating conditions) was used to simulate each treatment unit involved in the superstructure before the optimization process; this simulation provides the information required to develop cost models and to generate expressions for the removal efficiency of the treatment units to be used in the mathematical formulation.

The application of the MINLP model to two watersheds (one in Egypt and other one in Mexico) yielded the corresponding Pareto curves to guide the design process under different scenarios. The results show that the proposed model can be used to determine the minimum total cost required to get specific water quality requirements in different sections and at the catchment of the watershed with a distributed treatment system. Therefore, the methodology could be used for the governments to determine the investment required to improve the water quality through the watersheds.

To enhance the accuracy of the model, the annual variability (i.e., seasonality) of flow rates and compositions for some outputs and inputs of the watershed should be taken into account. Also, the synthesis of distributed treatment systems that include a detailed design of the individual treatment operations is another option if further improvements on the accuracy of optimization results are required. Furthermore, recently some approaches for in-plant water integration based on the stream properties (i.e., toxicity, chemical oxygen demand, density, viscosity, etc.) have been developed for systems constituted by several components (e.g., Ponce-Ortega et al. 2009b, 2010, 2011; Nápoles-Rivera et al. 2010). Therefore, an additional recommendation to improve the proposed model is that the property balances be included for the cases when multiple pollutants are presented to consider property-based constrains, which are very common in practice. Finally, we can note that the model here presented could be extended to consider the optimal design of distributed treatment system inside a city or a community.