Optimization of Wind Energy Battery Storage Microgrid by Division Algorithm Considering Cumulative Exergy Demand for Power ‐ Water Cogeneration

: This study investigates the use of division algorithms to optimize the size of a desalination system integrated with a microgrid based on a wind turbine plant and the battery storage to supply freshwater based on cost, reliability, and energy losses. Cumulative exergy demand is used to iden ‐ tify and minimize the energy losses in the optimized system. Division algorithms are used to over ‐ come the drawback of low convergence speed encountered by the well ‐ known method genetic al ‐ gorithm. The findings indicated that there is a positive relationship between cost, cumulative ex ‐ ergy, and reliability. More specifically, when the loss of power supply probability is 10%, compared to when it is 0%, the total cumulative exergy demand and total life cycle cost are reduced by 34.76% when the battery is full and 45.44% when the battery is empty and there is a 44.43% decrease in total life cycle cost, respectively. However, the more reliable system, the less exergy is lost during the production of 1 m 3 freshwater by desalination integrated into wind turbine plant.


Introduction
The 35% growth of the world population between 2015 and 2050 not only increases the demand for energy resources but also, leads to the rapid increase in the demand for freshwater [1]. Freshwater resources on Earth are limited, and to cope with the global freshwater demand, desalination is introduced as one of the most feasible solutions [2]. Among the various available technologies for desalination, reverse osmosis systems are recognized as economic technology [3]. However, reverse osmosis systems are energyintensive; in better words, desalination of 1 m3 of freshwater approximately consumes 4 kWh of energy [4]. To address this challenge, the integration of desalination into renewable energy systems is suggested [5].
Despite all the favorable features of renewable energy, such as wind energy, renewable energy systems suffer from a time mismatch between power generation and consumption and subsequently low reliability [6]. The battery bank as a backup power can partly solve the problem [7]. However, consumption of non-renewable energy in battery bank manufacturing and even in the construction of renewable energy plants such as wind farms has caused broad concerns. Therefore, it is necessary to study the energy demand in the life cycle of electricity generation from wind-based systems including the total energy consumed in the manufacturing of system components, especially batteries.
Cumulative energy demand (CED) is one of the most important methodologies for studying and quantifying energy consumption according to a cradle to grave approach.
It can calculate the total energy demand to produce a product or perform a process over its life cycle, from material extraction to waste management [8]. On the other hand, Bahlawan et al. [9] reported a strong link between CED and critical environmental impacts such as abiotic resource depletion and global warming potential. However, it is based on the first law of thermodynamics; thus, its scientific robustness is not appropriate [10]. Also, it does not consider non-energetic materials and focus on the sources of the calorific value. In comparison, cumulative exergy demand (CExD) is based on thermodynamics' second law and includes non-energetic resources such as minerals and metal [10][11][12]. This indicator is introduced to depict the total exergy removal from nature to produce a product or perform a process [13]. Therefore, it could be a suitable indicator to study the energy in the life cycle of renewable energy systems.
On the other hand, high cost is the most significant barrier to renewable energy systems acceptance, as reported by Iskin et al. [14]. Although the cost of renewable energybased systems has considerably reduced in recent years, they are still more expensive than fossil fuel-based systems [15]. Therefore, cost reduction is a crucial parameter for the successful adoption of renewable energy-based systems [16]. Various methods examine the costs in systems, life cycle cost (LCC) computes all production costs of a product with relatively high operating costs/long life span [17].
To have a reliable, low CExD, and cost-effective system based on renewable energy resources, it is required to optimize the size of the system. It should be noted that oversizing the system suffers from high initial costs, while its undersizing leads to energy shortfalls and operational limitations, despite lower initial costs [18]. Optimizing hybrid renewable energy systems reduces initial costs by energy storage and increases reliability due to various energy resources. The genetic algorithm (GA) as a population-based optimization method is widely used in hybrid renewable energy systems to obtain the optimal solution for a nonlinear optimization problem [19][20][21][22][23]. However, GA is easily trapped into local optimization [24]. Also, it has been reported that in solving real-world problems with complicated landscapes, GA suffers from low convergence speed [25]. For solving this problem, novel algorithms are proposed and developed to optimize the multi-objective problems. Recently, Kiehbadroudinezhad et al. [26] developed a novel algorithm named division algorithm (DA) to optimize reliable and cost-effective desalination based on renewable energy resources. They claimed that in solving problems, DA is flexible, simple, precise, and fast compared to GA.
Generally, islands and higher altitude zones that are usually far from freshwater sources and close to the seawater have a high potential to use wind energy to produce fresh water from the desalination process [27]. Due to this fact, the present study proposes using wind energy to generate the electricity required in the desalination process to supply freshwater to the inhabitants of Larak Island, Iran. Nevertheless, as mentioned, optimal sizing of systems based on renewable energy can lead to increased cost-effectiveness and reliability as well as exergy management. Accordingly, this paper searches for the best system size based on cost, reliability, and exergy demand which has been neglected so far.
Although various studies design, model, and optimize desalination integrated with renewable energy in terms of size, reliability, and cost, but the CExD of systems is not still widely discussed. This paper has provided a deeper insight into the role of optimal size and reliability on the exergy flow of desalination. In better words, this paper contributes to existing knowledge of wind energy battery storage microgrid by providing a new algorithm, that is, DA, and a new objective function, that is, minimum CExD. The findings reported here contribute to a better understanding of exergy flow in renewable energy systems and provide a basis for paying attention to optimizing the exergy flow in renewable energy systems. The findings from this study also contribute to understanding the relationship between exergy flow and reliability in renewable energy systems.
To achieve the purpose, the first section of this paper explains the modeling of desalination integrated with a renewable energy system. The second section focuses on cost modeling, followed by modeling cumulative exergy demand and cumulative degree of perfection (CDP). The third section describes system reliability followed by the power control system. The fourth section explains the problem of optimization and the proposed algorithm. Finally, in the fifth section, the optimization results will be presented and discussed.

Modeling of Wind Turbine (WT)
Wind is introduced as the most mature and cost-efficient renewable resource for electricity generation among different renewable resources [28][29][30]. A wind turbine converts the mechanical energy of wind into electrical energy [31]. Generally, two influential parameters play a critical role in the amount of power output of WT, that is, wind speed and height of the WT hub that could be modeled using Equation (1) [26]: (1) In this equation, α denotes the power-law exponent, and V and V0 are wind speeds at height h and h0 or reference height. Moreover, the power output of WT could be modeled as follows [7]: where PWT and Pr are power output from WT and rated power of a WT, respectively. Also, Vci, Vco, and Vr represent cut-in wind speed, cut-out wind speed, and rated WT speed, respectively. When the number of WT (NWT) is more than 1, the power output of WTs (PT) is obtained using Equation (5): (5) Moreover, Pr could be modeled using Equation (6): In this equation, AWT is the area swept by WT's blades, ƞWT is WT efficiency, ƞr is reducer efficiency, ρa is the air density, and Cp is the power coefficient.

Modeling of Battery Bank Storage (BBS)
As mentioned, batteries are commonly used in systems based on renewable energy to achieve higher reliability. When the desalination plant's power demand is less than the power generated by WT, BBS acts as a power storage unit that the capacity of the BBS in this mode could be calculated using Equation (7) [32]: where SOC(t) is the BBS charge at time t (SOCmin ≥SOC(t) ≥ SOCmax) and SOC(t−1) denotes the BBS charge at time t−1. Also, PL is the desalination plant's power demand, σ represents the hourly self-discharge rate, ηInv shows charge efficiency of inverter efficiency, and ηBC indicates charge efficiency of BBS.
On the other hand, when the desalination plant's power demand is more than the power generated by WT, BBS acts as power support units that the available BBS capacity in this mode, that is, discharging mode, could be calculated using Equation (8): where ηBF denotes the discharge efficiency of the BBS. It should be noted that loss of power supply (LPS) could also be estimated by Equation (9):

Modeling of Seawater Reverse Osmosis Desalination (SWROD)
Power consumption per hour in a desalination plant depends on the volume of hourly freshwater demand that is obtained as follows: (10) PDEM is the hourly power consumption of the desalination plant, HWD is the hourly water demand, and SDC is the specific energy consumption of the desalination plant. In the current study, the power required by the desalination plant is determined by ROSA software. This software could also assess the desalination plant's specific energy consumption, freshwater and seawater quality, membrane type, flow permeate rate, and structure and pressure of the vessels [26]. In this study, the daily water capacity that desalination could generate is estimated as follows [33]: In this equation, DWC and PD are daily water capacity and desalination installed power, respectively. Overall, PD is between minimum power (PMD) and nominal power (PDI) [34]. Notably, the excess freshwater produced by the desalination plant is stored in the water tank (WTa). If the freshwater is kept for two days, the water tank capacity is obtained as follows: VWTa is the water tank's capacity, and DWD is the total capacity pertaining to the daily freshwater demand.

Economic Modeling
LCCWT or total life cycle cost of WT includes total investment cost (CCWT) and the maintenance cost (MCWT) of WT that could be modeled as follows: (13) In this equation, CCWT and MCWT are obtained using Equations (14) and (15), respectively: CWT is the WT price and the WT installation fee, CMnt-WT is the maintenance cost of each WT per year, and CRF is the capital recovery coefficient which is defined as follows: , In this equation, I indicates the system's interest rate, and n denotes the system's life span.
LCC of BBS also is the sum of the investment cost of BBS (CCBBS) and maintenance and operation cost of BBS (MCBBS) that could be calculated Equations (17) and (18), respectively: NBBS is the number of battery banks, CMnt-BBS is the maintenance cost of each BBS in a year, and PWBBS is payment present worth factor of battery that could be obtained as: where CBBS is battery cost. Notably, in this study, the battery bank lifetime is assumed five years.
Also, alternating current is converted to direct current by converter/inverter that its LCC of converter/inverter could be determined as follows: where CCConv/Inv is the investment cost of the electric current converter and could be expressed as follows: where NConv/Inv is the number of converters, and PWCon/Inv is the payment present worth factor of converter/inverter as follows: MCConv/Inv, that is, the maintenance cost of the electric current converter, is modeled using Equation (23): CMnt-Conv/Inv is the maintenance cost of the converter per year. Finally, LCC of SWROD is the sum of the investment cost of SWROD (CCSWROD), the maintenance cost of SWROD (MCSWROD), membrane replacement cost (TCMR), water tank cost (CCWTa), and the chemical cost (TCCH) that could be computed using Equations (24)-(28), respectively: In Equation (24), CSWROD and Cawd are the cost of the SWROD plant and the capacity of the desalination plant per day, respectively. In Equation (25), CMnt-SWROD is the maintenance cost of SWROD per year and DWD is the total freshwater demand per day. In Equation (26), CMR and NMe are the cost of membrane replacement and the number of membrane replacements per year, respectively. In Equation (27), CWTa is the sum of the price to buy and install the water tank, and VWTa is the volumetric capacity of the water tank. Finally, in Equation (28), CCH is the cost of chemicals used in desalination.

Modeling Cumulative Exergy Demand (CExD)
To find an optimized model in hybrid energy systems, identifying and minimizing the energy losses is essential. However, conventional energy analysis, which relies on the first law of thermodynamics, cannot consider the quality of energy inputs and energy losses [35]. Therefore, the exergy analysis based on the second law of thermodynamics has been developed to meet this challenge, as previously mentioned. The CExD indicates the sum of exergy of all the natural resources used to produce a product during the life cycle, that is, the cradle to grave approach, that could be determined by the natural resources' exergy values [36]. To calculate the CExD, first, inventory data were collected from all energy and materials used in freshwater production by developed configuration in the current study, that is, seawater reverse osmosis desalination/wind turbine/battery bank storage (SWROD/WT/BBS) (Figure 1). Data related to energy carriers and materials used in producing components in the system named (background data) were extracted from EcoInvent database [37]. Data related to chemical consumption for membrane cleaning and other chemicals were not included in the analysis. It should be noted that energy form categories of CExD include "non-renewable, fossil", "non-renewable, nuclear","non-renewable, primary", "non-renewable, minerals", "non-renewable, metals," "renewable, kinetic", "renewable, potential", "renewable, solar", "renewable, biomass" and "renewable, water". In the current research, CExD was calculated for 1 m 3 as the functional unit (FU). In addition, CDP was obtained for comparative exergy analysis of freshwater production by developed configuration. CDP is defined as the ratio of the exergy content of the final product (electricity generated) to the total CExD of the final product [38]. It should be noted that a higher CDP implies better savings and more efficient consumption of inputs in the system. It should be noted that results are provided both for when the batteries are fully charged and for when the batteries are charged using a turbine.

Modeling the System Reliability
The power required for desalination should be uninterruptedly provided by a reliable power generating system. Loss of power supply probability (LPSP) is introduced as a critical parameter to determine the reliability of a power-generating system [39]. Generally, LPSP that could be calculated by Equation (29) varies from zero to one; when it is zero, the power requirement can be satisfied, and when it is one, it cannot be satisfied [40,41].

Power Control System
In this study, a power control system is designed according to the relationship between the power demand of desalination and power generated by WT (Figure 2). When the power demand of desalination and power generated by WT are the same, all the power generated is directed to desalination, and no power is stored in the BBS (Equation (30)).
On the other hand, when the power demand of desalination is more than the power generated by WT, the power required could be supplied using BBS (Equation (31)).
Finally, when power the demand of the desalination is lower than the power generated by WT, the surplus power could be stored in BBS. The remaining surplus power could also be directed out of the system by the damper (Equation (32)). (32)

Optimization Problem
Typically, the objective function is defined based on one or more continuous and/or discrete decision variables that the values of these variables are determined by the optimization models [42]. For optimizing the size of the system, two decision variables are considered in the current study, that is, AWT as a continuous decision variable and NBBS as a discrete decision variable.
According to optimization objectives, the objective function could be defined using Equation (33): There are constraints in solving the optimization problem of this study that are listed in Equations (34)-(39): 1- LPSP m is the maximum LPSP, and SBBS and DOD represent nominal battery bank capacity and the battery bank's depth of discharge, respectively.
As previously mentioned, this study follows the DA, which is faster, simpler, more flexible, and precise than the GA for optimization, since it overcomes the disadvantages of GA [26,43]. For example, the DA could work without operators like crossover and mutation and reduce the complexity. The implementation process of the DA for the current study coded by MATLAB software is demonstrated in Figure 3.

Characteristics of Case Study
The design of a renewable energy-based desalination plant in Larak Island, Iran is presented as a goal. Larak Island (Longitude: 56°21'20.0" E and Latitude: 26°51'12.0" N) with an area of about 49 km 2 is an island off the coast of Iran (Figure 4). The drinking water of the island's households, estimated at 261 households, is mainly provided by Bandar Abbas, Iran. This dependence leads to difficulties in access to freshwater for the inhabitants of this island. Nevertheless, this island is surrounded by the sea; thus, launching a desalination plant could be a promising option for non-dependence on other areas in the water supply. On the other hand, according to data extracted from NASA (https://power.larc.nasa.gov/ accessed on January 12, 2020), there is a high potential for using wind as a renewable energy resource.

Results and Discussion
According to the objective function and the DA, the size of the components of desalination based on wind energy are optimized, and the results are summarized in Table 1. Findings illustrate that there is an inverse relationship between LPSP and LCC and CExD for producing 1 m 3 of freshwater. More specifically, when LPSP is 10%, compared to LPSP is 0%, the total CExD is reduced by 34.76% and 45.44%, for when the battery is full and empty, respectively. Also, there is a 44.43% decrease in the total LCC of 1 m 3 of freshwater. In our previous study [26], which focused on costs and reliability, cost optimization results were well discussed. This study focuses on CExD for producing 1 m 3 of freshwater, which is discussed in more detail below. Table 1. LCC and CExD or producing 1 m 3 of freshwater according to the optimal size of system components. Data associated with the size of system components extracted from [26]. Although the energy consumed in desalination is wind and does not have concerns associated with non-renewable energy, one should not ignore the energy consumption in the manufacturing process of components. Knowledge of the type and amount of energy consumption in the life cycle of producing 1 m 3 of freshwater by desalination integrated to WT helps better manage energy consumption. The results presented in Table 2 show the type and amount of energy consumption for producing 1 m 3 freshwater in terms of CExD when the battery is full. The results indicate that exergy removal from nature in freshwater production by SWROD/WT/BBS is primarily in the form of "renewable, kinetic" in the range of 5.56-9.46 MJ/FU and followed by "non-renewable, fossil" in the range of 1.8-2.17 MJ/FU. Other impacts categories have less of a contribution in the total amount of exergy removal from nature. The contribution of impact categories in developing the total CExD for producing 1 m 3 freshwater are presented in Figure 5, for LPSP it is 0%, 2%, 5%, and 10%.   Table 3, also shows the type and amount of energy consumption for producing 1 m 3 freshwater in terms of CExD when the battery is empty and energy must be supplied by turbines. In addition, the contribution of impact categories in developing the total CExD in this mode, for producing 1 m 3 freshwater are presented in Figure 6, for LPSP is 0%, 2%, 5%, and 10%. Due to the consumption of wind energy to charge the batteries, the share of this energy is increased compared to when the batteries are fully charged.  As shown, when system reliability is reduced, a decrease in the contribution of "renewable, kinetic" or wind energy is recorded. In contrast, an increase is shown in the contribution of "non-renewable, fossil." Therefore, it can be concluded that the lower the system's reliability, the greater the share of "non-renewable, fossil" in the system. Given the adverse consequences of non-renewable energy, finding its source in the current study is essential. Figure 7 demonstrates the contribution of various system components in producing 1 m 3 freshwater by SWROD/WT/BBS for the "non-renewable, fossil" impact category based on different LPSP (%) when the battery is full ( Figure 7A) and when the battery empty ( Figure 7B). The water tank (polyethylene) exhibited the highest effect on the "non-renewable, fossil" impact category, followed by battery for all different LPSP (%). Fossil fuels often produce polyethylene. More specifically, ethylene gas is the main ingredient for polyethylene made from crude oil and natural gas [44]. Thathiana Benavides et al. [44] reported that feedstock production, that is, natural gas and crude oil, is the most significant contributor to the consumption of fossil fuels in polyethylene production. Although the recy-cling of waste polyethylene is widely regarded as a cost-effective and eco-friendly technology [45], appropriate approaches should be considered that reduce the use of polyethylene. Because the recycling process, in turn, leads to the consumption of fossil fuels, Thathiana Benavides et al. [44] suggested bio-polyethylene production instead of fossil-polyethylene production. They reported that bio-polyethylene production leads to a reduction of 63% in fossil fuel consumption. In addition to reducing fossil fuel consumption, biopolyethylene leads to decreased carbon dioxide emissions [44,46,47]. However, in comparison with fossil-based plastics, bio-based plastics with similar mechanical properties are expensive [48]. Therefore, future research is recommended on the production of biopolyethylene at competitive prices with polyethylene.

SWROD AWT (m 2 ) NBBS LPSP (%) LCC ($/m 3 ) CExD (MJ/m 3 ) A CExD
Inventory analysis shows that graphite used in battery production has a significant role in the "non-renewable, fossil" impact category. According to Notter et al. [49], graphite is made from hard coal coke as base material; thus, hard coal used in graphite production is main responsible for the ʺnon-renewable, fossil" impact category. Given that the presence of a battery is essential to increase the system's reliability, its presence is necessary; therefore, it should be directed towards the production of batteries that consume fewer fossil fuels. For example, Padashbarmchi et al. [50] claimed that metal oxides such as iron oxide, more than graphite, are favorable anode materials in fossil fuel consumption. Due to the higher operation of the power plant to supply the battery charge, the plant's share will increase when the battery is empty. Figure 8 presents the CDP values in the production of 1 m3 freshwater by SWROD/WT/BBS. In Figure 8, there is a clear trend of decreasing CDP with increasing LPSP. The higher value of CDP indicates that lower exergy is lost, that is, the exergy performance of the system is higher in the production process [51]. Accordingly, it could be said that the more reliable the system, the less exergy is lost during the production of 1 m3 freshwater by SWROD/WT/BBS. To improve CDP, strategies can be used to reduce CExD, especially the ʺnon-renewable, fossil" impact category, as previously described. On the other hand, more efficient desalination plants should be designed to consume less electricity to produce fresh water. Finally, Figure 9 shows the convergence speed to reach the optimal solution for the DA optimization algorithms compared to GA and the artificial bee swarm optimization (ABSO) algorithms. Based on the results, the DA's convergence speed is much higher and better than the GA and ABSO. Yang et al. [52] reported that the multi-objective firefly algorithm achieves the best result in the 200th iteration (1000 iterations in total). Cao and Ye [53] also showed that the best Coarse-Grained Parallel Genetic Algorithm performance is approximately achieved in the 800th iteration when there are 1000 iterations. Amaireh et al. [54] also reported that the Antlion optimization algorithm starts converging to optimum value at almost 300 iterations (1000 iterations in total).

Conclusions and Further Works
Developing economic growth and social welfare depends on energy, especially electricity. However, electricity is usually generated by fossil fuels, whose adverse effects on the environment are well known. Accordingly, safe and clean electricity generation by renewable energy resources has currently been considered. The wind is one of the renewable resources that its conversion to electricity is presently a matured technology. However, there is a time mismatch between power generation and consumption in systems based on renewable energy resources that could be solved using support units such as battery banks. Due to the significant cost and the high consumption of non-renewable energy in the production of system components, it should not overlook energy consumption and the costs of producing the system components. To have a reliable, low CExD, and cost-effective system, this paper optimizes the components' size of a desalination system integrated into a wind turbine plant to supply the freshwater of inhabitants of Larak Island, Iran by DA. Overall, results show the convergence speed to reach the optimal solution for the DA optimization algorithms than the GA and ABSO algorithms.
More specifically, the results showed that when LPSP is 10%, compared to when LPSP is 0%, the total CExD and total LCC are reduced by 34.76% when the battery is full and 45.44% when the battery is empty and there is a 44.43% decrease in the total LLC, respectively. Moreover, based on the results, exergy removal from nature in freshwater production by developed configuration is primarily in the form of "renewable, kinetic" in the range of 5.56-9.46 MJ/FU and followed by "non-renewable, fossil" in the range of 1.8-2.17 MJ/FU when the battery is full. Due to the consumption of wind energy to charge the batteries, the share of this energy increased compared to when the batteries are fully charged. The water tank and battery exhibited the highest effect on the "non-renewable, fossil" impact category, for all different LPSP (%). The bio-polyethylene application instead of fossil-polyethylene production in water tank production and the application of metal oxides instead of graphite in battery production are promising approaches for reducing fossil fuel consumption. Although the more reliable the system has a higher CExD, the system with higher reliability lead to less exergy loss during the production of 1 m 3 freshwater by SWROD/WT/BBS. It should be noted that the main limitation of the proposed solution here is that in the real world, there are cases that may affect the energy consumption of the desalination plant that is not considered in this solution. A database has also been used to analyze the exergy, and the exergy flow may be slightly different in the real world and the target area.
Future studies should also pursue these objective functions for desalination integrated to other renewable energy resources such as solar energy, geothermal energy, biomass, etc.