You are on page 1of 25

Finite Element Method

The nite element method (FEM) provides an alternative to the


nite dierence method (FDM) that is better suited for systems
with irregular geometry, unusual boundary conditions, or non-
homogeneous composition.
In both methods, the solution domain is divided into a grid of dis-
crete points or nodes. In the FDM, the equation is then written
for each node with its derivatives replaced by nite dierences.
The original equation is then satised in a pointwise fashion.
In contrast, the FEM divides the solution domain into simply
shaped regions or elements. An approximate solution for the
equation can then be developed for each of these elements. The
global solution is generated by linking together or assembling
the individual solutions, taking care to ensure continuity at the
inter-element boundaries. Thus, the original equation is satised
in a piecewise fashion.
The use of elements, rather than a rectangular grid, provides a
much better approximation for irregularly shaped systems. Fur-
ther, values of the unknown can be generated continuously across
the entire solution domain instead of only at isolated points.
The implementation of a nite element technique to any prob-
lem follows a standard step-by-step procedure. The following
provides a brief overview of each of these steps.
Discretization
This step involves dividing the solution domain into nite ele-
ments, as shown in the previous gure. The points of intersection
of the lines that make up the sides of the elements are referred
to as nodes.
Element Equations
This step develops equations to approximate the solution for
each element. This involves two steps. First, an appropriate
function with unknown coecients will be used to approximate
the solution. Second, the coecients are evaluated so that the
function approximates the solution in an optimal fashion.
Choice of Approximating Functions
Polynomials are normally employed for this purpose because they
are easy to manipulate mathematically. For the one-dimensional
case, the simplest alternative is a rst-order polynomial or straight
line,
u(x) = ax + b
where u is the dependent variable, a and b are constants and
x is the independent variable. For inter-element continuity, this
function must pass through the values of u(x) at the end points
of the element at x
1
and x
2
. Therefore,
u
1
= ax
1
+ b
u
2
= ax
2
+ b
with u
1
= u(x
1
) and u
2
= u(x
2
). The above equations can be
solved for a and b, giving
a =
u
2
u
1
x
2
x
1
b =
u
1
x
2
u
2
x
1
x
2
x
1
Substituting into the equation for u:
u(x) =
u
2
u
1
x
2
x
1
x +
u
1
x
2
u
2
x
1
x
2
x
1
and collecting terms:
u(x) =
x
2
x
x
2
x
1
u
1
+
x x
1
x
2
x
1
u
2
The above expression can also be written in the form:
u = N
1
u
1
+ N
2
u
2
where
N
1
=
x
2
x
x
2
x
1
N
2
=
x x
1
x
2
x
1
are interpolation functions since they provide a means to pre-
dict intermediate values (that is, to interpolate) between known
values u
1
and u
2
at the nodes. It can be noted that the sum of
the interpolation functions is always equal to one, i.e.
N
1
+ N
2
=
x
2
x
x
2
x
1
+
x x
1
x
2
x
1
=
x
2
x + x x
1
x
2
x
1
= 1
In addition, the fact that we are dealing with linear equations
simplies operations such as dierentiation and integration. Such
manipulations are important in the implementation of the nite
element method. The derivative of u is given by
du
dx
=
dN
1
dx
u
1
+
dN
2
dx
u
2
The derivatives of the interpolation functions are of the form
dN
1
dx
=
1
x
2
x
1
dN
2
dx
=
1
x
2
x
1
and, therefore, the derivative of u is
du
dx
=
u
2
u
1
x
2
x
1
which is equivalent to a nite dierence approximation.
The integral of u can be expressed as
Z
x
2
x
1
udx =
Z
x
2
x
1
(N
1
u
1
+ N
2
u
2
)dx
and the integrals of the interpolation functions are given by
Z
x
2
x
1
N
1
dx =
1
x
2
x
1

x
2
Z
x
2
x
1
dx
Z
x
2
x
1
xdx
!
=
=
1
x
2
x
1
_
_
x
2
(x
2
x
1
)
1
2
(x
2
2
x
2
1
)
_
_
=
1
2
(x
2
x
1
)
2
(x
2
x
1
)
Z
x
2
x
1
N
1
dx =
1
2
(x
2
x
1
)
Similarly,
Z
x
2
x
1
N
2
dx =
1
2
(x
2
x
1
)
Therefore,
Z
x
2
x
1
udx =
1
2
(x
2
x
1
)(u
1
+ u
2
)
The above result represents a simple application of the trape-
zoidal rule.
Optimal Fit of the Function to the Solution
The equations governing the behaviour of the function within an
element must be developed. These equations represent a t of the
function to the solution of the underlying dierential equation.
Several methods are available for this purpose but the Galerkin
method will be adopted in this case. The resulting element equa-
tions will often consist of a set of linear algebraic equations that
can be expressed in matrix form as
[k]{u} = {f}
where [k] is the element matrix, {u} is a column vector of nodal
unknowns and {f} is a column vector reecting the eect of any
external inuences, applied at the nodes.
Assembly
After the individual element equations are derived, they must
be linked together or assembled to characterize the unied be-
haviour of the entire system. The assembly process is governed
by the concept of continuity. That is, the solutions for adja-
cent elements are matched so that the unknown values at their
common nodes are equivalent. Thus, the total solution will be
continuous.
When all the individual elements are nally assembled, the entire
system is expressed in matrix form as
[K]{U} = {F}
where [K] is the global matrix, {U} and {F} are column vec-
tors containing the unknowns and external forces for the whole
system.
Boundary Conditions
Before the above system can be solved, it must be modied to
account for the boundary conditions of the problem.
Solution
Solutions of the nal system of simultaneous equations can be
obtained by direct or iterative methods.
Postprocessing
Upon obtaining a solution, it can be output in tabular form or
displayed graphically. In addition, secondary variables can be
determined and output.
Finite Element Application to a Simple Heat Con-
duction Problem
Apply the nite element method to solve the boundary-value
ODE
d
2
T
dx
2
= 0
given that T = 0

C at x = 0, T = 60

C at x = 30 cm. Divide
the region into 3 nite elements.
It can be noted that this simple problem has the exact solution
T = 2x, i.e. a linear function. Therefore, one linear nite el-
ement would be sucient to reproduce the exact solution; the
division into 3 elements used here is purely for illustration pur-
poses.
Element Equations
We start from the weighted residual statement:
Z
x
2
x
1
d
2
T
dx
2
dx = 0
for a generic element with end points x
1
, x
2
, with a weighting
function. Integrating by parts gives:
Z
x
2
x
1
d
2
T
dx
2
dx =
_
_
dT
dx

_
_
x
2
x
1

Z
x
2
x
1
dT
dx
d
dx
dx = 0
and since = 0 at the end points:

Z
x
2
x
1
dT
dx
d
dx
dx = 0
We now introduce the linear approximation for the temperature
T within the element
T = N
1
T
1
+ N
2
T
2
and, calling x
2
x
1
= h (the element length), we know that
dT
dx
=
1
h
(T
2
T
1
)
Since the Galerkin method will be used for derivation of the
element equations, the approximations for and its derivative
d/dx are the same as for the temperature,
= N
1

1
+ N
2

2
d
dx
=
1
h
(
2

1
)
Substituting the above expressions and integrating:

Z
x
2
x
1
dT
dx
d
dx
dx =
Z
x
2
x
1
1
h
2
(T
2
T
1
)(
2

1
)dx =
=
1
h
(T
2
T
1
)(
2

1
)
Therefore,

1
h
(T
2
T
1
)(
2

1
) = 0
or
1
h
(T
2
T
1
)
1

1
h
(T
2
T
1
)
2
= 0
But since
1
and
2
are arbitrary constants, the above equation
will only be satised if
1
h
(T
2
T
1
) = 0
and

1
h
(T
2
T
1
) = 0
The above can be written in matrix form as
_

_

1
h
1
h
1
h

1
h
_

_
_

_
T
1
T
2
_

_
=
_

_
0
0
_

_
and represent the element equations for the above problem.
The next step is the assembly of the global system. Before the
element equations are assembled, a global numbering scheme
must be established to specify the systems topology. As shown
in the table below, this denes the connectivity of the element
mesh. Because the present case is one-dimensional, the number-
ing scheme is trivial. However, for two- and three-dimensional
problems, it oers the only means to specify which nodes belong
to which elements.
Nodal Numbers
Element Local Global
1 1 1
2 2
2 1 2
2 3
3 1 3
2 4
Once the topology is specied, the element equations can be
written for each element and added one at a time to assemble
the total system matrix. This process is depicted below.
_

1
h
1
h
0 0
1
h

1
h
0 0
0 0 0 0
0 0 0 0
_

_
_

_
T
1
T
2
0
0
_

_
=
_

_
0
0
0
0
_

_
_

1
h
1
h
0 0
1
h

2
h
1
h
0
0
1
h

1
h
0
0 0 0 0
_

_
_

_
T
1
T
2
T
3
0
_

_
=
_

_
0
0
0
0
_

_
_

1
h
1
h
0 0
1
h

2
h
1
h
0
0
1
h

2
h
1
h
0 0
1
h

1
h
_

_
_

_
T
1
T
2
T
3
T
4
_

_
=
_

_
0
0
0
0
_

_
Introducing the boundary conditions, the system can be rewrit-
ten in the form
_

_

2
h
1
h
1
h

2
h
_

_
_

_
T
2
T
3
_

_
=
_

_
0

T
4
h
_

_
or, substituting h = 10, T
4
= 60:
_

_
0.2 0.1
0.1 0.2
_

_
_

_
T
2
T
3
_

_
=
_

_
0
6
_

_
The solution of the above system gives
T
2
= 20

C T
3
= 40

C
which are the exact values at these points, as expected.
Example 5
Apply the nite element method to solve the boundary-value
ODE
d
2
T
dx
2
+ T = 0
given that T = 100

C at x = 0, T = 0

C at x = 1 m. Divide
the region into 3 nite elements.
The exact solution of this problem is T = 100 cos x64.21 sin x.
The nite element solution with 3 linear elements will only pro-
vide an approximation in this case.
Element Equations
Weighted residual statement for a generic element with end points
x
1
, x
2
:
Z
x
2
x
1
_
_
_
d
2
T
dx
2
+ T
_
_
_ dx = 0
Integrating by parts gives
Z
x
2
x
1
_
_

dT
dx
d
dx
+ T
_
_
dx = 0
Linear approximation for T and :
T = N
1
T
1
+ N
2
T
2
dT
dx
=
1
h
(T
2
T
1
)
= N
1

1
+ N
2

2
d
dx
=
1
h
(
2

1
)
Substituting the above expressions and integrating:

Z
x
2
x
1
dT
dx
d
dx
dx =
Z
x
2
x
1
1
h
2
(T
2
T
1
)(
2

1
)dx =
=
1
h
(T
2
T
1
)(
2

1
)
Z
x
2
x
1
Tdx =
Z
x
2
x
1
(N
1
T
1
+ N
2
T
2
)(N
1

1
+ N
2

2
)dx =
= T
1

1
Z
x
2
x
1
N
2
1
dx + T
1

2
Z
x
2
x
1
N
1
N
2
dx+
T
2

1
Z
x
2
x
1
N
2
N
1
dx + T
2

2
Z
x
2
x
1
N
2
2
dx
The above integrals are more easily evaluated using the natural
coordinate , given by
=
2x x
2
x
1
x
2
x
1
with a dimensionless coordinate such that = 1 at x =
x
1
, = +1 at x = x
2
. The inverse relationship is of the form
x =
1
2
[(x
2
x
1
) + x
2
+ x
1
]
which can also be written in the form
x =
1
2
(1 ) x
1
+
1
2
(1 + ) x
2
= N
1
x
1
+ N
2
x
2
The above expression implies that the element geometry is also
approximated using linear functions. In this context, the func-
tions N
1
and N
2
are usually called shape functions. Elements
for which shape and interpolation functions are the same are
called isoparametric elements.
From the above denition, it can be seen that
dx
d
=
1
2
(x
2
x
1
)
dx =
1
2
(x
2
x
1
) d =
h
2
d
The integrals can now be evaluated as follows:
Z
x
2
x
1
N
2
1
dx =
h
8
Z
1
1
(1 )
2
d =
=
h
8
"
Z
1
1
d 2
Z
1
1
d +
Z
1
1

2
d
#
=
=
h
8
_

_
2
+

3
3
_

_
1
1
=
h
3
Performing similar calculations:
Z
x
2
x
1
N
1
N
2
dx =
h
6
Z
x
2
x
1
N
2
2
dx =
h
3
Therefore, the element equations in this case are given by

1
h
(T
2
T
1
)(
2

1
) +
h
3
(T
1

1
+T
2

2
) +
h
6
(T
1

2
+T
2

1
) = 0
or, collecting terms,
_
_
1
h
(T
2
T
1
) +
h
3
T
1
+
h
6
T
2
_
_

1
+
+
_
_

1
h
(T
2
T
1
) +
h
3
T
2
+
h
6
T
1
_
_

2
= 0
But since
1
and
2
are arbitrary constants, the above equations
will only be satised if
1
h
(T
2
T
1
) +
h
3
T
1
+
h
6
T
2
= 0
and

1
h
(T
2
T
1
) +
h
3
T
2
+
h
6
T
1
= 0
The above can be written in matrix form as
_

_
h
3

1
h
h
6
+
1
h
h
6
+
1
h
h
3

1
h
_

_
_

_
T
1
T
2
_

_
=
_

_
0
0
_

_
and represent the element equations for the above problem.
Substituting the following values for h = 1/3:
h
3

1
h
=
1
9
3 =
26
9
h
6
+
1
h
=
1
18
+ 3 =
55
18
and assembling, the global system of equations takes the form
_

26
9
55
18
0 0
55
18

52
9
55
18
0
0
55
18

52
9
55
18
0 0
55
18

26
9
_

_
_

_
T
1
T
2
T
3
T
4
_

_
=
_

_
0
0
0
0
_

_
Introducing the boundary conditions T
1
= 100

C, T
4
= 0

C, the
system can be rewritten in the form
_

_

52
9
55
18
55
18

52
9
_

_
_

_
T
2
T
3
_

_
=
_

5500
18
0
_

_
The solution of the above system gives
T
2
= 73.4

C T
3
= 38.8

C
which can be compared to the exact values at these points
T
2
= 73.5

C T
3
= 38.9

C
One advantage of the nite element method is that the element
equations are general, for any discretization. If the region is now
divided into 5 elements rather than 3, the equations
_

_
h
3

1
h
h
6
+
1
h
h
6
+
1
h
h
3

1
h
_

_
_

_
T
1
T
2
_

_
=
_

_
0
0
_

_
are still valid with h = 1/5 in this case. Using this value now
gives
h
3

1
h
=
1
15
5 =
74
15
h
6
+
1
h
=
1
30
+ 5 =
151
30
After assembling, the global system of equations takes the form
_

74
15
151
30
0 0 0 0
151
30

148
15
151
30
0 0 0
0
151
30

148
15
151
30
0 0
0 0
151
30

148
15
151
30
0
0 0 0
151
30

148
15
151
30
0 0 0 0
151
30

74
15
_

_
_

_
T
1
T
2
T
3
T
4
T
5
T
6
_

_
=
_

_
0
0
0
0
0
0
_

_
Introducing the boundary conditions T
1
= 100

C, T
6
= 0

C, the
system becomes
_

148
15
151
30
0 0
151
30

148
15
151
30
0
0
151
30

148
15
151
30
0 0
151
30

148
15
_

_
_

_
T
2
T
3
T
4
T
5
_

_
=
_

15100
30
0
0
0
_

_
The solution of the above system gives
T
2
= 85.2

C T
3
= 67.1

C T
4
= 46.3

C T
5
= 23.6

C
which coincide with the exact values at these points.

You might also like