Is Renewable Energy-Powered Desalination a Viable Solution for Water Stressed Regions? A Case Study in Algarve, Portugal

: With a severe seasonal concentration of precipitation and unevenly distributed water resources, the water supply in Portugal is under stress, and the problem is expected to increase with climate change. Water desalination is increasingly becoming the preferred solution to ﬁght water scarcity, but, because it is energy-intensive, the underlying costs and sustainability concerns over the power sources chosen remain a challenge to its implementation. This study aims to assess if the introduction of renewable energy sources (RES) powered desalination in mainland Portugal is viable and can contribute to guarantee water security. The Portuguese Algarve region is a viable case study to be considered because it is particularly water stressed and subject to highly varying demographics depending on the season. Taking the region’s freshwater demand, hourly RES production and power demand, a cost analysis was performed in order to obtain the levelized cost of water (LCOW) for two di ﬀ erent strategies (centralized and decentralized). Two models were developed to estimate the LCOW: a simpliﬁed model and a subsequent optimization model, minimizing electricity costs. The resulting LCOW of 72.66 c € / m 3 , obtained for the decentralized solution, ﬁts within the industry standard rate despite being 61.3% higher than the estimated conventional water supply production cost.


Introduction
Listed by the World Economic Forum as one of the biggest threats to the world's economies, environment and people, water scarcity sets an unprecedented challenge to water management and energy policy makers [1]. The 2007 European Commission Communication on water scarcity and droughts stated that these issues are now a major challenge, and climate change is expected to make matters worse [2]. Despite water availability above the European average, mainland Portugal is characterized by a severe seasonal concentration of precipitation, unevenly distributed water resources, and frequent droughts and floods. The water supply in Portugal, namely in the Algarve region, is under stress, and the problem is expected to increase with climate change [3].
Water desalination technologies, namely seawater reverse osmosis (SWRO), have matured in the last decade from being a last resort solution to becoming strong candidates in water resource diversification. This shift was made possible by bringing down desalination's energy consumption, its main drawback, towards the thermodynamic limit and plateauing at around 3 kWh/m 3 [4,5].
The main recent developments have been in the pairing of SWRO desalination plants with renewable energy sources (RES) and in dealing with the challenges that intermittent power sources entail. It has been shown [6,7] that solar photovoltaic (PV) and wind turbines are two of the strongest candidates to power low carbon-emission desalination.
Gude et al. [8] suggested a holistic approach of coupling RES with technologies for the recovery, reuse and recycling of both energy and water in order to achieve a sustainable path to meet the world's energy and water needs. The authors carried out a review on the possible configurations of RES to drive different desalination technologies, and they concluded that the selection of these configurations depends on several factors (plant size, feed water salinity, remoteness, availability of grid power, technical infrastructure, and type and potential of the local RES) [8]. Khan et al. [9] reviewed the current status of using RES for small and large-scale water desalination plants. The authors focused on the use of wind and PV power with reverse osmosis (RO) and concluded that solar and wind profiles have a strong effect on the economics of RES desalination. In addition, the option of integrating wind and PV power is more economical than using either of these technologies alone, and the optimization of this RES integration is crucial to lower the production cost of water [9].
Mentis et al. [10] considered the arid islands in the Aegean Sea. Comparing desalination technologies and local RES potential, the authors opted for an RO plant powered by wind turbines and PV panels. This system was dimensioned in order to supply 100% of the local water demand within the Greek RES legislation framework. The resulting production cost of water and suggested selling price (from 145 to 260 c€/m 3 ) indicate that RES-powered desalination is a suitable alternative to the expensive and polluting solution of water transportation from the mainland [10]. In a study by Segurado et al. [11], an integrated power and water supply system was proposed for the island of S. Vicente, in Cape Verde, in order to increase RES penetration. The authors proposed a methodology to optimize the size and operational strategy of this system-a wind-powered desalination and pumped hydro storage system. The results showed that RES penetration could reach 84%, with almost 100% of wind-powered desalination water. The power and water production costs decreased by 27%, and the CO 2 emissions decreased by 67% in relation to the values foreseen for 2020 [11]. Giudici et al. [12] proposed a dynamic multi-objective approach to optimize the operation of an integrated water-power system of small off-grid islands. The case study considered was the island of Ustica, in Italy. The results showed that the optimal dynamic solutions able to satisfy the whole water demand allowed for RES penetrations up to 40%, reductions of net present cost of about 2-3 M€, and CO 2 emission reductions of more than 200 ton/year [12].
Fornarelli et al. [13] compared seven energy configurations (consisting of centralized or decentralized PV panels, wind turbines, and a connection to the grid) to determine the most cost-effective solution to power a brackish water RO desalination plant, dimensioned to supply a rural community in the coastal town of Denmark, Australia. RES intermittency was accounted for by allowing the plant feed flow rate and operating pressure to vary within admissible limits. The results showed that the inclusion of 2.4 MW of wind and 2.8 MW of PV power reduced the levelized cost of energy by 47% in relation to the current system [13].
Vakilifard et al. [14] developed a multi-period long-term planning model for an integrated urban water and energy supply system. Grid power and the surplus output of grid connected residential PV panels were considered as energy sources for a desalination-based water supply system. The optimal operational scheduling of the system was determined while considering the fluctuations of the available RES. The case study considered was the city of Perth, Australia. The results showed a 10% reduction in the levelized cost of water (reaching 184 c€/m 3 ) due to the operation flexibility and the decentralized configuration considered. Furthermore, the addition of a flexible water-related energy load to the existing power grid at the time of surplus PV generation significantly increased the potential uptake of this technology over the long-term horizon [14].
In July 2009, in the municipality of El Prat del Llobregat, a desalination plant was inaugurated to provide fresh water to the 4.5 million inhabitants of the Barcelona metropolitan area. The plant has a capacity of 200,000 m 3 /day and is able to supply about 20% of the total needs of the area. The plant has 1.3 MW of solar PV installed on its rooftops [15]. The total investment was about 230 M€, covered  [16].
This study aimed to assess if SWRO powered by a hybrid of RES and grid power is a viable solution to guarantee water security in mainland Portugal, namely through a novel cost structure. The Algarve region was chosen as a case study because it is particularly water stressed and subject to highly varying demographics depending on the season. Three scenarios were considered:

1.
A baseline scenario, where one desalination plant supplies the whole Algarve and is powered exclusively by the grid.

2.
A centralized scenario, where one desalination plant supplies the whole Algarve and is powered by three different power sources (excess RES, the plant's own production RES and grid power as backup).

3.
A decentralized scenario, where two plants supply their respective sub-regions of Algarve and are powered by three different power sources (excess RES, the plant's own production RES, and grid power as backup).
The viability of such solutions was assessed by estimating the levelized cost of water (LCOW) and comparing it to the estimated production cost of the conventional water supply. To estimate the LCOW, two models were developed: a simplified model with a constant hourly output and a subsequent optimization model to find the operational strategy that minimizes electricity costs. Once the resulting LCOWs were obtained, a comparative analysis of the various scenarios was made in order to conclude on the project's viability and to advise on the best setup.
The main contributions of this work are as follows: (i) introducing a novel cost structure, using excess RES, that allows for both a reduction of LCOW and an increase in RES exploitation; and (ii) establishing three scenarios of desalination integration into the existing water supply network of Algarve.

Costs Structure
The LCOW of the desalination plant is calculated as: where CAPEX is the total capital expenditure, CRF is the capital recovery factor, OPEX is the total annual operational expenditure, EC is the energy costs, and TWP is the total annual desalinated water produced. Figure 1 shows the different components considered for the calculation of the LCOW, apart from CRF and TWP. The CAPEX and OPEX consider the desalination plant, the water supply system, the power line, and the plant's own RES power installation. To estimate the energy costs, there is firstly the need to determine the power consumption from each source considered (excess RES, the plant's own production RES, and grid power), and the respective costs. The power consumption is divided between the power used for pumping, i.e., used for distributing water, and the power used for water production. Nevertheless, the power used for water production is also pumping power, since the desalination technology is based on RO. The electricity cost of the RES surplus was calculated based on the hourly average cost of kWh of the Iberian electricity market (MIBEL) over a decade for each season of the year. The costs of power from the plant's own production were included in the CAPEX and OPEX. The cost of electricity from the grid was based on the power supplier's tariffs. Table 1 summarizes the CAPEX relative to the capacity installed and the OPEX relative to the produced volume for a large SWRO plant (>100,000 m 3 /day). The CAPEX of the power line depends on the length of the high voltage line and its capacity. This cost was estimated using a tool provided by the local grid supplier [19]. The OPEX of the power line was not considered, as this cost is the responsibility of the local grid supplier.
A pipeline and a pumping station were designed to inject the desalinated water into the water distribution network. The capacity of a pipeline (namely its diameter) must be sufficient to drain out the daily water volume needed for peak demand, assuming a flow velocity of 1.5 m/s (i.e., the recommended upper limit [20]). The pumping station was designed accordingly by considering the pumping head needed between the plant, the closest connection to the water supply network, and the pumping capacity, dimensioned to be as close as possible to the desalination output to avoid bottlenecks and a pumping efficiency of 90%. The CAPEX of the water supply system was the sum of the CAPEX of the pipeline, the pumping station construction, and the pumping station's equipment. The OPEX of the water supply was also the sum of the OPEX of these three components. The OPEX of the pipeline was considered 0.75% of the CAPEX of the pipeline. The OPEX of the pumping station construction was considered to be 1% of the CAPEX of the pumping station construction. Finally, the OPEX of the pumping station equipment was 2.5% of the CAPEX of the pumping station equipment [20].

General Assumptions
In order to determine the necessary capacity of the desalination plant, the average daily water demand was computed for each of the four seasons of the year. Taking the highest consumption of The electricity cost of the RES surplus was calculated based on the hourly average cost of kWh of the Iberian electricity market (MIBEL) over a decade for each season of the year. The costs of power from the plant's own production were included in the CAPEX and OPEX. The cost of electricity from the grid was based on the power supplier's tariffs. Table 1 summarizes the CAPEX relative to the capacity installed and the OPEX relative to the produced volume for a large SWRO plant (>100,000 m 3 /day). The CAPEX of the power line depends on the length of the high voltage line and its capacity. This cost was estimated using a tool provided by the local grid supplier [19]. The OPEX of the power line was not considered, as this cost is the responsibility of the local grid supplier.
A pipeline and a pumping station were designed to inject the desalinated water into the water distribution network. The capacity of a pipeline (namely its diameter) must be sufficient to drain out the daily water volume needed for peak demand, assuming a flow velocity of 1.5 m/s (i.e., the recommended upper limit [20]). The pumping station was designed accordingly by considering the pumping head needed between the plant, the closest connection to the water supply network, and the pumping capacity, dimensioned to be as close as possible to the desalination output to avoid bottlenecks and a pumping efficiency of 90%. The CAPEX of the water supply system was the sum of the CAPEX of the pipeline, the pumping station construction, and the pumping station's equipment. The OPEX of the water supply was also the sum of the OPEX of these three components. The OPEX of the pipeline was considered 0.75% of the CAPEX of the pipeline. The OPEX of the pumping station construction was considered to be 1% of the CAPEX of the pumping station construction. Finally, the OPEX of the pumping station equipment was 2.5% of the CAPEX of the pumping station equipment [20].

General Assumptions
In order to determine the necessary capacity of the desalination plant, the average daily water demand was computed for each of the four seasons of the year. Taking the highest consumption of the four and dividing by a plant factor of 85% [14] to account for maintenance downtime, the nominal plant capacity was chosen so that the real capacity could cover 100% of the demand.
A desalination plant must be connected to both the water supply network and the power grid. It could be assumed that both these networks have the capacity to absorb/supply the flows generated/needed by the plant.
Three different power sources are used to desalinate and pump water: the plant's own power production (through a private wind and/or PV solar installation), the region's RES excess output, and the national power grid. The optimization model seeks to minimize the total cost associated with energy consumption. The power source with the lowest marginal cost will be consumed first, until it is exhausted, and then the model starts using the second cheapest source. Since the marginal cost considered for the plant's own RES power production is zero, the model gives priority to this source. This solution aims to ensure that the share of RES used for powering the plant is maximized and that the high electricity cost of the grid is avoided as much as possible.
To accurately grasp the availability and subsequent costs of each power source, it was determined that the analysis should be hourly based, with one representative day (comprised of 24 h blocks) for each one of the four seasons of the year.
The region's RES production was estimated by considering the existing wind farms and PV solar installed capacities as of 2018, to which the PV solar capacities of the plants whose construction is in progress and due until 2021 are added.
PV solar output was computed as the seasonal average of the estimated hourly output of each location. Wind power being particularly unpredictable, its output was computed as the seasonal average over three years of the estimated hourly output of each location. The same methodology was used to estimate the production profile of the desalination plant's own power production. A PV installation of 1.3 MW covering the rooftops of the plant was considered, to which two capacities (1.3 and 5 MW) of both PV solar and wind turbines could be added. The installation capacity chosen was the one that results in the lowest LCOW.
Assuming that the penetration of RES will increase significantly in the next decade, it was considered that, on average, RES will supply 80% of the total power demand. If there is a surplus of RES power after the deduction of this power demand, the surplus will either be exported (if there is instantaneous demand) or not used. It was considered that ensuring a power demand for desalination, whatever time of the day, represents an added guarantee to RES producers. This guarantee was assumed to ensure a price discount of 25% on the RES surplus, relative to the instantaneous MIBEL price.
To define this available RES surplus, the power demand of the region had to be quantified. Taking one representative day in 2018 for each season, an hourly power consumption profile for the whole country was first obtained. Using the latest census on population, a per capita profile was then computed. Having no precise data on the number of temporary residents resulting from tourism inflow in summertime, the increase in water consumption throughout the year was taken as an indication of population variation and used to estimate the power consumption profile of the region.

Model Specific Assumptions
As previously mentioned, two different models were developed to estimate the LCOW of the centralized and the decentralized scenarios: a simplified model and an optimization model. The simplified model takes a simpler approach, as it considers the production and pumping a constant output of desalinated water for every hour of the day (no water storage is considered). In turn, the optimization model determines the operational schedule of the desalination plant that minimizes the total electricity costs. In these models, the SWRO plants are modelled with a pressure center design that evenly splits the total output capacity into four modules. This gives the desalination plant the ability to mirror demand fluctuations without incurring fouling problems, while also staying under the optimal pumping regime.
The optimization variables in this model are: • The power consumption from each one of the three sources, for desalination purposes (3 variables).

•
The power consumption from each one of the three sources, for pumping purposes (3 variables). • Plant modules in use (4 variables).
The dimension of the vector space was 10 × 24: from 0 to 23 h, for the 10 optimization variables. The optimization model also considers the usage of a storage tank for added operational flexibility, although its level is forced to be at 0 at the start and at the end of each day.
The details of the model developed are presented in Appendix A.

Sensitivity Analysis
Using the optimization model applied to the centralized scenario, a sensitivity analysis was carried out on three key input variables in order to understand how much of an impact they might have had on the obtained LCOW. The chosen variables are: 1.
FactorRES penetr -the share of electricity demand to be supplied by regional RES production, varying by −30/+20 percentage points; 2.
PriceFactor-the price discount awarded to SWRO plants for buying electricity in bulk, varying by −20/+10 percentage points; 3.
StorageTank capacity -the volume available for water storage, for capacities from 0 to 15,000 m 3 .

Carbon Footprint of Power Consumption
Powering desalination with RES helps decrease the total carbon footprint of water desalination. The carbon footprint of the baseline scenario was estimated by taking the total grid power consumed in a year and converting it by using the grid supplier's average CO 2 emission of 256 ton/GWh [21]. The same method was then used to estimate the CO 2 emissions of both the centralized and decentralized scenarios, and the emission savings were computed referring to the baseline scenario's emissions.

Case Study
Algarve, the southernmost region of continental Portugal, has a challenging water supply. It is one of the most water stressed regions of Portugal, with a water exploitation index of 27% versus a 14% national average [22]. Superficial water sources, despite being fairly abundant, are subject to precipitation fluctuations. The main subterranean source and water supply backup of the region, the Campina de Faro, was systematically in the lower 20th percentile of its capacity in 2017/2018 [23]. Adding the severe seasonal fluctuation in water consumption caused by the touristic inflow in the summer, the effects of climate change on aquifer recharge rate, precipitation variability and the impending desertification of the region, Algarve could use the added robustness in water sources provided by water desalination. Table 2 shows the estimated daily average drinking water supply for each season. The peak daily supply (nearly 280,000 m 3 /day) was observed in the summer and set the total desalination capacity needed.  Figure 2 shows the current electricity tariff of the Portuguese grid supplier [25] and the average tariff over the last decade on the MIBEL [26], for a summer day. The wind power installed in Algarve is about 225 MW. The current PV power installed in this region is 45 MW, and 472 MW are expected to be installed by 2021. Figure 3 shows the map of the Algarve region with the two potential locations for the desalination plants. The main selection criteria were the proximity to the ocean, to the water distribution network, and to the power grid, while avoiding national park areas and main recreational beaches. The wind power installed in Algarve is about 225 MW. The current PV power installed in this region is 45 MW, and 472 MW are expected to be installed by 2021. Figure 3 shows the map of the Algarve region with the two potential locations for the desalination plants. The main selection criteria were the proximity to the ocean, to the water distribution network, and to the power grid, while avoiding national park areas and main recreational beaches. The wind power installed in Algarve is about 225 MW. The current PV power installed in this region is 45 MW, and 472 MW are expected to be installed by 2021. Figure 3 shows the map of the Algarve region with the two potential locations for the desalination plants. The main selection criteria were the proximity to the ocean, to the water distribution network, and to the power grid, while avoiding national park areas and main recreational beaches.   Tables 3 and 4 present the characteristics and the CAPEX of the power line and the water supply system, respectively, for each potential location of the desalination plant for the centralized (Algarve) and decentralized scenarios (windward and leeward).

Baseline Scenario
The baseline scenario was analyzed by using the simplified model and served as reference for the production cost that a conventionally-powered desalination plant would obtain. The resulting annual costs were 64.1 M€, and the LCOW was 90.6 c€/m 3 , which was within the range of 59-281 c€/m 3 mentioned in the literature [17]. However, it is important to highlight that there is a meaningful lack of consistency in cost data in the literature across technologies (or similar-sized facilities) due to their site-specificity and the different factors considered [27]. The relative cost contributions are shown in Figure 4: Electricity costs represent the largest contribution to the LCOW at 43.7%, which is also consistent with the literature [4,5].  Tables 3 and 4 present the characteristics and the CAPEX of the power line and the water supply system, respectively, for each potential location of the desalination plant for the centralized (Algarve) and decentralized scenarios (windward and leeward).

Baseline Scenario
The baseline scenario was analyzed by using the simplified model and served as reference for the production cost that a conventionally-powered desalination plant would obtain. The resulting annual costs were 64.1 M€, and the LCOW was 90.6 c€/m 3 , which was within the range of 59-281 c€/m 3 mentioned in the literature [17]. However, it is important to highlight that there is a meaningful lack of consistency in cost data in the literature across technologies (or similar-sized facilities) due to their site-specificity and the different factors considered [27]. The relative cost contributions are shown in Figure 4: Electricity costs represent the largest contribution to the LCOW at 43.7%, which is also consistent with the literature [4,5].

Simplified Model
The simplified model applied to the centralized scenario yielded an LCOW of 84.1 c€/m 3 , which represented a 7.1% reduction when compared to the baseline scenario. This cost difference was a result of a much lower (−19.3%) electricity expenditure for the solution that used RES power even though it added RES, CAPEX, and OPEX to the total cost. The reason behind the electricity cost difference is that the tariff of grid power was systematically higher than the MIBEL market price used in the computation of surplus RES power, as shown in Figure 2. Table 5 summarizes the main characteristics of the solution that minimizes the electricity costs for a centralized desalination plant and its resulting LCOW. The installed capacity of RES was the maximum allowed: The savings in electricity costs it represented (by avoiding buying from the grid) compensated for the added annualized CAPEX and OPEX of the PV and wind power installation. The LCOW of this scenario after optimization was 74.2 c€/m 3 , which was 18.1% lower than the baseline scenario and represented an improvement of 11.8% over the results of the simplified model. The obtained LCOW was, however, 64.7% higher than the estimated production cost of 45.0 c€/m 3 for the regular water supplier [24].  Figure 5 shows the cost contributions to the resulting LCOW. The annualized CAPEX of the desalination plant was the largest contribution, closely followed by the electricity costs, whose share dropped 4.3% when compared to the share of LCOW of the baseline scenario shown in Figure 4.

Simplified Model
The simplified model applied to the centralized scenario yielded an LCOW of 84.1 c€/m 3 , which represented a 7.1% reduction when compared to the baseline scenario. This cost difference was a result of a much lower (−19.3%) electricity expenditure for the solution that used RES power even though it added RES, CAPEX, and OPEX to the total cost. The reason behind the electricity cost difference is that the tariff of grid power was systematically higher than the MIBEL market price used in the computation of surplus RES power, as shown in Figure 2. Table 5 summarizes the main characteristics of the solution that minimizes the electricity costs for a centralized desalination plant and its resulting LCOW. The installed capacity of RES was the maximum allowed: The savings in electricity costs it represented (by avoiding buying from the grid) compensated for the added annualized CAPEX and OPEX of the PV and wind power installation. The LCOW of this scenario after optimization was 74.2 c€/m 3 , which was 18.1% lower than the baseline scenario and represented an improvement of 11.8% over the results of the simplified model. The obtained LCOW was, however, 64.7% higher than the estimated production cost of 45.0 c€/m 3 for the regular water supplier [24]. 74.2 Figure 5 shows the cost contributions to the resulting LCOW. The annualized CAPEX of the desalination plant was the largest contribution, closely followed by the electricity costs, whose share dropped 4.3% when compared to the share of LCOW of the baseline scenario shown in Figure 4.   Additional reductions in electricity costs of the optimized solution (when compared to the simplified model solution) were possible due to the operational flexibility. Since the desalination plant was oversized for the seasons where water demand was smaller than peak demand, the plant could work at an hourly output below or above the hourly average output of the season. The main consequence was that the hours with the largest desalination output (and therefore power consumption) coincided with the hours with lower tariffs, as seen when comparing Figures 2 and 6. Energies 2019, 12, x 10 of 18

Optimization Model
Additional reductions in electricity costs of the optimized solution (when compared to the simplified model solution) were possible due to the operational flexibility. Since the desalination plant was oversized for the seasons where water demand was smaller than peak demand, the plant could work at an hourly output below or above the hourly average output of the season. The main consequence was that the hours with the largest desalination output (and therefore power consumption) coincided with the hours with lower tariffs, as seen when comparing Figures 2 and 6.  Figure 6 also shows that the storage tank acts as a buffer, allowing for a looser management of water pumping and, consequently, a smaller expense in pumping power costs. The optimization model made it so that the storage tank reached its maximum capacity around the time where it was less expensive to pump the desalinated water to the water supply network while ensuring that the storage tank was empty at the start of each new day, as per the model assumptions.

Sensitivity Analysis
Taking values of RES penetration from 50% to 100%, the resulting LCOWs for the centralized scenario are given in Table 6. The large decrease in LCOW that resulted from lowering FactorRESpenetr to 50% was the result of two factors. The first was straightforward: For the hour blocks where surplus RES was being consumed, a larger portion of this less expensive alternative to grid power was now available. The second was a consequence of the gaussian shape of the profile of RES production: For high values of FactorRESpenetr, the only instant when surplus RES was available was around the peak of production of PV panels at 13/14 h, limiting the possibilities of optimization (explained by the fact that the installed capacity of PV panels was much larger than that of wind turbines). As the factor was brought down, the number of hour blocks where surplus RES was available rose, leading to not only more surplus RES power available but also more flexibility regarding when to use it.  Figure 6 also shows that the storage tank acts as a buffer, allowing for a looser management of water pumping and, consequently, a smaller expense in pumping power costs. The optimization model made it so that the storage tank reached its maximum capacity around the time where it was less expensive to pump the desalinated water to the water supply network while ensuring that the storage tank was empty at the start of each new day, as per the model assumptions.

Sensitivity Analysis
Taking values of RES penetration from 50% to 100%, the resulting LCOWs for the centralized scenario are given in Table 6. The large decrease in LCOW that resulted from lowering FactorRES penetr to 50% was the result of two factors. The first was straightforward: For the hour blocks where surplus RES was being consumed, a larger portion of this less expensive alternative to grid power was now available. The second was a consequence of the gaussian shape of the profile of RES production: For high values of FactorRES penetr , the only instant when surplus RES was available was around the peak of production of PV panels at 13/14 h, limiting the possibilities of optimization (explained by the fact that the installed capacity of PV panels was much larger than that of wind turbines). As the factor was brought down, the number of hour blocks where surplus RES was available rose, leading to not only more surplus RES power available but also more flexibility regarding when to use it. As for PriceFactor variations, the LCOW was not particularly sensitive, yielding small differences when compared to the assumed 75% value. The most important factor in determining the LCOW was the surplus RES availability: The price difference between the MIBEL and the grid tariff shown in Figure 2 was significant and therefore had a bigger impact than the negotiated discount.
Finally, regarding storage tank capacities, adding a storage tank slightly loosened the constraints on the pumping operation and allowed for a different optimum, thus resulting in lower electricity costs. The sensitivity analysis showed, however, that the added annualized storage tank CAPEX and OPEX outbalanced the savings in electricity costs for every capacity chosen. The relatively small impact on electricity costs of having a storage tank can be explained in part by it only influencing the pumping operation, while the desalination operation (which has a specific energy consumption two orders of magnitude larger) remained unchanged. Therefore, the lowest LCOW possible, at 74.0 c€/m 3 , was for a solution where there was no storage tank installed. Though the lowest LCOW was obtained without a storage tank, the recommended solution is one where a storage tank with a capacity of 10,000 m 3 is considered (for the centralized scenario). The sensitivity analysis showed that capacities larger than 10,000 m 3 did not help to further reduce electricity costs. At around 3% of the nominal plant capacity, this volume represents a safety measure for when maintenance work must be done and for when unexpected occurrences might temporarily disturb the plant's capacity to supply demand.

Simplified Model
The simplified model applied to the decentralized scenario yielded an LCOW of 81.8 c€/m 3 , which was 81.7% higher than the estimated conventional water supply production cost, but it was 9.6% lower than the baseline scenario's LCOW and 2.8% lower than the centralized solution LCOW (with annual savings of 1.4 M€). Table 7 summarizes the main characteristics of the solution that minimized the electricity costs for the decentralized scenario and its resulting LCOW. The LCOW of this scenario after optimization was 72.7 c€/m 3 , which was 19.7% lower than the baseline scenario and 2.1% lower than the optimized centralized solution. By yielding the lowest electricity expenditures of all the strategies studied, this scenario yielded the lowest LCOW and represented the optimal solution for the case of Algarve. It was, however, 61.3% higher than the estimated production cost of the regular water supplier.  Figure 7 shows the cost contributions to the resulting optimized decentralized LCOW. The annualized CAPEX of the water supply and RES installation increase by 16.3% and 100%, respectively, when compared to the centralized solution, whereas electricity costs decreased by 13.6%. The higher aggregate RES capacity, although more expensive (+0.853 M€ in CAPEX and +0.175 M€ in OPEX), allowed for a significantly lower electricity expenditure (−2.11 M€ per year).  Figure 7 shows the cost contributions to the resulting optimized decentralized LCOW. The annualized CAPEX of the water supply and RES installation increase by 16.3% and 100%, respectively, when compared to the centralized solution, whereas electricity costs decreased by 13.6%. The higher aggregate RES capacity, although more expensive (+0.853 M€ in CAPEX and +0.175 M€ in OPEX), allowed for a significantly lower electricity expenditure (−2.11 M€ per year).

Centralized versus Decentralized Scenario
An analysis of the absolute values of power consumption (shown in Table 8) helps to understand the difference in electricity costs between the two strategies and the main reason for the optimized decentralized scenario yielding the optimal LCOW; although the optimized decentralized scenario led to a slightly larger total power consumption (+0.5%, explained by the higher pumping head needed for the windward plant), the grid power consumption (the most expensive of power sources) was 9.2% lower than for the optimized centralized scenario, which also added a 24.6% improvement in CO2 emission savings.

Centralized versus Decentralized Scenario
An analysis of the absolute values of power consumption (shown in Table 8) helps to understand the difference in electricity costs between the two strategies and the main reason for the optimized decentralized scenario yielding the optimal LCOW; although the optimized decentralized scenario led to a slightly larger total power consumption (+0.5%, explained by the higher pumping head needed for the windward plant), the grid power consumption (the most expensive of power sources) was 9.2% lower than for the optimized centralized scenario, which also added a 24.6% improvement in CO 2 emission savings.

Policy Implications
There has been a steady growth in RES production globally, but the larger share of this source of power in the energy mix is aggravating the challenge posed by power demand and supply mismatch. The available surplus RES should increase in the next few decades, and using water desalination as a deferrable load with a setup such as the one proposed in this work will be an increasingly attractive option to policy makers of coastal regions affected by both water scarcity and RES power curtailment.
Desalination technologies should not, however, be used in isolation. Though the plants in this work were dimensioned to supply 100% of the drinking water demand, mixing water coming from desalination, water reuse, and rain harvesting technologies might lead to solutions that are both more cost-effective and sustainable. Policy makers should take a holistic approach when rethinking water supply networks, and they should gradually introduce desalination solutions as the lifetime of current water treatment plants comes to an end. They must also consider the challenges that come with large scale SWRO projects (namely the management of large quantities of brine waste) whose biological impact on marine ecosystems is yet to be fully understood but is known to be very significant.

Conclusions
The main purpose of this work was to understand how RES-powered desalination could become a viable solution for water stressed regions such as Algarve, Portugal, and to determine whether a centralized or a decentralized strategy yields the lowest LCOW.
The results of the optimization model indicate that the decentralized scenario is the solution with the lowest LCOW at 72.7 c€/m 3 , which was 2.1% lower than the centralized scenario's LCOW and 19.7% lower than the baseline scenario's LCOW. This result shows that, under the assumptions set for this project, having two smaller desalination plants comes at a slightly lower cost than having one large one. Though the centralized scenario benefits from economies of scale, with yearly savings of 853,000 € in total CAPEX (−3.5%), the increased installed capacity in RES for the plant's own consumption of the decentralized scenario leads to 2.11 M€ of savings in electricity costs (−13.6%) every year. It must be noted, however, that if the constraint on total RES capacity installed for the centralized scenario is relaxed and set equal to the total capacity installed for the decentralized scenario, the LCOW obtained for one large plant drops to 72.0 c€/m 3 .
A sensitivity analysis was carried out on three variables: PriceFactor, StorageTank capacity and FactorRES penetr . PriceFactor variations were found to have little impact on the LCOW. StorageTank capacity variations showed that the lowest LCOW obtained was for a setup with no storage tank and that increasing the storage tank capacity has diminishing returns regarding electricity cost savings (which are exclusively related to water pumping). The retained solution settleed for a total storage tank capacity of 10,000 m 3 , a compromise between added expenses and the need for an operational security margin. Lastly, a variation in FactorRES penetr had a significant impact on the LCOW (−7.5% for a RES penetration of 50%). RES surplus availability strongly influences total electricity costs, which makes RES penetration a very important aspect of feasibility studies. Under the conditions set for this project, the recommended solution considered a nominal plant capacity of 175,000 m 3 /day at the windward location (Portimão) and a 155,000 m 3 /day plant at the leeward location (Monte Gordo). Each of them is equipped with 5000 m 3 of storage tank capacity (for a total of 10,000 m 3 ), with 1.3 MW of rooftop solar PV, 5 MW of fixed tilt solar PV panels, and 5 MW wind turbines (for a total installed capacity of 12.6 MW of solar PV and 10 MW of wind turbines). The obtained LCOW of 72.7 c€/m 3 ranks among the lowest production costs mentioned by Gao et al. [18] at around 70 c€/m 3 but is still 61.3% higher than the reference cost of the conventional water supplier. This means that from a purely economic point of view and under the conditions set in this project, water desalination cannot compete with conventional water suppliers. However, the cost structure analysis carried out in this work shows that with the right operational strategy, the electricity costs can be minimized (33.8% reduction when compared to the simplified model), but further cost reductions are hampered by the total CAPEX (298 M€). To make this project economically viable, it is recommended to follow the example of Barcelona's Llobregat desalination plant project mentioned above. This plant has a capacity similar to the ones considered in this work (200,000 m 3 /day), and its total investment has covered with contributions from the European Union's Cohesion Fund, Spain's Ministry of Environment, and the company operating the water supply concession that covered about 12% of the total investment [16].
The solution presented can supply 100% of Algarve's freshwater demand, making desalinated water a suitable alternative to water sourced from ground and surface resources. This would greatly reduce the stress on local aquifers, allowing them to slowly replenish themselves and avoid the risk of contamination. It would make Algarve's fresh water supply drought-proof, and it would free surface resources, which are subject to precipitation and to the effects of advancing desertification, for agricultural use. As for CO 2 emissions, the decentralized scenario has an advantage over the centralized scenario by consuming less grid power, resulting in a 26.8% increase in CO 2 emission savings compared to the centralized solution and a 51.4% increased savings compared to the baseline scenario.
Finally, to implement this solution in practice, it is necessary to assess the type of contract of the RES producers with the national grid. In cases where the RES producers can inject all the power produced in the national grid, they will not have an incentive to participate in this market; on the other hand, the utility responsible for managing the national grid will have an incentive, since it can have an additional power consumption in times of excess RES production. In the cases where the RES producers have incentive to participate in this market, such as when they cannot inject RES power into the grid when there not enough power consumption, the use of the national grid for power transmission will be certainly possible, but a tariff can be charged by the utility.

Further Research
Regarding future research, several hypotheses could be tested in order to improve the developed model:

1.
What is the impact of installing batteries in the desalination plants in order to store surplus RES? What would be the resulting RES share of total power consumption? How would it affect the LCOW? 2.
Is an over-dimensioned plant a better solution? By increasing the desalination output capacity, more surplus power could be exploited around the hours of RES production peak before the capacity constraint forced curtailment. Do the electricity cost savings compensate for the increased CAPEX? How could larger storage tanks contribute? 3.
The present work strictly considered solar PV and wind power for the local RES production estimation: Should other RES power sources such as hydro power and biomass be included? What would be the impact on the hourly profile of surplus RES available?
In addition, to fully integrate the desalination plants into the existing water supply network, assumptions related to water management can also be further developed, and existing water pumping efficiency models found in the literature could be considered. Strong assumptions are made, for instance, with regard to the way water is pumped into the water supply network. As previously mentioned, under model limitations, the point of junction where the desalination plant's pipeline feeds the water supply network has to be sufficiently large so that the volume demand of the entire region can be injected. Taking the network's hydraulic constraints in consideration would contribute to a more realistic integration of the desalinated water. Finally, freshwater demand could also be estimated for an hourly basis, instead of assuming that demand is an average taken over 24 h.
Finally, it is very important to consider the brine disposal in these scenarios. On one hand, brine disposal will increase costs, but, on the other hand, brine can be used to produce value added products or energy can be recovered from the brine rejection with turbines. Constraints that impose an hourly limit of water production to the nominal desalination capacity of the plant and an hourly limit of water pumping to the pumping capacity of the water supply system are also applied.
Finally, the power from the plant's own RES for desalination and for pumping are limited to the maximum power potential of the installed RES equipment, and the power from surplus RES is also limited to the surplus that is available.
In addition, there are two constraints regarding the operation of the water storage tank. The storage tanks cannot be used overnight, so their level must be at zero at the beginning of the first hour of each day and at the end of the last hour of each day. This guarantees that the last value of each day matches the first value of the following, for a clean cycle. Finally, at any given time, the difference between the volume of water produced and the volume pumped out to the water supply network cannot be larger than the storage tank capacity.

Appendix A.2.2 Modularity
The goal of the secondary optimization is to ensure that the plant is only activating the modules that it strictly needs to produce the optimal volume set by the main optimization (electricity costs minimization). The activation of each module is modelled by a binary variable, and the objective function to minimize is given by Equation (A14).
where the superscript c represents the activation of each module. It is considered that the desalination plant has four modules, each one with a quarter of the total desalination capacity. This optimization problem has two constraints. The first one is the ensure that the operation of the modules is cumulative (Equation (A16)).