Introduction

Water is a vital resource for the survival of living organisms. It plays an important role in most of the vital activities. The rapid growth in world population coupled with the dwindling water resources resulting from the global climate change is leading to water shortages that call for the adoption of water conservation strategies. Several efficient techniques for water reuse, recycle, regeneration, and distribution have been proposed in the process industry. In this context, Foo (2009) proposed a literature review for the approaches reported for water integration in industry. Recently, water integration techniques that incorporate the integration of the industrial wastewater with the surrounding environment have been reported. For instance, several strategies for synthesizing water networks into an eco-industrial park have been proposed (see for example Yang et al. 2000; Chew et al. 2008, 2009; Dakwala et al. 2009; Lovelady and El-Halwagi 2009; Rubio-Castro et al. 2010, 2011, 2012, 2013; Aviso et al. 2010; Taskhiri et al. 2011; Tan et al. 2011; Chew et al. 2011; Yu et al. 2014). Furthermore, several strategies that incorporate the effects of the wastewater discharges on the environment have been reported (EL-Baz et al. 2004; Lira-Barragán et al. 2011a, b, 2013; Atilhan et al. 2012; Burgara-Montero et al. 2012, 2013a, b; Martínez-Gómez et al., 2013; Nápoles-Rivera et al., 2013). These previous studies have shown that the methodologies proposed for water integration in industry and the incorporation of the effect on the environment can be extended to analyze other water usage activities.

Residential water consumption is substantial. Water is used for various household activities. In the US, the Environmental Protection Agency (EPA 2014) estimates an average usage of 100 gal/(person day) with about 70 % used indoors (e.g., toilet, shower, dishwasher, laundry) and the rest in outdoors activities (e.g., gardening). Mah et al. (2009) proposed a conceptual modeling approach for greywater treating, recycling, and reusing; obtaining fresh water savings by 40 %. Zhang et al. (2010) showed important economic and environmental benefits for the domestic fresh water reduction, and Friedler and Hadari (2006) showed that this approach is feasible to be implemented. Furthermore, Chang et al. (2011) proposed a stochastic programming model for the optimal design of green roofs. Davies and Simonvic (2011) implemented simulation models for water using in a house incorporating economic, environmental, and social aspects.

Figure 1 shows the similarities between water management in industry and in residential complexes. There are a number of sinks (water using units), sources (water discharging units), fresh sources, and potential treatment units that can be used to regenerate the used water. There are several potential options to design a water network in a housing complex and the optimal one in terms of a given objective should be identified through an optimization approach. In the industry is easier to define an appropriate treatment for a given wastewater stream based on its contaminants (if the information for the stream is available); however, in residential complexes is more difficult due to the varying nature and number of the contaminants related to a waste stream from the different uses. Therefore, there is a need to develop an optimization formulation for the design of a water network in a housing complex that involves recycle, reuse, and regeneration while accounting for the optimum segregation, mixing, and storage of water to simultaneously optimize the configuration and operation of the system.

Fig. 1
figure 1

Schematic representation for water using in an industry (a), and the analogy for a housing complex (b)

This work introduces a mathematical programming approach for the optimal design of water networks in a housing complex. The formulation accounts for water recycle, reuse, and regeneration and allows the segregation, mixing, and storage for the different types of wastewater. The proposed optimization formulation is capable of handling the simultaneous design and operation of the system. The objective function is the minimization of the total annual cost (TAC), which includes the capital costs for the wastewater treatment units, required pipes, pumps, and storage devices as well as the operating costs involving the electric power for the pumps, the operating costs for the treatment units and for the storage devices.

Problem statement

The addressed problem in this paper can be stated as follows: Given is a housing complex with a known number of houses and inhabitants. The water demands for each house are known as well as the time when these demands need to be satisfied daily and throughout the year. The design problem consists of determining the optimal network structure allowing wastewater recycle, reuse, and regeneration. This way, the model needs to determine the optimal treatments, pipes, pumps, and the storage devices for the reclaimed water. The network configuration must consider wastewater segregation and mixing to satisfy the quality demands for the considered uses. The superstructure shown in Fig. 2 is constructed to embed potential configurations of interest. The example shown by Fig. 2 is just for two residential units and five specific uses (i.e., toilet, shower, dishwasher, laundry, and gardening). Nonetheless, the proposed superstructure is general and can consider any number of houses and uses. In Fig. 2, the dashed lines represent the wastewater flowrates from the houses to the treatment units. It should be noted that wastewater from different uses before treatment is not allowed to be mixed to avoid degradation in water quality prior to treatment and recycle. In Fig. 2, the solid lines represent the reclaimed water which can be reused in the different houses and for the different uses. Mixing of different types of reclaimed water and fresh water may be used to satisfy the water quality demands for the considered uses. Furthermore, the discharged wastewater must also be treated to satisfy the environmental regulations. It should be noted that avoiding the mixing of different types of wastewater streams may increase the costs for pipes but may also reduce the treatment cost. Also by avoiding the mixing of streams no component balances are required and thus non-convex terms are avoided in the formulation. Therefore, the model must determine the optimal network structure, type of treatment units, size of pipes, pumps, and storages, as well as the operating conditions to satisfy the water demands in the housing complex at the minimum TAC and the minimum annual fresh water consumption. Then, the proposed model formulation for the superstructure is presented in the next section.

Fig. 2
figure 2

Proposed superstructure for water integration into a housing complex

Model formulation

First, the indexes used are defined; i represents the different uses (i.e., toilet, shower, dishwasher, laundry, and gardening), j represents the units considered in the housing complex, k represents the different treatment units considered, t represents the different periods over the day (i.e., periods of 1 h to have an horizon of 24 h per day) when water is discharged, used and stored, tt is the processing time for the different activities considered. The proposed model formulation is stated as follows.

Splitting of fresh water

The fresh water consumed in the period of time t (\(F_{t}\)) is equal to the segregated fresh water sent to the different units j for the different uses i through the period t (\(f_{j,i,t}\)):

$$F_{t} = \sum\limits_{j} {\sum\limits_{i} {f_{j,i,t\,\,} ,\quad \forall t} } \in T.$$
(1)

Water demands for the different uses

The water demand for each unit j for each use i over each period t (\(m_{j,i,t}\)) must be satisfied with the segregated fresh water (\(f_{j,i,t}\)) plus the sum of the recycled wastewater from the different treatments (\(g_{{k,i^{\prime},j,i,t}}\)):

$$m_{j,i,t} = f_{j,i,t} + \sum\limits_{k} {\sum\limits_{{i^{\prime}}} {g_{{k,i^{\prime},j,i,t}} } } ,\quad \forall j \in J,\;\forall i \in I,\;\forall t \in T,$$
(2)

where the water demands (\(m_{j,i,t}\)) are known parameters. It should be noted that there are constraints for recycled wastewater from any activity i′ to be used in the activity i.

Mixing of wastewater

The sum of the wastewater produced in the different units j for the different uses i over the different periods of time t (\(w_{j,i,t}\)) is equal to the wastewater segregated to the different treatment units k (\(l_{k,i,t}\)) as follows:

$$\sum\limits_{j} {w_{j,i,t} = \sum\limits_{k} {l_{k,i,t} } } ,\quad \forall i \in I,\;\forall t \in T.$$
(3)

Balances in the wastewater treatment units

The reclaimed water (\(h_{k,i,t + tt}^{\text{in}}\)) after treatment is equal to the inlet wastewater (\(l_{k,i,t}\)) accounting for the efficiency for the treatment units (\(\alpha_{k,i}\)):

$$h_{k,i,t + tt}^{\text{in}} = (1 - \alpha_{k,i} )l_{k,i,t} ,\quad \forall i \in I,\;\forall k \in K,\;\forall t \in T.$$
(4)

It should be noted that the wastewater inlets to the treatment unit at time period t and exits at the time period t + tt, where tt is the processing time. In the proposed optimization model, the processing time is given for each treatment technology considered. Also, the efficiency depends on the type of treatment and this must be between zero and one; this value can be determined from simulation or using experimental data.

Splitting for the reclaimed water

The reclaimed water (\(h_{k,i,t}^{\text{out}}\)) is segregated and this can be recycled from the different uses i′ to the different units j (\(g_{k,i,j,i,t}\)) and discharged to the environment (\(ww_{k,i,t}\)).

$$h_{k,i,t}^{\text{out}} = \sum\limits_{j} {\sum\limits_{{i^{\prime}}} {g_{{k,i,j,i^{\prime},t}} + ww_{k,i,t} } } ,\quad \forall i \in I,\;\forall k \in K,\;\forall t \in T.$$
(5)

Water losses in the different uses

The exit wastewater from the different uses (\(w_{j,i,t}\)) is equal to the inlet water (\(m_{j,i,t}\)) accounting for the efficiency for the use of water (\(\beta_{\text{j,i}}\))

$$w_{j,i,t} = (1 - \beta_{j,i} )m_{j,i,t} ,\quad \forall i \in I,\;\forall k \in K,\;\forall t \in T.$$
(6)

It should be noted that the efficiency factor \(\beta_{j,i}\) is function of the type of use and the unit considered; this parameter \(\beta_{j,i}\) ranges from 0 to 1 and can be determined experimentally (i.e., the value of \(\beta_{j,i}\) is 0.01 for the toilet, 0.15 for the shower, 0.12 for dishwasher, 0.2 for laundry, and 1 for gardening).

Balances in the storage tanks

Storage tanks are required for storing reclaimed water after recycling because the water demands are required at specific periods. Then, the water stored at period of time t (\(S_{k,i,t}\)) must be equal to the water stored in the previous period (\(S_{k,i,t - 1}\)) plus the inlet water over this period (\(h_{k,i,t}^{\text{in}}\)) minus the outlet water over the period (\(h_{k,i,t}^{\text{out}}\)):

$$S_{k,i,t} = S_{k,i,t - 1} + h_{k,i,t}^{\text{in}} - h_{k,i,t}^{\text{out}} ,\quad \forall i \in I,\;\forall k \in K,\;\forall t \in T.$$
(7)

Capacity for the storage tanks

The capacity required for the storage tanks (\(S_{k,i}^{\text{cap}}\)) must be greater than the water stored in the tank over all the periods of time considered (\(S_{k,i,t}\)):

$$S_{k,i}^{\text{cap}} \ge S_{k,i,t} ,\quad \forall i \in I,\;\forall k \in K,\;\forall t \in T.$$
(8)

Existence for the storage tanks

Logical relationships are required to determine the existence for the storage tanks; and this way, when the tank exists the binary variable (\(V_{k,i}\)) must be activated as follows:

$$S_{k,i}^{\text{cap}} \le S^{ \hbox{max} } V_{k,i} ,\quad \forall i \in I,\;\forall k \in K,$$
(9)

where \(S^{ \hbox{max} }\) is the upper limit for the storage capacity for each tank. It should be noted that when the capacity is greater than zero, the binary variable is activated and must be equal to one.

Capital cost for the tanks

The capital costs for the water storage tanks (\(C_{k,i}^{\text{capTanks}}\)) is determined as a function of the unit fixed (\({\text{FC}}_{k,i}^{\text{Tanks}}\)) and variable (\({\text{VC}}_{k,i}^{\text{Tanks}}\)) costs as follows:

$$C_{k,i}^{\text{capTanks}} = {\text{FC}}_{k,i}^{\text{Tanks}} V_{k,i} + {\text{VC}}_{k,i}^{\text{Tanks}} \left( {S_{k,i}^{\text{cap}} } \right)^{{\gamma_{k,i}^{\text{Tank}} }} ,\quad \forall i \in I,\;\forall k \in K,$$
(10)

where \(\gamma_{k,i}^{\text{Tank}}\) is the exponent of the capital cost function for the water storage tanks and this is used to account for the economies of scale. The binary variable \(V_{k,i}\) is used to activate the fixed part of the capital cost when the tank is required.

Fresh water cost

The fresh water cost (\(C^{\text{FW}}\)) is calculated multiplying the unit fresh water cost (\(c^{\text{fw}}\)) times the sum of the fresh water consumed over all the periods of time (\(F_{t}\)) as follows:

$$C^{\text{FW}} = {\text{c}}^{\text{fw}} \sum\limits_{t} {F_{t} } .$$
(11)

Fresh water pumping cost

The pumping cost for the fresh water (\(C^{\text{PFW}}\)) is calculated accounting for the unit pumping cost (\(c^{\text{pfw}}\)) and the fresh water required (\(F_{t}\)):

$$C^{\text{PFW}} = c^{\text{pfw}} \sum\limits_{t} {F_{t} } .$$
(12)

Existence for the wastewater treatment units

The existence for the wastewater treatment units is modeled through a binary variable (\(y_{k.i} \,\)); when this binary variable is one the unit exists and when this binary variable is zero the unit does not exit. Then, the following relationship is used to activate the binary variable:

$$l_{k,i,t} \le L_{i}^{ \hbox{max} } y_{k.i} ,\quad \forall k \in K,\;\forall i \in I,\;\forall t \in T.$$
(13)

where \(L_{i}^{ \hbox{max} }\) is an upper limit for the capacity of the wastewater treatment unit.

Capacity for the wastewater treatment units

The capacity for the treatment unit (\(L_{k.i}^{\text{cap}}\)) must be greater than the flowrate manipulated through all the periods of time considered (\(l_{k,i,t}\)):

$$L_{k.i}^{\text{cap}} \ge l_{k,i,t} ,\quad \forall k \in K,\;\forall i \in I,\;\forall t \in T$$
(14)

Capital cost for the wastewater treatment units

The capital costs for the wastewater treatment units (\(C_{k,i}^{\text{capTU}}\)) are calculated accounting for the unit fixed (\({\text{FC}}_{k,i}^{\text{capTU}}\)) and variable (\({\text{VC}}_{k,i}^{\text{capTU}}\)) costs as follows:

$$C_{k,i}^{\text{capTU}} = {\text{FC}}_{k,i}^{\text{capTU}} y_{k,i} + {\text{VC}}_{k,i}^{\text{capTU}} \left( {L_{k,i}^{\text{cap}} } \right)^{{\gamma_{\text{k,i}}^{\text{TU}} }} ,\quad \forall k \in K,\;\forall i \in I,$$
(15)

where \(\gamma_{k,i}^{\text{TU}}\) is an exponent used to consider the economies of scale. It should be noted that the binary variable \(y_{k,i}\) is used to activate the fixed part of the capital cost function for the wastewater treatment units.

Existence for the pipe segments

The existence for the new pipe segments is determined through the binary variables \(z_{j,i}\) (for the segment from the use to the treatment unit) and \(x_{{k,i^{\prime},j,i}}\) (for the segment from the treatment unit to the new use) as follows:

$$w_{j,i,t} \le L_{i}^{ \hbox{max} } z_{j,i} ,\quad \forall j \in J,\;\forall i \in I,\;\forall t \in T,$$
(16)
$$g_{{k,i^{\prime},j,i,t}} \le L_{i}^{ \hbox{max} } x_{{k,i^{\prime},j,i}} ,\quad \forall k \in K,\;\forall i^{\prime} \in I^{\prime},\;\forall j \in J,\;\forall i \in I,\;\forall t \in T,$$
(17)

where \(L_{i}^{ \hbox{max} }\) is the upper limit for the flow rate in the pipe segments. It should be noticed that the pipe network is different depending on the water quality, there is a set of pipes in the outlet of water and another set of pipes for the water reuse for each type; Eq. 16 shows the existence of pipe segments for the water in the outlet of each sink and Eq. 17 shows the existence of pipe segments for the water reuse. The different flowrates that pass through the pipes cannot mix to avoid the contamination of water with major quality. In addition, it should be noted that this paper presents a targeting approach to determine objectives before detailed design. The detailed piping network design is carried out in a later stage using the information obtained with the optimization approach.

Capacity for the pipe segments

The capacity for the pipe segments (\(W_{j,i}^{\text{cap}}\) and \(g_{{k,i^{\prime},i,j,t}}^{\text{cap}}\)) is determined accounting for the maximum flow rate manipulated over all the periods of time as follows:

$$W_{j,i}^{\text{cap}} \ge w_{j,i,t\,} ,\quad \forall j \in J,\;\forall i \in I,\;\forall t \in T,$$
(18)
$$g_{{k,i^{\prime},i,j,t}}^{\text{cap}} \ge g_{{k,i^{\prime},j,i,t}} ,\quad \forall k \in K,\;\forall i^{\prime} \in I^{\prime},\;\forall j \in J,\;\forall t \in T.$$
(19)

Capital cost for the pipe segments

The capital costs for the pipe segments (\(C_{j,i}^{\text{capPW}}\) and \(C_{{k,i^{\prime},j,i}}^{\text{capPg}}\)) are determined considering the unit fixed (\({\text{FC}}_{j,i}^{\text{capPW}}\) and \({\text{FC}}_{{k,i^{\prime},j,i}}^{\text{capPg}}\)) and variable (\({\text{VC}}_{j,i}^{\text{capPW}}\) and \({\text{VC}}_{{k,i^{\prime},j,i}}^{\text{capPg}}\)) costs as follows:

$$C_{j,i}^{\text{capPW}} = {\text{FC}}_{j,i}^{\text{capPW}} z_{j,i} + {\text{VC}}_{j,i}^{\text{capPW}} \left( {w_{j,i}^{\text{cap}} } \right)^{{\gamma_{j,i}^{\text{PW}} }} ,\quad \forall j \in J,\;\forall i \in I,$$
(20)
$$C_{k,i',j,i}^{\text{capPg}} = {\text{FC}}_{{k,i^{\prime},j,i}}^{\text{capPg}} x_{{k,i^{\prime},j,i}} + {\text{VC}}_{{k,i^{\prime},j,i}}^{\text{capPg}} \left( {g_{{k,i^{\prime},j,i}}^{\text{cap}} } \right)^{{\gamma_{{k,i^{\prime},j,i}}^{\text{Pg}} }} ,\quad \forall k \in K,\;\forall i^{\prime} \in I^{\prime},\;\forall j \in J,\;\forall i \in I.$$
(21)

Operating cost for the pumps

The operating cost for the pump used for the recycled water (\(C_{{k,i^{\prime},j,i}}^{\text{pumpg}}\)) is determined as a function of the recycled water (\(g_{{k,i^{\prime},j,i,t}}\)) and the unit pumping costs (\({\text{C}}_{{k,i^{\prime},j,i}}^{\text{Pump}}\)) as follows:

$$C_{{k,i^{\prime},j,i}}^{\text{pumpg}} = \sum\limits_{t} {\left( {{\text{C}}_{{k,i^{\prime},j,i}}^{\text{Pump}} g_{{k,i^{\prime},j,i,t}} } \right)} ,\quad \forall k \in K,\;\forall i^{\prime} \in I^{\prime},\;\forall j \in J,\;\forall i \in I.$$
(22)

Whereas, the operating cost for the pump for the used wastewater (\(C_{k,i}^{\text{opTreat}}\)) is determined accounting for the unit pumping cost (\({\text{C}}_{k,i}^{\text{op}}\)) and the flowrate (\(l_{k,i,t\,\,\,}\)) as follows:

$$C_{k,i}^{\text{opTreat}} = \sum\limits_{t} {{\text{C}}_{k,i}^{\text{op}} l_{k,i,t\,} ,\quad \forall k \in K,\;\forall i \in I} .$$
(23)

Capital costs for the pumps used for recycling water

The capital cost for the pumps used for recycling water (\(C_{{k,i^{\prime},j,i}}^{\text{cappump}}\)) is determined using the unit fixed (\({\text{FC}}_{{k,i^{\prime},j,i}}^{\text{cappump}}\)) and variable (\({\text{VC}}_{{k,i^{\prime},j,i}}^{\text{cappump}}\)) costs, and accounting for the economies of scale (\(\gamma_{{k,i^{\prime},j,i}}\)) as follows:

$$C_{{k,i^{\prime},j,i}}^{\text{cappump}} = {\text{FC}}_{{k,i^{\prime},j,i}}^{\text{cappump}} x_{{k,i^{\prime},j,i}} + {\text{VC}}_{{k,i^{\prime},j,i}}^{\text{cappump}} \left( {g_{{k,i^{\prime},j,i}}^{\text{cap}} } \right)^{{\gamma_{{k,i^{\prime},j,i}}^{\text{pump}} }} ,\quad \forall k \in K,\;\forall i^{\prime} \in I^{\prime},\;\forall j \in J,\;\forall i \in I.$$
(24)

It should be noted that the fixed part of the capital cost for the pumps is activated through the use of the binary variables \(x_{{k,i^{\prime},j,i}}\). Notice also that the capital costs for other pumps are not needed because these usually exist in the current housing complexes.

Constrained recycling streams

There are required constraints to avoid recycling streams from some uses i to specific new uses i′ after treatment. These constraints are given as follows:

$$g_{{k,i,j,i^{\prime},t}} = 0,\quad \forall i \in I,\;\forall j \in J,\;\forall k \in K,\;\forall t \in T,\;\forall i^{\prime}\left( {k,i} \right)\in I^{\prime}\left( {K,I} \right).$$
(25)

Constraints for the initial and final periods for water stored in storage tanks

The stored water at the beginning is equal to the stored water at the end of the day as follows:

$$S_{k,i,t = 1} = S_{k,i,t = T} ,\quad \forall k \in K,\;\forall i \in I.$$
(26)

Total annual cost

The TAC accounts for the annualized capital costs for the treatment units (\(C_{k,i}^{\text{capTU}}\)), pumps (\(C_{j,i}^{\text{capPW}}\)), water storage tanks (\(C_{k,i}^{\text{capTanks}}\)) and pumps (\(C_{{k,i^{\prime},j,i}}^{\text{capPg}}\) and \(C_{{k,i^{\prime},j,i}}^{\text{cappump}}\)), as well as the annual operating costs for the operation of pumps (\(C_{{k,i^{\prime},j,i}}^{\text{pumpg}}\) and \(C^{\text{PFW}}\)), treatment units (\(C_{k,i}^{\text{opTreat}}\)), and fresh water (\(C^{\text{FW}}\)) as follows:

$$\begin{aligned} {\text{TAC}} = & K_{\text{F}} \left( {\sum\limits_{k} {\sum\limits_{i} {C_{k,i}^{\text{capTU}} + \sum\limits_{j} {\sum\limits_{i} {C_{j,i}^{\text{capPW}} + \sum\limits_{k} {\sum\limits_{i} {C_{k,i}^{\text{capTanks}} } } + \sum\limits_{k} {\sum\limits_{{i^{\prime}}} {\sum\limits_{j} {\sum\limits_{i} {C_{{k,i^{\prime},j,i}}^{\text{capPg}} } } } } } } } } + \sum\limits_{k} {\sum\limits_{i'} {\sum\limits_{j} {\sum\limits_{i} {C_{{k,i^{\prime},j,i}}^{\text{cappump}} } } } } } \right) \\ + {\text{H}}_{Y} \left( {\sum\limits_{k} {\sum\limits_{{i^{\prime}}} {\sum\limits_{j} {\sum\limits_{i} {C_{{k,i^{\prime},j,i}}^{\text{pumpg}} } } } } + C^{\text{PFW}} + \sum\limits_{k} {\sum\limits_{i} {C_{k,i}^{\text{opTreat}} + C^{\text{FW}} } } } \right) \\ \end{aligned}$$
(27)

where \(K_{\text{F}}\) is the factor used to annualize the inversion and \(H_{Y}\) are the days of operation per year.

Total fresh water consumed

The total fresh water consumed (\({\text{TOTFRESH}}\)) for the housing complex is determined as follows:

$${\text{TOTFRESH}} = \sum\limits_{t} {F_{t} } .$$
(28)

Objective function

The objective function is the simultaneous minimization for the TAC and the total annual fresh water consumption (TOTFRESH) as follows:

$${\text{O}} . {\text{F}}. = \left\{ {\left[ {{\text{Min}}\;{\text{TAC}}} \right]\,{\text{and}}\,\left[ {{\text{Min}}\,{\text{TOTFRESH}}} \right]} \right\}.$$
(29)

The proposed optimization problem involves minimizing simultaneously two objectives (TAC and TOTFRESH) and to solve this multi-objective optimization problem, the constraint method was implemented. First, the problem for the minimum TAC was solved (this provides the solution for the maximum fresh water consumed). The problem for the minimum fresh water consumption was implemented (this provides the solution for the maximum TAC). Based on these two extreme solutions, several problems for minimizing TAC using limits for the consumed fresh water were solved to obtain a Pareto set.

The model is a mixed-integer nonlinear problem where the continuous variables are flowrates and costs. Each flowrate from a source to a sink is considered as variable; also the costs associated to the network are variables. The binary variables are associated to the existence or not existence of tanks, segments of pipelines, and treatment units. The equations can be classified in mass balances, cost equations and use constraints; the use constraints and the domain of the variables are set by physical limitations such as treatment and storage capacity, these limits are associated to the pre-selection of the used technologies. Notice also that the use constraints function indirectly as quality constraints, this way some connections can be forbidden, for example toilet water cannot be reused even after treatment in any use but gardening. Thus, no component balances are included, and instead are substituted with these constraints. The main assumptions and simplifications of the proposed model are the following:

  • Mixing of streams with different qualities is avoided.

  • The quality of the streams leaving each of the treatments satisfies quality constraints of the final uses.

  • The reclaimed water cannot be used in any use indistinctly, this is related to the quality of the water and is defined by the user.

  • Technical aspects, such as size and material of construction cannot be calculated. Instead a preliminary cost data is related to flowrates and treatments in base of available data for similar processes.

Case study

A case study is presented to show the application of the proposed mathematical programming model. The considered case study corresponds to the housing complex called “Villas del Pedregal” located in the city of Morelia, Michoacán in Mexico. It has two units: the first one with 894 houses and the second one with 835 houses. An average of 4 inhabitants per house is considered giving a total of 6,916 inhabitants. Currently, the overall fresh water consumption is 1,504 m3/day, the wastewater discharged to the environment is 1,160 m3/day, and the TAC for the fresh water consumption is US$655,275/year. The unit costs are US$0.653/m3 for fresh water, US$0.0152/m3 for pumping fresh water, US$0.0652/m3 for pumping recirculation flows; the unit fixed costs are US$100 for pipes, US$2614 for recirculating pump, US$1000 for treatment units, US$100 for tanks; and the unit variable costs were US$60/m3 for recirculating pipes, US$50/m3 for pipes from output of each sink, US$60/m3 for treatment units and US$176/m3 for tanks. The operating costs of wastewater treatments are between US$ 3.1 and 3.9/m3 for the aerobic process, US$ 0.4–0.7/m3 for the anaerobic process and 5.2–6.5/m3 for the membrane bioreactor. The interest discount was of 10 % and the service life was of 10 years. Figure 3 shows the schematic representation for the housing complex considered in this case study. The following wastewater treatments were considered: anaerobic digestion, aerobic digestion, and membrane bioreactors; these treatments have been widely used for treating domestic wastewater (Blšt'áková et al. 2009; Hasar et al. 2001; Li et al. 2009; Paris and Schlapp 2010; Ramona et al. 2004). Furthermore, the superstructure accounts for a blank treatment which is used to model the bypassing stream (these bypassing streams have been widely used in the industrial water network with significant benefits (Ponce-Ortega et al. 2009, 2010; Rubio-Castro et al. 2010, 2011, 2012; Vázquez-Castillo et al. 2013). This problem was coded in the software GAMS (Brooke et al. 2014); where the solvers SBB, CONOPT, and CPLEX were used to solve the associated mixed-integer nonlinear, nonlinear and linear problems, respectively. The problem then consists of 6,792 continuous variables, 190 binary variables, 10,987 constraints, and this was solved in a computer with an Intel i7 processor at 2.10 GHz with 8 GB of RAM in approximately 0.78 s of CPU time.

Fig. 3
figure 3

Schematic representation for the housing complex considered in the case study

The Pareto curve (Fig. 4) shows the optimal solutions identifying the tradeoffs between the minimum TAC and minimum consumed fresh water. Scenario A shows the lowest fresh water and the highest TAC while Scenario G displays the largest fresh water and the lowest TAC. The other options are solutions that compensate these two contradicting objectives. From this Pareto curve, options B and C appear as attractive solutions because they have costs that are 64.90 and 67.01 %, respectively, lower than the cost of Scenario A, whereas the fresh water consumed is slightly greater than the minimum one of Scenario A (i.e., an increase of 1.18 and 3.33 % for scenarios B and C, respectively). Furthermore, the TAC for Scenarios B and C is slightly greater than the one of the minimum of Scenario G (19.42 and 12.43 % for Scenarios B and C, respectively) whereas the fresh water consumed is 8.91 and 6.97 % lower than to one of Scenario G, respectively. There are no significant differences in the TAC and the fresh water consumed between the solutions of Scenarios B and C. Nonetheless, the difference is in the configuration and operating conditions. Tables 1 and 2 show a summary of results; furthermore for better understanding the most significant cases are analyzed in detail as follows.

Fig. 4
figure 4

Pareto curve for the solutions of the case study

Table 1 Results for the different scenarios analyzed in the case study
Table 2 Water flows for the scenarios analyzed in the case study

Scenario G

First, the solution for the minimum TAC (i.e., US$554,422/year) was obtained. This solution represents a total fresh water consumption of 1,032 m3/day and this is represented as Scenario G. The schematic representation for the solution of this Scenario G is presented in Fig. 5. It should be noted that for this solution only the anaerobic treatment is required for all the types of wastewater. The treated wastewater flows from the toilet, shower, dishwasher, and laundry are 600, 197, 136, and 224 m3/day, respectively. For Scenario G, there are three storage tanks required each with a capacity of 25 m3 (Table 3). Furthermore, the total wastewater discharged to the environment is 688 m3/day, which comes from the toilet, shower, and laundry. The TAC is distributed as 44.40 % for fresh water, 1.03 % for pumping fresh water, 2.02 % for pumping recirculated water, 0.35 % for capital cost for the treatment units, 0.37 % for capital cost of pipes (outlet and recirculation), 0.14 % capital costs for pumps, 0.25 % capital cost for tanks, and 51.44 % for operating treatment units. Comparing the solution for Scenario G with respect to the current situation (called Scenario 0), a reduction of 31.38 % in the total fresh water consumed is observed, whereas the TAC decreased by 15.39 %. Table 4 shows the daily distribution of water in the main nodes of the proposed network.

Fig. 5
figure 5

Schematic representation for the solution of Scenario G (minimum TAC)

Table 3 Capacity for storage tanks of Scenario G
Table 4 Solution of Scenario G (minimum TAC)

Scenario A

The second scenario (Scenario A) corresponds to the minimization of the total fresh water consumption, where the TAC is US$1,889,600/year with a total fresh water consumption of 929 m3/day and the total wastewater discharged to the environment is 571 m3/day (this flowrate comes from the toilet and laundry). This solution requires aerobic and membrane bioreactors for the wastewater from the toilet. The wastewater from the shower requires aerobic and anaerobic treatments. The three treatment technologies are required for the wastewater from the dishwasher and the laundry (see Fig. 6; Table 5). Nine tanks are required for this scenario, whose capacities are 25 m3 for six tanks, and for the other tanks the capacities are 13.69, 20.11, and 21.52 m3 (Table 6). Moreover, the TAC is allocated as 11.72 % for fresh water, 0.27 % for pumping fresh water, 0.72 % for pumping recirculated water, 0.16 % for capital cost of the treatment units, 0.14 % for capital cost for outlet and recirculation pipes, 0.08 % capital costs for pumps, 0.2 % capital cost for tanks, and 86.8 % for operating the treatment units. Comparing the solution for this Scenario A with respect to the current situation (called Scenario 0), there is a reduction of 38.23 % in the total fresh water consumed and an increase of 188.36 % in the TAC.

Fig. 6
figure 6

Schematic representation for the solution of Scenario A (minimum fresh water consumption)

Table 5 Solution of Scenario A (minimum fresh water consumption)
Table 6 Capacity for storage tanks of Scenario A

Scenario B

The solution of Scenario B has a TAC of US$662,124/year, the demand of fresh water is 940 m3/day and the total wastewater (from the toilet and laundry) discharged to the environment is 596 m3/day. This solution requires anaerobic treatment for the wastewater from the toilet, aerobic and anaerobic treatments for the wastewater from the shower, and the three treatment technologies for the wastewater from the dishwasher and laundry (see Fig. 7; Table 7). For Scenario B, eight tanks are required; two tanks for treated water from the shower, three tanks for treated water from the dishwasher, and three tanks for treated water from the laundry (Table 8 shows the capacity for these tanks). In this scenario, the TAC constitutes of 33.83 % for fresh water, 0.78 % for pumping fresh water, 2.02 % for pumping recirculated water, 0.37 % for capital cost of the treatment units, 0.36 % for capital cost for outlet and recirculation pipes, 0.18 % for capital costs for pumps, 0.46 % for capital cost for tanks, and 62.00 % for operating the treatment units. Comparing the solution for this Scenario B with respect to the current situation (Scenario 0), a marginal increase of 1.04 % in the TAC and a reduction of 37.5 % in the total fresh water consumed are observed. The reclaimed water mainly is reused in the toilet and gardening, and the reclaimed water corresponds mainly to the one used in the shower, dishwasher, and laundry. Comparing Scenarios A, B and G, the TAC of Scenario A is 185.38 and 240.82 % higher than Scenarios B and G, respectively. The fresh water consumption of Scenario A is 1.17 and 9.98 % lower than those of Scenarios B and G, respectively. On the other hand, Scenario B is an attractive solution because this represents a very small increment in the fresh water consumption with respect to the minimum one and there are significant savings in the TAC.

Fig. 7
figure 7

Schematic representation for the solution of Scenario B

Table 7 Solution of Scenario B
Table 8 Capacity for storage tanks of Scenario B

Conclusions

This paper has presented an optimization approach for water integration in a housing complex. The proposed approach is based on a new superstructure that allows mixing, segregating, reusing, regenerating, recirculating, and storing the used water in order to decrease the fresh water consumption and the TAC. The proposed model is a multi-objective optimization program which is formulated as a mixed-integer nonlinear programming problem. One objective is the minimum TAC which accounts for the fresh water cost, operating costs for pumping and treatment units, and the capital costs for treatment units, tanks, pipes, and pumps. The other objective function corresponds to the minimum fresh water consumption. A proper representation of the contradicting objectives through a Pareto curve is presented in this paper where the tradeoffs between the two objectives can be properly represented to guide the decision makers in selecting the best solution for the specific requirements.

A case study for a housing complex of the city of Morelia in Mexico was presented. The results show that a significant reduction in the total fresh water consumption can be obtained with the application of the proposed optimization approach. The results also show that the economic objective function is favorable for the reduction in the fresh water consumption and that the required initial investment can be recovered in a short period of time. The proposed optimization approach is general and this can be applied to any different housing complex and including additional types of treatment units. Finally, no numerical complications were observed during the application of the proposed optimization approach and this can be solved in a short CPU time.