Sei sulla pagina 1di 12

Chapter 1 FEM in 1 Dimension

1.4 Unsteady diffusion in one dimension

Unsteady heat conduction equation:


2
f f
cp k 2
s x, t : is the density of rod material, c p is the heat capacity under
t t
constant pressure.

f 2
f s x, t
Or, 2
, thermal diffusivity; s.t. f x, t 0 F x .
t t cp

1.4.1 Galerkin projection


i-th Galerkin projection
L f L
i f q0 1 L
i dx dx i1 i s x, t dx , where i runs over an
0 t 0 x x cp cp 0

appropriate number of nodes. Next, we substitute the finite element expansion


NE 1 NE 1
f x fj j x ;s x sj j x .
j 1 j 1

Rearranging, we derive a system of linear ordinary differential equations (ODE)


df
M D f b
dt
1 1
B11 B12 0 0 ... 0 0 0
1 1 2 2
B 21 B 22 B
11 B
12 0 ... 0 0 0
2 2 3 3
0 B 21 B 22 B
11 B12 ... ... ... ...
0 0 ... ... ... ... ... 0
M
... ... ... ... ... ... ... ...
... ... ... ... ... ... 0 0
N 2 N 2 N 1 N 1
0 0 0 ... B21 e B22 e B11 e B12 e 0
Ne 1 Ne 1 Ne N
0 0 ... 0 B 21 B
22 B 11 B12 e

I
Evaluating the mass matrix, we find the i-th equation of the Galerkin finite element
system takes the form
NE
hi 1 dfi 1 hi 1 hi dfi hi dfi 1
Dij f j bi
6 dt 3 dt 6 dt j 1

For i=2,3,…,Ne, which can be rearranged into


NE
1 hi 1 dfi 1 2 dfi 1 hi dfi 1 2 2
Dij f j bi
3 hi 1 hi dt 3 dt 3 hi 1 hi dt hi 1 hi j 1 hi 1 hi

The first three terms on LHS contribute a weighed average of the time derivative at
three nodes.
If h1 h2 ... hN E h

1 dfi 1 2 dfi 1 df i 1 fi 1 2 fi fi 1
bi .
6 dt 3 dt 6 dt h2 h

1.4.2 Integrating ODEs

Euler method, Crank-Nicolson method, or a Runge-Kutta method.

1.4.3 Forward Euler method


f t t f t
M D f t b t tridiagonal system
t
M f t t r t , where r t M f t t D f t b t (Thomas algorithm)

The method is based on the forward difference formula:


yn 1 yn hf xn , yn where y ' f x, y

Solution procedure:

II
if y n is known, yn 1 can be computed by evaluating f, multiplying by h, and adding the

result to y n ; a method having this property of allowing direct calculation of yn 1 is

called explicit.

Error:
1 2
y xn 1 y xn hy ' xn h y '' xn .....
2
If yn y xn , that is, if the solution at xn is exact, then

1 2
y xn 1 yn hf xn , yn h y '' xn .....
2
1 2 1
y xn 1 yn 1 h y ''n : error introduced in a single step is approximately h 2 y ''n : 1st
2 2
order method. Why?
If we wish to compute the solution from x=x0 to x=xf, the number of steps of size h
required is proportional to 1/h. The error in y(xf) will be the product of the number of
steps and the error per step, and thus be proportional to h.

Mass lumping
ri
Ideal case: fi t t
M ii

1.4.4 Numerical stability


Mass lumping and equal size of element, and Galerkin procedure

dfi fi 1 2 fi fi 1
bi , for i=1,2,…,Ne.
dt he h

Explicit Euler
fi n 1
fi n fi n1 2 fi n fi n1
bi
t h2 h

III
t t
fi n 1
fi n1 1 2 fi n fi n1 bi , where , is the dimensionless
h h2
diffusion number. At steady state, fi n 1
fi n , and the solution, denoted by F , satisfies

the difference equation


t
Fi Fi 1 1 2 Fi Fi 1 bi
h

Subtracting fˆi n fi n F evolves according to the homogeneous difference equation

fˆi n 1
fˆi n1 1 2 fˆi n fˆi n1 , in vector form fˆ n 1
P fˆ n .

P is an NxN tridiagonal projection matrix.


1 2
1 2
1 2

1 2
1 2

Note: Each time we make a step, we effectively multiply the current solution vector, fˆ n

by the projection matrix to obtain the new solution vector fˆ n 1

fˆ n 1
P fˆ n P P fˆ n 1
.... Pn 1
fˆ 0

Introduction of eigenvectors of the projection matrix, u m ,

P um m um , where lambda is corresponding eigenvalues.

Assume that P has N linearly independent eigenvectors and express the initial deviation
from the steady state as a linear combination of them,

IV
N
fˆ 0 cm u m , where cm is appropriate coefficient. The first projection yields
m 1

N N
P fˆ 0 cm P u m cm m um repeating this
m 1 m 1

N
fˆ n 1
Pn 1
fˆ 0 cm n 1
m um an arbitrary initial condition will grow in time if the
m 1

magnitude of at least one eigenvalue is greater than unity. (Growth is physically


unacceptable in a diffusion process) The formal stability is that the spectral radius of the
projection matrix, defined as the maximum of the magnitude of the eigenvalues, is less
than unity.

Max m 1.

The eigenvalues of the projection matrix can be calculated exactly

m mj
m 1 4 sin 2 and eigenvector um j sin .
2 N 1 2 N 1

h2
Requiring m 1 , we derive the stability criterion. 1/ 2 t
2
This stability constraint is extremely restrictive.

Consistent formulation
(element with equal size)
1 ˆn 1 2 ˆn 1 2 ˆn 1 1 2 1
fi 1 fi 1
fi 1 fˆi n1 2 fˆi n fˆi n1
6 3 63 6 3 6
And the counterpart of vector equation

Q fˆ n 1
P Q I fˆ n

where

V
4 1
1 4 1
1 4 1
1
Q
6

1 4 1
1 4

fˆ n 1
fˆ n , where P Q 1
P Q I is a new projection matrix.

Q 2 2 m
m 1 sin
3 2 N 1

Since the eigenvalues of the inverse of a matrix are equal to the inverses of the
eigenvalues

Q 1 1
m
2 2 m
1 sin
3 2 N 1

Because matrices P 1 and P+Q-I share eigenvectors, the eigenvalues of their product is
equal to the product of their eigenvalues,
1
Q P Q
m m m m 1 then

2 m
1 4 sin 2
P
3 2 N 1
m
2 2 m
1 sin
3 2 N 1

1 h2
t
6 6

Example: 1/ 6 0.1667

1.4.6 Crank-Nicolson integration


To circumvent the time step restriction,

VI
fn 1
fn
M D fn fn 1
bn bn 1

t 2 2
Rearranging
1 1 1
C fn 1
r, C M tD , and r M tD f n t bn bn 1
.
2 2 2
1.5 One-dimensional convection
f f
u 0 ; u(x,f,t) is a prescribed convection velocity. The solution is to be found
t x
over a specified interval of the x axis, a<x<b, subject to a given initial conditions
f(x,t=0)=F(x), and a suitable boundary condition. If u(x,t) is a function of x and t explicitly
but not implicitly through f(x,t), the convection equation is quasi-linear, and we say that
the field f(x,t) is advected with the specified position- and time-dependent advection
velocity. In the special case where u is a constant, the convection equation is linear.

Galerkin finite element:


b f b f
i dx u x, t i dx 0 , for Ng global interpolation functions
a t a x
NG
f x fj t j x
j 1

NG
b df j NG
b j
i j dx u x, t i dx f j 0
j 1
a dt j 1
a x
NG
df j NG
M ij Nij f j 0 , where
j 1 dt j 1

b
i
Nij u x i dx is the global advection matrix.
a x
df
M N f 0.
dt
To evaluate the global advection matrix, we express the convection velocity in the
isoparametric form
NG
u x, t uk t k x
k 1

VII
NG NG
b j
Nij uk k i dx uk kij , where kij is a three-index global advection
k 1
a dx k 1

df
tensor. M u f 0 . In practice, the tensor is assembled from the individual
dt
element advection matrices.

1.5.1 Linear elements


d j 1
, for x j 1 x xj
dx hj 1

d j 1
, for x j x xj 1
dx hj

only nonzero components of the matrix N ij are the tridiagonal elements N i 1, j , Ni, j ,

Ni 1, j

1 xi 1 xi 1
Nii ui 1 i 1 ui i i dx ui i ui 1 i 1 i dx
hi 1 xi 1 hi xi

1 xi
Ni 1,i ui 1 i 1 ui i i dx
hi 1 xi 1

1 xi 1 xi 1
Nii ui 1 i 1 ui i i dx ui i ui 1 i 1 i dx
hi 1 xi 1 hi xi

1 1
A11 A12 0 0 ... 0 0 0
1 1 2 2
A21 A22 A 11 A 12 0 ... 0 0 0
2 2 3 3
0 A21 A22 A11 A12 ... ... ... ...
0 0 ... ... ... ... ... 0
N
... ... ... ... ... ... ... ...
N 3 N 3 N 2 N 2
... ... ... ... A21 e A22 e A12 e A21 e 0
Ne 2 Ne 2 Ne 1 Ne 1
0 0 0 ... 0 A 21 A 22 A 11 A 12
Ne 1 Ne 1 N
0 0 0 ... 0 0 A 21 A 22 A11 e

Accordingly the global advection matrix simplifies to


1 xi xi 1
Nij i, j i 1, j ui 1 i 1 ui i i dx i 1, j i, j ui i ui 1 i 1 i dx
hi 1 xi 1 xi

VIII
The contribution of the advection term to the ith Galerkin projection is
NG
1 fi 1 fi 1
Nij f j ui 1 fi fi 1 4ui ui 1 fi 1 fi
j 1 6 2

Linear advection
1 1
1 0 1
U 1 0 1
N independent of mesh size!!
2 1 0 1
1 0 1
1 1

Apart from the first and last diagonal elements, the global advection matrix is skew-
symmetric, that is, it is equal to the negative of its transpose. A skew-symmetric matrix
has zeros along the diagonal.

The global advection matrix is composed of overlapping diagonal blocks of


corresponding element matrices. The lth-element advection matrix is given by

l U 1 1
C cancellation of the alternating 1 and -1 diagonal entries during the
2 1 1

assembly process yields zeros along the diagonal.


Question: is it possible to invert N?

GFEM system for i th equation


hi 1 dfi 1 hi 1 hi dfi hi 1 dfi 1 U
fi 1 fi 1 0
6 dt 3 dt 6 dt 2
When h1=h2=…h
1 dfi 1 2 dfi 1 dfi 1 U
fi 1 fi 1 0 : cf) FDM
6 dt 3 dt 6 dt 2h

Numerical dispersion due to spatial discretization

IX
Consider a solution in the form of a periodic wave with period , and assume that the
solution of the discrete system is given by the real or imaginary part of the function

f x, t A exp ik x ct , A AR iAI (complex wave amplitude), k 2 / is the

wavenumber, and c cR icI . The complex angular frequency of oscillation is given by

kc .
Let’s assume that the length of the domain L=hNe is a multiple of the wavelength ,

L/ n . Substituting f x, t A exp ik x ct or f t i
A exp ik xi ct ,

f t i 1
A exp ik xi h ct , f t i 1
A exp ik xi h ct

1 dfi 1 2 dfi 1 dfi 1 U


fi 1 fi 1 0
6 dt 3 dt 6 dt 2h
1 2 1 U
ikc exp ikh exp ikh exp ikh exp ikh 0
6 3 6 2h
Or
2 1 U
ikc cos kh) i sin kh 0
3 3 2h
Solving for the phase velocity, we obtain

c sin kh 3
U kh 2 cos kh

The corresponding angular frequency kc reduced by the time scale U/L, is given by
L kcL c 2 n 3
2 n sin kh
U U U kh 2 cos kh

2 n
Since h L / NE , h / n / NE kh 2 h/ kh , thus
NE

L 3
1) N E sin kh When the ratio n/Ne is small, we may perform
U 2 cos kh

Taylor series expansion to find


L
2 n.
U

X
3
In the lumped mass approximation, the fractions are replaced by unity.
2 cos kh

Note: The exact solution of the linear convection equation states that the initial
distribution travels with the specified velocity U, which means c=U, and L /U 2 n.
Expression 1) reveals that the spatial discretization modifies the exact phase velocity by
an amount that depends on the reduced wave number, kh, thereby introducing
numerical dispersion.
Fig. 1.5.1 Graph of the reduced angular frequency plotted against the wavenumber.

1.5.3 Integrating ODEs


Forward Euler
f t t f t
M N f t 0 or
t
M f t t M tN f t implementing mass lumping to diagonalize the

coefficient matrix on the left-hand side, we recover the explicit forward-time, centered-
space (FTCS) fdm equation. In linear element with uniform size h, the ith equation takes
the form

fi t t fi t C fi 1 t fi t , C is the convection number

1.6 One-dimensional convection-diffusion

f f 2
f s x, t
u 2
( k / cp
t x x cp

1.6.1 Steady linear convection-diffusion


2
f f
c pU k 2
s x, t
x x
The importance of convection relative to diffusion is expressed by the dimensionless
Peclet number
c p LU LU
Pe , L is the characteristic length
k

XI
Galerkin finite element method with linear elements (Ne * Ne linear algebraic system)
1
Q f c M s
k
1 1
1 Pec 1 Pec 0 0 ... 0 0 0
2 2
1 1
1 Pec 2 1 Pec 0 ... 0 0 0
2 2
1 1
0 1 Pec 2 1 Pec ... ... ... ...
2 2
1 0 0 ... ... ... ... ... 0
Q
h
... ... ... ... ... ... ... ...
... ... ... ... 0
1 1
0 0 0 ... 0 1 Pec 2 1 Pec
2 2
1 1
0 0 0 ... 0 0 1 Pec 2 Pec
2 2

c p hU hU
Where Pec is called cell peclet number
k k
q0 / k
0
0
c .
0
1
1 Pec f L / hNe
2

1
As Pec becomes large, the coefficient matrix Q tends to the skew-symmetric form N,

where N is the global advection matrix.

XII

Potrebbero piacerti anche