Mathematical Modeling and Simulation of SWRO Process Based on Simultaneous Method

Reverse osmosis (RO) technique is one of the most efficient ways for seawater desalination to solve the shortage of freshwater. For prediction and analysis of the performance of seawater reverse osmosis (SWRO) process, an accurate and detailed model based on the solution-diffusion and mass transfer theory is established. Since the accurate formulation of the model includes many differential equations and strong nonlinear equations (differential and algebraic equations, DAEs), to solve the problem efficiently, the simultaneous method through orthogonal collocation on finite elements and large scale solver were used to obtain the solutions. The model was fully discretized into NLP (nonlinear programming) with large scale variables and equations, and then the NLP was solved by large scale solver of IPOPT. Validation of the formulated model and solution method is verified by case study on a SWRO plant. Then simulation and analysis are carried out to demonstrate the performance of reverse osmosis process; operational conditions such as feed pressure and feed flow rate as well as feed temperature are also analyzed. This work is of significant meaning for the detailed understanding of RO process and future energy saving through operational optimization.


Introduction
China, which has the largest population in the world and is called the world's factory, has a much more serious problem of freshwater shortage.This problem is expected to worsen in the whole world with the growth of industrialization, as well as climate change [1][2][3].Seawater desalination based on RO (reverse osmosis) membrane technique is one of the most promising ways to obtain freshwater, especially in the coastal regions and islands.More than 40% market shares of seawater desalination based on RO technique was occupied worldwide in the past decade [4].Reverse osmosis (RO) is also a membrane technology driven by high pressure and is used to separate salt and water of the same order of molecular size.High pressure is applied on the feed side of the membrane to overcome the osmotic pressure and cause transport of the solvent from feed to permeate side.Among the membrane modules, spiral-wound RO occupies the largest market share because of its relative ease of cleaning, fabrication technology, and very large surface area per unit volume [5,6].The general process of SWRO can be found in the specialized literature [7,8].To achieve a high recovery in a single stage, several spiral-wound elements in series, held in a cylindrical pressure vessel, are usually used in seawater desalination applications.Generally a reverse osmosis desalination unit is composed of dozens of cylindrical pressure vessels, and several units with a permeate water storage tank were used as the key part of a seawater desalination plant.
The feed pressure as well as other parameters such as operational temperature and properties of the membrane has significant effect on the performance of SWRO process.It is quite important to understand the mechanism of SWRO process and improve the performance and reduce the energy consumption.For this reason, based on solutiondiffusion model and film theory, the model of RO process was researched, found, analyzed, and used to optimize the operation of SWRO plant [9,10].
Libotean and Khayet established the performance prediction model based on data-driven method such as artificial neural networks [11,12].Since modeling based on rigid first principle can reveal more information, Senthilmurugan et al. [9] applied the solution-diffusion model modified with the concentration polarization theory for analyzing the 2 Journal of Applied Mathematics operation and performance of RO systems.Abbas analyzed and simulated an industrial medium-scale brackish water reverse osmosis plant with semirigorous model, and then he used it to analyze the optimal operation of RO system [13].Geraldes considered both the investment cost and operation cost of SWRO system and provided the differential equations of the RO process with distributed method [14].Then, to avoid computing difficulties, he simplified the simulation process and solved his optimal problem with simple difference equations.Sundaramoorthy et al. build more complex analytical model of spiral wound reverse osmosis modules, based on complex model parameters estimation; the model is computed based on sequential method [15].To get more accurate results, more modeling and simulation of reverse osmosis system are carried out with CFD technique [16][17][18].But since these models are not founded with simultaneous method, computing efficiency for simulation and optimization cannot be guaranteed for online application.
In this paper, to achieve accurate prediction of RO process performance and to accelerate the computing efficiency for real time simulation, the mathematical modeling is carried out based on rigid first principle, then simultaneous method within which the differential variables are fully discretized by finite element collocation.The mathematical model is verified and then simulation under different conditions will be discussed.

Mathematical Modeling of Spiral-Wound RO Process
The performance of SWRO plants is quite sensitive to the quality of the feed water and plant operating conditions.Based on solution-diffusion model and film theory and according to the schematic diagram of the SWRO process shown in Figure 2, more accurate membrane transport equations of steady-state in the form of distributed parameters can be derived.For the RO membrane, the overall fluid and solute mass balance equations are Here subscripts , , and  refer to the feed, reject (brine), and permeate (product) streams. and  refer to the flow rate and salt concentration, respectively.The local water flux and salt flux can be calculated from the Kimura-Sourirajan solution-diffusion mass transport relations.  , , and  express the number of leaves and the width and length of the RO module, respectively.The solution-diffusion model is assumed to be valid for the transport of solvent and solute through the membrane.According to this model, solvent flux V and solute flux  through membrane are expressed by the following equations: Then where   is the solvent transport parameter,   is the feed pressure,   is the pressure drop along a RO spiral-wound module,   is the pressure along the channel of spiral-wound module, and   is the pressure of permeate side, which in general is assumed as environment pressure.Δ is the pressure loss of osmosis pressure.  is the solute transport parameter,   and   are solute concentration at the membrane surface on the feed side and solute concentration on the permeate side, respectively, and   is the value of   at the end of module.That means   =   ().  and   are sensitive with operational temperature and related factors; the relationship is expressed as follows: where  0 and  0 are intrinsic transport parameter in standard condition and  1 ,  2 , and  1 are constant parameters for transport. represents operational temperature with unit of kelvin degree.The osmotic pressure is nearly linearly related to concentration by the equation where  is the gas law constant.Solution of the above equations requires knowledge of the RO process specification and parameters as well as the solute concentration of   at the membrane wall, which is quite different from the bulk concentration   due to the CP (concentration polarization) phenomenon.Through steadystate material balance around the boundary layer and CP theory, the following simple expression is developed: The bulk concentration   and solvent transports V vary along the membrane channel.The computation of the mass transfer coefficient   is as follows [19]: Detailed SWRO process and storage tank information for the desalination plant

Sea water with TDS concentration C s0
Volumetric permeate is the density of permeate water,   is hydraulic diameter of the feed spacer channel,  is kinematic viscosity, and   is dynamic viscosity; it can be calculated by the regression equation The relationship between V and  is According to Figure 2, the pressure loss along the RO channel can be formulated as where is the empirical parameter.Since the pressure along RO   =   −   , so at  = 0,   =   , at  = ,   =   .
is axial velocity in feed channel and satisfies ℎ sp is height of the feed spacer channel.The bulk concentration   varies along the membrane channel and can be given as and at  = 0,   =   ; at  = ,   =   .From the solution of the above equations,   and   at given operational conditions and specification of membrane can be obtained, from which the water recovery rate Rec and specific energy consumption SEC can be calculated by the equations Salt passage and salt rejection coefficient are also two important parameters reflecting the performance of the RO process.They are formulated as the following equations: where   and   are the mechanical efficiency and energy recovery efficiency, respectively.Equations ( 1)-( 20) explain the detailed reverse osmosis process with spiral-wound membrane module.If the operational variables, such as feed flow rate and feed pressure, are fixed, the permeate quality and related performance can be obtained by the solution of the equations.Otherwise, the operational variables and related parameters can be calculated by ( 1)-( 20) under certain constraints.The constraints listed in (21) include requirement of equipment safety, water quality, and parameter of CP:

Discretization and the Solution Method
Since ( 1)-( 20) include a set of strong nonlinear equations and even DAEs (differential and algebraic equations) and since there are more constraints than those of the equation mentioned above, it is fairly tough to solve this kind of problem efficiently with high accuracy [20][21][22].Here the DAEs (1)-( 21) are converted into the form of NLP (nonlinear programming) through simultaneous approach by approximating state and control profiles with a family of polynomials on finite elements (shown as Figure 3) [20,23].These polynomials can be represented as power series, such as orthogonal polynomials, or in Lagrange form.Here the following monomial basis representation for the differential profile was selected, which is popular for Runge-Kutta discretizations [23]: Here  −1 is the value of the differential variable at the beginning of element , ℎ  is the length of element , / , denotes the value of its first derivative in element  at the collocation point , and Ω  is a polynomial of order , satisfying where   is the location of the th collocation point within each element.Continuity of the differential profile is enforced by Time Based on a number of studies of Larry group [20,[24][25][26], Radau collocation points were selected in this study because they allow constraints to be set at the end of each element and to stabilize the system more efficiently if high index DAEs are present.In addition, the control and algebraic profile are approximated using a Lagrange basis representation which takes the following form: Here  , and  , represent the values of the algebraic and control variables, respectively, in element  at collocation point ,  is the value satisfying  −1 ⩽  ⩽   , and Ψ  is the Lagrange polynomial of degree  satisfying And, at collocation points, The differential variables are required to be continuous throughout the time (or space) horizon, while the control and algebraic variables are allowed to have discontinuities at the boundaries of the elements.Through the simultaneous method DAEs of (1)-( 21) were transformed into NLP problem.Some state variables in ( 1)-( 21) can be discretized as flow variables:  , ,  , ,  , ,  , ,  ,0 ,  ,0 ,  ,0 ,  ,0 , and V , ,  , ,  , , Sc , , Re Continuity equations are Initial conditions are Here 0 ≤    ≤ ,  = 1 ⋅ ⋅ ⋅ 100  = 1 ⋅ ⋅ ⋅ . Figure 3 gives the detailed discretization process and distribution of discretized variables.Since the NLP problem is formulated with large scale equations and variables through discretization of the original model, it can be solved by large scale NLP solvers such as IPOPT.If all the operational variables (feed pressure and feed flow rate) are fixed, the solution of the problem results in the simulation of the RO process; profiles of key performance parameters as well as detailed status variables can be obtained, which is helpful for us to understand the mechanism and the whole process.

Model Simulation and Analysis Based on Seawater Desalination Plant
Based on the mathematical model and collocation method on finite element, the solution of the problem will yield the profiles of key performance parameters as well as the distribution of state variables.To verify the validity of the established model, data of a real seawater desalination plant is studied and then used for the simulation and analysis.The main process of the plant is the same as Figure 1.SW30HR-380 membrane modules were selected in series in the pressure vessel, and 55 pressure vessels were used to form two RO process units.Some conditional parameters are listed in Table 1.Field data of a RO process are used for model verification and parameter identification.The key performance As can be seen from Table 2, the overall results obtained from the established model are in good agreement with those obtained from both ROSA and the field data.Though the water recovery ratio and salt reject are lower than our model and that of ROSA9.0, the relative error is quite small.So the established model can be well used for the simulation and analysis of the seawater RO process.Since the established model was affected by feed temperature obviously, the properties and correction factor are also compared with the real data or the data from literature [13].Figures 4, 5, and 6 are the comparison results between model value and real value; it can be seen that these property parameters agree with the real data with relatively high accuracy.The RO process model is fairly robust at the temperature range from 0 ∘ C to 60 ∘ C.
Based on the collocation method on finite element, simulation results are yielded through the solution of the discrete model.Simulation results are shown in Figures 7,8,9,10,11,12,13,14,15,and 16.From these figures it can be seen that the velocity of solvent, permeate flux, and concentration polarization in modules decrease nonlinearly along the length of membrane.The reason is that the feed flow is separated as two parts, and the pressure difference between the two sides decreases quickly.The osmosis pressure increase is the main factor for the decrease of pressure difference, which is shown in Figure 9.It also can be seen that the decrease of CP along the length of membrane is relatively small, and the rejection coefficient is higher than 99.4% along the length of membrane; the decrease is fairly small and the simulation value is almost the same as the real value.Figure 11 shows the relationship of feed TDS and permeate TDS; as the feed TDS increase linearly, the permeate TDS increase nonlinearly.
From (18), the value SEC is affected by the energy recovery efficiency   and the mechanical efficiency   .Here they are   set as 0.85 and 0.65, respectively.At the given feed condition of Table 1, calculation result shows that about 4.373 kw⋅h electricity energy should be consumed to produce one cubic meter freshwater.From Figure 16 it can be found that the value of SEC decreases at initial time when the feed pressure increases; then the SEC increases again as the pressure increases continually; there is a minimizing value as the feed pressure increases from about 30 bars to 90 bars.This means that through improving the operational condition, significant energy saving can be achieved.Based on the well-established model, profiles of the relationship between feed conditions and key performance parameters can be obtained, which are listed in Figures 12-16.From Figure 12 it can be seen that Rec (water recovery ratio) increases quickly and almost linearly with the increase of feed pressure, because the increase of feed pressure can cause the increase of permeate flux V.The other parameter of salt reject increases nonlinearly and slowly with the increase of feed pressure; at the feed pressure of 59 bar, the salt reject is more than 99.5%.From Figure 13 it can be seen that Rec reduces quickly as the feed flow rate increases, while the Ry has the positive relationship with the feed flow rate; this is because of the fact that velocity in the feed channel has positive linear relationship with feed flow rate.And when the feed flow rate increases, the velocity of feed channel increases correspondingly, but the residence time of seawater in the channel will be largely decreased; there  is also not enough time for salt to be transported to the permeate water side, which results in the reduction of Rec.From Figure 14, it can be seen that, as the feed concentration   increases, the water recovery and salt reject decrease substantially; this is explained by the needing of much more transmembrane osmotic pressure and more difficulty to resist the diffusion of brine.The effect of temperature on the RO process performance is shown in Figure 15, from which it can be seen that, with the increase of feed temperature, Rec increases substantially, but the Ry decreases accordingly.This can be explained by the increase of transport parameters   and   and the corresponding increase of permeate flux and solute flux.

Conclusion
In this paper, based on the solution-diffusion and mass transfer theory, a spiral-wound SWRO process model is established.The model is expressed by DAEs (differential and algebraic equations) of ( 1)-( 21) with some inequality and equality constraints of equipment and water quality.To solve the tough problem with high efficiency and accuracy, orthogonal collocation on finite element is proposed to transform the problem into NLP.All the state variables and intermediate variables are discretized and ( 1)-( 21) are transferred into (28)-(32).Then IPOPT solver under GAMS platform is used for the efficient solution.And the efficient solution yields detailed simulation results related to operational variables and key performance.Profiles of feed pressure, feed concentration, and feed velocity along feed channel are investigated as well as relationship of water recovery with temperature and feed pressure.SEC, which is the key performance parameter of energy consumption, is also calculated.The minimizing value in the middle curve shows that, through improving the operational condition, significant energy saving can be achieved.Factors including the feed conditions and operational temperature are also analyzed.All the work is helpful to further understand the mechanism of SWRO process, and shows the significant potential for energy saving through optimal operation.

Figure 1 :
Figure 1: Detailed schematic diagram of RO process and water storage process.

Figure 2 :
Figure 2: Scheme of the rectangular channel model of spiral wound module feed channel.

Figure 4 :
Figure 4: Value of seawater viscosity along temperature.

Figure 5 :
Figure 5: Comparison of DAB with literature.
TCF Field value of TCFFeed temperature of seawater ( ∘ C)

Figure 8 :Figure 9 :
Figure 8: Permeate flux along the length of membrane.

Table 1 :
Feed condition of the seawater plant.

Table 2 :
Comparison of the actual performance with those from ROSA9.0 and our model.water recovery rate and salt rejection are compared to indicate the accuracy of the model.Comparison of the field data with those obtained from established models and ROSA9.0 is listed in Table 2. ROSA is a powerful software package developed by Dow Chemical Company to help design the RO process system [27].