Multiobjective optimization design of the solar field and reverse osmosis system with preheating feed water using Genetic algorithm

In this article the solar energy is utilized to generate needed steam for a power generation cycle which in turn provides the required power of a RO system. Optimization was carried out on two levels. First, Economizer, Evaporator, Super heater in power generation cycle as well as the type of membrane, PV numbers and series were optimized. In addition, the optimum design of a solar field for the system was carried out and the collector specifications, number of branches, and flow rate were designed. Based on the first level, optimization was designed to reduce costs and increase the permeate water production and reduction in costs and pressure drop of the solar filed. Preheating of the RO feed water had different effects on the production of fresh water at various concentrations. For feed water with constant flow rate and concentration of 45 000 ppm, the maximum rate of permeate flow was obtained at 26°C, while for concentration of 35 000 ppm, the maximum permeate flow rate was achieved at 33°C. By using 5 parallel elements SW30XLE‐400 for RO system, in the optimized condition, permeate flow rate and recovery were 9494.19 (m3/day) and 59.5%, respectively. In this condition, the unit production cost of water was 0.6046 ($/m3).


| INTRODUCTION
Design of a system for producing fresh water which can meet water needs of a city or village respecting the cost reduction is necessary and inevitable. Several methods can be applied to produce fresh water from saline water. [1][2][3][4] One of the most efficient methods that can provide fresh water at a favorable cost is reverse osmosis system. 5 Producing the fresh water by applying reverse osmosis technology attracts the researcher's attention around the world. Al-Bastaki and Abbas 6 experimentally and theoretically studied the recovery of spiral membranes and hollow fibers. In addition, the impacts of ignoring the polarization phenomena, concentration and pressure drop that estimates higher recovery for reverse osmosis system were investigated. El-Halwagi 7 modeled the structure of reverse osmosis system based on state-space method. In this way, an approach was introduced to reduce the condensate water. Mathematical model expressed in the study was formulated as a nonlinear programming problem ((MINLP). Zhu et al 8 introduce an agent to decrease the required time for solving the equations according El-Halwagi's work. 7 Voros et al 9 simplified the model that defined by El-Halwagi by reducing the distribution box connections. Maskan et al 10 utilized a direct graph and connect matrix to exhibit the network form of reverse osmosis. In this type of mathematical simulation, the computational time can be reduced by using variable reduction techniques. Nemeth 11 evaluated the performance of low pressure membranes of reverse osmosis in full-scale system and proposed this method for improving the structure and efficiency of the system. Voros et al 12 identified the permeability parameter value for six various Ions. In their study, concentration and flow of production water and condensate water were given based on experimental data. Transmission parameters including mass and water transfer coefficient were calculated. Experimental plots were utilized to calculate the mentioned coefficients.
Hybrid membrane Inter-stage Design (HID) is the combination of the membrane with the flow and different nominal salt rejection in Reverse osmosis pressure vessels. The main goal of Peñate and García-Rodríguez 13 was representing the results from full computer evaluation for seawater in reverse osmosis plants. Two kinds of analysis were performed for various membrane models. At first, membrane replacement was done due to low pressure. Thereby, it resulted in the reduction in energy consumption to achieve a constant flow. In the second kind, replacement took place to improve output with low specific energy utilization while electrical energy consumption was constant. The overall design of HID was defined as a bench mark for three main membrane producers of the hydranautics, filmtec and Toray.
Thermoeconomic analysis is an appropriate method which is obtained from the combination of both economic and thermodynamic aspects. [14][15][16][17][18][19] This approach is able to obtain irreversibilities and the type of effect that each procedure has on the exergy economic cost of products.
Romero-Ternero et al 20 carried out a thermoeconomic analysis on reverse osmosis system with nominal capacity equal to 21 000 m 3 /d. The obtained results showed that economic analysis had priority compared with thermodynamic analysis; therefore, the influence of working factors on the final product cost was a significant constraint. The main parts of the reverse osmosis system including membrane and PV had the highest effect on the components in thermodynamic analysis. The pretreatment had a significant effect on the cost of water production (upc) since the O & M costs. External costs, including the use of chemical cleaning of the membrane, lighting with annual real discount rate had the highest impact on the permeate flow sensitivity analysis and the efficiency of high-pressure pump. On the other hand, the replacement of the membrane replacement had the least effect based on their analysis. In another study conducted by Romero-Ternero et al 21 the process flowchart, rate of exergy flow, the related cost, and the rate of exergy destruction were determined in the components. It was concluded that 80% of exergy flow rate destruction occurred in core areas of process (High-Pressure Pump, Regulator Valve, Reverse osmosis separation, and Energy Recovery). Twenty-nine percent additional exergy flow rate was required to provide water supply that included pumping from sea to treatment and pretreatment plant. The exergy efficiency was approximately 50%. Lu et al 22 provided the reverse osmosis system which had various inputs and outputs. In their research, synthesisbased optimization technique was applied. Spiral type was utilized to model the membrane plant. In their study, optimization was presented to obtain the type of membrane and the required membrane component per pressure vessel. In the proposed method, each of the input and output percentage was determined. The distribution of percentages can be achieved through optimization. Marcovecchio et al 23 offered an algorithm to optimize the national networks in process of the reverse osmosis seawater desalination. Hollow fiber membranes for reverse osmosis were studied in their research. To describe the phenomenon of heat transfer in the membrane, the Kimura-Sourirajan's model is utilized. The objective function was to minimize investment costs (including the cost of membrane pumps and the systems used for energy recov-ery…) and the main costs (such as replacing the membrane and using the chemicals for pretreatment). Moreover, the application of optimization for RO technology can be found in the study performed by Poullikkas. 24 The algorithm works on the basis of the cost of various components and designs systems based on reverse osmosis. In this algorithm, parameters of investment costs, variable and constant O & M costs, interest rates, and energy costs are considered as variable.
Du et al 25 offered multiobjective optimization for reverse osmosis systems which in the proposed model, the transportation phenomena in the membrane at various velocity, pressure, and concentration was studied. Initially, due to a variety of devices, optimization of energy recovery was done. In the next step, exergy analysis of the system was carried out. The total annual costs and total cost functions and optimization were presented. Energy costs in the process of water treatment by reverse osmosis method were about 50-70% of the total cost. High levels of electrical energy consumption in water treatment by reverse osmosis method have led to the production of fresh water. Utilizing fossil fuels is the most common way to generate electricity. Decrease in electricity consumption results in lower environmental impacts. 26 Based on the literature review, for each cubic meter of treated water, 3 kg of CO 2 is produced. 26 Report that published by the Desalination Markets in 2010 showed 11% growth in demand of water in the past few years. 26 The capacity of water treatment plant was expected to be 68 million cubic meters per day in 2016. Increase in quantity of water supply, fossil fuel utilization, and emissions of greenhouse gases (GHGs) related to the warming of the planet will increase. 26 In addition, according to environmental regulations that were presented in the Kyoto Protocol, using the environmentally friendly systems including renewable ones is supported. To allow this, for producing fresh water, integrating solar power and reverse osmosis is utilized. Moreover, to reduce the environmental effects, using the solar energy is favorable for remote areas or areas where there is no adequate energy resource. 26 Renewable energies are applicable for various purposes including power generation, water heating systems, and desalinations. [27][28][29][30][31] Using the efficient, innovative, and costeffective renewable energy systems to produce drinking water is the target of several scientists and researches. 32,33 Organic Rankine Cycle (ORC) system is one of the efficient technologies in remote areas that are out of reach for power generation. [34][35][36] ORC is similar to Rankine cycle, while the working fluid is an organic compound. ORC energy needs can be provided by a small cycle of photovoltaic (PV).
Ibarra et al 37 had examined the thermodynamic study of the system for input power in reverse osmosis systems. Karellas et al 38 offered the overall design of a system to utilize a solar field in order to activate the procedure of reverse osmosis organic solar Rankine cycle and project cost to simultaneously solve two problems. Nafey and Sharaf 39 investigated solar ORC with the reverse osmosis. Cycle consisted of a solar field, a turbine to produce work, pumping component, condenser, and RO unit. The investigation included the calculation of the efficiency of exergy, destruction of exergy, thermodynamic efficiency, and economic evaluation. System was designed by Simulink area of Matlab software. Reverse osmosis unit used in the study was Sharm el-Sheikh. As well as, various organic fluids were studied in the cycle. Solar reverse osmosis systems based on organic Rankine cycle solar had better efficiency in the cases of low and medium capacities. Delgado-Torres and García-Rodríguez 40 offered recommendations for the design of this type of systems. In this research, the analysis of the mentioned system was specifically studied. Useful information for selecting an operating fluid and the boundary conditions ORC, the solar farm installations' temperature, solar collectors, and proper storage units was presented.
Peñate and García-Rodríguez 41 conducted study on solar reverse osmosis systems with capacities of about 1000-5000 m 3 /d. A solar field of parabolic type was used in their study. The overall assessment of the project compared with other technologies was performed. Li et al 42 studied the use of parabolic collectors for ORC cycle to generate electricity to be applied in reverse osmosis systems. In addition, a comparison between the case and the case of the power grid was carried out. For the first case, the fluid named hexamethyldisiloxane was utilized as the operating fluid and the efficiency of the cycle was equal to 21%. In the mentioned study, the impact of temperature of water entering the reverse osmosis system on the cycle was investigated and concluded that the SEC declined with the increase in temperature of water.
Manolakos et al 43 put a lot of efforts in technical and economic studies in order to design reverse osmosis systems for input power. In the first design, 18 photovoltaic modules were utilized for energy production; while in the second design, pump and an ORC system were applied to generate power. The economic analysis also estimated the cost of the two projects, a comparison between the two projects had done from an economic perspective.
In a study, 44 the minimum initial cost of photovoltaic modules to supply energy that was needed for reverse osmosis units was evaluated. A function was used, which was obtained on the basis of the second law of thermodynamics, to determine the cost. Parameter's Function was estimated data related to the air. In addition, the effects of input and output salinity of system on the overall performance of the system were studied.
Salcedo et al 26 had examined the reverse osmosis filtration system that used solar Rankine cycle based on the economic and environmental point of view. The optimization was conducted to minimize the costs and environmental impacts. Their results showed that using these systems significantly reduced the environmental impacts while the cost was low.
Kosmadakis et al 45 studied the solar organic Rankine cycle parameters of a two-stage reverse osmosis system to produce power. Simulation of the system was performed in order to achieve good productivity and annual mechanical power calculation. The sensitivity analysis was carried out on various parameters of the system which can be used to determine the slop of the collectors and their total number. Nafey et al 46 thermos-economically analyzed reverse osmosis system in the basic state (transducers and turbines) as well as units with energy recovery. In their study, the energy | 627 GHOUJDI et al. required for reverse osmosis was provided by ORC cycle. It was concluded that the best configuration of RO system was obtained by using the pressure transducer.
Bruno et al 47 performed a study on the modeling and optimization of the organic Rankine cycle which acted as a stimulant for reverse osmosis unit. Solar collectors were utilized in the ORC cycle. The introduced system was applicable for remote areas without connection to the grid of electricity (or a very high cost). In the study, ORC system was simulated by applying Aspen Plus. The needed input was obtained by other programs for simulation of RO and solar field. At first, based on fluid used in the ORC, analysis was done and the best fluid was used with respect to collectors. To achieve the optimum overall efficiency integrated system ORC, RO, and solar field, the optimal operation temperature was calculated. Then, it had been carried out for two cases in Spain and Germany, based on the various levels of the solar radiation and analyzing the economic and technical calculations. In addition, using solar energy to produce fresh water can be cited to Kabeel and El-Said. 48 They conducted a practical study in Egypt to produce fresh water by using energy of sun and applying nanofluid. In the previous work in this field, the hybrid system of dehumidifiers and an evaporator component with respect to heat and mass transfer were modeled. 48,49 Several studies have focused on the environmental impact of desalination. For instance, Ranjan et al 50 examined a desalination unit integrated with solar pool without any unfavorable environmental effect. The analysis covered both exergy and energy concepts in India. Including a recent economic study on the parabolic mirror, it can be referred to Anuj Mathur 51 who had studied the economic analysis of linear parabolic mirrors used in solar energy.
Li 52 built a small-scale pilot humidification-dehumidification. In the study, a series of multiple testing for water desalination were designed based on a novel type of water desalination by solar design. This example of mathematical model had been optimized and finally the results showed that various temperature of inlet sprayed water in the pad humidifier, in the range of 9-27°C, can significantly enhance outlet moist air relative humidity from 89% to 97% and the temperature of outlet air varied from 35°C to 42°C.
Franchini 53 investigated the HD system to produce fresh water at 200 L per hour by modeling thermodynamic specifications of both air and water in a computer to optimize the levels of thermal and mass flow rate of air and sea. The performance of the unit could reach 63.6 kg per hour when the flow rate of water was 1000 kg per hour and GOR of desalination system was able to reach 2.1 by reusing the latent heat. Nematollahi 54 developed dynamic models based on the equations of heat and mass transfer. The model was able to predict the weather in different situations and it included a collector, a tower of solar desalination systems, and dehumidifiers (a humidification tower). The system was designed according to exergy analysis which had high exergy efficiency.
There are some other approaches to desalinate water with solar energy. 55-57 Caputo 57 designed the desalination system using photovoltaic cell membrane and reverse osmosis process for systems which require electricity in desalination process. Liu 58 designed a miniature solar desalination unit with multistage evaporation. The designed system included four stages of evaporation using a parabolic solar focus to deal with the evaporation of seawater.
In order to reduce unfavorable environmental issues and costs related to fuel consumption, several methods have been proposed for energy systems. Using hybrid systems, developing renewable energies, and optimizing the working conditions are among the most attractive ideas. 59,60 Due to this fact, using renewable energy sources and optimizing operating conditions of desalination units result in more environmentally friendly performance. 61,62 In this study, solar farm is used to provide the thermal energy of a steam power plant which produces required electricity for a reverse osmosis water treatment system. Afterward, regarding the preheating of the reverse osmosis feed water, the optimum temperature for a certain concentration is determined. In the next step, genetic algorithm is applied to optimize the objective for reducing costs and increasing permeate water production. In this optimization, design of the heat exchanger, power cycle generation, and reverse osmosis system parameters are performed. Optimization method leads to determine optimal parameters, such as pinch and approach temperature, incoming flow rate of oil in solar farm for the heat exchanger, the number of membranes, membrane parameters, and the temperature difference between inlet and outlet cold water.

| SYSTEM DESCRIPTION
The studied cycle consists of three general parts as shown in Figure 1. The first part includes solar farm. VP1 oil is utilized as heat transfer fluid. The energy absorbed by the absorber pipes which can cause the VP1 oil to be warm and its temperature increase up to 400. According to the reference 63 this oil produces higher steam in comparison with other thermal oils. Subsequently, the oil is transferred into a steam generator that includes three components.
The type of heat exchanger in this study is shell and tube type. In this configuration, oil is in the shell and steam exists in the tube. The heat exchanger is a medium between the solar farm and power production system. Produced steam by heat exchanger enters the steam turbine at point (1) where there is a turbine with certain isentropic efficiency. The quality of the steam in point (2) can be determined by using thermodynamic relationships.
The two-phase flow enters the condenser to condensate. Consequently, at point (3), saturated liquid enters into the pump and the cycle of power generation is completed. The third part of the system has Plug two-stage reverse osmosis system. The power which is generated by the turbine drives a high-pressure pump in order to supply required pressure for the reverse osmosis system. Preheated water in condenser enters the RO high-pressure pump. Seawater enters the pump at pint (8) and after passing an initial treatment, it does the cooling process of the turbine's output steam, in condenser. In this case, with respect to the temperature difference which is calculated by the designer, certain flow of seawater enters at point (12) to the first stage of the RO system. Water output from Step 1 at point (13) has still considerable pressure. As a result, it can be used as another step in the RO system. Also, the water that has dropped its salts contain, exit from the membrane in point (14) at atmospheric pressure. Then, after going through a similar process in the second stage of RO, fresh water mixes with fresh water that is produced in the previous stage and exit from the other side of the cycle in point (15) as the produced desalinated water.

| RO system modeling
Reverse osmosis stage is usually a single-or multistage plug system. In this approach, each stage composed of various parallel pressure vessels (PV). Each PV has several components with the same membranes which have serial connection. Water is fed into the first component. After the treatment, the condensate water (water output of membrane) goes into the second component. And so on until the last component will continue. Outlet products of all elements are connected to each other and, finally, the obtained product is gathered. The number of series component is between 2 and 8. 64 Brine water enters the second step as a feed water and flows a similar trend to improve the permeate flow rate.

| RO system design
RO system design consists of several complicated steps. Reference 64 introduces an outstanding method for process design of RO systems. At the first step, regarding the quality of feed water entering the membrane, the membrane average flow rate (f) is determined. Afterward, by using Equation (1), the total number of required components of the system (NE) is calculated and number of PVs from Equation (2) is obtained. Using design values of DOW company tables and the number of elements it is possible to calculate the number of steps to achieve a desired recovery. After determining the number of stages, using a specified stage ratio (Equation 3) the number of pressure vessels within each stage can be achieved from Equations (4) and (5). 64 In this equation Q p is rate of permeate flow (m 3 /h) and S m is membrane area (m 2 ).
N V is the total number of utilized pressure vessels, N E is the total number of elements, and N EPV is the number of components in each series.
RR is the stage ratio, R is recovery system, and n is the number of stages.
which is discussed in the article Since modeling RO system in Refs 6,22,25 are fully expressed, in this article it is focused on describing the governing equations for an element which is shown in Table 1. The auxiliary equations which are used to solve nonlinear problem are represented in Table 2. Equations (6) and (7) express the intensity of water flow (J w ) and salt (J s ) of the membrane (kg/m 2 s). Average speed of flow in the membrane can be obtained by Equation (8). 6,22,25 The concentration of salt in permeate (product water) is obtained from Equation (9). 6 Also, due to the polarization phenomena, the membrane wall salt concentration in the feed water side (C w ) is determined by applying the film theory in Equation (10). 7 Considering the continuity equation, Equations (11) and (12) can be applied for water and Equation (13) can be used for salt. In the mentioned equations, A and B are the membrane penetration of water and salt, respectively, which can be found in reference. 22,25 In order to have a discussion for auxiliary equations of Table 2, Equation (14) is utilized for the coefficient of mass transfer. In this relationship, D s is amount of salt permeability (m 2 /S) and d is the distance between feed streams which is used to approximate the average pressure drop from Hagen-Poiseuille equation (Equation 16). For a spiral membrane (helical), each feed water and product streams can be assumed as a flow between two parallel plates with length L, width W, and distance d. Accordingly, the pressure drop in the feed flow is calculated. For spiral element, membrane width, W, can be determined by the Equation (21) with respect to the membrane surface (S m ) and the number of layers (N 1 ). 22 To estimate the amount of flow rate, average rate of input (Q f ) and output (Q b ) of the membrane is used. Π is osmosis pressure and C in the Equation (19) is the salt concentration. Reference temperature is 25°C in the reverse osmosis process that can be fixed during the process. If the temperature of incoming feed water differs from the reference temperature, the correction factor TCF indicated in Equation (20) will be used. 64 To solve these system of equations, in some references the salt rejection is assumed to be known (for instance, in Ref. 22 ) and in some other references, RO recovery is assumed (eg, in Ref. 10 ).
Al-Bastaki and Abbas 6 introduced another approach to solve equations with as many unknown parameters which is based on trial and error. In this study least assumptions are used; therefore, a detailed and comprehensive modeling based on Al-Bastaki method 6 was used. Afterward, Jacobean method was used to solve nonlinear equations. In these equations, the pressure of feed water is determined using Equations (22) and (23).
In this regard, V f is special volume of incoming water (m 3 /kg), P f and P in (kPa) are the feed water and pump inlet water pressure, respectively. In Equation (23), η pump is the pump efficiency.
Each component was divided into smaller elements in order to achieve higher accuracy. The component output would be the input for the next element. Figure 2 shows the method of element dividing into smaller components to increase the accuracy which was selected according to the proposed method by Al-Bastaki and Abbas. 6 The effect of dividing of each element will check in the validation.

| Solar farm modeling
Two models are conventional for modeling the solar collectors including one and two dimensional. Figure 3 shows a cross section of HEC (heat collector component) without glass. It also shows a transient one-dimensional energy balance around it. Equation (24) can present one-dimensional energy balance in absorber tubes of solar collectors.
where ̇q Solar is solar radiation, ̇q Rad is the wasted energy by radiation heat transfer, q conv is the energy transferred through convection, and ̇q cond, bracket is bracket heat losses. q cond is the part of solar energy absorbed by receiver and transferred by conduction via the tube wall into the inside fluid and lead to increase its temperature can be increased. Assumptions made in the modeling include the uniform temperature, heat flux, and thermodynamic properties within the fluid and pipe element and also the fluxes shown in Figure 3 are positive in shown directions. Losses can be expressed in an element as follows: Using Newton's law of cooling, the heat transfer (convective) to the operating fluid is as follows: There are two modes for calculating Nusselt number, Turbulent flow (Re > 2300), and Laminar flow (Re < 2300). To calculate the Nusselt number in turbulent flow, Gnielinski 65 proposed the following relation: which f is friction coefficient in the inner surface of the absorber tube and Pr is Prandtl number of the operating fluid.
For laminar flow, f is calculated via f = 64/Re.
The Fourier's law of thermal conduction has calculated the conductive heat transfer from the wall of a hollow cylinder that is an absorber tube here. In this equation, T flow and T w are inner and outer wall temperature, respectively. The equivalent diameter can be used for each one. 66 In this equation, k is the absorber tube thermal conductivity. By considering copper as material of the absorber, its thermal conductivity is supposed to be constant equals to 400 W/mK. 66 If the stainless steel is used, the following equations are appropriate 66 : Heat transfer from the absorber pipes to the environment occurs in two ways: convection and radiation. The amount of k 0 is determined from the reference. 66 Convection is occurred because of the existence or absence of wind, so it can be free or forced.
Convection heat transfer is determined by Newton's law of cooling as previously explained. Only Nusselt numbers change when conditions change. In case of no wind condition, Nusselt relations have obtained from Churchill and Chu equations. 66 To calculate the Nusselt when there is no wind, the following equation can be used: (24) q Solar =q Rad +q conv +q cond +q cond, bracket (25) q Heat Loss =q conv +q Rad +q cond,bracket (26)  where β is coefficient of volume thermal expansion, v refers to Kinematic Viscosity, Ra is Rayleigh numbers, P r is Prandtl number evaluated at average of average ambient temperature and the pipe surface temperature, and T ave can be present by the average temperature of the surface and the environment. In case of wind condition, convection from the tube to the environment is forced convection and therefore the relevant Nusselt number can be obtained from Zhukauskas' correlation. 63,66,67 The amount of radiation between the pipes and environment is estimated by the following equations 41,44 : σ is Stefan-Boltzmann constant and θ is the coefficients of the collector optics angle with sky. T sky is the temperature of sky that can be obtained by Ouagued et al equation. 68

| Heat exchanger modeling
The heat exchanger modeling is according to the concepts of approach point and pinch, which governs the oil and the temperature profiles of steam. The pinch point defined as the difference between the temperatures of the oil exiting the evaporator and the saturated steam exist in the evaporator. The decrease in the pinch point reduces loss. However, the costs of the heat exchanger and the pressure drop will increase. 69 Moreover, the increase in the pinch point temperature reduces the needed area for heat transfer. Figure 4 illustrates the approach and pinch number. Approach point defines as the difference between the temperatures of the economizer exiting water and water (which is saturated) in the evaporator. In single-pressure heat exchanger, reducing the approach point enhances the heat exchanger performance. However, formation of steam in the economizer causes some constraints on the approach point. 69 Both pinch point and approach points are considered in the modeling.
For economizer, evaporator, and super heater, mass and energy balance equations are represented in following sections. Economizer: Evaporator: Super heater: Besides thermodynamic simulation of heat exchanger, the model introduced by Serth et al 70 was utilized to determine heat transfer and pressure loss. Shell analysis is not as simple as analysis of the pipe. This due to the fact that the flow in the shell is complex and is combination of the cross flow, flow in window wall, and flow bypass wall-shell.

| Economic analysis
To reach an optimum design economic analysis has a great importance besides economic and thermodynamic limits. The total annual cost (TAC) consists of two term including operating costs (OC) and the total cost investment (TCI). The total cost of investment (TCI) includes fixed investment costs (FCI), Startup costs (SUC), working costs (WC), Licensing fees and research and development cost (LRD), and the cost has been estimated due to lack of budget during construction (AFUDC) 71 : Direct cost of the project is calculated by the Equation (49) that includes the internal costs of site (ONSC) and activation cost (OFSC).
Research and development cost is calculated as: TCI can be achieved from equation (54): TCI is also possible to be taken into account by combination of (55) and (54): Experience has shown that the cost of fixed investment in a new system is between 8.2 and 5.5 times more than the cost of buying equipment. 72 By combination of above equations with equation (57), the following equation is obtained: With the cost of purchasing equipment (CC) and internal costs site (ONSC), the total investment costs (TCI) can be estimated. Equations to estimate the cost of a reverse osmosis system are introduced in Table 3. The costs of other equipment such as steam turbine, condenser, and solar farms are presented in Table 4. It is worth noting that the cost of the heat exchanger is achieved from references. 66,70 In the above table CC m is the total cost of membrane module. C k is the price of the membrane component, and C pv refers to price of the pressure vessel.
In these equations: ΔT in : The difference between incoming and outgoing water flow temperatures for cooling the condenser. The price of pumps in power generation cycle is achieved by Equation (61). The operation cost of the reverse osmosis system is determined as: In the above equations: OC m : The cost of replacement. 14 OC o\m : The total operation cost OC lab : Annual costs of laboratory OC maint : Annual maintenance cost OC ch : The annual cost of chemicals OC insur : Insurance costs The operation costs of other components with respect to the reference 71 were calculated.
Finally, the total annual benefit is calculated as follows: The total normalized cost is determined from:    Investment cost factor (CRF) is related to interest rate and the estimated life of the equipment which is obtained from Ref. 25 : In which, Year is the useful life of the project and I is the interest rate.
The amount of fresh water unit production cost (UPC) is calculated as follows: In the economic modeling, RO system parameters are considered according to Table 5.

| VALIDATION
A For validation of software code written with MATLAB, ROSA software is used. In this validation which is done by the ROSA software for plug system, flow rate and concentration of feed water is intended to be 40 m 3 /hour and TDS to be 4049 ppm. This sample is modeled considering a two-stage RO system which 3 PV in the first stage and 2 PV in the second stage. Each PV supposed to have 6 series elements (Table 6).
To prove the independency of computational results with respect to number of divisions in each element, the number of division varies between 30 and 75 and its effect on the computational error was determined as shown in Figure 5. As can be seen, by increasing the number of elements, the error can be reduced. This change becomes moderate from the element 60 to 75.

| OPTIMIZATION
In order to obtain the optimal parameters, an optimization algorithm can be applied. Although gradient descent approaches are the most elegant approaches for solving the optimization problems, it is possible to be got trapped at local optimum depending. To obtain a reasonable final result, these methods require close initial guesses for the solution variables. Stochastic optimization approaches such as GA seem to be promising option for resolving such problems.
In this study, the optimal design of the cycle will be asserted. To do this, the two-objective optimization is performed by two-objective functions including unit production cost (UPC) and fresh water flow rate (Q p ). The optimization parameters along with their allowable bounds are expressed in Table 7. The selected lower and upper bounds are according to previous studies. 63,72,75 Three types of membrane SW30HR-320, SW30HR-380, and SW30XLE-400 from DOW Company are considered for both economic and technical analysis and optimization.

Number of equation
T A B L E 3 Cost of reverse osmosis system's components 22,25

| RESULTS
One of the important aims of this study is increasing the production of fresh water with the lowest possible unit production cost. To increase the rate of water production, the flow rate of feed water and its pressure should be increased. In this plant, to increase the supply pressure, required power of the high-pressure pump is increased; therefore, the steam flow rate of the power cycle must be increased. The generated steam flow rate in the cycle can change with pinch and approach temperature as well as the input oil flow rate from the solar farm. In this section, the effects of these parameters on the output of the system are discussed.

Cost (P steam =12 bar) Cost (P steam =12 bar) Cost (P steam =5 bar) Cost (P steam =5 bar)
According to Figure 6, by increasing the pinch temperature in heat exchanger, the rate of steam flow and total cost for construction are decreased. With constant oil flow rate, increasing the pinch temperature leads to reduction in heat transfer. As a consequence, steam flow rate is reduced. Also at a constant pinch, the levelized cost of heat exchanger increases by increasing the main-steam pressure while the steam flow rate is decreased.
By increasing the pinch temperature and constant flow rate for feed water in the RO system, the fresh water flow rate is decreased and the cost of fresh water production unit (UPC) is increased slightly as shown in Figure 7. To discuss this trend, it should be noted that by increasing the pinch temperature, steam production rate is reduced (according to Figure 6). By reducing the steam flow rate, less power is generated by the turbine and due to the constant flow rate of feed water, the pressure of feed water in the outlet of the RO high pressure pump is decreased. As a result, generated water flow rate Q p is reduced. Although by increasing the pinch temperature, the cost of heat exchanger is reduced, due to lower production rates, the unit production cost of fresh water increases.
The effect of ∆T on the supply pressure is presented in Figure 8. By increasing the temperature difference between incoming and outgoing flow of cooling water in the condenser (ΔT), water production rate increases and UPC decreases. Increase in causes the reduction in feed water flow rate. By reducing the feed water flow rate, feed water pressure increases, which in turn leads to increase in fresh water flow rate.
Also it is important to note that increase in ∆T can cause reduction in condenser construction cost, since it needs less number of pipes for cooling.
Input feed water temperature to the RO system is affected by the condenser's ∆T. In this part, impacts of feed water temperature are studied on the rate of mass flow and concentration of the produced fresh water (permeate water). For this purpose, in constant pressure of feed water and constant flow rate, the impact of temperature changes from 20 to 40°C is studied for the three feed water salt concentrations of 45 000, 35 000, and 20 000 ppm. As stated previously, the equations obtained for reverse osmosis systems are based on 25°C. For other temperatures, the temperature correction factor, TFC, is used which is obtained from equation 20. For temperatures higher than 25°C, TFC is greater than 1. In cases where the temperature is lower than 25°C, TFC is lower than 1. According to equation 19, by increasing the temperature, osmosis pressure increases. By increasing the feed water temperature, the permeate water at first increases and then decreases as shown in Figure 9. The trend is due to this fact that by increasing the temperature of feed water, TCF and osmosis pressure increases based on the Equations (19) and (20). In accordance with the Equation (6), flow through the membrane J w has a direct relationship with TCF, and the reverse relationship with osmosis pressure. Conflict between these two parameters results in creating such a trend for permeate flow rate. In addition, increase in the concentration results in the movement of the optimum point toward the lower temperatures. This is due to the dramatic increase in osmosis pressure by changing the concentration, as according to the Equation (6), the effect of osmosis pressure is more than TCF. The water concentration level in permeate water (C p ), which is the amount of salt flows through the membrane over the whole potential of flow, is another influential parameter for designing and analyzing the reverse osmosis system. By increasing the feed water temperature, concentration of permeate water increases. In 45 000 ppm, C p at first decreases; afterward, it increases by raising the temperature ( Figure 10). Permeate concentration (C p ) is the contrast between J s and V w factor. Equation (9) shows that C p has direct relationship with J s and reverse relationship with V w . By increasing the feed water temperature, salt concentration in the wall (C w ) is reduced and it causes the reduction in J s according to Equation (7). However, with increasing feed water temperature, the amount of the V w decreases which is due to the decrease in J w . In very high concentrations (eg, ppm 45 000) and low temperatures, reduction in J s is more sensible than V w and it causes reduction in C p . In lower concentrations (35 000 and 20 000) and higher temperatures, V w reduction is more than J s and it makes proper condition for C p to increase.
The point that should be noted is that the feed water flow rate and pressure of the pump are related to temperature difference of the condenser (ΔT). By increasing the temperature difference, cooling water flow rate is reduced and its pressure and temperature increase. As a result, the contrast between these parameters leads to an optimum point in the RO system. The results of this study for concentration 45 000 ppm can be seen in Figure 8. In this section, to find the optimal performance of the cycle, the temperature of the condenser is altered from 5°C to 12°C that is the operating range of the power plant condensers. The aim is determining an optimal condition for the RO cycle when increasing the feed water flow rate, temperature and pressure interact with the temperature difference of the condenser. It can be seen from Figure 11 that in case of 45 000 ppm salt concentration, in ΔT = 5.8°C the Q P and UPC interact with each other which means the optimal point for producing permeate flow. In this case, condenser inlet temperature is assumed to be 27.7°C, therefore condenser outlet water temperature or RO feed water temperature will be 33.5°C at optimum condition. Figure 11 also shows that maximum permeate flow rate occurs in ΔT = 8.5°C (feed water temperature 36.2°C), while according to Figure 9, with feed water concentration of 45 000 ppm, the maximum permeate flow rate is obtained when feed water temperature is 26°C. The reason is that the condition of Figure 9 was constant feed water flow rate and pressure, while in Figure 11, by increasing the ΔT, feed water flow rate is reduced and feed water pressure is increased. Contrast between reduction in feed water flow rate, increasing the pressure and the temperature of feed water flow rate makes a condition to transfer the maximum point of permeate flow rate to a higher position.
According to the Equation (63), the price of condenser is determined based on the temperature difference and heat transfer which is depended on the condenser's pressure. By increasing the temperature difference between inlet and outlet of the condenser, the cost of the condenser is reduced. Increase in ΔT can cause a reduction in feed water flow rate. It will increase the pump pressure and its price. So, with condenser's cost reduction and increase in amount of the Q p , UPC is decreased while considering the cost of the pump, UPC increases but its increase is more than its decrease.  Concave curve of UPC is due to the contrast between cost reduction and increase in Q p amount.

| Optimum design of the solar field
To design a solar farm, it is inevitable to calculate the oil flow. In this section, optimum condition of the cycle is determined using genetic algorithms. As mentioned in the previous section, optimization is based on the lowest unit production cost and the highest permeate flow rate. In this optimization of power generation cycle, heat exchanger and reverse osmosis system are designed simultaneously in order to design the solar farm with the best performance. Another benefit of this optimization is the ability of checking the parameters and constraints at the same time in different parts of the cycle. In this optimization, the following constraints are considered for the cycle.

1.
Quality of the output steam from the turbine is not more than 88%. 2. Depending on the membrane type, maximum possible feed water pressure is used.
The results of the optimization are presented in Figure 12 as a Pareto curve which indicates all optimum points of the system. To determine the best optimum point among them, two tangent lines should be drawn and then a perpendicular line to the Pareto curve should be drawn from the intersection of these tangents to determine the best optimum point. In the Pareto curve of optimization, three points of the cycle are examined which are point A (the lowest permeate flow rate and lowest cost), point B (the best point of the Pareto curve), and point C (maximum permeate flow rate and the most expensive). As can be seen in these three points, GA has been proposed the highest  The thickness of the absorber tube (mm) 3 Inlet oil temperature of each branch (m/s) 2.3 Width of collector (m) 7.9 Length of collector (m) 185 The number of loops and branching 11 Flow rate of each branch (kg/s) 0.99 Cost of solar field ($/year) 894 449.7 Pressure drop in solar field (bar) 11.25 possible value for the oil flow rate in the range of choice to increase steam flow, leading to increased permeate flow rate. It is important to optimize the design of the solar field for the state that system is in its optimal performance. This factor led to the selection of a suitable Pinch temperature to reduce construction cost of heat exchanger. In such condition, to increase the permeate flow rate suitable ΔT should be selected as in the sensitivity analysis was achieved. Some important parameters in modeling of heat exchanger, Power Plant and RO system for point B are presented in Tables 8-10.
Finally, according to the results of the optimized Pareto curve, the optimization of the solar field for heat exchanger, Power plant, and RO system is performed with the aim of reducing the cost of production and reducing the pressure drop on the solar field.
For this purpose, optimization of the solar field is done according to point B which is the best design for current cycle. In this optimization, the environmental conditions are supposed to be according to Table 11. The outlet oil temperature from heat exchanger is calculated about 157°C based on the pinch and approach temperature. This amount has a great influence on design of the solar field and its area. The results of this optimization are shown in Figure 13.
Again the best optimum point for the solar field is obtained from the Pareto curve and the results are presented in Table 12.
According to the results, the total cost for water production with 9494.1 (m 3 /hour) is 0.6046 ($/m 3 ).

| CONCLUSION
There are several approaches to reduce environmental impacts in the process of producing fresh water. In this study, a reverse osmosis system using feed water preheating system and solar collectors was investigated. The purpose of this study was designing a solar field for an optimized system including power plant, heat exchanger, and RO system. In order to achieve the optimized design, all involved systems except the solar field were optimized simultaneously. These three components were closely related to each other. They had highly interdependent parameters. In addition, sensitivity analysis was performed on the pinch temperature, mainsteam pressure, and temperature difference in cooling water in order to determine the impacts of parameters on performance parameters of the system, for example, cost and flow rate of permeate water. In current modeling, water was preheated in the condenser before entering the RO system. The impact of this action, according to the sensitivity analysis depends on the concentration and flow rate of the feed water. Initially, it increases the permeate flow rate and afterward it decreases its flow rate. In a constant input flow rate for RO system and concentration of 45 000 ppm, the maximum flow rate was obtained at 26°C. For concentration of 35 000 ppm, the maximum flow rate was achieved at 33°C.
Based on the optimization results, pinch and approach temperature obtained 21.12 and 22.53 and oil flow rate obtained 10.92 (kg/s) and the condenser ∆T was 8.75°C. Permeate flow rate and recovery were 9494.19 (m 3 /day) and 59.5%, respectively. The cost of water production in optimal state was 0.6046 ($/m 3 ).