Finite-element Simulation of Two-Dimensional Fluid Flow

Finite-element Simulation of Two-Dimensional Fluid
Flow
Jahrul Alam
Department of Mathematics
Shah Jalal University of Science and Technology
Sylhet, Bangladesh
Md. Ashaque Meah
Department of Mathematics
Shah Jalal University of Science and Technology
Sylhet, Bangladesh
Abstract
ical models. An important and interesting technique
in this area is the application of a potential gradient
to a mixture of charged substances and their separation from each other, as the movement of the species is
known to be inversely proportional to their size. Thus
larger species move slowly and vice versa.
Advection dominated flows frequently occur in many
diverse natural and engineering applications. We have
developed a finite-element algorithm to simulate advection dominate flows. The advection part has been
splited from the diffusion part and been solved as a
pure advection initial value problem. The remaining
diffusion problem is integrated using a fully implicit
method. The algorithm has been implemented to simulate two-dimensional shear flow. Series of numerical
experiments have been performed to examine different
aspect of the algorithm and the simulated results are
found to be qualitatively very good.
1
Mathematical models of chemical separation process
are precisely described in Babskii et al. (1983),Mosher
et al. (1992),Andreev & Lisin (1993) and Alam (2000).
Such models consist of nonlinear partial differential
equations and a closed form solution does not exist for
most of the case (Bender 1978). Linearizing the problem based on dimensional reasoning or on other physical
nature of some variables is a common practice (Burgreen & Nakache 1964). However, the linear theory is a
local phenomena and is not guaranteed to be enough to
describe a global approximation to the solution (Bender 1978). The alternate to the analytical method in
finding an approximate solution is the numerical simulation. Rapid advances in developing numerical algorithms have recently attracted engineers, chemists to
use digital computers in studying the separation efficiency and fluid flows (Patankar & Hu 1998; Ermakov
et al. 2000, 1998).
Introduction
Chemical separation techniques are becoming popular
analytical tools in the biological sciences and in the analytical chemistry. During the last two decades, there
has been an increasing interest in the application of
an electric field to a mixture of charged species. In
1809, Ruess (1809) noticed that the dissolved charged
species in fluid do respond to electric potential. Although the physical structure of colloidal charged substances like DNA, protein etc are complicated, the fundamental behavior of such a substance in response to
electric potential can be studied by means of mathemat-
It is worth mentioning that due to the invent of high
powerful personal computers and super computers, it is
now possible to employ huge computer memory during
a numerical simulation. However, the chemical separation procedure is a passive scalar advection problem
mathematically (Alam 2000) and the powerful digi1
tal computers are till not sufficient to complete a full
numerical simulation (Alam & Bowman 2002). Besides the development of efficient numerical algorithms
and powerful, faster digital computers, a more efficient
and more elegant numerical algorithm is very essential
for the numerical simulation of passive scalar advection. The major difficulty is the numerical instability,
which appear and affects seriously both the finite difference and the finite element method. The published
literatures exhibit the use of finite difference and finite
volume approach to compute the fluid characteristics
in the case of chemical separation technique. The Eulerian finite difference algorithms are unconditionally
unstable unless they are stabilized explicitly or implicitly with the expense of artificial diffusion. Numerical
viscosity dampens the solution (Press et al. 1997) and
is impractical to be used for the numerical simulation
of passive scalar advection (Shahjalal 2002). To overcome this, a new numerical technique was proposed and
implemented with dramatically better result by Alam
(2000) and Alam & Bowman (2002).
x
H
y
h
Figure 1: The cross-channel device.
2
Basic equations
A mathematical model do represent some physical behavior of a natural process. In order to express a real
situation mathematically, we adopt some basic approximations that lead us to handle only certain characteristics of the problem. A nonlinear model is difficult to
solve analytically but do resolve the major characteristics of a situation and thus the output of such a model
is very closed to the actual result.
Recent experimental studies demonstrate the thrust
of learning the effect of a turn geometry to the separation efficiency (Paegel et al. 2000). The finite element technique is a widely used and popular method to
be known to employ irregular geometry more successfully. However, there exist additional troubles in implementing a finite element algorithm in order to simulate
a chemical separation technique as the mathematical
model involves the Navier-Stokes system. The main
thrust of this study is driven by the successful application of the parcel advection method together with a
finite element discretization. However, the parcel advection method of Alam (2000) is not implemented in
its original form. It is mainly because of the compexity
of the velocity-pressure relationship that appears in the
finite-element method. The pressure correction method
of Chorin (1968) successfully maintained the velocitypressure relationship in the finite difference method
and is now be implemented by many authors in the
finite-element method (Nithiarasu et al. 2002). In this
study, we are interested to develop a software library,
to produce some basic code and graphical user interface
(GUI), which will work as a foundation to the successful
implementation of the parcel advection algorithm with
the finite element method.
To demonstrate the mathematical model, we consider
a rectangular straight micro chip instrument with uniform cross section, which is actually a portion of the
widely used cross-channel device as shown in the figure 1.
The fluid containing this chip is temra solution and
thus the Newtonian and incompressible assumptions
are very good approximation. The fluid flow satisfy
the incompressible Navier-Stokes equation. Using twodimensional Cartesian co-ordinate system, these equations can be written as:
∂u ∂v
+
= 0,
(1) incompr
∂x ∂y
∂u
∂u
1 ∂P
∂u
+u
+v
=−
+ ν∇2 u + fx ,
∂t
∂x
∂y
ρ ∂x
∂v
∂v
∂v
1 ∂P
+u
+v
=−
+ ν∇2 v + fy ,
∂t
∂x
∂y
ρ ∂y
where
u = X-component of the velocity field,
2
(2) xMom
(3) yMom
2.2
v = Y -component of the velocity field,
ρ = density of the fluid,
In view of the theory of partial differential equation,
one can solve equation (1) - (3) with proper initial and
boundary conditions i.e. they form a well-posed problem. However the variable P disappears from equation (1) causing a troubles to the solution procedure.
One needs to eliminate u and v from equation (2 and (3)
with the help of equation (1) and thus computes P to
solve equation (2) and (3). The role of equation (1) is
to maintain the solenoidal nature of the velocity field.
This equation can be used as a condition to ensure the
solenoidal nature of the system.
P = the pressure field,
ν = kinematic viscosity,
∇2 = the Laplacian operator.
All the variables are non-dimensionalized by using a
characteristic length and time scale and the dimensional
variables are expressed with an asterisk(*) to the corresponding non-dimensional variables being related to
each other by
x∗
,
x=
L
2.1
y∗
y=
,
L
u∗
u=
,
U
v∗
v=
,
U
Mathematical difficulties
3
P∗
P =
ρU 2
Numerical Approach
In modeling any set of partial differential equation
(PDE) on a computer it is necessary to break the continuous nature of the equations into some discrete form.
One way of doing this is the Gelerkin based finite element method where the computational domain is composed into sub-domains called elements and each of the
field variables is approximated by
The boundary conditions
The problem is known as capillary electrophoresis to
chemical engineers, medical and biological scientist. To
gain a more information of this topic we prefer the
readers to the following references. For a pedagogical reason, we consider a microchip with a rectangular
cross section which is filled with a fluid having a second charged substance dissolved on it. Without loss
of generality we assume that the fluid behaves like a
non-Newtonian one and incompressible. Assumption is
a very good approximation. This assumption may not
be valid for all cases in real life experiments, however
there has a good agreement to most of the cases in practical situation. Under this assumption the fluid flow can
be described by the following two partial differential
equations where all the symbols denote the common
usual meanings and adopted a dimensionless variable
using the following scales. L= width of the channels as
length scale, U= most typical velocity as velocity scale.
The last term in equation (2) is the external force and
related to and by Where, is a constant is the wall potential is the external potential. The potential and can
be obtained by solving the following equations: For a
detailed derivation of equations (3), (4) and (5) one can
go through the references ...............??? Thus equation
(1), (2) completely describes an electro osmotic flow
in a micro-chip and can be solved with the following
conditions:
u = Σnj=1 uj Nj ,
where is uj the nodal approximation and Nj is a test
function having the following property:
Nj = {
1
0
if
if
i=j
i 6= j
The equations (1, 2, 3) are simultaneous equations but
the absence of the pressure variable in (1) requires additional numerical work (Alam & Bowman 2002). We
have used the penalty function method that perturb
equation (1) to eliminate the variable P from equation (2) and (3).
Upon multiplying equation (1, 2, 3) by Ni and then
integrating over an arbitrary domain Ω we get the following semi-discrete set of differential equations:
[L]{u} =
1
[D]{P }
1
∂
[S]{u}
[M ]{u} + [N ]{u} = −[L]{P } +
∂t
Re
where
{u} = {u1 , v1 , . . . un , vn }
3
(4) dsol
(5) dMom
The numerical solution of equation (7) is approximated by
u ≈ u∗ .
and
{P } = {P1 , P1 , . . . Pn }.
Equation (4) and (5) can be combined together to get
This technique is known as operator splitting method
1
∂
[S]{u} and widely used for the numerical simulation of many
[M ]{u} + [N ]{u} = −[L][D]−1 [L]{u} +
∂t
Re
diverse engineering problems. For the Stokes problem
(6) cMom
The non-linear advective matrix [N ] is the source of the we adopt a Gelerkin based finite element approximation
non-linear instability that appear in solving the dynam- that is capable of handling any computational domain
ical system (6). We have developed a splitting based fi- on a structured grid. For the advection problem, we
nite element (SBFE) algorithm that computes the time have designed a splitting based Lagrangian advection
splitted advection along Lagrangian trajectories. This algorithm which is very similar to the work of Alam
method combines the Lagrangian advection with the (2000) and Alam & Bowman (2002).
remaining stokes problem on a Eulerian grid by using
a operator splitting method.
3.1
Let us consider the initial value problem (IVP)
Splitting based parcel advection algorithm:
∂u
= Lu
∂t
(7) IVP
The parcel advection method is known to be a very
efficient advection algorithm for a passive scalar advecwith
tion and was developed during the work of Alam(2000).
u = u0 for t = 0,
The algorithm assumes that the fluid is a collection of
where L is any differential operator. One can write L = parcels that travel along a Lagrangian trajectory. ConA + D, where A and D are two differential operators. tinuous straining of parcels contributes in changing any
In our case A = u · ∇ and D = ν∇2 + Q, where
field variable at any location. The computational trick
requires
to track down the path and deformation of
u = (u, v) is a vector field
each parcels. At each time step, parcel carries and con∂ ∂
tributes to the nodal values of any field variable. For a
∇ = ( ,
)
∂x ∂y
detail description, the readers may go through the work
∂2
∂2
of Alam (2000). However, these studies deals only with
+ 2
∇2 =
2
∂x
∂y
the advection of a passive scalar quantity but did nothing in solving the momentum equation. The principal
and ν is any constant. In order to solve the initial value
motto of this study is devoted to integrate the momenproblem (7) we consider two initial value problems as
tum equation along the path-lines or trajectories. The
below:
recent work of Shahjalal (2002) examine the impact of
the splitting based algorithm and was found to be much
better than the method of artificial damping.
Advection problem
∂ ũ
= Aũ
∂t
Let the advection operator can be splited as
(8)
A = A x + Ay .
with
ũ = u0
for t = 0,
Then
Stokes problem
with initial data
∗
∂u
= Du∗
∂t
with
∂u
= Ax u + Ay u.
∂t
u∗ = ũ
(9)
u(x, y, 0) = u0 (x, y).
Consider solving this problem by instead solving a pair
of one-dimensional advection problems:
for t = 0,
4
equal size and having one node only. Thus the grid reduced to nothing but a Eulerian finite difference grid.
In this simple case, nodal approximations are straight
forward. The main advantage of this algorithm is that
it is unconditionally stable and conservative. Although
most of the Lagrangian algorithms are unconditionally
stable, they destroy the conservative nature of the solution by the inherent computational damping associated
with interpolation.
Figure 2: Advection
5
X- split
Eulerian Stokes problem:
As described earlier the Eulerian Stokes problem can be
solved by using a Gelerkin based finite element method.
This is done by multiplying the equation with a so
called test function and then integrating over any arbitrary volume. This, along with the penalty function
method, leads to a system of first order ordinary differential equations as described below:
∂u∗
= A x u∗
∂t
u∗ (x, y, 0) = u0 (x, y).
Y- split
∂
[M ][u] = [S][u],
∂t
∂u∗∗
= Ay u∗∗
∂t
where [M ] and [S] are ne × ne matrix given by
Z
Ni Nj dΩ,
mij =
u∗∗ (x, y, 0) = u∗ (x, y).
Finally, we assume u ≈ u∗∗ to get the solution of the
advection problem.
Ω
sij =
4
(10) adv
Z
Ω
DNi Nj dΩ,
1 2
∇ and ne being the number of node per
Re
element. We have used the 9-node quadrilateral element as shown in the figure (5) (Fortin 1981). The
with D =
Lagrangian parcel advection
method:
Let us consider an Eulerian grid as shown in figure (2).
When the grid is occupied with a fluid, the amount
of fluid contained on each element is thought to be a
parcel. A parcel has a position, velocity, concentration, density, temperature. When the fluid flows, the
parcels advect along trajectories and take place to a
new position by overlapping more elements. The overlapped areas of respective elements are computed and
the corresponding fluid of the parcel is assumed to be
transferred to the respective elements. In this way, a
parcel contributes in changing the elemental values of
any fluid variable. However, it is not clear from this
picture how the nodal values are contributed by a parcel. To this date, the implementation of this algorithm
used a grid containing a finite number of element with
Figure 3: Nine-node quadrilateral element.
main advantage of using this element is the huge reduction of the computational work and the convenient
5
implementation of the penalty function approach. It is
a common practice to use different type of shape functions for the pressure variable and the velocity variable,
which restricts the nodal approximation of the pressure
variable from that of the velocities. The task of eliminating the pressure variable from the momentum equation is not straight forward and must be done very carefully as the role of pressure is to maintain the solenoidal
nature of the velocity field. Splitting based numerical
technique can use the same nodal approximation for the
pressure and the velocity variable. However, we are interested to develop a splitting based algorithm to avoid
the non-linear instability introduced by the advection
term.
6
location. If the location of a parcel in the previous step
is not a node, a distance-weighted-average value from
the nearest node is used. This is shown in the figure 6.
Assuming the parcels to be infinitesimal, we have neglected the effect of parcel deformation. While computing the trajectories passing through a node, advection
of each parcels is first computed along the X-direction
(X-split) and then along the Y -direction (Y -split).
Numerical implementation
The details of the velocity and the pressure approximation using 9-node quadrilateral element can be found
in ()[book]. The integrations associated with the matrices [L], [M ], and [S] has been computed by using a
3-point Gauss method. We have developed a C++ library that is capable of producing such matrices if the
necessary shape functions and the nodal coordinates
associated with the 9-node Crouxe-Roviert quadrilateral elements are provided. The library is designed in
object-oriented programming language C++ in such a
way that one can easily extend this to any type of elements. The matrices associated with the local elements
are called ’local matrices’ and can be computed by simply calling the following library function:
Figure 4: Parcel propagation along trajectories
Once the advection is computed, the Stokes problem
is solved as an initial value problem using the advecting
field as the initial value. In this algorithm, advection
split is unconditionally stable and the Stokes problem is
computed using a fully implicit method. Thus the overall algorithm becomes unconditionally stable. However,
a very large time step accumulates some sort of numerical error if the advection split is handled by a first order
Euler’s method. A higher order trajectorial approximation reduces such error and allows us to use larger time
steps.
LocalMatrices();
7
In order to compute the time-splitted advection, we
have assumed that the fluid is a collection of parcels
with arbitrary infinitesimal size. Each of the parcels
contain all the local dynamical information about the
fluid and travels along the trajectory. Thus a parcel is
associated with the nodal approximation of the velocity,
temperature, pressure, density, concentration etc. (and
hereinafter called parcel variables). In a particular time
step, one parcel is located at one node in the structured
mesh and the trajectory passing through each of the
nodes is approximated by a first-order Euler’s method.
In this way, the approximate location of each parcel in
the previous time-step is computed. Parcel variables
of a particular parcel are propagated from its previous
Result and discussion
The splitting based finite element algorithm is implemented to simulate a two-dimensional parallel shear
flow. Trajectorial splitting of advection combined with
the fully implicit stokes treatment leads to an unconditionally stable method. We are not interested to attempt the complexity due to the special role of the pressure gradient term that appears in the incompressible
Navier-Stokes equation and we simply have used a panelty function approach. This introduces a small perturbation in the global solution but a huge amount of computational time is saved. However, we are restricted to
use a special type of 9-node element in this case. One
6
0.8
0.6
0.4
0.2
1.6
1.4
1.2
0
1
-2
-1
0
1
2
x
3
4
Grid lines
1
0.8
0.6
0.4
0.2
0
5
6
y
The inlet velocity profile
1.6
Figure 5: The mesh generated with a two-dimensional
straight channel.
1.4
1.2
advantage of this algorithm is that we can use any time
step during a numerical simulation. The other advantage is that we can use a large value of the Reynolds
number. Thus the algorithm is capable of simulating
flows with high Reynolds number and also with low
Reynolds number. To demonstrate the performance of
the algorithm, we have generated two meshes; one with
a straight two-dimensional channel and the other with
a U -shaped channel. The flow is symmytric about the
centerline of the straight channel and thus we have used
one half of the channel as our computational domain.
In both the cases, we use a no-slip boundary condition
at the walls and a Dirichlet type condition at the inlet. Symmetric condition that is similar to a Neumann
condition, is used at the outlet and at the boundary
which is not a wall. We compute a suddenly accelerated flow with a parabolic inlet velocity profile. For
the straight channel, the velocity increases from zero
everywhere in the computational domain and takes the
same parabolic profile if the the Reynolds number is
not very high. In the following sub-sections, we compute compute velocity profile with different state. The
simulated results are found to be qualitatively in a very
good agreement with known results.
7.1
velocity
velocity
1
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
y
Figure 6: Initial velocity profile in the straight channel.
Two-dimensional straight channel
A mesh is generated for a two-dimensional region that
extends from x = −2, y = 0 to x = 6, y = 1 and is
shown in figure 7.1. The initial velocity profile of the
two-dimensional straight channel is shown in figure 7.1.
We than compute the velocity profile along the outlet
7
The computed velocity profile in the outlet boundary
1.6
velocity
1.4
0.8
0.6
0.4
0.2
1.6
1.4
1.2
0
1
1.2
-2
-1
0
1
2
x
3
4
Grid lines
1
0.8
0.6
0.4
0.2
0
5
6
1
u
Figure 9: The mesh generated with a two-dimensional
U-shaped channel.
0.8
boundary. The result is shown in the figure 7.1. The
contours of the x-component of the velocity is presented
further in figure 7.1.
0.6
0.4
7.2
0.2
0
0
0.2
0.4
0.6
0.8
Two-dimension U-shaped channel
We have then repeated the same numerical simulation
using the two-dimensional U-shaped channel instead
of the straight channel. The mesh generated by a Ushaped computational domain, the initial velocity profile, the outlet velocity profile, and the contours of the
velocity is shown respectively in figures 7.2,7.2, 7.2, 7.2.
1
x
Figure 7: The velocity profile in the outlet boundary of
the straight channel.
8
The main contribution throughout this work is the development of a splitting based finite element algorithm,
which is unconditionally stable and is not restricted by
the value of Reynolds number. The result obtained
from the numerical experiment show that the algorithm
is capable of computing a shear flow and the resuts are,
as shown in the prevous subsection, qualitatively very
good.
The velocity contours in the 2D straight channel
-2
-1
0
1
2
3
4
5
6
Conclusion and future work
1
0.8
0.6
0.4
0.2
0
In the implemetation of the algorithm, we have ignored the deformation of parcels, which is a good approximation if the parcels are infinitesimal for a laminer
flow. However, this approximation is not valid for all
the cases. Thus we plan to alter the code so that the
software library can be used to simulate any type of
Figure 8: The velocity contours in the straight channel.
8
y
The computed velocity profile in the outlet boundary
1.6
velocity
1.4
1.2
The inlet velocity profile
1.6
velocity
1
u
1.4
0.8
1.2
0.6
1
velocity
0.4
0.8
0.2
0.6
0
0
0.2
0.4
0.6
0.8
1
x
0.4
Figure 11: The velocity profile in the outlet boundary
of the U-shaped channel.
0.2
0
0
0.2
0.4
0.6
0.8
1
y
The velocity contours in the 2D straight channel
Figure 10: Initial velocity profile in the U-shaped channel.
-2
-1
0
1
2
3
4
5
6
1
0.8
0.6
0.4
0.2
0
Figure 12: The velocity contours in the U-shaped channel.
9
flow field with reasonable accuracy. The pressure correction method of Chorin (1968) is a good alternate to
the penalty function method. We are interested to develop an algorithm that would be able to compute the
incompressible velocity field by maintaining automatically the solenoidal nature as was done by Alam & Bowman (2002). These are left as a future work. However,
this numerical work is good enough to study fundamental theories of fluid flow that influences a chemical
separation process. Once a mesh is generated with any
shape of computational domain, the mesh data file can
be read by the code to produce numerical results for
the velocity field.
10
References
[Alam & Bowman 2002]
M. J. Alam & J. C. Bowman, Theoret. Comput. Fluid Dynamics., 16:133, 2002.
[Alam 2000]
M. J. Alam, “A fully Lagrangian advection scheme for electro-osmotic flow,” Master’s thesis, University of Alberta, Canada, 2000.
[Andreev & Lisin 1993]
V. P. Andreev & E. E. Lisin, Chromatograhia, 37:202, 1993.
[Babskii et al. 1983]
V. G. Babskii, M. Y. Zhukov, & V. I. Yudovich, Mathematical Theory of Electrophoresis, Consultants Bureau, New York, 1983.
[Bender 1978]
C. M. Bender, Advanced Mathematical Methods for Scientists and Engineers, McGraw Hill, New York, 1978.
[Burgreen & Nakache 1964] D. Burgreen & F. R. Nakache, J. Phys. Chem., 68:1084, 1964.
[Chorin 1968]
A. Chorin, Math. Commp., 22:745, 1968.
[Ermakov et al. 1998]
S. V. Ermakov, S. C. Jacobson, & J. M. Ramsey, Anal. Chem., 70:4494, 1998.
[Ermakov et al. 2000]
S. V. Ermakov, S. C. Jacobson, & J. M. Ramsey, Anal. Chem., 15:3512, 2000.
[Fortin 1981]
M. Fortin, Int. J. for Num. Meth. in Fluids, 1:93, 1981.
[Mosher et al. 1992]
R. A. Mosher, D. A. Saville, & W. Thormann, The Dynamics of Electrophoresis,
VCH, Weinheim, 1992.
[Nithiarasu et al. 2002]
P. Nithiarasu, K. Seetharamu, & T. Sundararajan, Arch. Comput. Meth. Engng,
9:3, 2002.
[Paegel et al. 2000]
B. M. Paegel, L. D. Hutt, P. C. Simpson, & R. A. Mathies, Anal. Chem., 72:3030,
2000.
[Patankar & Hu 1998]
N. A. Patankar & H. H. Hu, Anal. Chem, 70:1870, 1998.
[Press et al. 1997]
W. H. Press, S. A. Teukolsky, W. T. Vetterling, & B. P. Flannery, Numerical Recipes
in C: The art of scientific computing, Cambridge University Press, Cambridge, 1997.
[Ruess 1809]
F. F. Ruess, Memoires de la Societé IMperiale de Naturalistes de Moscou, 2:327,
1809.
[Shahjalal 2002]
M. Shahjalal, “Software development to fcilitate the numerical simulation of microfluidic flows,” Master’s thesis, Shah Jalal University of Science and Technology,
Bangladesh, 2002.
11