Sie sind auf Seite 1von 10

Introduction to Finite Element Method

INTRODUCTION TO FINITE ELEMENT METHOD


1
THE NATURE OF APPROXIMATION
In order to be a solution to a partial differential equation, the solution must
satisfy:
the differential equation
the boundary conditions
the initial conditions (for an unsteady or nonstationary problem)
Consider the steady one-dimensional form of the continuity and energy conservation
equations with constant properties:
( ) 0 = u
dx
d
(1.1)
( ) |
.
|

\
|
=
dx
dT
dx
d
c
k
uT
dx
d
p
(1.2)
subject to the boundary conditions

0 0
) 0 ( u u = (1.3)

0
) 0 ( T T = (1.4)

L
T L T = ) ( (1.5)
The exact solution to these equations is

0 0
u const u = = (1.6)

1
/
exp
1
/
exp
) (
0
0

|
|
.
|

\
|

|
|
.
|

\
|

=

p
p
L
c k
uL
L
x
c k
uL
T T
T x T
(1.7)
Equations (1.6) and (1.7) satisfy the governing partial differential equations (Eqs.
(1.1)-(1.2)) and the boundary conditions (Eqs. (1.3)-(1.5)) and thus constitute the
solution to the problem posed.
Suppose we wish to approximate the solution to the equation (1.2), rather than obtain
its exact solution. One possible method would be to use the method of weighted residuals
(MWR) to obtain an approximate analytical expression for the variation of T(x) over the
domain 0 x L. This method will be explained later in detail, but we make an example
of its application here as an introduction.
We begin by assuming a functional form of the solution. A simple polynomial
expression, a quadratic, will be used.
Introduction to Finite Element Method 2
(1.8)
2
2 1 0
2
0
) (
~
x a x a a
x a x T
i
i
i
+ + =
=

=
To be a solution, the expression must satisfy the boundary conditions (1.4)-(1.5).
We take for this example L=1, T
0
=1, and T
L
=0. Applying these boundary conditions to
the expression (1.8), we find that

) 1 (
1
2 1
0
a a
a
+ =
=
(1.9)
So the polynomial (1.8) is reduced to an expression with only one unknown constant,
a
2
:
) ( 1 ) (
~
2
2
x x a x x T + = (1.10)
To evaluate the remaining constant, we use one of a class of methods called the
method of weighted residuals (MWR). If we substitute the approximate expression (1.10)
for T into the differential equation (1.2), the equation will not, in general, be satisfied.
In other words, some residual will exist which varies over the domain.
) (
~
x
0
~ ~
/
) (
2
2

=
dx
T d
dx
T d
c k
u
x R
p
(1.11)
The MWR minimizes the error in the approximation by forcing this residual to zero in
some \ average, weighted sense.
(1.12)

= =
L
i
n i dx x R W
0
,... 2 , 1 0 ) (
Note that the number of weight functions W
i
, and hence the number of weighted
residual expressions, must equal the number of unknown constants in the residual
expression. One of the subclasses of the MWR is the collocation method, where the
weight functions are simply the Dirac delta functions, ) (
i
x x . The weighted
integration then simply forces the residual to zero at a fixed number of discrete points
within the domain. For the current example, we need one weighted residual statement to
evaluate the remaining single constant in the approximation. We choose to collocate the
residual at the midpoint of the domain, x
i
=0.5. Hence,
0
~ ~
/
) (
2
2
=

=
i i
x x
p
i
dx
T d
dx
T d
c k
u
x R (1.13)
Now, by computing the required derivatives directly from the equation (1.10), we
find
) 1 2 ( 1
~
2
+ = x a
dx
T d
(1.14)
Introduction to Finite Element Method 3

2
2
2
2
~
a
dx
T d
= (1.15)
Substituting these expressions into the residual expression (1.11) yields
|
2 2
2 ) 1 2 ( 1
/
) ( a x a
c k
u
x R
p
+ |

= (1.16)
Now, we collocate this residual at the midpoint of the domain

2
2 ) 1 (
/
0 ) 5 . 0 ( a
c k
u
R
p

= =

2
Pe
/ 2
2
=

=
p
c k
u
a
( ) x x x x T =
2
2
Pe
1 ) (
~
(1.17)
Here Pe is the Peclet number, Pe = uLc
p
/k. The Peclet number represents the
relative strength of the convective flux ( uc
p
) to that of the diffusive flux (k/L), and may
be positive or negative according to the sign of u. The graph on the following page
illustrates the behavior of the exact solution, given by Equation (1.7), and the
approximation, given by Equation (1.17) for the range -5 Pe +5. Note that the
approximation does well for low Pe, but errs grossly for Pe = 5.
What can be done to improve the approximation? One obvious suggestion would be
to increase the order of the approximating polynomial. Another, less obvious, notion is to
decrease the extent of the domain over which the polynomial approximates T(x). In other
words, break the overall domain into smaller pieces, and assume an approximating
function for T over each sub-domain. This facilitates the use of lower, not higher, order
approximations over the sub-regions. This is the basis for the Finite Element Method
(FEM).
Introduction to Finite Element Method 4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
T
e
m
p
e
r
a
t
u
r
e
x
Pe = -5 Exact
Pe = -5 MWR
Pe = -1 Exact
Pe = -1 MWR
Pe =0.001 Exact
Pe =0.001 MWR
Pe = +1 Exact
Pe = +1 MWR
Pe = +5 Exact
Pe = +5 MWR

Figure 1. Quadratic MWR solution (Eq. 1.17) compared with exact solution (Eq. 1.7)

An Introductory Example
AN INTRODUCTORY EXAMPLE
5

We would like to get an overview of the steps required for application of the FEM to
a new problem. These steps are:
1. Discretize the domain.
2. Select the element interpolation functions.
3. Determine the element equations.
4. Assemble the element equations into the system equations.
5. Apply the boundary conditions to the system equations.
6. Solve the system.
7. Perform any supplemental calculations (post processing).
We will use the one-dimensional example of the previous section as a vehicle for
illustrating these steps. This example is intended to give an overview only, as many of the
steps must be explained in detail later.
Step 1. Discretize the domain. The domain is one-dimensional, having an extent
from 0 to L. We will divide the domain into a series of n segments of uniform length.
Each segment has two nodes, one at either end, hence there will n+1 nodes in the system.
The nodes serve as the location points for calculation of the field variable T.
Step 2. Select the element interpolation functions. Conceptually, this is a central step
in the FEM. There are some requirements which must be followed in selection of these
interpolation functions to assure convergence of the method, and these will be stated
later. Generally, the approximations are taken from the family of polynomials, and the
lowest order polynomial which satisfies the requirements for convergence are usually
chosen. In this case, a linear variation of T(x) over each element is assumed:
(2.1)

| |{ } T N =
)
`

=
2
1
2 1
) ( ) ( ) (
T
T
x N x N x T
where

( )
( )
( )
( )
) ( ) (
1 2
1
2
1 2
2
1
x x
x x
x N
x x
x x
x N

= (2.2)
The role of the interpolation row matrix [N] is to operate on the column vector of
nodal temperatures {T} to yield the value of T(x) for x
1
x x
2
. Note that the
interpolation functions embody all of the spatial dependence of the dependent variable.
Step 3. Determine the element equations. The approach to be used exclusively in this
course is a MWR approach. In this particular example, and in much of what follows, a
Galerkin MWR approach is used. The major steps to be taken to derive the element
equations are:
An Introductory Example 6
1. Multiply each term in the governing equation by a weight function, W
i
.
2. Substitute the approximation for the field variable (Equation (2.1)} into the
resulting equation.
3. Integrate the equation (either formally or numerically) to obtain the element
matrix equations. Use integration by parts (Green's theorem) on the highest
order derivative in the equation. This reduces the highest order of derivative in
the equation by one (facilitating use of simpler, lower order interpolation
functions) and also introduces the natural boundary conditions.
For the example under consideration, the element matricies are as follows:
0
1 1
1 1
2 1 1
1 1
2
1
2
1
2
1
=
)
`


+
)
`

T
T uc
T
T
L
k
dx
dT
dx
dT
k
p
e
x
x
(2.3)
The first two terms in this equation come from the integration by parts of the
conduction term (kd
2
T/dx
2
). The last term on the left hand side comes from the
integration of the convective term (uc
p
dT/dx). The first term on the left hand side
contains the natural boundary conditions. These terms will be non-zero only for nodes
which are on the boundary.
The equations can be written more compactly as:

=
)
`


2
1
"
"
1 1
1 1
2 1 1
1 1
2
1
x
x p
e
q
q
T
T uc
L
k
(2.4)

=
)
`


k
L
q
k
L
q
T
T
e
x
e
x
e
2
1
"
"
1 1
1 1
2
Pe
1 1
1 1
2
1
(2.5)
Step 4. Assemble the system. This step uses a superposition principle, enforcing the
requirement that the nodal value of temperature represented in different element
equations is the same for nodes common to more than one element.
Consider a domain with n = 3 elements only:

e1 e2 e3
1 2 3 4
e1 e2 e3
1 2 3 4

The assembled equations look like:
An Introductory Example 7

|
.
|

\
|
+ |
.
|

\
|

|
.
|

\
|
+ |
.
|

\
|
+ |
.
|

\
|
+ |
.
|

\
|

|
.
|

\
|
+ |
.
|

\
|
+ |
.
|

\
|
+ |
.
|

\
|

|
.
|

\
|
+ |
.
|

\
|

k
L q
k
L q
T
T
T
T
e
e
"
4
"
1
4
3
2
1
e e
e e e e
e e e e
e e
0
0
2
Pe
1
2
Pe
1 0 0
2
Pe
1
2
Pe
1
2
Pe
1
2
Pe
1 0
0
2
Pe
1
2
Pe
1
2
Pe
1
2
Pe
1
0 0
2
Pe
1
2
Pe
1

After combining some terms, the system of equations becomes:

|
.
|

\
|
+ |
.
|

\
|

|
.
|

\
|
+ |
.
|

\
|

|
.
|

\
|
+ |
.
|

\
|

|
.
|

\
|
+ |
.
|

\
|

k
L q
k
L q
T
T
T
T
e
e
e e
e e
e e
e e
"
2
"
1
4
3
2
1
0
0
2
Pe
1
2
Pe
1 0 0
2
Pe
1 2
2
Pe
1 0
0
2
Pe
1 2
2
Pe
1
0 0
2
Pe
1
2
Pe
1

Step 5. Apply Boundary Conditions. In this step we modify the system of equations
to include the effect of the action at the system boundary. In general, there are three well-
known types of boundary conditions, and in heat transfer these type correspond to the
following physical boundary conditions:
Type 1 Condition. Specified surface temperature.
Type 2 Condition. Specified heat flux.
Type 3 Condition. Specified heat transfer coefficient.
Only when Type 2 conditions are specified are the terms in the RHS of the equation
q
1
and q
4
used. In the present example, we have a specified surface temperature at node
1 (x = 0) and also at node 4 (x = 1). Therefore, the first and last equations are not needed,
and the effect of T
1
and T
4
must be replace in equations 2 and 3 with the known
information. The system of equations reduces further to:

|
.
|

\
|

|
.
|

\
|
+
=
)
`

|
.
|

\
|

|
.
|

\
|
+
4
1
3
2
2
Pe
1
2
Pe
1
2
2
Pe
1
2
Pe
1 2
T
T
T
T
e
e
e
e

Step 6. Solve the system. For a steady problem, such as the one presented here,
standard matrix methods for solving systems of the form
| |{ } { } b x K =
An Introductory Example 8
may be used. This includes Gaussian elimination and LU decomposition. For unsteady
problems, the original partial differential equation is transformed into a set of coupled
ordinary differential equations for the temperatures at the nodes:
| |{ } | |{ } { } b x K x C = +
This system could be solved by conventional methods such as Runge-Kutta, but such
solutions are computationally expensive. Two ways of dealing with the transient system
are
1. Diagonalize the [C] matrix. This results in an explicit system of equations.
2. Introduce an Euler-like approximation for { } x . This results in a system
solvable by recurrence relations.
The example problem under consideration was solved for n = 4 elements, and the
results are depicted in Figure 2.1. Note that excellent results are obtained up to Pe = 5.
For higher convective strength (Pe = 10 in Figure 2.2), the number of elements (acutally
the degree of interpolation on these big elements) is too small to capture the physics of
the flow. The ringing of the solution illustrated in Figure 2.2 is typical of convective
flows with large elements.
Three possibilities exist to get better results for convection dominated flows: 1) use
higher order approximations on the existing mesh, or 2) increase the number of elements
(refine the mesh), or 3) use some sort of upwinding approximation in the element. The
second of these choices is consistent with the spirit of the finite element method. Shown
also in the Figure 2.2 are the results for Pe =10 for n = 10 elements. Note that the
approximation now closely follows the exact solution.
Step 7. Perform any supplemental calculations (post-processing). This step must
always be performed to check the validity of the analysis (make sure the desired problem
was the one which was actually solved!). Most workstation-based packages, including
FIDAP, have extensive post processing modules to allow contour, vector, or line plots of
virtually any of the computed results. Alternately, for custom-written analysis codes, if
the output is coerced into a Universal File Format which can be read by a post
processing code, the results can be reviewed.
An Introductory Example 9
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
T
e
m
p
e
r
a
t
u
r
e
x
Pe = -5 Exact
Pe = -5 FEM
Pe = -1 Exact
Pe = -1 FEM
Pe =0.001 Exact
Pe =0.001 FEM
Pe = +1 Exact
Pe = +1 FEM
Pe = +5 Exact
Pe = +5 FEM

Figure 2.1 Comparison of FEM with n=4 elements to exact solution.

An Introductory Example 10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
1.2
1.4
T
e
m
p
e
r
a
t
u
r
e
x
Pe = 10 Exact
Pe = 10 FEM(n=4)
Pe = 10 Exact
Pe = 10 FEM(n=10)

Figure 2.2 FEM solution for n=4 and n=10 elements with high Pe=10

Das könnte Ihnen auch gefallen