Introduction

Mexico is facing a water crisis that affects a lot of people across the country, according to CONEVAL (2019) 9.3 millions of people do not have access to potable water and another 10.2 million lack basic sanitation infrastructure in their households, factors such as population growth, migration to urban areas, and environmental factors are expected to intensify the water crisis (Nápoles-Rivera et al. 2013), and this situation is common in several countries around the world such as India (Swain et al. 2020) and China (Li et al. 2020), amongst others.

Recently, several methods have been proposed to reduce the freshwater consumption (Pfister et al. 2011), such as water reclamation (Jeong et al. 2018) and rainwater harvesting (Semaan et al. 2020). These two alternatives have been widely studied in the literature. López-Morales and Rodríguez-Tapia (2019) implemented an economic analysis of wastewater treatment and reuse and found that to reduce the aquifer exploitation, it is necessary expanding the water reclamation capacities. Mu’azu et al. (2020) assessed the public acceptability of using wastewater in Saudi Arabia, and found that even though this resource is becoming more important in satsifying the water demands in arid regions, the acceptability is still low among the citizens. Marangon et al. (2020) proposed the use of treated municipal wastewater in productive activities such as crop irrigation, hydroponic cultivation and fish farming. Saidan (2020) quantifies the industrial demand and reclamation in five industrial sectors in Jordan. Several studies have been implemented for rainwater harvesting. Usually, this type of resource is considered to be of high quality, but it can contain contaminants (Lopes et al. 2017). The potential to satisfy water demands in a residential complex was studied by Bocanegra-Martínez et al. (2014). Palermo et al. (2020) presented a methodology to optimize rainwater harvesting systems where the decision variables are various process attributes. Estong (2020) proposed that a reasonable goal for rooftop collection for a custom building could be to reduce domestic water supply by 40–50% for that building, whereas a lower level may be expected for a retrofitted system (Campisano et al. 2013). For a small city, it was estimated that rainwater could supply about 32% of needs; however, a goal of 10% would be reasonable from an economic standpoint (Liaw and Chiang 2014). Recently, several optimization approaches have been proposed for designing water distribution systems (Nápoles-Rivera et al. 2014), this can improve the social benefit specially in regions where aquifers, dams and lakes have poor water avaibility (González-Bravo et al. 2016).

It should be noticed that none of the above-mentioned optimization approaches for water distribution has considered the fair allocation of the resource under water scarcity conditions; however, this has been studied before. Movik (2014) examined the multiple meanings of justice embedded in the notion of environmental justice for water sharing. Sechi et al. (2013) developed a methodology based on Cooperative Game Theory using a mathematical optimization approach. The methodology was applied to a multi-reservoir and multi-demand water system in Sardinia, Italy.

The main purpose of this project is to find and compare the optimal and sustainable way to supply water for domestic and agricultural users at a macroscopic level proposing three new and different fair distribution schemes based on Social welfare, Rawlsian welfare, and Nash welfare, trying to take the less possible amount of water of natural sources using different scenarios. It is necessary to consider that for this paper, a fair distribution refers to an equitable distribution.

Social welfare analysis is mainly concerned with how total income must be divided among different individuals (Arrow 1950). Inequality measurement is mainly concerned with how total income is divided among different individuals. This distinction embodies the conceptual difference between the descriptive approach and the normative approach to the analysis of income distribution. Social welfare analysis takes into consideration the amount of total income available in a society (or equivalently, the mean level of income) as well as its degree of inequality (Bellù and Liberati 2005). Social Welfare is the usually implanted mathematical approach for social planning; however, this could be used for distribution of water, but it fails when the values of demands are too different between different consumers (the data scale is not the same). Therefore, this scheme tends to favor users with greater demands. On the other side, the Rawlsian distribution scheme arises from Rawls’s theory called “justice as fairness”. Chung (2018) reported that this theory is structured of the following three principles stablished in strict priority order as follows:

  1. 1.

    The Principle of Maximum Equal Basic Liberties Each person (water users for this study) is to have an equal right to the most extensive scheme of equal basic liberties compatible with a similar scheme of liberties for others.

  2. 2.

    The Principle of Fair Equal Opportunity Social economic inequalities should be attached to positions and offices opened to all under conditions of fair equal opportunity.

  3. 3.

    The Difference Principle Social and economic inequalities should be arranged in a way that is the greatest benefit to the least-advantaged members of society.

Analogously, for water demands, Rawls’s scheme would tend to favor users with smaller demands, penalizing the biggest ones, in contrast with social welfare scheme. These two schemes have a lot of deficiencies, thus different schemes have been explored in literature, an appropriate distribution of the natural resources is needed in this search of fairness. The Nash scheme was originally a unique arbitration scheme for two-persons bargaining games, later, it was reconsidered to give a n-person scheme modifying the Nash axioms for the two-person (Kaneko and Nakamura 1979). For Cole and Gkatzelis (2018), the Nash social welfare consists in maximizing “happiness”, allocation x* is a Pareto optimal allocation which compares favorably to any other Pareto optimal allocation x in the sense that, when switching from x to x*, the percentage gains in happiness outweigh the percentage losses. Two of the most notable properties of this objective are:

  1. 1.

    Scale-freeness its optimal allocation x* is independent of the scale of each agent’s valuations.

  2. 2.

    A natural compromise between fairness and efficiency.

This scheme gives balanced solutions putting the data in the same scale using logarithms, so the penalizing among large and small demands is more systematic.

This paper presents an optimization formulation for distribution of water comparing three different schemes and setting different scenarios changing the amount of available fresh water, reducing the amount of rainwater and minimizing the associated cost (minimizing total cost).

Case Study

The city of Morelia is taken as case study, the city has a population of 729,279 inhabitants (INEGI 2010a; b). According to data from CONAGUA (National Council of Water-Mexico), the water consumption in Morelia for public uses is 90,168,374.77 m3/year (CONAGUA 2009), which translates into a daily consumption per capita of 338.75 lcd. This is an average consumption, but it is acknowledged that the water consumption is dependent on the socioeconomic stratum, this also has an impact on the cost of water and the water availability for the users, the users that pay the most for the water have a continuous supply of water, whereas low-income sectors have intermittent supply, thus it is important to find new supply schemes that distribute the burden under water scarcity conditions. The water used for agricultural purposes is 21,348,208.28 m3/year for a total annual consumption for public and agricultural uses of 111,516,583.05 m3/year, which is satisfied by 105 deep wells (43.93%), springs (33.41%) and the Cointzio dam (22.66%) (Rojas-Torres et al. 2014a, b).

For simplicity, the city is divided in five sectors: Center (CE), North East (NE), North West (NW), South East (SE) and South West (SW) (see Fig. 1 taken and adapted from Google Earth). The demands in domestic sinks used for the model are presented in Table S1 (available in the Supplementary Material Section). In the city, 17,668 ha are used for agricultural purposes, from which 1251 ha are irrigated lands and the rest are seasonal (INEGI 2010a; b); the water consumption considered for this work for agricultural purposes is shown in Table S2 (available in the Supplementary Material Section).

Fig. 1
figure 1

Sections for the city of Morelia

Methodology

The first part of the problem consists in finding an optimal schedule to satisfy the demands on a scarcity scenario following the conditions stablished by Nápoles-Rivera et al. (2013) as follows:

  • The level of the springs and dam should not be less than 35% of their maximum capacity at any period of time, and at the end of the planning period, it should not be less than 45% of their maximum capacity.

  • The level of the deep wells should not be less than 80% of their maximum capacity at any period of time.

  • The amount of water used from each source should not exceed 20% of its content at any period.

The second part (where this paper is focused) consists in proposing different scarcity scenarios where the optimal solution (calculated in the first part) is not enough to satisfy the demands, so, the available water must be “equally” distributed (see Fig. 2).

Fig. 2
figure 2

Proposed approach to solve the water scarcity problem at macroscopic level

Three distribution schemes were used to find the best solution to the stablished problem:

  • Social Welfare scheme

  • Rawls scheme

  • Nash scheme

Each distribution scheme must be solved using the same criteria. Finally, setting restrictions, three scenarios based on a year of water scarcity were analyzed, varying in each scenario the intensity of the scarcity, the idea is that there is a central decision maker who is responsible for interacting and coordinating the different stakeholders involved. In the specific case of Mexico, the government is responsible for the water distribution, thus it is the main stakeholder that must propose the optimal water distribution to satisfy user demands and environmental constraints, and thus must look for fair distribution scenarios.

Mathematical Model

This section presents the mathematical model, which is based on the model presented by Nápoles-Rivera et al. (2013) for the optimal water distribution system (see Eqs. (1)–(37)) in addition with three new different mathematical schemes of distribution at a macroscopic level (see Eqs. (38)–(46)). The proposed superstructure is shown in Fig. 3. The indexes used in the model are defined as follows: i represents the natural sources, m is used to represent the number of tributaries recharging the natural sources and t is the time period in which the balance is performed, for this case, t represents months. l and n are the possible locations of storage tanks and artificial ponds, respectively. In the last place, j represents the domestic sinks, and h represents the agricultural sinks. Then, the mathematical model is developed as follows.

Fig. 3
figure 3

Proposed superstructure for water distribution at a macroscopic region

The proposed solution approach is presented in Fig. 2.

Balance for the Natural Sources of Water

$$G_{i,t} - G_{i,t - 1} = \sum\limits_{m} {r_{m,i,t} } + P_{i,t}^{g} - g_{i,t}^{d} - g_{i,t}^{a} - v_{i,t}^{g} \,,\,\,\,i \in I,t \in T,$$
(1)

where the accumulation is \(G_{i,t}\) (the available water at time period t) minus \(G_{i,t - 1}\) (the available water at the previous time period), which is equal to the sum of all the tributaries to source i (\(r_{m,i,t}\)), the flows of the tributaries include the return water from agriculture, plus the runoff water and direct precipitation (\(P_{i,t}^{g}\)) minus the water distribution for domestic use (\(g_{i,t}^{d}\)) minus the water distribution for agricultural use (\(g_{i,t}^{a}\)) minus water lost (\(v_{i,t}^{g}\)).

The runoff water (\({\text{ROWV}}_{i,t}\)) can be calculated using an indirect method, where the runoff water is function of the precipitation, using the runoff coefficient and collecting area:

$${\text{ROWV}}_{i,t} = P_{t} \,A_{{i\,{\text{ROW}}}}^{{}} {\text{Ce}}\,,\,\,\,i \in I,t \in T,$$
(2)

where \(P_{t}\) is the precipitation at time period t, \(A_{{i\,{\text{ROW}}}}^{{}}\) is the area for collection of the source of runoff water and the runoff coefficient Ce (a dimensionless number) depends on the annual precipitation and the type and use of terrain, which is stated as follows:

$${\text{Ce}}\, = \frac{{K\left( {P_{{{\text{total}}}} - 250} \right)}}{2000}\,,\,\,\,\,\,K \le 0.15\,\,$$
(3)
$${\text{Ce}}\, = \frac{{K\left( {P_{{{\text{total}}}} - 250} \right)}}{2000}\, + \,\frac{K - 0.15}{{1.5}}\,\,,\,\,\,\,\,K \ge 0.15.$$
(4)

The value of K is obtained by the norm NOM-011-CNA-2000 and \(P_{{{\text{total}}}}\) is the annual precipitation in mm H2O. The water collected from direct precipitation (DPWVk,t) in the natural bodies is calculated as follows:

$${\text{DPWV}}_{i,t} = P_{t} A_{{i\,{\text{DPW}}}}^{{}} ,\,\,\,\,i \in I,t \in T,$$
(5)

Finally, the recharge of natural bodies of water is the sum of the runoff water and the direct recharge:

$$P_{i,t}^{g} = {\text{ROWV}}_{i,t} + \,{\text{DPWV}}_{i,t} ,\,\,\,\,i \in I,t \in T.$$
(6)

One of most important water losses is by evaporation (loss of humidity due to direct evaporation) and filtration (water retained by the soil) (\(v_{i,t}^{g}\)), and it is taken as 20% of the total collected water:

$$v_{i,t}^{g} = 0.2\left( {\sum\limits_{m} {r_{m,i,t} } + P_{i,t}^{g} } \right)\,\,\,i \in I,t \in T.$$
(7)

For the precipitation in artificial water sinks, the balance is similar, where the value of Ce for roofs is 0.8 for any roof in general:

$$P_{l,t}^{s} = P_{t} \,\,A_{l}^{s} {\text{Ce}}^{s} \,\,\,\,\,\,\,\,l \in L,t \in T$$
(8)
$$P_{n,t}^{a} = P_{t} \,\,A_{n}^{a} {\text{Ce}}^{a} \,\,\,\,\,\,\,\,n \in N,t \in T,$$
(9)

where \(P_{l,t}^{s}\) is the collected water in storage tank l at time period t. \(P_{n,t}^{a}\) is the collected water in artificial pond n at time period t. \(A_{l}^{s}\) and \(A_{n}^{a}\) are the available areas of collection for each type of storage.

After the precipitation is calculated, the balances for the collected water are stated as follows:

$$P_{l,t}^{s} = P_{t} \,\,A_{l}^{s} Ce^{s} \,\,\,\,\,\,\,\,l \in L,t \in T\,$$
(10)
$$P_{n,t}^{a} = P_{t} \,\,A_{n}^{a} Ce^{a} \,\,\,\,\,\,\,\,n \in N,t \in T.$$
(11)

Balance in Artificial Water Storages

$$S_{i,t} - S_{i,t - 1} = \,S_{i,t}^{{{\text{in}}}} - \sum\limits_{j \in J} {S_{i,j,t}^{{{\text{out}},d}} - } \sum\limits_{h \in H} {S_{i,h,t}^{{{\text{out}},a}} } ,\,\,\,i \in I,\,t \in T.$$
(12)

Now, if we use water storages near to the consumption site, where the accumulation is \(S_{i,t}\) (the available water during time period t) minus \(S_{i,t - 1}\) (the available water at the previous time period) is equal to the collected water from rain (\(S_{i,t}^{{{\text{in}}}}\)) minus the water used for domestic purposes (\(S_{i,j,t}^{{{\text{out}},d}}\)) and the water used for agricultural purposes (\(S_{i,h,t}^{{{\text{out}},a}}\)).

Balance In Artificial Ponds

$$A_{n,t} - A_{n,t - 1} = \,a_{i,t}^{{{\text{in}}}} - \sum\limits_{j \in J} {a_{i,j,t}^{{{\text{out}},d}} - } \sum\limits_{h \in H} {a_{i,h,t}^{{{\text{out}},a}} } ,\,\,\,i \in I,\,t \in T$$
(13)

This balance is equivalent to the one above, where the accumulation is \(A_{n,t}\) (the available water at time period t) minus \(A_{n,t - 1}\) (the available water at the previous time period) is equal to the collected water from rain (\(a_{i,t}^{{{\text{in}}}}\)) minus the water used for domestic purposes (\(a_{i,j,t}^{{{\text{out}},d}}\)) and the water used for agricultural purposes (\(a_{i,h,t}^{{{\text{out}},a}}\)).

Balance in Mains for Domestic Use

$$\sum\limits_{i} {g_{i,t}^{d} } = \,\sum\limits_{j} {f_{j,t}^{{}} } \,\,\,t \in T.$$
(14)

The treated water in a centralized facility is just an intermediate step, so there is not accumulation, the water that enters (\(g_{i,t}^{d}\)) is the same at the end of the process (\(f_{j,t}^{{}}\)).

Balance in Main for Agricultural Use

Not given

$$\sum\limits_{i} {g_{i,t}^{s} } = \,\sum\limits_{h} {r_{h,t}^{{}} } \,\,\,t \in T.$$
(15)

This balance implies that the water entering the main (\(g_{i,t}^{s}\)) is equal to the water leaving the treatment facility (\(r_{h,t}^{{}}\)). The type of treatment does not affect the behavior of the mathematical model.

Balance In Domestic Sinks

$$D_{j,t}^{ds} = \,f_{j,t}^{{}} + \sum\limits_{l} {s_{l,j,t}^{{{\text{out}},d}} + } \sum\limits_{n} {a_{n,j,t}^{{{\text{out}},d}} } ,\,\,\,i \in I,\,t \in T.$$
(16)

Domestic sinks could use water from three different sources: from the main (\(f_{j,t}^{{}}\)), from storage tanks (\(s_{l,j,t}^{{{\text{out}},d}}\)) and from artificial ponds (\(a_{n,j,t}^{{{\text{out}},d}}\)). Where the main is the principal source. The demand for each sink (\(D_{j,t}^{ds}\)) can be obtained from the sum of all sources as follows:

$$D_{j,t}^{ds} = \,{\text{cw}}_{j,t}^{d} \, + {\text{int}}_{j,t}^{in} \,\,.$$
(17)

And the exit flow will be split into two flows, the consumed water (\({\text{cw}}_{j,t}^{d}\)) (water used for gardening, evaporated water, etc.) and wasted water (\({\text{int}}_{j,t}^{in}\)), this water could be treated and used for agricultural purposes.

Treatment Plant Balance

$$\sum\limits_{j} {{\text{int}}_{j,t}^{{{\text{in}}}} } \, = {\text{int}}_{j,t}^{{{\text{out}}}} + \,\,cw_{t}^{tp} .$$
(18)

The treatment plant receives wastewater from domestic sinks (\({\text{int}}_{j,t}^{{{\text{in}}}}\)), which can be regenerated and reused for agricultural proposes (\({\text{int}}_{j,t}^{{{\text{out}}}}\)). The second term (\({\text{cw}}_{t}^{tp}\)) of the balance accounts for the flow of water not recovered during the time period t (i.e., water sent to final disposal).

The treated water can be sent to any agricultural sink as follows:

$${\text{int}}_{j,t}^{{{\text{out}}}} \, = \sum\limits_{h} {{\text{int}}_{h,t}^{{{\text{out}},ag}} } ,$$
(19)

where \({\text{int}}_{h,t}^{{{\text{out}},ag}}\) is the flow of water sent from the treatment facility to any agricultural sink during time period t.

Balance in Agricultural Sinks

$$D_{h,t}^{as} = \,r_{h,t}^{{}} + \sum\limits_{l} {s_{l,j,t}^{{{\text{out}},a}} + } \sum\limits_{n} {a_{n,j,t}^{{{\text{out}},a}} } + {\text{int}}_{h,t}^{{{\text{out}},ag}} \,\,h \in H,\,t \in T.$$
(20)

All the flow received by the agricultural sinks is consumed in the production process and must satisfy the demands (\(D_{h,t}^{as}\)). These demands can be met with the water coming from the main for agriculture (\(r_{h,t}^{{}}\)), water from storage tanks (\(s_{l,j,t}^{{{\text{out}},a}}\)), water from artificial ponds (\(a_{n,j,t}^{{{\text{out}},a}}\)) and the water recovered from the treatment plant (\({\text{int}}_{h,t}^{{{\text{out}},ag}}\)). The outlet balance for the agricultural sink, is not presented, but it is important to mention that the water that enters the agricultural sink is consumed and the rest (return water) appears as part of the recharges to the natural sources. Since a return flow treatment is not proposed, then this value is not of interest for the presented analysis.

Disjunctions for Installing or not Storage Tanks or an Artificial Pond

The following disjunctions are used to install or not a storage tank or an artificial pond in a given location, which are given in terms of a new set of variables (\(S_{l}^{\text{Max} }\) and \(A_{n}^{\text{Max} }\)) that define the maximum capacity of the storage devices. Then, the following inequalities must be set for this purpose:

$$S_{l}^{\text{Max} } \ge \,S_{l,t}^{{}} ,\,\,\,\,l \in L,\,t \in T$$
(21)
$$A_{n}^{\text{Max} } \ge \,A_{n,t}^{{}} ,\,\,\,\,a \in A,\,t \in T$$
(22)
$$S_{l}^{\text{Max} } \ge \,S_{l,t}^{{{\text{in}}}} ,\,\,\,\,l \in L,\,t \in T$$
(23)
$$A_{n}^{\text{Max} } \ge \,A_{n,t}^{{{\text{in}}}} ,\,\,\,\,a \in A,\,t \in T.$$
(24)

The existence or not is decided with the next disjunction. If storage is required at any period, then the binary variable \(z_{l}^{s}\) is equal to one and the storage tank is installed in location l. The capacity of storage tanks must lie within maximum and minimum bounds. If the tank is not necessary, then the binary variable must be equal to 0.

$$\left[ \begin{gathered} z_{l}^{s} \hfill \\ S_{l}^{\text{Max} } \ge \delta_{l}^{s,\text{Min} } \hfill \\ S_{l}^{\text{Max} } \le \delta_{l}^{s,\text{Max} } \hfill \\ {\text{Cos}} t_{l}^{s} = A + B(S_{l}^{\text{Max} } )^{\alpha } \hfill \\ \end{gathered} \right] \vee \left[ \begin{gathered} S_{l}^{{\text{Max}^{{Z_{l}^{s} }} }} = 0 \hfill \\ {\text{Cos}} t_{l}^{s} = 0 \hfill \\ \end{gathered} \right],\;l \in L.$$
(25)

In the same way, for artificial ponds an equivalent disjunction is used:

$$\left[ \begin{gathered} z_{n}^{a} \hfill \\ A_{n}^{\text{Max} } \ge \delta_{n}^{a,\text{Min} } \hfill \\ A_{n}^{\text{Max} } \le \delta_{n}^{a,\text{Max} } \hfill \\ {\text{Cos}} t_{n}^{a} = C + D(A_{n}^{\text{Max} } )^{\alpha } \hfill \\ \end{gathered} \right] \vee \left[ \begin{gathered} A_{n}^{{\text{Max}^{{Z_{n}^{a} }} }} = 0 \hfill \\ {\text{Cos}} t_{n}^{a} = 0 \hfill \\ \end{gathered} \right],n \in N.$$
(26)

Using the Big-M reformulation, previous disjunction is reformulated as follows:

$$S_{l}^{\text{Max} } \ge \delta_{l}^{s,\text{Min} } \times z_{l}^{s} ,\quad l \in L$$
(27)
$$S_{l}^{\text{Max} } \le \delta_{l}^{s,\text{Max} } \times z_{l}^{s} ,\quad l \in L$$
(28)
$${\text{Cos}} t_{l}^{s} = A^{\prime} \times z_{l}^{s} + B^{\prime} \times S_{l}^{\text{Max} } ,\quad l \in L$$
(29)
$$A_{n}^{\text{Max} } \ge \delta_{n}^{a,\text{Min} } \times z_{l}^{a} ,\quad n \in N$$
(30)
$$A_{n}^{\text{Max} } \le \delta_{n}^{a,\text{Max} } \times z_{l}^{a} ,\quad n \in N$$
(31)
$${\text{Cost}}_{n}^{a} = C^{\prime} \times z_{n}^{a} + D^{\prime} \times A_{n}^{\text{Max} } ,\quad n \in N$$
(32)

Objective Function

The proposed objective function considers the sales of water (\({\text{revenue}}\)) for domestic and agricultural uses minus the cost associated to treatment (\({\text{treatment}}\,{\text{cost}}\)) and distribution of water (\({\text{pp}}\,{\text{cost}}\)), as well as the cost associated to the installation and operation of storage tanks and/or artificial ponds (\({\text{storage}}\,{\text{cost}}\)). The purpose is maximizing the gross profit for the sales of freshwater used in a city and subsequently reducing the amount of used freshwater. The objective function is stated as follows:

$${\text{TAR}} = {\text{revenue}} - \left( {{\text{treatment}}\,{\text{cost}} + {\text{storage}}\,{\text{cost}} + {\text{pp}}\,{\text{cost}}} \right)$$
(33)

The objective of this work is minimizing TAR. Where:

$$\begin{aligned} {\text{revenue}} & = \left( {\sum\limits_{i} {\sum\limits_{t} {g_{i,t}^{d} + \sum\limits_{l} {\sum\limits_{j} {\sum\limits_{t} {s_{l,j,t}^{{{\text{out}},d}} + \sum\limits_{n} {\sum\limits_{j} {\sum\limits_{t} {a_{n,j,t}^{{{\text{out}},d}} } } } } } } } } } \right){\text{DSC}} \\ & + \left( {\sum\limits_{i} {\sum\limits_{t} {g_{i,t}^{a} + \sum\limits_{l} {\sum\limits_{h} {\sum\limits_{t} {s_{l,h,t}^{{{\text{out}},a}} + \sum\limits_{n} {\sum\limits_{h} {\sum\limits_{t} {a_{n,j,t}^{{{\text{out}},a}} + \sum\limits_{t} {{\text{int}}_{t}^{{{\text{out}}}} } } } } } } } } } } \right){\text{ASC}}{.} \\ \end{aligned}$$
(34)

DSC is the water sale price for domestic use and ASC is the water sale price for agricultural purposes. CTND is the cost of natural sources for domestic use, CTNA is the cost of natural sources for agricultural use, CTAD and CTAA are the treatment costs of rainwater for domestic and agricultural uses, respectively, CTPA is the treatment cost for regeneration of wastewater for agricultural use and CTPE is the wastewater treatment cost for final disposal into the environment. It is necessary to consider that different qualities of water that require a different type of treatment, so the cost is not the same.

$$\begin{aligned} {\text{treatment}}\;{\text{cost}} & = \left( {\sum\limits_{i} {\sum\limits_{t} {g_{i,t}^{d} {\text{CTND}} + \sum\limits_{i} {\sum\limits_{t} {g_{i,t}^{a} } {\text{CTNA}}} } } } \right) + \left( {\sum\limits_{l} {\sum\limits_{j} {\sum\limits_{t} {s_{l,jt}^{{{\text{out}},d}} + \sum\limits_{n} {\sum\limits_{j} {\sum\limits_{t} {a_{n,j,t}^{{{\text{out}},a}} } } } } } } } \right){\text{CTAD}} \\ & + \left( {\sum\limits_{l} {\sum\limits_{h} {\sum\limits_{t} {s_{l,h,t}^{{{\text{out}},a}} + \sum\limits_{n} {\sum\limits_{h} {\sum\limits_{t} {a_{n,h,t}^{{{\text{out}},a}} } } } } } } } \right){\text{CTAA}} + \sum\limits_{t} {{\text{int}}_{t}^{{{\text{out}}}} {\text{CTPA}} + \sum\limits_{t} {{\text{cw}}_{t}^{tp} {\text{CTPE}}} } . \\ \end{aligned}$$
(35)

The storage cost can be obtained by the sum of the annualized costs of artificial storage devices (\({\text{Cost}}_{l}^{s}\) and \({\text{Cost}}_{n}^{a}\) for ponds and tanks, respectively):

$${\text{storege}}\;{\text{cos}}t = \left( {\sum\limits_{l} {{\text{Cost}}_{l}^{s} + \sum\limits_{n} {{\text{Cost}}_{n}^{a} } } } \right).$$
(36)

The piping and pumping costs (pp cost) associated to the transportation of water are given in terms of the following parameters.

PCSTDl,j is the piping and pumping unit cost from storage tank l to domestic sink j, PCASDn,j is the piping and pumping unit cost from artificial pond n to domestic sink j, PCSTAl,h is the piping and pumping unit cost from storage tank l to agricultural sink h, PCASAn,h is the piping and pumping unit cost from artificial pond n to agricultural sink h, PCNDi and PCNAi are the piping and pumping unit costs from natural source i to domestic and agricultural mains, respectively, and finally PCTWh is the piping and pumping unit cost from treatment plant to agricultural sinks h. Then, the total piping and pumping cost is determined as follows:

$$\begin{aligned} {\text{pp}}\;{\text{cost}} & = \sum\limits_{l} {\sum\limits_{j} {\sum\limits_{t} {s_{l,j,t}^{{{\text{out}},d}} {\text{PCSTD}}_{l,j} + \sum\limits_{n} {\sum\limits_{j} {\sum\limits_{t} {a_{n,j,t}^{{{\text{out}},d}} {\text{PCASD}}_{n,j} + \sum\limits_{l} {\sum\limits_{h} {\sum\limits_{t} {s_{l,h,t}^{{{\text{out}},a}} {\text{PCSTA}}_{l,h} } } } } } } } } } \\ & + \sum\limits_{n} {\sum\limits_{h} {\sum\limits_{t} {s_{n,h,t}^{{{\text{out}},a}} PCASA_{n,h} + \sum\limits_{i} {\sum\limits_{t} {g_{i,t}^{d} {\text{PCND}}_{i} + \sum\limits_{i} {\sum\limits_{t} {g_{i,t}^{a} {\text{PCNA}}_{i} + \sum\limits_{h} {\sum\limits_{t} {{\text{int}}_{h,t}^{{{\text{out}},ag}} {\text{PCTW}}_{h} } } } } } } } } } \\ \end{aligned}$$
(37)

Distribution Schemes

The main contribution of this manuscript is to provide a fair distribution scheme for the available water under water scarcity conditions. Therefore, sometimes, it is not possible to satisfy the full demanded water, this way the following relationships are needed:

$$D_{j,t}^{ds} \le \,D_{j,t}^{dw}, \,\,\,j \in J,\,t \in T$$
(38)
$$D_{h,t}^{as} \le \,D_{h,t}^{aw}, \,\,h \in H,\,t \in T,$$
(39)

where \(D_{j,t}^{dw}\) is the wished demand for domestic use and \(D_{h,t}^{aw}\) is the wished demand for agricultural uses. To normalize these variables, the following relationships are used:

$$\Phi_{j,t}^{{{\text{dom}}}} = \frac{{D_{j,t}^{ds} }}{{D_{j,t}^{dw} \,}}, \,\,j \in J,\,t \in T$$
(40)
$$\Phi_{h,t}^{{{\text{agr}}}} = \frac{{D_{h,t}^{as} }}{{D_{h,t}^{aw} \,}}, \,\,h \in H,\,t \in T.$$
(41)

The purpose of this is that \(\Phi_{j,t}^{{{\text{dom}}}}\) and \(\Phi_{h,t}^{{{\text{agr}}}}\) must be within the 0–1 interval (the results are shown in these terms), where 1 represents the maximum social welfare and 0 represents the minimum social welfare. This way, the following objective function, which satisfies the social welfare analysis mentioned on the first part of this paper, is used to represent the maximum social welfare for all users of water:

$${\text{Max}}\,\,{\text{SW}} = \frac{1}{2}\left[ {\sum\limits_{j} {\Phi_{j,t}^{{{\text{dom}}}} } + \sum\limits_{h}^{{}} {\Phi_{h,t}^{{{\text{agr}}}} } } \right].$$
(42)

For a scheme independent of the scale of water user’s valuations, the following objective functions are stated through the Nash approach as follows (logarithms allow all the consumers to be on the same scale):

$${\text{max}}\,\,{\text{Nash}} = \sum\limits_{j,h}^{{}} {\left[ {\log \Phi_{j,t}^{{{\text{dom}}}} + \log \Phi_{h,t}^{{{\text{agr}}}} } \right]} ,$$
(43)

which can be reformulated as follows:

$${\text{max}}\,\,\,10^{{{\text{Nash}}}} = \,\,\prod\limits_{i,j} {\Phi_{j,t}^{{{\text{dom}}}} } \times \Phi_{h,t}^{{{\text{agr}}}} .$$
(44)

Then, for a distribution scheme that follows the Rawlsian approach mentioned in the first part of this paper, the following inequalities are stated:

$$\begin{gathered} \text{Max} \,\,\,\,\gamma \hfill \\ \hfill \\ \end{gathered}$$

s.t.

$$\,\,\gamma \le \Phi_{j,t}^{{{\text{dom}}}}, \,\,j \in J,\,t \in T$$
(45)
$$\,\,\gamma \le \Phi_{h,t}^{{{\text{agr}}}}, \,\,h \in H,\,t \in T,$$
(46)

where \(\,\gamma\) is Rawlsian scheme’s variable that links the normalized variables allowing to maximize them.

Specific Terms for the Case Study

To calculate the runoff coefficient for the city of Morelia, K is taken as 0.263, which corresponds to the distribution of land shown by CONAGUA (2011). For this value of K and the average annual precipitation, the runoff coefficient is given as follows:

$${\text{Ce}} = \frac{0.263(768.9 - 250)}{{2000}} + \frac{0.263 - 0.15}{{1.5}} = 0.1435.$$
(47)

For the case study, only the transportation cost of the water is considered, because the annualized capital cost of pipelines and pumps is overweighed by the operating cost (this is considering that the current piping network can be used and the only new piping required is from storage devices to existing piping network); this is because of the high local cost of energy. Nevertheless, the formulation allows considering these costs if they are significant.

The transportation unit costs to send water from a tank to any section or from a pond to any section are given in Tables S3–S6 (available in the Supplementary Material Section). The average monthly precipitation in Morelia for the period 1951–2010 according to the National Meteorological System (SMN 2010) is shown in Table S7 (available in the Supplementary Material Section). The demands in agricultural sinks used for the model are presented in Table S2 (available in the Supplementary Material Section). The maximum capacity and cost functions of the storage tanks and ponds are shown in Table S8 (available in the Supplementary Material Section). It is important to notice that the cost function includes fixed and variable costs for units and the exponent 0.8 takes into account the economies of scale. To avoid the nonlinear terms, the cost functions are linearized as follows:

$${\text{Cost}}_{l}^{s} = 13080 + 1.8135\,\left( {S_{l}^{{{\text{max}}}} } \right),\,\,\,l \in L$$
(48)
$${\text{Cost}}_{n}^{a} = 111968 + 0.8895\,\left( {A_{n}^{\text{Max} } } \right),\,\,\,n \in N.$$
(49)

In both cases, the obtained adjustment is satisfactory with a correlation factor r2 of 0.998 and 0.997, respectively; thus, this adjustment is enough.

Results

The proposed model was coded in the software GAMS, which includes 26 binary variables, 4974 continuous variables and 2336 constraints for each distribution scheme. The model is a mixed integer linear programming problem (MILP) solved with CPLEX. When the Nash Scheme is used, the model becomes a mixed integer non-linear problem (MINLP) associated to the use of logarithms, to solve the non-linear model the solver DICOPT was implemented, using an absolute and relative gap of 1 × 10–5 (for both solvers) on a computer with an AMD Ryzen 2700X 4.3 Ghz with 16 Gb of RAM 3200 MHz. The solution for each scenario was obtained in an average of 0.109 CPU s, and the global optimal solution is guaranteed because the model is linear (for Social welfare and Rawls).

Scenario 1:

  • The 40% of the total annual revenue (TAR) previously calculated can be invested for the installation of artificial ponds or storage tanks.

  • The available fresh water at time zero is 90% of the previous year.

  • The natural sources can be overexploited (the water level of the aquifer can be reduced without limit).

  • The amount of water recollected for artificial ponds or tanks is the 100% of the optimal capacity.

  • Gray water is reused for non-potable uses.

    Figure 4 shows the water distribution for Scenario 1 using the social welfare scheme. Figure 5 shows the optimal water distribution for Scenario 1 using the Rawls scheme. Figure 6 shows the water distribution for Scenario 1 using the Nash distribution scheme.

Fig. 4
figure 4

Scenario 1: Social Welfare solution

Fig. 5
figure 5

Scenario 1: Rawls solution

Fig. 6
figure 6

Scenario 1: Nash solution

Scenario 2:

  • The 40% of the total annual revenue (TAR) previously calculated can be invested for the installation of artificial ponds or storage tanks.

  • The annual precipitation of water decreases to 10%.

  • The available water at time zero is 80% of the previous year.

  • The amount of available water for consumption is the minimum possible (with this we can avoid overexploitation of the natural sources).

  • The amount of water recollected for artificial ponds or tanks is the 10% of the optimal capacity (would be almost insignificant).

  • Gray water is reused for non-potable uses.

Figure 7 presents the optimal water distribution for Scenario 2 using the Social welfare scheme. Figure 8 presents the water distribution for Scenario 2 using the Rawls scheme. Figure 9 presents the optimal water distribution for Scenario 2 using the Nash scheme.

Fig. 7
figure 7

Scenario 2: Social Welfare solution

Fig. 8
figure 8

Scenario 2: Rawls solution

Fig. 9
figure 9

Scenario 2: Nash solution

Scenario 3:

  • The 100% of the total annual revenue (TAR) previously calculated can be invested for the installation of artificial ponds or storage tanks.

  • The annual precipitation of water decreases at 50%.

  • The available water at time zero is 80% of the previous year.

  • The amount of available water for consumption is the minimum possible (with this we can avoid overexploitation of the natural sources).

  • The amount of water recollected for artificial ponds or tanks is the 50% of the optimal capacity (artificial ponds and tanks are working at 50% of their capacity).

  • Gray water is reused for non-potable uses.

The obtained results for the different analyzed scenarios are summarized in Figs. 10, 11. Where, Fig. 10 presents the water distribution for Scenario 3 using the social welfare scheme, Fig. 11 presents the optimal water distribution for Scenario 3 using the Rawls scheme, and Fig. 12 presents the water distribution for Scenario 3 using the Nash scheme.

Fig. 10
figure 10

Scenario 3: Social Welfare solution

Fig. 11
figure 11

Scenario 3: Rawls solution

Fig. 12
figure 12

Scenario 3: Nash solution

Discussion of results

It should be noted that the first scenario does not have many problems to solve the distribution of water, because the restrictions are not strong enough to represent a true scarcity year (see Figs. 4, 5, and 6); however, there are a lot of differences between each scheme, the social welfare yields a solution which only penalizes the domestic users, because as one can see in Tables S1 and S2, the demands of agricultural and domestic users are completely different (domestic demands are considerably higher than agricultural demands), thus, as mentioned before, the different scale of the demands produces nonsystematic solutions even when the restrictions are not strong enough. Social welfare does not solve these scenarios in good way, domestic demands could not be satisfied using this scheme, since to satisfy the lower demands (agricultural) a lot of the city sectors would have no water for 2 or 3 months making this distribution scheme very radical.

On the other hand, the Rawls Scheme, for the first scenario, the main difference with social welfare is that this scheme also penalizes agricultural purposes taking the higher demands and making them 0 (or close to 0) for both demands (for example: CE for domestic purposes and NW–SW see in Tables S1 and S2), it is not possible to use this scheme in real life for the same reason as the previous scheme (Fig. 5).

Nash is the most reasonable scheme. For the first scenario only the consumption for domestic purposes is reduced, the amount of water reduced by the restrictions is not enough to require water from the agricultural demand, this changes for the second scenario where the natural resources cannot be exploited and is not possible to collect water with artificial ponds or tanks, so, Nash penalizes both (Figs. 6 and 9), trying to avoid demands with 0% of satisfaction, in fact, it is the only scheme capable of doing that. Between the three options, Nash is the best, this is the only scheme that has no consumers with 0% satisfaction in any month.

For scenarios 2 and 3, the constraints are different and more pessimistic (drought conditions), this allows determining the true behavior of each distribution scheme. It is important to notice how social welfare gives the priority to agricultural purposes in the three scenarios, this causes that agricultural demands reach high levels of satisfaction while many domestic consumers get a satisfaction level of 0 or close to 0 in some months (Figs. 7 and 10). While for Rawls scheme something similar happens, Rawls reduces all the high demands (for agricultural and domestic purposes) to 0 (or close to 0) and the lower demands reach the highest level of satisfaction (values of 1) (Figs. 8 and 11), which is non-viable.

Finally, Nash shows a fair distribution to split the available water between all consumers. This barely penalizes the domestic consumption, in comparison with the agricultural demands, it should be noticed that the scale of consumption of water for each purpose is very different; so, a large penalty for agricultural consumption could not significantly increase the satisfaction levels of domestic consumption, this is why the Nash scheme has a greater impact on domestic consumption, without being unfair, because this scheme distributes better the penalization per month showing a systematic way to solve the problem (Figs. 12 and 9).

Conclusion

This paper has presented an optimization approach for the water distribution in a given region accounting for the proper use of available resources and the implementation of new rainwater harvesting systems and reclaimed water. The proposed optimization model incorporates different water balances and allows the proper distribution of the resource to satisfy domestic and agricultural water demands, while maximizing the associated revenue. The main contribution of the presented approach is that it incorporates and compares three new different fair water distribution schemes, for analyzing cases of water scarcity scenarios. Distribution schemes have been developed and added to the existent mathematical model resulting in a mixed integer linear problem (for Social Welfare and Rawls Schemes) that can be solved globally to find optimal water management strategies, however, comparing schemes, the Nash scheme should be always chosen if the water scarcity is intense. For the Nash Scheme, the mathematical model results in a mixed integer nonlinear problem (for the use of logarithms) that can be solved to find optimal water management strategies in the same way. The formulation is general and can be applied to any city or region, also it can be applied to cities with low precipitation. For these cities, the use of rainwater would be impractical, and no storage devices will be constructed (the superstructure would change). Different types of water distribution schemes under water scarcity conditions allow providing different solutions, where the decision maker can select the best one.

The water allocation problem in the city of Morelia, Mexico was considered as a case study. Water scarcity was considered by proposing several scenarios which reflect different levels of water availability. Results of the first scenario (low water scarcity) show that there are no significant differences between the solutions obtained for the case study of Morelia city, thus the use of alternative water sources and reuse of gray water could reach better levels of satisfaction for the population, but this alternative water sources depend of the rainwater harvesting and the reuse of gray water for non-potable proposes. If there is no rainwater for harvesting, the problem becomes bigger, making the reuse of gray water the only option, so the use of distribution schemes would be necessary. Scenarios 2 and 3 give enough information to always choose the Nash Scheme as the best solution when the available water is not enough to satisfy demands.

It is necessary to focus in how necessary the implementation of other water sources is, the second scenario shows how bad could be the distribution of water without another water source (scenario 2 only uses water from the municipal water network), even if gray water is reused. The friendly side is that if the use of artificial ponds or tanks is implemented in conjunction with the reuse of gray water for non-potable uses, the quality of live in Morelia would improve a lot, without exploit the natural sources, as long as there is not big water scarcity.