# A Dynamic Optimization Strategy for the Operation of Large Scale Seawater Reverses Osmosis System

Authors: Aipeng Jiang; Jian Wang; Wen Cheng; Changxin Xing; Shu Jiangzhou
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

In this work, an efficient strategy was proposed for efficient solution of the dynamic model of SWRO system. Since the dynamic model is formulated by a set of differential-algebraic equations, simultaneous strategies based on collocations on finite element were used to transform the DAOP into large scale nonlinear programming problem named Opt2. Then, simulation of RO process and storage tanks was carried element by element and step by step with fixed control variables. All the obtained values of these variables then were used as the initial value for the optimal solution of SWRO system. Finally, in order to accelerate the computing efficiency and at the same time to keep enough accuracy for the solution of Opt2, a simple but efficient finite element refinement rule was used to reduce the scale of Opt2. The proposed strategy was applied to a large scale SWRO system with 8 RO plants and 4 storage tanks as case study. Computing result shows that the proposed strategy is quite effective for optimal operation of the large scale SWRO system; the optimal problem can be successfully solved within decades of iterations and several minutes when load and other operating parameters fluctuate.


---

## Body

## 1. Introduction

The shortage of freshwater resources is expected to worsen with the growth of population and industrialization, as well as climate change [1, 2]. Seawater desalination is one of the most promising approaches to get freshwater resources in the world and is considered as the most important strategy to develop new freshwater for the coastal counties [3, 4]. With the process of low-cost, high rejection membrane technique and high efficiency energy recovery device, seawater reverse osmosis (SWRO) technique is becoming the most popular and attractive seawater technique for its economy and convenience [5–7].Recently, more attention was paid to optimal operation and energy management to further reduce the energy consumption of SWRO system [8]. Modeling methods based on first principle and data-driven are used for practical control and fault diagnosis [9]. And with development of advanced control techniques such as predictive control, sliding-mode control, and optimal control [10–13], more potential benefit can be expected.Kim et al. comprehensively studied the RO process especially on the minimization of product cost with system engineering method [14]. Sassi and Mujtaba and Palacin et al. evaluated the optimal operation of SWRO system through minimizing the specific energy consumption [15, 16]; with the consideration of thermodynamic restriction, Zhu studied the energy cost optimization problem. Among which factors such as stages and energy recovery efficiency were discussed to get the optimal operation condition [17]. After a comprehensive first-principle based mathematical model has been developed and validated by plant data, Li studied the optimal plant operation of brackish water reverse osmosis (BWRO) desalination to reduce specific energy consumption (SEC). His computing results show that about 16% reduction of SEC can be achieved by optimizing operating condition [18]. Since all the cost spent on SWRO system includes not only operational cost but also capital cost, Geraldes studied the optimization problem through minimizing the objective function including all these costs; but to make solution of the problem with DAEs easier and simple, Geraldes used differential technology to discretize the equations and then obtained the optimal results with low accuracy [19]. Since the operating environments change frequently, Sassi and Mujtaba studied the optimal operation problem which is the variation of load and feed temperature. In his study, storage tank was used as the buffering unit between water production and water supply, and water level of storage tank can be freely adjusted to add the flexibility of operation [20].The researches above are of great significance to improve the economical performance of desalination, but most of them put emphasis on the optimal operation of steady-state process. As we know, in the actual process many operating parameters such as feed temperature, electricity price, and water supply requirement change dynamically over time [21]; the performance of equipment and reverse osmosis membrane also constantly change over time, so dynamic optimization to improve the operation will be more meaningful. However, since the dynamical optimization problem includes a set of differential and algebraic equations (DAEs), its efficient and stable solution is fairly tough when inequality constraints enforced on the bounds. Direct methods such as variational principle based method often failed because of their disadvantage in dealing with active inequalities [22, 23].Though with development of computing technique, simultaneous approach with collocation on finite element is more suitable for this kind of problems, and large scale solvers such as sparse SQP and IPOPT become more powerful to solve large scale nonlinear problems, there are still many works to do to make the solution more efficient and stable, especially when the optimal problem is not convex and with the characteristic of strong nonlinear. But the real time optimization need the optimal operation problem be solved efficiently. In this paper, to solve optimization problem of RO process system with network structure more efficiently, based on the well-developed dynamic models of RO process and water storage process, an efficient optimization strategy to optimize the dynamic operation of SWRO system is proposed, which will be helpful to the reduction of energy cost and to the realization of real time optimization.


## 2. Dynamic Model of SWRO System

According to the flowsheet of SWRO system, RO unit is the key part for freshwater production. After the pretreatment, the seawater was pumped into RO modules by high pressure pump, from which the freshwater and the salt were separated through the work of solution-diffusion; then with simple posttreatment, the freshwater was pumped to terminal user [19] to meet the needs of daily life. In the RO module, the pressure, flow rate, and concentration change along the channel (shown in Figure 1). These variables satisfy the following equations [19]:
(1)
d
V
d
z
=
-
2
J
v
h
sp
z
=
0
,
V
=
V
f
;
z
=
z
f
;
V
=
V
r
;
d
P
d
d
z
=
-
λ
ρ
d
e
V
2
2
z
=
0
,
P
d
=
0
;
z
=
z
f
;
P
r
=
P
f
-
P
d
;
d
C
b
d
z
=
2
J
v
h
sp
V
(
C
b
-
C
p
)
z
=
0
,
C
b
=
V
f
;
z
=
z
f
,
C
b
=
C
r
;
here, J
v denotes solvent flux, and V represent the axial velocity in feed channel. C
b is the bulk concentration of RO module, and P
d is the pressure drop along the RO module. The parameters and variables from the above equations can be obtained from the solution-diffusion mass transport relations and principle of energy conservation; all the equations involved are listed as follows [19, 24–27].Figure 1
Scheme of the rectangular channel model of spiral wound module.RO process model equations are(2)
Q
p
=
Q
f
-
Q
r
Q
f
C
f
=
Q
r
C
r
+
Q
p
C
p
J
v
=
A
w
(
P
f
-
P
d
-
P
p
-
Δ
π
)
.See [24]
(3)
J
s
=
B
s
(
C
m
-
C
sp
)
P
b
=
P
f
-
P
d
Δ
P
=
(
P
b
-
P
p
)
A
w
=
A
w
0
exp
⁡
⁡
(
α
1
T
-
273
273
-
α
2
(
P
f
-
P
d
)
)
.See [19]
(4)
B
s
=
B
s
0
exp
⁡
⁡
(
β
1
T
-
273
273
)
Δ
π
=
R
T
(
C
m
-
C
p
)
ϕ
=
C
m
-
C
p
C
b
-
C
p
=
exp
⁡
⁡
(
J
v
k
c
)
Sh
=
k
c
d
e
D
A
B
=
0.065
Re
0.875
Sc
0.25
.See [27]
(5)
Re
=
ρ
V
d
e
μ
Sc
=
μ
(
ρ
D
A
B
)
J
s
=
J
v
*
C
p
λ
=
6.23
K
λ
Re
-
0.3
D
A
B
=
6.76
×
1
0
-
6
exp
⁡
⁡
(
0.155
×
1
0
-
3
C
b
-
2513
273
+
T
)
.Consider (Masaaki Sekino, 1995)(6)
ρ
=
498.4
M
+
248400
M
2
+
752.4
M
C
b
M
=
1.0069
-
2.757
×
1
0
-
4
T
μ
=
1.234
×
1
0
-
6
·
exp
⁡
⁡
(
0.00212
C
b
+
1965
273.15
+
T
)
Q
r
=
Q
f
×
V
r
V
f
R
ec
=
Q
p
Q
f
Sp
=
C
p
C
f
×
100
%
R
y
=
(
1
-
C
p
C
f
)
×
100
%
.As to the large scale SWRO system with multiple RO units and multiple storage tanks, the storage tanks perform as the buffering units between water production of RO units and water supply. Since there are pipes to connect each RO unit with storage tanks, the feed water can come from each RO unit; the dynamic process can be formulated as(7)
d
H
t
,
j
j
(
t
)
d
t
=
(
∑
i
i
=
1
N
P
T
Q
p
k
(
i
i
,
j
j
)
-
Q
out
,
j
j
)
S
t
,
j
j
d
C
t
,
j
j
(
t
)
d
t
=
1
S
t
,
j
j
H
t
,
j
j
(
∑
i
i
=
1
N
P
T
Q
p
k
(
i
i
,
j
j
)
C
p
,
i
i
-
∑
i
i
=
1
N
P
T
Q
p
k
(
i
i
,
j
j
)
C
t
,
j
j
)
Q
sup
⁡
=
∑
j
j
=
1
N
T
K
Q
out
,
j
j
C
sup
⁡
=
∑
j
j
=
1
N
T
K
Q
out
,
j
j
C
t
,
j
j
Q
sup
⁡
and equations
(8)
Q
p
,
i
i
=
∑
j
j
=
1
N
T
K
Q
p
k
(
i
i
,
j
j
)
∑
j
=
1
N
T
K
∑
i
=
1
N
P
T
Q
p
k
(
i
i
,
j
j
)
=
∑
i
N
P
T
Q
p
(
i
i
)
.
Bound constraint is as follows:
(9)
H
t
,
j
j
,
lo
<
H
t
,
j
j
<
H
t
,
j
j
,
up
.
Initial condition is as follows:
(10)
t
=
0
;
H
t
,
j
j
=
H
t
,
j
j
(
0
)
,
C
t
,
out
,
j
j
=
C
t
,
out
,
j
j
(
0
)
.
Here N
P
T denotes the number of RO units, N
T
K denotes the number of storage tanks, Q
p
k
(
i
i
,
j
j
) denotes the flow rate from the i
ith RO units to the j
jth storage tanks, Q
out
,
j
j denotes the load requirement of freshwater of the j
jth storage tank, Q
sup
⁡ denotes the total flow rate of freshwater supply, and the C
sup
⁡ denotes the concentration of the supplied freshwater.


## 3. Formulation of Dynamic Optimization Problem of SWRO System

Energy cost is the largest portion of the SWRO system’s operation cost; generally it accounts for over 50% of the operation cost. So minimizing the energy cost can be set as the objective function. It is affected by the electricity price and the specific energy consumption (SEC) which is defined as [28]
(11)
SEC
=
P
f
Q
f
/
ε
p
-
P
r
Q
r
ε
e
f
Q
p
.With the consideration of daily fluctuation of feed temperature, electricity price, and the load requirement, the daily objective function can be denoted by(12)
min
⁡
P
f
,
ii
,
Q
f
,
ii
,
H
t
,
ii
⁡
∫
0
24
E
P
∑
i
i
=
1
N
P
T
(
Q
p
,
i
i
SEC
i
i
)
d
t
.Since the control variables cannot be adjusted too frequently and the change of electricity price is based on an hour, it is reasonable to adjust the control variables one hour by one hour, and so (12) can be renewed in another form, and the optimization problem named Opt1 can be denoted byObjective Function. 						(13)
min
⁡
P
f
,
ii
,
Q
f
,
ii
,
H
t
,
ii
⁡
F
obj
=
∑
t
i
=
1
24
[
E
P
,
i
i
∑
i
i
=
1
N
T
P
(
Q
p
,
i
i
SEC
i
i
)
]
.Equality Constraints.RO process model ((1)–(6)).
Dynamic model of storage tanks ((7)-(8)).
Specific energy cost (11).Inequality Constraints.Water quality:C
sup
⁡
≤
C
w
q
,
limit.
Scaling resistant:C
r
,
i
i
≤
C
r
,
i
i
,
limit.
Concentration polarization:ϕ
≤
1.2.
Pressure constraints:P
f
,
i
i
,
lo
≤
P
f
,
i
i
≤
P
f
,
i
i
,
up.
Flowrate of RO units:V
f
,
i
i
,
lo
≤
V
f
,
i
i
≤
V
f
,
i
i
,
up.
Water levelH
t
,
j
j
,
lo
<
H
t
,
j
j
<
H
t
,
j
j
,
up.
Initial conditions of RO at each hour are as follows:(14)
z
=
0
,
V
i
i
=
V
f
,
i
i
=
Q
f
,
i
i
n
l
W
h
sp
;
z
=
L
,
V
i
i
=
V
r
,
i
i
=
Q
r
,
i
i
n
l
W
h
sp
z
=
0
,
P
b
=
P
f
;
z
=
L
,
P
b
=
P
r
z
=
0
,
C
b
=
C
f
;
z
=
L
,
C
b
=
C
r
.
Initial condition of storage tankst
=
0,  (10).


## 4. The Strategy to Solve Opt2

### 4.1. Simultaneous Approach Based on Collocation on Finite Element

Since the Opt1 includes differential equations as well as strongly nonlinear algebraic equations, it belongs to a kind of differential-algebraic optimization problems (DAOPs). The Opt1 problem of SWRO system withN
P
T RO plants and N
T
K storage tanks will have (3
×
N
P
T
+
2
×
N
T
K) differential equations and more nonlinear algebraic equations, since there are also constraints to satisfy the water quality and the equipment’s safety; it is really hard to get the solution efficiently through direct ways such as variational principle. Here we use the simultaneous approach to fully discretize all the control variables and status variables, which is quite suitable and has many advantages for this kind of problems. We use the following monomial basis representation for the differential profiles, which is popular for Runge-Kutta discretization [29]:
(15)
w
(
z
)
=
w
i
-
1
+
h
i
∑
q
=
1
K
Ω
q
(
z
-
z
i
-
1
h
i
)
d
w
d
z
i
,
q
.Herew
i
-
1 is the value of the differential variable at the beginning of element i, h
i is the length of element i, d
w
/
d
t
i
,
q denotes the value of its first derivative in element i at the collocation point q, and Ω
q is a polynomial of order K, satisfying
(16)
Ω
q
(
0
)
=
0
q
=
1
,
…
,
K
Ω
q
′
(
ρ
r
)
=
δ
q
,
r
q
=
1
,
…
,
K
;
here ρ
r is the location of the rth collocation point within each element. Continuity of the differential profile is enforced by
(17)
w
i
=
w
i
-
1
+
h
i
∑
q
=
1
K
Ω
q
(
1
)
d
w
d
z
i
,
q
.In addition, the control and algebraic profile are approximated using a Lagrange basis representation which takes the form:(18)
y
(
z
)
=
∑
q
=
1
K
ψ
q
(
z
-
z
i
-
1
h
i
)
y
i
,
q
,
u
(
z
)
=
∑
q
=
1
K
ψ
q
(
z
-
z
i
-
1
h
i
)
u
i
,
q
.
Here y
i
,
q and u
i
,
q represent the values of the algebraic and control variables, respectively, in element i at collocation point q, z is the value satisfying z
i
-
1
≤
z
≤
z
i, and Ψ
q is the Lagrange polynomial of degree K.Through the simultaneous method mentioned above, the Opt1 in the form of DAEs is discretized into the NLP problem denoted by (19a)–(19i); here the problem is named Opt2.(19a)
min
⁡
w
(
z
i
j
)
,
dw
/
d
z
i
j
,
u
(
z
i
j
)
,
y
(
z
i
j
)
⁡
φ
(
w
(
z
i
j
)
,
u
(
z
i
j
)
,
y
(
z
i
j
)
,
p
v
)
(19b)
d
w
d
z
i
,
j
-
F
(
w
(
z
i
j
)
,
u
(
z
i
j
)
,
y
i
j
,
z
i
j
,
p
v
)
=
0
(19c)
H
(
w
(
z
i
j
)
,
u
(
z
i
j
)
,
y
i
j
,
z
i
j
,
p
v
)
=
0
(19d)
w
i
,
j
=
w
i
-
1
+
h
i
∑
j
=
1
K
Ω
j
(
z
-
z
i
-
1
h
i
)
d
w
d
z
i
,
j
(19e)
w
i
0
-
h
i
∑
j
=
1
k
Ω
j
(
1
)
d
w
d
z
i
,
j
=
0
(19f)
w
1
0
=
w
0
(19g)
w
L
≤
w
i
j
≤
w
U
(19h)
u
L
≤
u
i
j
≤
u
U
(19i)
y
L
≤
y
i
j
≤
y
U
.Herez
0
≤
z
i
j
≤
z
f, i
=
1
,
…
,
n
e
j
=
1
,
…
,
K.Since all the differential variables and continuous variables are fully discretized into algebraic variables along the spacious or time horizon, and large number of finite elements is generally selected to ensure the accuracy of the discretization, all the factors led to the great increase of the size of discretized problem of Opt2. As the result, though with the development of computing technique such as spare matrix and automatic differentiation, large scale solvers such as IPOPT and CONOPT can solve problems with millions of variables, and its efficient and stable solution is a big challenge. Special work need to be paid attention to to reduce the computing time and to keep the stability of the problem.There are still two key factors influencing the efficient solution of the discretized problem of Opt2: the first is to configure the number of finite element. Too large number of finite elements will lead to rapid increase in the size of variables and equations, which will greatly increase the computing time and memory occupation. The second problem is to obtain initial values for all the discretized variables, which is very critical to the stability of Opt2 formulated in (19a)–(19i). If the initial values are not carefully given, time-consuming and even failure of convergence will happen during the solution of Opt2. Based on the above reasons, techniques for assignment of initial values and suitable division of finite element are carefully designed as below.


### 4.2. Assignment of Initial Value through Simulation on Finite Element Individually

If all the control variables are fixed as constant values, all the variables of Opt2 can be obtained by simulation of the whole process model. According to the flowsheet of SWRO system, the permeate flow rate and concentration of the permeate water are the input parameters for the dynamic process of storage tanks, so variables of storage tanks can only be obtained after the simulation of RO process.The principle of collocation on finite element is shown in Figure2. Though all the variables are discretized, to keep the continuity, the final values of the first finite element are equal to the initial value of the second finite element. So to get all the values of RO process, the control variables are fixed as constant values, and then the simulation is carried out from one finite element to the next along the space or time horizon. After the simulation of RO process was finished, the values of Q
p, C
p, and so on were used as input parameters and the simulations of storage tanks are then carried out in the same way of RO process.Figure 2
Schematic of collocation on finite elements.After all the values of the discretized variables of Opt2 were obtained, we relax the control variables and enforce the constraints again. Then those obtained values were set as the initial value for Opt2, and nonlinear solver of IPOPT is used for the solution. The whole process of the technique to get good initial values is shown in Figure3.Initial value strategy based on step by step simulation.
(a)
Simulation of RO process
(b)
Simulation of storage tanks
(c)
The whole process of the strategy


### 4.3. Method for Suitable Division of Finite Element

To balance the relationship of the discrete accuracy and computing efficiency, suitable ways to determine the number of finite element are necessary. Truong et al. improved an adaptive mesh refinement method [30] to improve the computing efficiency; Lan and Taylor designed a moving grid computing strategy [31], though the computational efficiency is not high, the method is more stable. Binder proposed a mesh refinement strategy, making it superior to the average grid distribution strategy [32]. Biegler et al. proposed a dynamic optimization method [33–35] based on moving finite element technique; the finite element is automatically adjusted through error analysis. In this work, with the consideration of the special structure of SWRO system, and the relationship between the change of objective function value and the number of finite element which affect discrete state and control variables, a simple but effective method to get suitable division of finite element is designed as follows.(1)
Set the accuracy of the objective function which is defined asσ
=
[
1
-
abs
⁡
(
F
obj
0
/
F
obj
1
)
]
≤
γ; γ is a small positive value such as 1.0
E
-
7.
(2)
Set the number of finite element as Nef1 and the corresponding collocation point by conventional way.
(3)
Solve the discretized problem of Opt2, and get the value of objective functionF
obj
0.
(4)
Add the number of finite element to Nef1′.
(5)
Resolve the discretized problem of Opt2, and then obtain another value of objective functionF
obj
1.
(6)
Compute the value ofσ.
(7)
If the required accuracy is satisfied, then stop; otherwise, letF
obj
0
=
F
obj
1, and go to step (
4
).Since IPOPT is one of the best solvers to solve large scale dynamical problems, here it was used for the solution of Opt2 quickly.


## 4.1. Simultaneous Approach Based on Collocation on Finite Element

Since the Opt1 includes differential equations as well as strongly nonlinear algebraic equations, it belongs to a kind of differential-algebraic optimization problems (DAOPs). The Opt1 problem of SWRO system withN
P
T RO plants and N
T
K storage tanks will have (3
×
N
P
T
+
2
×
N
T
K) differential equations and more nonlinear algebraic equations, since there are also constraints to satisfy the water quality and the equipment’s safety; it is really hard to get the solution efficiently through direct ways such as variational principle. Here we use the simultaneous approach to fully discretize all the control variables and status variables, which is quite suitable and has many advantages for this kind of problems. We use the following monomial basis representation for the differential profiles, which is popular for Runge-Kutta discretization [29]:
(15)
w
(
z
)
=
w
i
-
1
+
h
i
∑
q
=
1
K
Ω
q
(
z
-
z
i
-
1
h
i
)
d
w
d
z
i
,
q
.Herew
i
-
1 is the value of the differential variable at the beginning of element i, h
i is the length of element i, d
w
/
d
t
i
,
q denotes the value of its first derivative in element i at the collocation point q, and Ω
q is a polynomial of order K, satisfying
(16)
Ω
q
(
0
)
=
0
q
=
1
,
…
,
K
Ω
q
′
(
ρ
r
)
=
δ
q
,
r
q
=
1
,
…
,
K
;
here ρ
r is the location of the rth collocation point within each element. Continuity of the differential profile is enforced by
(17)
w
i
=
w
i
-
1
+
h
i
∑
q
=
1
K
Ω
q
(
1
)
d
w
d
z
i
,
q
.In addition, the control and algebraic profile are approximated using a Lagrange basis representation which takes the form:(18)
y
(
z
)
=
∑
q
=
1
K
ψ
q
(
z
-
z
i
-
1
h
i
)
y
i
,
q
,
u
(
z
)
=
∑
q
=
1
K
ψ
q
(
z
-
z
i
-
1
h
i
)
u
i
,
q
.
Here y
i
,
q and u
i
,
q represent the values of the algebraic and control variables, respectively, in element i at collocation point q, z is the value satisfying z
i
-
1
≤
z
≤
z
i, and Ψ
q is the Lagrange polynomial of degree K.Through the simultaneous method mentioned above, the Opt1 in the form of DAEs is discretized into the NLP problem denoted by (19a)–(19i); here the problem is named Opt2.(19a)
min
⁡
w
(
z
i
j
)
,
dw
/
d
z
i
j
,
u
(
z
i
j
)
,
y
(
z
i
j
)
⁡
φ
(
w
(
z
i
j
)
,
u
(
z
i
j
)
,
y
(
z
i
j
)
,
p
v
)
(19b)
d
w
d
z
i
,
j
-
F
(
w
(
z
i
j
)
,
u
(
z
i
j
)
,
y
i
j
,
z
i
j
,
p
v
)
=
0
(19c)
H
(
w
(
z
i
j
)
,
u
(
z
i
j
)
,
y
i
j
,
z
i
j
,
p
v
)
=
0
(19d)
w
i
,
j
=
w
i
-
1
+
h
i
∑
j
=
1
K
Ω
j
(
z
-
z
i
-
1
h
i
)
d
w
d
z
i
,
j
(19e)
w
i
0
-
h
i
∑
j
=
1
k
Ω
j
(
1
)
d
w
d
z
i
,
j
=
0
(19f)
w
1
0
=
w
0
(19g)
w
L
≤
w
i
j
≤
w
U
(19h)
u
L
≤
u
i
j
≤
u
U
(19i)
y
L
≤
y
i
j
≤
y
U
.Herez
0
≤
z
i
j
≤
z
f, i
=
1
,
…
,
n
e
j
=
1
,
…
,
K.Since all the differential variables and continuous variables are fully discretized into algebraic variables along the spacious or time horizon, and large number of finite elements is generally selected to ensure the accuracy of the discretization, all the factors led to the great increase of the size of discretized problem of Opt2. As the result, though with the development of computing technique such as spare matrix and automatic differentiation, large scale solvers such as IPOPT and CONOPT can solve problems with millions of variables, and its efficient and stable solution is a big challenge. Special work need to be paid attention to to reduce the computing time and to keep the stability of the problem.There are still two key factors influencing the efficient solution of the discretized problem of Opt2: the first is to configure the number of finite element. Too large number of finite elements will lead to rapid increase in the size of variables and equations, which will greatly increase the computing time and memory occupation. The second problem is to obtain initial values for all the discretized variables, which is very critical to the stability of Opt2 formulated in (19a)–(19i). If the initial values are not carefully given, time-consuming and even failure of convergence will happen during the solution of Opt2. Based on the above reasons, techniques for assignment of initial values and suitable division of finite element are carefully designed as below.


## 4.2. Assignment of Initial Value through Simulation on Finite Element Individually

If all the control variables are fixed as constant values, all the variables of Opt2 can be obtained by simulation of the whole process model. According to the flowsheet of SWRO system, the permeate flow rate and concentration of the permeate water are the input parameters for the dynamic process of storage tanks, so variables of storage tanks can only be obtained after the simulation of RO process.The principle of collocation on finite element is shown in Figure2. Though all the variables are discretized, to keep the continuity, the final values of the first finite element are equal to the initial value of the second finite element. So to get all the values of RO process, the control variables are fixed as constant values, and then the simulation is carried out from one finite element to the next along the space or time horizon. After the simulation of RO process was finished, the values of Q
p, C
p, and so on were used as input parameters and the simulations of storage tanks are then carried out in the same way of RO process.Figure 2
Schematic of collocation on finite elements.After all the values of the discretized variables of Opt2 were obtained, we relax the control variables and enforce the constraints again. Then those obtained values were set as the initial value for Opt2, and nonlinear solver of IPOPT is used for the solution. The whole process of the technique to get good initial values is shown in Figure3.Initial value strategy based on step by step simulation.
(a)
Simulation of RO process
(b)
Simulation of storage tanks
(c)
The whole process of the strategy


## 4.3. Method for Suitable Division of Finite Element

To balance the relationship of the discrete accuracy and computing efficiency, suitable ways to determine the number of finite element are necessary. Truong et al. improved an adaptive mesh refinement method [30] to improve the computing efficiency; Lan and Taylor designed a moving grid computing strategy [31], though the computational efficiency is not high, the method is more stable. Binder proposed a mesh refinement strategy, making it superior to the average grid distribution strategy [32]. Biegler et al. proposed a dynamic optimization method [33–35] based on moving finite element technique; the finite element is automatically adjusted through error analysis. In this work, with the consideration of the special structure of SWRO system, and the relationship between the change of objective function value and the number of finite element which affect discrete state and control variables, a simple but effective method to get suitable division of finite element is designed as follows.(1)
Set the accuracy of the objective function which is defined asσ
=
[
1
-
abs
⁡
(
F
obj
0
/
F
obj
1
)
]
≤
γ; γ is a small positive value such as 1.0
E
-
7.
(2)
Set the number of finite element as Nef1 and the corresponding collocation point by conventional way.
(3)
Solve the discretized problem of Opt2, and get the value of objective functionF
obj
0.
(4)
Add the number of finite element to Nef1′.
(5)
Resolve the discretized problem of Opt2, and then obtain another value of objective functionF
obj
1.
(6)
Compute the value ofσ.
(7)
If the required accuracy is satisfied, then stop; otherwise, letF
obj
0
=
F
obj
1, and go to step (
4
).Since IPOPT is one of the best solvers to solve large scale dynamical problems, here it was used for the solution of Opt2 quickly.


## 5. Case Study

The large scale SWRO system has 8 RO plants and 4 storage tanks, and the RO membranes are the products of Dow Chemical Company named SW30HR. Each RO plant has decades of pressure vessels in parallel, and several RO membranes in the pressure vessel connected in series are used to separate salt and pure water. The storage tanks are used as the buffering units between water supply and water production. The electricity price and other information for the system are listed in Tables1-2 and shown in Figure 4. Here NPT rays and NMOD represent the number of pressure vessel and the number of membranes in pressure vessels. FF denotes the fouling factor, and ε
p and ε
p
f denote the efficiency of high-pressure pumps and energy recovery unit.Table 1
Designed operating parameters of RO unit.
Feed concentration (kg/m3)
30
Feed temperature (°C)
25
Feed pressure (Bar)
59
Feed PH
5–8
Kinematic viscosity (kg/m/s)
1.02
e
-
6 (at 0°C)
Mechanical efficiency of HP
0.85
Energy efficiency of PX
0.9
Mechanical efficiency ofη
vd
0.95
Single water quality limit (kg/m3)
0.9
Water quality limit (kg/m3)
0.9
Spiral wound modules
SW30HR seriesTable 2
Structure information about RO units.
Number of plant
NMOD
NPTrays
FF
ε
p
ε
p
f
1
8
25
1.0
0.85
0.9
2
8
30
1.0
0.85
0.9
3
7
35
1.0
0.85
0.9
4
7
55
1.0
0.85
0.9
5
7
40
1.0
0.85
0.9
6
7
50
1.0
0.85
0.9
7
6
30
1.0
0.85
0.9
8
6
32
1.0
0.85
0.9Figure 4
Daily profile of electricity price.The optimization problem of this system was discretized by simultaneous approach based on collocation on finite element. Since the control variables are not allowed to adjust frequently and the electricity price changes at different hour, 24 finite elements and 3 collocation points are selected to discretize the dynamic variables of storage tanks. For the RO process, 3 collocation points are used and the number of finite element is determined by the proposed technique. To get good initial values, the developed method in chapter 3.2 was used for the solution of Opt2. To comprehensively understand the effect of finite element on the solution, information of problem Opt2 with different finite element of RO process is listed in Table3. Table 3 shows that when the number of finite element of RO increased to 40, the discretized variables and the equations of Opt2 reached 495371 and 494411, respectively; the size of the problem is quite large.Table 3
Information of the Opt2 through discretization.
Item number
Nef1
Ncp
Total variables
equalities
Nonzero equality Jacobian
Nonzero Lagrangian Hessian
1
2
3
100378
40260
28427
27467
2
5
3
65291
64331
227674
86916
3
10
3
126731
125771
439834
164676
4
20
3
249611
248651
864154
320196
5
40
3
495371
494411
1712794
631236Nonlinear solver IPOPT [36, 37] which is based on interior point method was used for the solution of Opt2, and computing results with different finite element of RO process were listed in Table 4. The results show that the problem of Opt2 can be successfully solved when the finite element increases from 2 to 40, and the solution converged to the best point within decades of iterations. The computing time of simulation and optimization increased much more greatly when the finite element increases. In particular, it can be seen that the optimization time increases almost in the form of exponential. When 40 finite elements and 3 collocation points were selected, the optimization time will reach 3519.953 CPU seconds.Table 4
Computing results with different finite elements.
Number
Nef1
Sim. time (s)
Opt. time (s)
Total time (s)
Iteration
F
obj (104 CNY)
Relative errors (×105)
1
2
29.374
13.907
43.281
32
3.5913297
0.66349
2
5
60.407
46.64
107.047
33
3.5913061
0.00635
3
10
103.328
162.453
265.781
56
3.59130588
0.00022
4
20
209.14
868.328
1077.468
66
3.591305841
−0.00086
5
40
609.172
3519.953
4129.125
121
3.591305872
0It can also be seen that the change of objective function became much smaller with the increase of finite elements. Compared with the objective function of 40 finite elements, the relative errors were obtained and showed in Figure5. As the finite elements increased to 10, the relative errors become fairly small, and the required accuracy can be reached at this time. Compared with the computing time with 40 finite elements, more than 94% computing time was saved. To show the effectiveness of the above method, initial values for Opt2 were given by reasonable assumption near the set point, the optimal solution failed to converge when the finite element is 40; and even when the finite element is 10, more than 1187 iterations and more than 4680 seconds were spent to get the optimal solution.Figure 5
Relationship between errors of objective function values and number of finite element.As 10 finite elements of RO unit were selected, the solution of problem of Opt2 was resolved under default operating conditions. The solution led to the profiles of control variables-feed flow rates and feed pressures along time horizon, from which the best control trajectory as well as the various status variables are achieved. Some of these results can be seen from Figures6, 7, 8, and 9.Figure 6
Profiles of feed flow rate of each RO plant.Figure 7
Profiles of feed pressure of each RO plant.Figure 8
Profiles of water recovery of each RO plant.Figure 9
Profiles of water level of each storage tank.Since the feed temperature changes frequently and has significant effect on performance of RO membranes, it is necessary to optimize the process quickly through adjusting the control variables to the aimed value. To validate the performance of the proposed strategy with large fluctuation of feed temperature, increase the feed temperature from 21°C to 29°C and keep other parameters as default, and then solve the Opt2 individually. Summary of the computing results can be seen from Table5. From which it can be seen that temperature has significant effect on the energy cost. The optimal energy cost reduces quickly as the temperature increases, when feed temperature increases from 21°C to 29°C, the optimal energy cost reduces from 3.8654 Wan CNY to 3.4202 Wan CNY. It can also be seen that the change of feed temperature has little effect on the computing performance and convergence of the proposed method. All the solution can be successfully achieved within decades of iterations and within several minutes. The results show that the proposed strategy for the SWRO system not only is quite effective but also has wide temperature adaptability. All the results show the good potential to the on-line optimization of actual SWRO system.Table 5
Comparison of computing results with different feed temperatures.
T (°C)
Simulation time (s)
Optimization time (s)
Total time (s)
Iter.
F
obj (104 CNY)
Bias (%)
21
79.608
129.985
209.593
43
3.8654
7.63
23
86.235
132.297
218.532
43
3.7166
3.49
25
103.328
162.453
265.781
56
3.5913
0.00
27
97.141
120.875
218.016
39
3.4915
−2.78
29
109.032
123.031
232.063
42
3.4202
−4.76


## 6. Conclusions

It is of significance to reduce the energy cost of seawater reverse osmosis (SWRO) system through the system engineering approach, especially when the system is operated in dynamical environments due to the changes of load and other operating parameters.In this work, a dynamic optimization strategy for optimizing operation of large scale SWRO system was proposed. Based on first principle, the dynamic models of RO units and storage tanks which are developed by were formulated by differential-algebraic equations, and the objective function is formulated to minimize the energy cost. The optimization problem in the form of DAOPs was fully discretized into large scale NLP through simultaneous method, with which all the dynamic variables were approximated by polynomial equations with collocation point on each finite element. To solve the large scale NLP problem named Opt2 efficiently, a method was developed to get the initial value of all variables through simulation element by element and step by step. Then a simple but effective rule to determine the number of finite element was used to reduce the scale and at the same time to keep enough accuracy of Opt2.Case study of a large scale SWRO system which includes 8 RO plants and 4 storage tanks was studied to validate the proposed strategy. Computing results demonstrate that the method is quite efficient for the solution of dynamic optimization of SWRO system. The problem can be solved in decade’s iterations within several minutes. The minimized objective function and accordingly the best daily profiles of control variables can be achieved. The proposed strategy also performs well with large fluctuation of feed temperature, which can fully satisfy the requirement of on-line real time optimization.



---

*Source: 635434-2014-06-18.xml*