Professional Documents
Culture Documents
Introduction
In recent years, renewable energy and microgrids are drawing attention towards non-
fossil fuel based energy society. At the same time, necessity of Electrical Energy Storage
(EES) to mitigate the transient discrepancy between energy demand and supply is
increasing. Among the candidates suitable to be used as ESS in grids, Redox Flow
Batteries (RFB) has advantages in energy capacity, cycle and calendar life.
In this paper, a representative flow problem is analyzed and solved. As a prevalent
two-dimensional Boundary Value Problem (BVP), cavity flow problem has been studied
with various methods and approaches.1,2,3 While Thom discussed Finite Difference
Method (FDM) for fluid dynamics in the early 1930s, Woods and others implemented
and expanded the method to get the numerical solution for large-scale grids and high
Reynolds numbers.4,5,6 It was around the late 1970s when the Finite Element Method
(FEM) was applied by Tuann and Olson.7,8,9,10 In conventional FEM for PDE problems,
spatial discretization builds the grid and defines unknown variables at each point in the
grid, and a trial function passes through these grid points. Among the different
implementations of FEM, Orthogonal Collocation on Finite Element (OCFE) method
successfully demonstrated that high accuracy can be achieved using the minimum
number of grid points.11,12,13
In this study, OCFE method is introduced for the cavity flow problem with imaginary
points outside of the cavity. The imaginary points help to get the vorticity boundary
11
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
condition as well as allow us to evade the singularities at the corner. The performance of
the method is evaluated based on the accuracy and computational speed of solution.
Method
The OCFE approach has two steps of discretization. First step is to generate
subdomains, and the next is to place collocation points in them. At the same time, the
continuity in the variables at the interfaces between the subdomains should be guaranteed.
While the state variables which have been defined at the inner space and boundaries of
the cavity, the variables at the corners of the cavity have been excluded purposefully to
evade the singularity, as two of these corners have inconsistent boundary conditions.
BC1
BC3 BC4
BC2
12
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
for the index of each stage, from 1 to Nstage . Because both axes are scaled to 1, the length
of subdomain h is defined by equation [17]. The second step discretizes each sub-domain
into Nnode Nnode grid points (shown as a dotted line). However, the second discretization
is conducted at roots of shifted Legendre polynomials, corresponding to the order of N node .
Each point is denoted as ( xi , y j ) , where i and j stands for the index of x and y-axis from
0 to Nnode 1 Nstage . At these points, state function and vorticity become state variable
( xi , y j ) and ( xi , y j ) , and there are ((Nnode 1) Nstage 1)2 grid points in total. This
approach significantly reduces the number of non-zero elements in the Jacobian
calculation and therefore enables rapid solution.
Equation No.
Velocity u , v [13],[14]
y x
w w 2 w 2 w
Navier-Stokes Equation Re 2 2 [15]
x y y x x y
2 2
Vorticity w 2 2 [16]
x y
1
Scaling factor for subdomains h [17]
N stage
[2,1] [2,2]
[1,1] [2,1]
Continuity condition
Since the whole domain is discretized into subdomains, additional condition for the
continuity between subdomains should be satisfied. Figure 3 shows a schematic of grid
points and the boundary of subdomains at the left-bottom of the cavity, subdomain [1,1] ,
when the number of the nodes is 2. Since the trial functions in each subdomain share
same points, ( x1 , y3 ) at [1,1] and [1, 2] should be equal, as ( x1 , y3 ) is equal at [1,1] and
[1, 2] . To satisfy this, the state variables at the interface should be identical for the trial
13
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
functions which are adjacent to each other. It gives a clue about the general form of
stream and vorticity which shares the boundaries, as in Table 3.
[1,2]
(0,4)
Point index
(0,3) Boundary
(0,2) [1,1]
[1,2]
[2,1]
[1,1] [2,1]
[2,2]
(0,1)
Equations No.
NJ MI MI
x xi N J y yj
x, y [ I , J ] xm , yn
mM I 1
xm xi j N
yn y j
[18]
n N J 1 i M I 1
j n
J 1
im
NJ MI MI
x xi N J
y yj
w x, y [ I , J ] w xm , yn
m M I 1
xm xi j N
yn y j
[19]
n N J 1 i M I 1 j n J 1
im
Index
With these trial functions, N-S and vorticity equation [15] and [16] can be expressed
as Algebraic Equations (AEs) at the interior grid points of each subdomain. Though the
continuity is guaranteed by sharing identical variables in both N-S and vorticity equation,
there is still a need for smoothness of the trial functions at interface between the
subdomains. In FEM, smoothness corresponds to derivatives of the trial function, and it
becomes an additional continuity condition. In addition, the normal derivatives of the
variables are also continuous as described in Table 4.
14
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
Border
x, y [ I , J ] x, y [ I 1, J ]
I [1, N stage 1] [20]
x x x x( N node 1)( I )
J [0, N stage 1]
w x, y [ I , J ] w x, y [ I 1, J ] y y( N node 1)( J ) N
N [1, N node ] [21]
x x
x, y [ I , J ] x, y [ I , J 1]
I [0, N stage 1] [22]
y y x x( N node 1)( I ) M
J [1, N stage 1]
w x, y [ I , J ] w x, y [ I , J 1] y y( N node 1)( J )
M [1, N node ] [23]
y y
Corner
x, y [ I , J ] x, y [ I 1, J 1]
x x( Nnode 1)I I [1, N stage 1]
[24]
x x
w x, y [ I , J ] w x, y [ I 1, J 1] y y( Nnode 1)J J [1, N stage 1]
[25]
x x
Boundary conditions
As explained in Table 1, boundary conditions are given as stream functions and
velocity in x and y-direction. However, governing equations at the grid are defined with
stream and vorticity. Whereas the velocity is derivative of the stream and can be
interpreted as a function of it, vorticity is not given explicitly and needs to be clarified.
Meanwhile, there are singularities at the corner of cavity and should be excluded.
However, the equation [19] is defined including these singular points, and unlike the case
for inner grid points, the boundary conditions includes these points. To avoid this issue,
stream function at the cavity boundaries needs to be redefined.
Figure 4 illustrates the grid and imaginary points along the x-axis, when Nnode is 2 and
Nstage is 4. The imaginary points, also known as ghost points, are notated as 1 and are
located outside the boundary. With ghost and other Nnode 1 sequential points, stream
function at the boundary ( x, y)B can be defined, while the B indicates boundary and
{L} , {R} , {D} , and {U } which stands for left, right, bottom, and topside boundaries, as
summarized in Table 5.
(-1) (0) (1) (2) (3) (4) (9) (10) (11) (12) (13) (14)
Figure 4. Schematic of grid points along x-axis when Nnode 2 and Nstage 4
15
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
Equations No.
N node N node
x xi
( x, y j )L
xm , y j
xm xi
[26]
m1 i 1
im
Nnode 1N stage 11 Nnode 1N stage 11
x xi
( x, y j )R
xm , y j
x xi
[27]
m N node 1 N stage 1 N node i N node 1 N stage 1 N node m
im
N node N node y yj
( xi , y )D xi , yn y y [28]
n 1 j 1 n j
j n
Nnode 1N stage 11 Nnode 1N stage 11 y y
( xi , y )U xi , yn
j
[29]
n N node 1 N stage 1 N node j N node 1 N stage 1 N node
yn y j
j n
Index
Unlike polynomials which are defined inside the boundary, the newly defined stream
and vorticity are functions of either x or y, because one of the variables is already
determined as 0 or 1 at the boundary. Simultaneously, it should satisfy the velocity
condition at the boundary as well. For example, the velocity in y-direction v( x0 , yJ ) is
derivative of stream ( x, yJ ) L with respect to x, and it gives a relationship between the
ghost and other three points. Meanwhile, u ( x0 , yJ ) is trivial because ( x, yJ ) L is not a
function of y. On the other hand, when the bottom and lid boundaries are considered,
u( xI , y) has a meaning, as the lid has non-zero velocity condition. Though introducing
ghost point increases the number of variables, the velocity boundary condition can be
used to identify these new variables. With this approach, vorticity at the boundaries can
be evaluated without singular points. Table 6 summarizes the boundary conditions for the
boundary function and vorticity based on them.
Solver comparison
For benchmarking purposes, few open-source codes were simulated as well
(Successive Over Relaxation (SOR), Alternating Direction Implicit (ADI) in Fortran.14, 15
For the simulation, workstation with 2 hexa-core 3.33GHz Intel Xeon processors and 24
GB RAM were used to carry out the calculation.
16
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
(0, yJ ) 0 [26]
( xI ,0) 0 [27]
(1, yJ ) 0 [28]
( x , y J )L
0
x [30]
x 0 J [1, N node 1 N stage ]
( x , y J )R [31]
0
x
x 1
[32]
( xI , y )D
0
y
y 0
( xI , y )U [33]
1
y
y 1
2 ( x, y J )L [34]
w(0, y J )
x 2
x 0
2 ( x, y J )R
w(1, y J ) [35]
x 2
x 1
( xI , y )D
2
w( xI , 0)
y 2 [36]
y 0
2 ( xI , y )U
w( xI ,1)
y 2 [37]
y 1
17
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
Convergence
Convergence study of the algorithm is important to understand the effect of scaling
and the computational requirements. Figure 5 shows the results of OCFE for velocity at
the center, i.e. at x = 0.5 and y = 0.5. Throughout the simulation, the number of nodes and
tolerance was 2 and 1e-6, respectively. For this specific case, the Reynolds number was
100. Because the cavity flow problem is a 2D-BVP, the solution at the center is the most
inaccurate and appropriate to appraise the error. In OCFE, the number of grid lines along
the axis is Nnode 1 Nstage 1 and solution in both x and y-direction coincides well when
Nstage is only 16. It means that even relatively coarse grid of 49 49 points is enough to
get a convergent solution.
1.0 1.0
Nstage=4
0.8
0.8
Velocity in y direction
Nstage=8
0.6
Nstage=16
0.6
0.4
Y-axis
0.2 0.4
Nstage=4
0.0
0.2 Nstage=8
-0.2
Nstage=16
-0.4 0.0
0.0 0.2 0.4 0.6 0.8 1.0 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0
X-axis Velocity in x direction
a) y=0.5 b) x=0.5
-1.9E-1 6.E-2
OCFE
SOR
6.E-2
Center Velocity [-]
-2.0E-1 ADI
5.E-2
-2.1E-1
OCFE
5.E-2
SOR
ADI
-2.2E-1 4.E-2
8 16 32 64 128 256 512 8 16 32 64 128 256 512
Square root of Grid point [-] Square root of Grid point [-]
a) In y direction a) In x direction
Figure 6 shows velocity at the center with different approaches, related to square root
of grid points. The OCFE and ADI solution converged to approximately -0.209 and 0.057,
while SOR did not. For both SOR and ADI method, fourth order accuracy was used
while OCFE guarantees a second order accuracy. In spite of this, the OCFE converges as
fast as these fourth order accuracy methods. It shows that OCFE can achieve good
18
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
convergence and accuracy with reduced number of variables. This simulation was
performed when Reynolds number is merely 100, it will require more grid points as
Reynolds number increases.
Computational cost
The solution time of OCFE and other approaches with different sizes of grid and
Reynolds number is summarized in Figure 7. When the Reynolds number is fixed at 100,
OCFE calculated the solution faster than conventional methods, for sizes of the grid, as
shown in Figure 7.a). When a more complex system is considered, by increasing the
Reynolds numbers up to 1000, OCFE maintained the advantage in speed and is about 10
times faster than other methods. These results validate that OCFE is more effective in
time, especially when complex and large-scale simulations are considered.
Conclusions
To facilitate model based-design, control and simulation of redox flow batteries, fast
and robust numerical solution of computational fluid dynamics is essential. In this paper,
OCFE method is introduced for the lid-driven cavity flow simulation, with different size
of grids and Reynolds numbers. The proposed approach enables fast simulation. As the
model has been solved using an optimizer, it is possible to combine flow models for
RFBs with electrochemical models for real-time simulation and control.
Acknowledgments
This work was supported by the Clean Energy Institute located in University of
Washington, Seattle and the Washington Research Foundation.
19
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).
ECS Transactions, 85 (5) 11-20 (2018)
References
1. U. Ghia and T. Shin, .J Comput. Phys., 48, 387 (1982).
2. C. Migeon and G. Pineau, J. Fluids Struct., 14, 469 (1999).
3. P. N. Shankar and M. D. Deshpande, Annu. Rev. Fluid Mech, 32, 93 (2000).
4. A. Thom, Proc. R. Soc. London, Ser. A, 141, 651 (1933).
5. L. C. Woods, Aeronautical Quarterly, 5, 176 (1954).
6. O. R. Burggraf, J. Fluid Mech., 24, 113 (2006).
7. S. Tuann and M. D. Olson, .J Comput. Phys., 29, 1 (1978).
8. M. A. Mendelson and R. C. Armstrong, J. Non-Newtonian Fluid Mech., 10, 31
(1982).
9. E. Barragy and G. F. Carey, Comput. Fluids, 26, 453 (1997).
10. A. M. Grillet and B. Khomami, J. Non-Newtonian Fluid Mech., 88, 99 (1999).
11. N. B. Ferguson and B. A. Finlayson, Chem. Eng. J., 1, 327 (1970).
12. G. F. Carey and B. A. Finlayson, Chem. Eng. Sci., 30, 587 (1975).
13. P. W. Chang and B. A. Finlayson, Math. Comput. Simulat., 20, 83 (1978).
14. E. Erturk, Int. J. Numer. Meth. Fluids, 60, 275 (2009).
15. E. Erturk and C. Gokcol, Int. J. Numer. Meth. Fluids, 50, 16 (2006).
20
Downloaded on 2018-05-10 to IP 144.173.6.94 address. Redistribution subject to ECS terms of use (see ecsdl.org/site/terms_use) unless CC License in place (see abstract).