Optimization of Renewable Energy Systems: The Case of Desalination

The application of renewable energies (RE) for driving desalination units (DES) is very promising in isolated areas (i.e. islands, villages in the desert, etc.), where the electricity production is very expensive, potable water resources are inexistent and the potential of renewable energies (solar and wind) is very important (Koroneos et al., 2007; Kalogirou, 2005). The application of renewable energies in the desalination industry does not face the same barriers as in the case of RES for electricity power production (expensive storage systems to compensate the stochastic characteristics of the renewable energies). In the case of RES/DES coupling, the energy is consumed directly for water production, the water can be stored, cheaply in large quantities and for long periods (Koroneos et al., 2007).


Introduction
The application of renewable energies (RE) for driving desalination units (DES) is very promising in isolated areas (i.e.islands, villages in the desert, etc.), where the electricity production is very expensive, potable water resources are inexistent and the potential of renewable energies (solar and wind) is very important (Koroneos et al., 2007;Kalogirou, 2005).The application of renewable energies in the desalination industry does not face the same barriers as in the case of RES for electricity power production (expensive storage systems to compensate the stochastic characteristics of the renewable energies).In the case of RES/DES coupling, the energy is consumed directly for water production, the water can be stored, cheaply in large quantities and for long periods (Koroneos et al., 2007).
The operational performances, the cost and the reliability of RES/DES units depend on the design and calibration of such systems.Optimal use of RES potential is necessary in order to reduce the cost of produced water.In this frame considering hybrid configurations (PV and Wind) is the best way to optimize the use of RE.
On the other hand, the design of such systems is complex because of uncertain renewable energy supplies, load demands and the non-linear characteristics of some components.
Despite the great effort done to improve the efficiency of RES/DES systems the desalinated water cost still relatively high compared to conventional desalination units and more effort should be done to optimize this kind of systems.
In this chapter we present different methods to optimize renewable energy systems driving desalination unit, with a particular interest to the RO driven by hybrid PV/Wind systems.For this last configuration we will present a new methodology based on Genetic Algorithms.
The objective function used in this optimization is the unit cost of desalinated water during the life cycle of the plant (20 years).The presented methodology consists in selecting from available components in the market, the optimal number and the type of each unit (PV panels, wind turbines, membranes, etc.) in such way that the water needs are satisfied and the production cost is minimized.The total water cost for the life cycle of the plant is equal to the sum of the capital and maintenance costs.
The present methodology has the advantage to take into account all the critical functioning parameters that have an influence on the electricity and desalinated water productions and the investment and operational costs.
The minimization of the function total cost was implemented by using Genetic algorithms (GA), that have the capacity to reach the solution corresponding to the global optimum with a relative simple calculation.The benefit of using Genetic algorithms in the proposed methodology is the calculation of the optimal solution in the global space of feasible solutions of desalination systems (individuals).These later are obtained by different simulation during all over a year.

Desalination technologies
Future water supply is a major concern in developed and developing countries of the world, such as in Middle East and North Africa (MENA region).In these countries conventional water resources are limited and cannot sustain the growing demand where population growth is increasing dramatically.Hence, since 1970 other non conventional methods have been adopted on a large scale to satisfy this growing demand.One of the most promising technologies is water desalination whom the total world capacity increased from 100.000 m 3 /day in 1970 to 6.800.000m 3 /day in 2007 (GWI, 2010).
By looking at the total desalination plants installed in the world we simply realize that three major desalination technologies are used:


Multi stage flash process (MSF) -43.5% of world production,  Reverse osmosis (RO) -43.5% of world production, and  Multi effect distillation (MED), which has increased dramatically in the world during the last years.
MED and MSF are classified us thermal desalination technologies, however RO desalination is considered as membrane technology.Besides these technologies other techniques can be used (i.e.Mechanical Vapor Compression, MVC; Electrodialysis, ED; Humidification and Dehumidification of Air, HD; etc.).However their application still limited for specific context.

MSF desalination
An MSF distillation plant consists of several consecutive stages (evaporating chambers) maintained at decreasing pressures from the first stage (hot) to the last stage (cold).The vapor condenses to form fresh water.At vacuum conditions the boiling point of water is low requiring less energy.Before entering the first cell, seawater sweeps all cells from the last one to the first by flowing through the tubes of the heat exchangers where it is warmed by condensation of the vapor produced in each stage (Fig. 1).Its temperature increases from sea temperature to inlet temperature of the brine heater.
The seawater then flows through the brine heater where it receives the heat necessary for the process (generally by condensing steam).At the outlet of the brine heater, when entering the first cell, seawater is overheated exceeding boiling point compared to the temperature and pressure of stage 1.
Therefore, it is the abrupt introduction of this sea water into a lower pressure "stage" that makes it boil so quickly as to "flash" into steam to reach equilibrium with stage conditions.The produced vapor is condensed into fresh water on the tubular exchanger at the top of the stage.The process takes place again once the water is introduced into the following stage, and so on until the last and coldest stage.The cumulated fresh water builds up the distillate production which is extracted from the coldest stage.Seawater slightly concentrates from stage to stage and builds up the brine flow which is extracted from the last stage.
Typically a number of units are constructed alongside a combined cycle power plant and utilize low-grade steam (semi waste heat) from the power plant to produce the desalinated water.An MSF plant performance is selected to ensure the overall optimization of the plant power and steam cycles.

MED desalination
MED, like MSF, takes place in successive effects and uses the principle of reducing the ambient pressure in the various effects.This permits the seawater feed to undergo multiple boiling without supplying additional heat after the first effect.In a MED plant, the seawater enters the first effect and is raised to the boiling point after being preheated in tubes.The seawater is either sprayed or distributed onto the surface of evaporator tubes in a thin film to promote rapid boiling and evaporation.The tubes are heated by steam from a boiler or other source, which is condensed on the inside of the tubes.The condensate from the boiler steam is recycled to the boiler for reuse (Fig. 2).
In MED the maximum temperature is now limited to 80°C to reduce the scale deposition, which limit the gain output ratio (GOR) to a maximum level of 12 kg distillate/kg of steam.However, with the introduction of a compression technology plant (hybrid) to the MED process the performance has been radically improved to GOR of 15.The compression is provided by electric compressors or thermo-compressors, which utilize motive steam.
Thermal desalination (MED and MSF) produce very low TDS production (50 mg/l), and does not depend on feed quality, as is the case with the Reverse Osmosis technology.

Reverse osmosis (RO)
RO is a pressure-driven process that separates two solutions with different concentrations across a semi-permeable membrane.The fresh water flow rate through the membrane is proportional to the pressure differential that exceeds the natural osmotic pressure differential.The membrane itself represents a major pressure differential to the flow of fresh water.For brackish water desalination the operating pressures range from 15 to 30 bar, and for seawater desalination from 55 to 70 bar (Abdallah et al., 2005).The initial pressurization of the feed water represents the major energy requirement.As fresh water permeates across the membrane, the feed water becomes more and more concentrated.There is a limit to the amount of fresh water that can be recovered from the feed without causing fouling.
Seawater RO plants have recoveries from 25 to 45%, while brackish water RO plants have recovery rates as high as 90%.RO system major components include membrane modules, high-pressure pumps, power plant, and energy recovery devices as needed (Fig 3).Membrane properties and feed water salinity are the two major factors controlling the energy requirements of an RO system.Higher water salinity requires more energy to overcome the osmotic pressure.
Pre-treatment of seawater feeding RO membranes is recognized as a key in designing RO desalination plants (Gaid and Treal, 2007).The use of an adapted pre-treatment minimizes the fouling problems and can provide good protection of the membranes and a longer lifetime.

Renewable energy systems for desalination
Solar and Wind systems can be used to provide heat required to produce steam for the thermal desalination plants and electricity to drive high pressure pumps in RO units and auxiliary components in the different desalination technologies.

Solar technologies
Different solar energy collectors may be used in order to convert solar energy to thermal energy.In most of them, a fluid is heated by the solar radiation as it circulates along the solar collector through an absorber pipe.This heat transfer fluid is usually water or synthetic oil.The fluid heated at the solar collector field may be either stored at an insulated tank or used to heat another thermal storage medium.
The solar collector may be a static or suntracking device.The second ones may have one or two axes of sun tracking.Otherwise, with respect to solar concentration, solar collectors are already commercially available; nevertheless, many collector improvements and advanced solar technologies are being developed.The main solar collectors suitable for seawater distillation are as follow.

Flat-plate collector
Flat-plate collectors (FPCs) are used as heat transfer fluid, which circulates through absorber pipes made of either metal or plastic.The absorber selective coatings are used to reduce heat losses and to increase radiation absorption.Thus the thermal efficiency increases although the collector cost also increase.
A typical flat-plate collector is an insulated metal box with a glass or plastic cover and a darkcolored absorber plate.The flow tubes can be routed in parallel or in a serpentine pattern.Flat plate collectors have not been found as a useful technology for desalination (Belessiotis and Delyannis, 2001;Gracia-Rodriguez, 2002).Although they have been used for relatively small desalinated water production volumes, production of large volumes of water would require an additional energy source.

Parabolic trough collector
A parabolic trough is a linear collector with a parabolic cross-section.Its reflective surface concentrates sunlight onto a receiver tube located along the trough's focal line, heating the heat transfer fluid in the tube.Parabolic troughs typically have concentration ratios of 10 to 100, leading to operating temperatures of 100-400°C.
Parabolic trough collectors (PTCs) require sun tracking along one axis only.In this way, the receiver tube can achieve a much higher temperature than flat-plate or evacuated-tube collectors.The parabolic trough collector systems usually include a mechanical control system that keeps the trough reflector pointed at the sun throughout the day.Parabolictrough concentrating systems can provide hot water and steam, and are generally used in commercial and industrial applications.
Due to the high temperatures parabolic troughs are capable of producing high-grade thermal energy that is generally used for electricity generation (Belessiotis and Delyannis, 2001).Parabolic troughs could be a suitable energy supply for most desalination methods, but in practice, they have mainly been used for thermal distillation as these methods can take advantage of both the heat and electricity troughs produce.Parabolic Trough Collectors can also drive RO units by using Rankine Organic Cycle.

Photovoltaic systems
Photovoltaic systems consist of a number of PV modules, which convert solar radiation into direct-current (DC) electricity.The voltage and current of the system can be increased by connecting multiple cells in series and parallel, respectively.The other system equipment includes a charge controller, batteries, inverter, and other components needed to provide the output electric power suitable to operate the systems coupled with the PV system.PV is a rapidly developing technology, with costs falling dramatically with time, and this will lead to its broad application in all types of systems.Today, however, it is clear that PV-RO and PV-ED will initially be most cost-competitive for small-scale systems where other technologies are less competitive.
The electricity form PV systems can be used to drive high-pressure pumps in RO desalination plants.The main advantage of PV/desalination systems is their ability to develop small size desalination plants.The energy production unit consists of a number of photovoltaic modules, which convert solar radiation into direct electric current (DC).DC/AC inverters have to be used because RO uses alternating current (AC) for the pumps.
Energy storage (batteries) is required for PV output power smoothing or for sustaining system operation when insufficient solar energy is available.

Wind systems
Wind energy and desalination plants can be coupled in various ways (Ma and Lu, 2011).Currently, wind energy can power desalination plants directly or indirectly through four types of energy media (Fig. 4): electricity, thermal energy, gravitational potential energy and kinematical power (shaft power).
Electricity is the most commonly used energy form as the interface between wind energy and desalination process.After having converted into electricity, the energy from wind plant can be employed to drive desalination processes such as RO, ED and MVC (Kalogirou, 2005).The wind plant can be on or off the grid.Due to the intermittent characteristic of wind power, usually backup facilities like battery, water tank, flywheel system might be integrated into the system to store or release energy when the wind speed exceeds or cannot achieve the required level.Direct conversion from wind energy to thermal energy to drive thermal desalination units (distiller) has been studied since the efficiency of direct wind-thermal conversion is higher than that of wind-electricity conversion and their structures are simpler (Nakatake and Tanaka, 2005).The proposed distiller could produce 1.5 kg/d or more when a 6 m/s wind blew steadily all day on a sunny or cloudy day.
To reduce the energy loss caused by the wind-electricity conversion, gravitational energy has also been used as the interface between wind energy and desalination process.Fadigas and Dias (2009) designed an alternative configuration to conventional RO desalination systems by incorporating the use of gravitational potential energy, without using either electricity or fossil fuels.The gravitational potential energy, presented by water stored in a reservoir above a certain height, was converted by wind energy from windmills (or wind turbines).

RE/DES systems
Many different renewable energy desalination systems are technically feasible (Kalogirou, 2005).Fig. 5 presents the possible combinations between desalination processes and RE technologies.
A methodology for selecting the most appropriate combination between desalination technologies and renewable energies for a given site based on different criteria was developed (Setiawan et al., 2009).Desalination systems are energy intensive, and their energy consumption is a driving factor in determining their economic feasibility when they are coupled to RES.Typical energy consumptions for different desalination processes are shown in Table 1.  1. Energy consumption and electric power cogeneration (Bilton et al., 2011) In table 1 the energy requirements are separated into thermal energy which is used to heat the seawater and electrical energy which is used to drive pumps, compressors and auxiliary equipment.For seawater desalination, reverse osmosis requires the least amount of overall energy.However, if thermal energy is inexpensive (the case of Middle East), a thermal desalination process like multi-effect distillation can be practical.
Fig. 6 illustrates the breakdown of renewable energy powered desalination system technologies implemented worldwide in 2007 (Forstmeier, 2007).It shows that the most used RES/Desalination systems are RES/RO (51% of the total worldwide installed RES/DES plants).
Reverse Osmosis (RO) is the desalination process which can be coupled, in reliable and economic way, with RES.The suitability of renewable energy technologies, especially wind turbines and photovoltaics, for RO desalination systems is due to the convenience of RO for desalinating small quantity of water for remote and isolated areas; it has low energy consumption (Table 1) and little need for maintenance (Weiner et al., 2001).

MSF desalination plants driven by solar energy
Solar-powered MSF plants can produce 6-60 L/m 2 /day, in comparison with the 3-4 L/m 2 /day typical of solar stills (Block, 1989)).
The use of solar troughs for MSF desalination was tested mainly in the USA.In a typical commercial small plant 48 kW is required to produce 450 L/day in three stages.
In Szacsvay et al. (1999), a Solar/MSF system using an Atlantis autoflash multistage stage desalination unit is described.Since the standard MSF process is not able to operate coupled to any variable heat source, an adapted MSF system called "Autoflash" was developped.
Performance and layout data were obtained both from computer simulation and experimental results with a small-sized Solar/MSF systems in Switzerland.The system had been in operation for 9 years.From these studies it was shown that the cost of distillate could be reduced from 5.48 $/m 3 for small desalination system with a capacity of 15 m 3 /day to 2.39 $/m 3 for desalination systems with a capacity of 300 m 3 /day.

Multiple-effect distillation driven by solar energy
Several multiple-effect distillation (MED) plants of medium capacity powered by solar energy were built worldwide.One MED-plant designed for a maximum capacity of 120 m 3 /day with 18 stack type stages and pre-heaters was analyzed in UAE (El-Nashar and Samad, 1998).Evacuated-tube solar collectors of 1862 m 2 were used with water as heat carrying medium.It had a heat accumulator of 300 m 3 capacity.Specific heat consumption of the plant was 43.8 kcal/kg with performance ratio of 12.4.Due to heat accumulator the evaporator could run 24 h a day during sunny days producing freshwater of 85 m 3 /day.The plant was able to desalt seawater of 55,000 ppm.The total seawater requirement was 42.5 m 3 /h.The major problem was the maintenance of the pumps.It was shown that the acid cleaning and silt removal were extremely necessary for better performance of the plant.
A practical scale desalination system of three effects using only solar energy from solar collectors as the heat source and the electrical power from the PV-cells was investigated by Abu-Jabal et al. (2001).The unit was developed and manufactured by the Ebara Corporation (Tokyo) and tested at the Al Azhar University in Gaza.The average production rate was in the range of 6-13 L/m 2 /day.Thomas (1997) carried several experiments on MED and MSF units driven by solar energy in Kuwait.He reported several difficulties operating under the variable conditions of solar insulation.Greater success has been found with self-regulating solar MSF plants than solar MED plants.
In Fiorenza et al. (2003) the water production cost for seawater desalination by MED powered by a solar thermal field has been estimated.The results obtained for plants of capacity varying between 500 and 5000 m 3 /d have shown that the cost of water produced can be reduced by increasing the plant capacity; i.e. 3.2 $/m 3 for the 500 m 3 /d plant capacity and 2 $/m 3 for the 5000 m 3 /d plant capacity.

Reverse osmosis desalination driven by photovoltaic
Photovoltaic (PV) powered RO systems have been implemented in different regions, i.e: remote areas of the Tunisia desert, rural areas of Jordan, remote communities in Australia, etc. Several investigations were carried to analyze the cost of PV/RO desalination systems (Kalogirou, 2001).If PV connected to a RO system is commercial nowadays, the main problem of this technology is reported to be the high cost of the PV cells.The distance at which the PV energy is competitive with conventional energy depends on the plant capacity, on the distance to the electric grid and on the salt concentration of the feed (Garzia-Rodriguez, 2002).
In Saudi Arabia, a PV/RO brackish water desalination plant was installed (Hasnain and Alajlan, 1998).It was connected to a solar still with 5 m 3 /d production.The feed water of the water still was the blowdown of the RO unit (10 m 3 /d).A detailed cost analysis was also reported.
Bourouni and Chaibi (2009) presented a PV/RO desalination plant, for supplying one village, in southern Tunisia.It uses solar energy to power a reverse osmosis brackish water desalination unit with a capacity of 15 m 3 /day.They present an analytical description of the plant components and reports experimental results for a 6-month operating period.Several problems were highlighted such as brine rejection, low efficiencies and high cost.
Several tools were developed to improve the design of PV/RO systems by using iterative procedure (Herbert et al., 2007).The size of the RO unit is computed according to the desalinated-water requirements, while the PV system nominal power rating is calculated such that the corresponding energy requirements of the RO unit are satisfied, taking into account the available solar radiation potential of the installation area.The size of the battery incorporated in the system is computed such that the daily variations of the solar radiation are compensated.On the other hand, up to now the design process does not include the optimization of the components' number and type and the minimization of the total system cost.

Reverse osmosis driven by wind energy
Since the coastal areas present a high availability of wind power resources, wind powered desalination represents a promising alternative of renewable energy desalination (Gracia-Rodriguez et al., 2002).Wind-powered RO plants have been implemented on the islands of the County of Split and Dalmatia (Croatia), on the island Utsira in Norway, and in remote communities in Australia.
A prototype wind-powered RO desalination system was constructed and tested on Coconut Island off the northern coast of Oahu, Hawaii, for brackish water desalination (Liu et al., 2002).The system has four major subsystems: multivaned windmill/pump, flow/pressure stabilizer, RO module, and control mechanism.It was shown that the flow rate of 13 l/min could be processed for an average wind speed of 5 m/s, and a brackish feed water at a total dissolved solids concentration of 3000 mg/l.The average rejection rate and recovery ratio were 97% and 20%, respectively.Energy efficiency equal to 35% was shown to be comparable to the typical energy efficiency of well-operated multi-vaned windmills.
A prototype of a fully autonomous wind powered desalination system has been installed on the island of Gran Canaria in the Canarian Archipelago (Carta et al., 2003).The system consists of a wind farm, made up of two wind turbines and a flywheel, which supplies the energy needs of a group of eight RO modules throughout the complete desalination process (from the pumping of seawater to the storage of the product water), as well as the energy requirements of the control subsystems.It was highlighted that this system can be applied to seawater desalination, both on a small and large scale, in coastal regions with a scarcity of water for domestic and/or agricultural use.
The economic feasibility of a wind-powered RO plant was evaluated by mathematical modelling analysis (Forstmeier et al., 2007).It was shown that the costs of a windpowered RO desalination system are in line with what is expected for a conventional desalination system, proving to be particularly cost-competitive in areas with good wind resources that have high costs of energy.The unit cost of freshwater production by a conventional RO plant can be reduced up to 20% for regions with an average wind speed of 5 m/s or higher.
In order to optimize the design of Wind/RO systems Kiranoudis et al. (1997) considered desalination plants power-supplied by one Wind Generator (W/G).The optimal design objectives are the determination of the optimum size and type of the W/G and the optimum structure of the RO desalination unit membranes, such that the system total annual cost is minimized, with respect to certain product quality and quantity demand constraints.This procedure is implemented using a successive quadratic optimization algorithm.The W/Gdesalination systems investigated do not incorporate either electric energy, or produced water storage units.).The performances of these units were reported by Weiner et al. (2001), Peterson et al. (1981), Bourouni and Chaibi (2009) and Peterson et al. (1979).
Two RO desalination plants (Germany) using a plate module system supplied by a 6 kW wind energy converter and a 2.5 kW solar generator have been designed for remote areas (Peterson et al., 1979).Two of these prototypes were installed in the northern part of Mexico and in a small island on the German coast of the North Sea (Peterson et al., 1981).
The design of a stand-alone, hybrid PV/Wind system, used to power-supply a seawater RO desalination unit, based on a technoeconomic analysis, is proposed by Mohamed and Papadakis (2004).The system contains both a battery bank and a storage tank for the produced water, in order to cover the potable water demand during the days with negligible solar and/or wind energy production.The RO unit is designed to be able to cover the maximum daily water demand, dictating the corresponding maximum total power requirements.In the second step of the proposed methodology the number of PV modules is calculated such that the maximum energy requirements during the year are covered, taking into account the available solar radiation potential.The battery bank capacity is computed such that the electric energy required for two days can be stored.The volume of the water storage tank is calculated in such way that it provides two summer day autonomy.In order to minimize the total system cost, the developed software eliminates a part of the PV modules, determines the corresponding produced daily energy and replaces them by one or more W/G.This calculation is performed for various combinations of PV and W/G contribution percentages to the hybrid system total energy production.The combination achieving the minimum water production cost is selected as the final hybrid system configuration.Manolakos et al. (2001) discussed the developed and the application a software tool for designing hybrid PV/Wind systems, which are used to cover the electricity and water demands of remote areas.The nominal power rating of the W/G and the number of the PV modules are determined through several program runs simulating the system operation, in order to satisfy the electric energy and water needs.The battery bank is sized taking into account several days of energy autonomy of the system, in order to ensure the uninterrupted power-supply during the time periods of low solar radiation and/or low wind speed.The volume of the desalinated-water tank is computed to satisfy the water demand, even during the time periods of low RES potential availability.
Voivontas et al. ( 2001) developed a computer-aided design tool for the preliminary design of desalination plants driven by RES and the evaluation of the corresponding water production cost.The RES power production capability is determined using an iterative procedure allowing an energy balance between the energy produced by the RES and the auxiliary energy sources (e.g.electric grid, diesel generators etc.) and the energy requirements of the desalination unit.However, this design method does not include the economic optimization of the resulting configurations.The investigations carried on RO desalination plants driven by hybrid PV/Wind systems showed that this kind of units is the most efficient compared to the other RES/DES technologies.Moreover, this technology can be improved by optimizing the design of the overall plant.For these reasons we focus in this chapter on the optimization of this kind of systems.

New methodology of optimization hybrid PV/WIND/RO systems
The operational performance and the reliability of the desalination systems driven by RES depend on their proper design and sizing.The optimal exploitation of the available RES potential is necessary in order to reduce the cost of the water produced.
The objective of this chapter is to present a new methodology to optimize RO desalination system, which is power-supplied by hybrid Photovoltaic (PV) and Wind-Generator (W/G) energy sources.Compared to the past-proposed methodologies, which have been used in order to design water desalination systems driven by RES, the methodology presented in this chapter has the advantage to take into account all the critical operational parameters that affect both the resulting electric energy and desalinated-water production levels and the system capital and maintenance costs.The block diagram of the PV/Wind/RO system considered in this study is illustrated in Fig. 7.
The Battery bank is charged from the respective PV and W/G input power sources by using battery chargers, connected to a common DC bus.The power sources are usually configured in multiple power generation blocks according to the devices nominal power ratings and the redundancy requirements.The battery bank, which is usually of lead-acid type, is used to store the generated electric energy surplus and to supply the RO desalination units in case of low solar radiation and/or wind speed conditions.DC/AC converters are used to interface the DC battery voltage to the AC requirements of the RO desalination units.A water tank is used to store the produced desalinated water surplus, which is not directly consumed.The purpose of the proposed methodology is to derive, among a list of commercially available system devices, the optimal number and type of units such that the life time round total system cost (CO Tot ) is minimized.At the same time the desalinated-water demand is completely covered.CO Tot is equal to the sum of the respective components capital and maintenance costs.The decision variables for the optimization are: (i) the number and the type of the membranes, (ii) the number and the type of the PV modules, (iii) the number and the type of the wind turbines, (iv) the batteries charger, (v) the DC/AC converters, (vi) the height of the turbines and the volume of the storage tank.
The minimization of the system total cost function has been implemented using genetic algorithms (GAs), which have the ability to attain the global optimum solution with relative computational simplicity.The scope of the GAs in the proposed methodology is the calculation of the optimum solutions in the overall state space of the desalination system sizing problem.
The block diagram depicted in Fig. 8 summarizes the proposed optimization methodology.This methodology uses a database including: (i) the technical characteristics of commercially available system devices, (ii) their associated per unit capital and (iii) their maintenance costs.The input of the model are the: (i) feed and the desalinated water quality specifications (ii) water demand profile, (iii) daily solar irradiation on a horizontal plane, (iv) the hourly mean values of ambient temperature and wind speed.

www.intechopen.com
At the first step the RO plant is designed and optimized based on water demand, feed water characteristics and desalinated water specifications.One important outcome of this step is the determination of the energy required to operate the pumps and other auxiliaries.In the second step, special attention is paid to the design of energy systems related to the chosen technology and the arrangements of various components that can meet the goal of energy demand.In this step, the structure of the power unit, batteries, water storage and inverters are studied.Several Hybrid PV/Wind combinations are possible to power the designed RO plant.To validate the RES configuration, a simulation of the system operation is performed during the year in order to examine whether it fulfils the desalinated-water requirements.
In the third step, a process employing GAs is executed, in order to dynamically search for the system configuration, which subject to the criterion set in the first step, results in minimum total system cost.
During the application of the proposed methodology, the system operation is simulated for one year with a time step of one hour.The power produced by the PV and W/G sources and the desalinated-water flow rate are assumed to be constant during that time step and they are arithmetically equal to the corresponding energy and water volume, respectively.

Modeling of the RO unit
The equations of flow and salt distribution, used in the model, are similar to those provided by the software for the design of RO membrane "FILMTEC-ROSA" (DOW, 2006).
RO membranes are selected after checking the feed water characteristics.Hence, the number of membranes N mb which is a function o f unit capacit y, the stream flow Q p and the membrane surface S mb is calculated as follows.
Where f is the pure water transport coefficient.
The number N tp of pressure vessels in the system is calculated the following equation: Where N T is the total number of membranes per unit.
Equation 3 is used to calculate the water flow rate produced by RO membranes.
A is the membrane pure water permeability, TCF is the temperature correction factor, F is the membrane fouling factor (0.8≤F≤ 1), ΔP is the applied transmembrane pressure and Δп is the transmembrane osmotic pressure.
The osmotic pressure in the different elements of RO unit is given by equation 4.
273 . .1000 1000 Where C is the salt concentration.
The average pressure drop P between the first and the last element is given by equation 5.
ΔP fs represents the pressure drop between feed and discharge of a single element, it's given as follows: 1.7 0.01.
The efficiency (Y k ) of the membrane is a function of the overall performance of the RO system Y and N mb in the system (equation 7).
The product concentration C P is function of recovery rate and salt rejection (equation 8).The brine concentration C c of RO element is calculated from the equation 9.
By applying equations ( 6), ( 7) and ( 8) the: flow rates and concentrations of permeate and concentrated brine in the first element are determined respectively.Thus, product water is collected in the central tube and the brine becomes feed to the second element.This process is repeated for all elements in series.To determine the feed pressure of the system, the model starts from last element for which the applied pressure P a is calculated from equation (3).
The total water quantity Q T produced by RO system is given by equation 10.Where Q k is the amount of water produced by the cell k.The desalinated water salinity concentration is deduced from equation 11.
It should be noted that many other parameters are considered in the model including estimation of the water needs, chemical analysis of the feed water and the choice of the membranes.The optimal system design is targeting towards the minimization of the RO energy consumption.In this frame energy recovery systems can be considered.

Modeling of the photovoltaic PV panels
Each PV power generation block shown in Fig. 7, consists of N P PV modules connected in parallel and N S PV modules connected in series.On one day i (1≤i≤365) and at hour t (1≤t≤24) the maximum output power of each PV power generation block is determined.This calculation is based on the specifications of the PV module under Standard Test Conditions (STC, cell temperature=25 °C and solar irradiance=1 kW/m 2 ), provided by the manufacturer, as well as the ambient temperature and solar irradiation conditions.The following equations (12-15) are used to design the PV modules:   () . .() ., .() . 1000 ) 800 Where ( ) Pt is the maximum output power of the PV array, ( , ) Gt  is the global irradiance (W/m 2 ) incident on the PV module placed at tilt angle (°), K I is the short-circuit current temperature coefficient (A/°C), ( ) Tt is the ambient temperature (°C), NOCT is the Nominal Operating Cell Temperature (°C), provided by the manufacturer and ( ) i FF t is the Fill Factor, (Markvart, 1994).
The number of PV modules connected in series in each PV power generation block, N S , is calculated according to the battery charger maximum input voltage, m DC V , and the PV modules maximum open-circuit voltage level, m OC V : The values of the daily solar irradiation on the horizontal plane are used to calculate the value of

 
, i Gt  according to the methodology analyzed by Lorenzo (1994). www.intechopen.com

106
The battery charger power conversion factor n s is defined as follows: Pt  is the PV power really transferred to the battery bank by each PV power generation block, n 1 is the battery charger power electronic interface efficiency and n 2 is a conversion factor, which depends on the battery charging algorithm executed during the charger operation and indicates the deviation of the actual PV power generated from the corresponding maximum power.
In case that the battery charger operates according to the Maximum Power Point Tracking (MPPT) principle (Esram and Chapman, 2007), n 2 is approximately equal to 1, otherwise its value is much lower.The values of n 1 and n 2 are specified by the battery charger manufacturer.

Modeling of wind generator W/G
The variation of the W/G output power versus the wind speed is provided by the manufacturer.It usually indicates the actual power transferred to the battery bank from the W/G source, taking into account the effects of both the battery charger power electronic interface efficiency and the MPPT operation, if available.Thus, in the proposed methodology, the power transferred to the battery bank at hour t of day i, from each W/G power generation block, ( , ) i WG Pt h , is calculated using the following linear relation: .
ii WG

PP Pt hP v t hv vv
where h (m) is the W/G installation height, ( , ) i vthis the wind speed (m/s) at height h (h low ≤h≤h high according to the limits h low and h high specified by the W/G manufacturer) and (P 1 , v 1 ), (P 2 , v 2 ) are the W/G output power and wind speed pairs.
If the input wind speed data are measured at a different height than the desired W/G installation height, h, thus, (, ) i vthis corrected using the following exponential law: where ( ) vt is the reference (input) wind speed (m/s) measured at height h ref (m) and the exponent ranges from 1/7 to 1/4.

Modeling of batteries
The number of batteries connected in series in each of the multiple, parallel-connected battery strings forming the battery bank, s B n , depends on the nominal DC bus voltage and the nominal voltage of each individual battery, B V (V): www.intechopen.com Optimization of Renewable Energy Systems: The Case of Desalination 107 The value of the battery bank nominal capacity, C n (Ah), depends on the total number of batteries, N BAT , the number of series connected batteries and the nominal capacity of each battery, C B (Ah): .
The maximum permissible battery depth of discharge, DOD (%) is specified by the system designer at the beginning of the optimal sizing procedure and it dictates the value of the minimum permissible battery bank capacity during discharging, C min (Ah), which is calculated as follows: During the desalination system operation the available battery bank capacity is modified according to the PV and W/G energy production levels and the power requirements of the desalination units.This variation is expressed by the following equation: .
where C i (t), C i (t−1) is the available battery capacity (Ah) at hour t and t−1, respectively, of day i, n B =80% is the battery round-trip efficiency during charging and n B =100% during discharging (Borowy and Salameh, 1996), V BUS is the nominal DC bus voltage (V), ( ) In order to avoid the battery performance degradation under practical operating conditions the maximum permissible battery bank charging or discharging current has been limited to (C n /5) h.The initial capacity of the battery bank, C 1 (0), is calculated using the following equation:

Modeling of the global RE/DES system
The PV panels and W/G must be sized such that the produced energy during the year allows to completely satisfy the desalination system energy requirements.Hence, the remaining battery bank capacity at the end of the simulation period must be higher than its initial value: where n i (%) is the power conversion efficiency of the DC/AC inverters.The minimum permissible amount of water stored in the tank, V min (m 3 ), should be fixed (generally set equal to 25% to 30% of the tank total volume, V TANK (m 3 )).
The volume of the available water stored in the tank at hour t of day i, V i (t) (m 3 ), is modified during the desalination system operation, such that: min () When the desalinated water demand at hour t of day i ( ), i D Vt(m 3 ), is defined then the energy and water flows among the components of the system can be described by the Fig. 9.
The developed desalination system model should be used to simulate the system operation on a yearly basis to check the feasibility of the proposed solution.The optimization of the whole system is achieved by using the Genetic Algorithms methods by considering potential solutions.

System total cost minimization using gas
The genetic algorithms (GAs) are used for designing and sizing a, through the calculation of optimum solutions in the overall state space.The role of the GA is to derive the optimal desalination system configuration by selecting chromosomes from the total state space of potential solutions, which minimize the problem's objective function and simultaneously lead to a successful system operation during the whole year.
GAs is an optimum search technique based on the concepts of natural selection and survival of the fittest individuals.
It works with a fixed-size population of possible solutions of a problem, which are evolving in time.A genetic algorithm utilizes three principal genetic operators; selection, crossover andmutation.Compared to conventional optimization methods, such as dynamic programming and gradient techniques, genetic algorithms are able to: (i) handle complex problems with linear or non-linear cost functions, both accurately and efficiently and (ii) attain the global optimum solution with relative computational simplicity, without being restricted by local optima (Michalewicz, 1994).

Flushing is processed
Flushing is postponed

.. ( 2 0 1 ) . )
. expected numbers of PV battery chargers and DC/AC inverters replacements during the system 20-year lifetime period, which are equal to the system lifetime period (20 years) divided by the Mean Time Between Failures (MTBF) of power electronic converters.Each of the capital costs incorporated in Eq. ( 30) incorporates the market price and the installation cost of the respective device.
Initially, a population of chromosomes is generated randomly and the constraints described by the inequalities (Eq.30) are evaluated for each chromosome.If any of the initial population chromosomes violates these constraints then it is replaced by a new, randomly generated chromosome, which fulfils these constraints.The first step of the GAbased optimal sizing algorithm iteration is the fitness function evaluation for each chromosome of the extracted population.If any of the resulting fitness function values is lower than the lowest value obtained at the previous iterations then this value is considered to be the optimal solution of the minimization problem and the corresponding chromosome's values are considered to be the desalination system's optimal sizing and operational parameters.
This optimal solution is replaced by better solutions, if any, produced in subsequent GA generations during the program evolution.The selection of the chromosomes which will be subject to the crossover andmutation operations, thus producing the next generation population, is based on the roulette wheel method (Michalewicz, 1994).The crossover mechanism uses the Simple Crossover, Simple Arithmetical Crossover and Whole Arithmetical Crossover operators.Next, the selected chromosomes are subject to the mutation mechanism, which is performed using the Uniform Mutation, Boundary Mutation and Non-Uniform Mutation operators.In case that the application of the crossover or mutation operators results in a chromosome which does not satisfy the optimization problem constraints, then a "repair" procedure is performed and that chromosome is replaced by the corresponding parent.In case of the Simple Crossover operation, where each new chromosome is generated by two parents, then the chromosome is replaced by the parent with the best fitness function value.The GA optimization process described above is repeated until a predefined number of population generations have been evaluated.

Simulation results and discussion
The proposed methodology, has been applied and tested for the design and optimal sizing of RO desalination systems power-supplied by PV and W/G energy sources, located in the area of Ksar Ghilène Village (300 inhabitants), southern Tunisia at: latitude=33.45°,longitude=9.02°and altitude=64 m above sea level.The average national water consumption in Tunisia is about 150 l/day/inhabitant.However, the RO unit is designed for primary needs consumption (drinking, cooking, etc.).Hence, a maximum daily water consumption of 50 l/day/inhabitant was assumed; giving 15m 3 /day as maximum total water needs.
To calculate the energy needs of the system, first we calculate the total power requirements for different subsystems, given the maximum operation hours of the RO system.In the present case the total energy demand for the RO plant is 558.03Wh.
In the first iteration of the optimization methodology 20 individuals were generated.This population contains different PV/Wind combinations allowing to provide the water required by the village and the power to drive the RO plant.
The different characteristics of the components used in these simulations are summarized in table 2.  From the chromosomes generated in the first step a second generation is provided by using selection (30%), crossover (50%) and mutation (20%).We found that the minimum cost of water in the first generation was 3.56 $/m 3 .It decreased to 3.12 $/m 3 in the second generation.

RO Membranes Solar Generators Wind Turbines Batteries
The variation of the water cost during the GA-based optimization process evolution is presented in Fig. 10.
This figure shows a significant decrease of the objective function CO Tot for the first 30 generations and stabilizes around 2.62 $/m 3 .This means that the optimal solution is reached.
In the context of Ksar Ghilène Village the minimum cost corresponds to RO desalination plant driven by PV modules only.Fig. 11 presents the variation of the charge and discharge state of the batteries during throughout the year.
In the optimal solution no W/G is considered since the village of Ksar Ghilène does not have a good potential for wind energy but a very interesting solar potential.

Conclusion
Several combinations for desalination processes driven by renewable energies (RE) can be proposed to provide water and energy in remote areas (Solar/MSF, Solar/MED, PV/RO, etc.).Reverse Osmosis (RO) is most often chosen as one of the most efficient desalination techniques in terms of energy consumption, flexibility, reliability, simple maintenance, etc.
There are a number of issues that should be taken into consideration while designing RES/RO systems as: the characteristics of water demand, the cost of water and fuel, the availability of renewable energy resources, the initial cost of the project, including the cost of each component required, the life time of the project, the interest rate subsidies, etc.A techno-economic comparison between different scenarios can be carried out to study the feasibility of the project.
In this chapter a new methodology to optimize RO desalination system driven by hybrid PV/Wind systems is presented.The proposed methodology is based on determining, among a list of commercially available system devices, the optimal number and type of units (PV modules, W/G, Batteries, etc.) such that the life time round total system cost is minimized, while simultaneously the desalinated-water demand is completely covered.The minimization of the system total cost function has been implemented using genetic algorithms (GAs) that allows considering a large number of possible configurations.
The proposed method has been applied and tested for the design of a desalination system, which cover the potable water demands of a small community in South Tunisia.The application of this methodology allows to reduce the cost of the produced water from 56 $/m 3 in the first generation to 2.62 $/m 3 for the optimal solution.The fluctuation of the different costs during the GA-based optimization process shows that the capital cost of the system varies from 69% to 82% of the total cost.In all cases examined, a significant part of the desalination system total capital cost is comprised by the cost of the batteries, which fluctuates between 17% and 32% depending on the PV modules types and inclination.

Fig. 3 .
Fig. 3. Schematic diagram of one RO Desalination process with two stages
osmosis desalination driven by hybrid pv/wind systems RO desalination units driven by hybrid PV/Wind power systems have been designed and implemented in different areas of the world (e.g.Sultanate of Oman, Israel, Mexico, Tunisia, etc.

Fig. 7 .
Fig. 7. Block diagram of RO driven by Hybrid PV and W/G energy sources.

Fig. 8 .
Fig. 8.The flowchart of the proposed optimization methodology.

Fig. 9 .
Fig. 9.The flowchart of energy and water flows among the components of the system.The GA chromosomes are in the form of X = [N mb , N PV , N WG , N BAT , h, , W TANK ].The objective function to be minimized by the GA is equal to the sum of the capital and maintenance costs evolving during the desalination system lifetime period:

Fig. 10 .
Fig. 10.The variation of the total cost function during the GA-based optimization process When the necessary power for the RO operation is available, then the desalination process is performed and desalinated water is produced.Otherwise, the operation of the RO units is suspended.In this case, cleaning of each RO unit membranes should be performed, using flushing techniques.The total power produced by the PV and Wind Turbines at hour t of day i is calculated as follows:

Table 2 .
Characteristics of the different components used in the model