Sie sind auf Seite 1von 85

Finite Element Method

(FEM)
L. Guneshwor
SO/F, SSS, HPD
44th Batch (Physics)

Course details
No. of lectures : 10 + 1(tutorial)
Several books in BARC library on FEM
Following are the suggested books for
this course:
Basic Finite Element Method by Pepper &
Heinrich
Finite Element Method by L. Segerlind
Finite Element Method by Huebner

Why FEM & How it is different from FDM


Issues with Finite Difference method
Approximates the operator e.g. differentiation operator
Find the solution only at the nodes
Can use only parallel grids/mesh of nodes
Difficult to represent complex geometries
Difficult to handle variable material properties

Finite Element Method

1/2

Approximates the state variable itself, not operators


Solves over an element i.e. solutions are obtained over
every point in the element
It can represent any complex geometries much more
accurately or closely
Many kinds of elements can be designed; not constrained
by parallel grids
Can adaptively refine the mesh / grid efficiently
Two ways to improve accuracy:
by improving the approximating function
changing the element sizes/shapes

Finite Element Method

2/2

FEM is one of the most widely


studied / researched method
It is a well established method, being
applied at industrial scale /large scale
engineering projects
Most new softwares /codes are
implemented in FEM;
even old / legacy codes are being updated
with FEM

Method of weighted residuals


Initially, an approximate function( called trial
function) is assumed as the solution
The trial functions has parameters which has to be
determined so that it satisfies the differential eqn. as closely
as possible

Since it is not an exact solution, substitution of


the trial function into the differential equation
will produce an error (called residual)
The unknown parameters in the trial function are
determined such that the residual(i.e. error) is
made as small as possible (minimized)

Weighted residual method


The residual is usually multiplied by a weighting function, and
the integral (summation) of the product is required to be zero
The number of weighting functions equals the number of
unknown parameters in the trial function
As an example, let us take the 1D differential equation(DE)
below:
Suppose is an approximate solution(trial function) to the
above equation. Substitution into the above DE gives,

( since is only an approx.)

The weighted residual method requires that,

There are several choices of the weighting functions ; each


leading to a distinct/unique technique

Weighted residual method

Commonly used weighted residual methods


1. Point collocation method
2. Method of least squares
3. Galerkins residual approach

1. Point Collocation method


impulse (dirac delta) functions, are chosen as the
weighting function
this choice is equivalent to requiring the residual to vanish
at specific points called collocation points i.e.

1. Point collocation method

(1/2)

Example: Solve the following equation by using and as the collocation


points

boundary conditions(BC):
Ans:
Let us choose the following function as the trial function. It satisfies the BCs

at both ends.
Differentiating,

Substituting these into the given DE, the residual is obtained as,

1. Point collocation method

(2/2)

This residuals is made zero at the collocation points x =

0.25 & 0.50 as below:

Solving the above equations

Hence, the solution is given by

2. Method of Least Squares

(1/3)

the sum (integral)of squares of the residuals are minimised


after substitution of the trial function in the DE
- i.e. the residual itself is used as the
weighting function
- the squared sum is minimised w.r.t. the unknown

parameters (coefficients) of the trial function i.e.

Using differentiation inside integral rule,

2. Method of Least Squares


(2/3)
Example : solve the previous equation using method of
least squares?
Ans: Let us use the same trial function

The residual is given (see earlier derivation) by:

Minimising
the squared sum of residuals w.r.t. the unknown
parameters , we get the following simultaneous linear equation

2. Method of Least Squares


(2/3)
( as
On integrationleft
homework

Hence the solution is,

),

3. Galerkins Method

(1/3)

Here the approximating or trial functions are


used as the weighting functions

Galerkins method requires that the


approximating function be of the form

The residual is forced to zero by weighting


with the trial functions s i.e.

Galerkins method

(2/3)

Example: Solve the previous equation using Galerkins


method?
Ans:

Or,

Let us use the same approximating function,

in Galerkins form

The

residual is (derived earlier),

Galerkins method

(3/3)

Hence by Galerkins method,

On substituting the expression for and integrating ,we get

(Homework: verify this step

On solving,
(Homework)
Hence the solution is

Comparison of the 3 methods


The solutions are
Method

Solution,

Point
Point Collocation
Collocation
Least
Least Squares
Squares
Galerkins
Galerkins method
method

Comparison of solutions at some points (exact solution


is: )
X

Exact,

Point
collocation

Least Squares
method

Galerkins
method

%
error

%
error

%
error

0.2
5

1.54
0.0351 0.0345

-0.03576

2.02

0.21
0.0349

0.5

-0.05789

2.27

1.84

0.39

Finite element method

Steps in FEM
1. Create a grid/mesh of the domain
- locating & numbering of nodes, specifying the coordinates
of the nodes, identifying the elements

2. Specify the approximation equation


-shape function determination for each element
3. Develop the discretized equation for
each element
-using Galerkins method, form the element equations
4. Assemble the element equations to
form the global system of equations
5. Solve the system of equations

FEM in 1D
The finite element formulation is illustrated with the following
equation:

Discretization of the domain:

x=
0 1

Node
s

2
2

4
4

An element

5
5

x=
L6

Approximation of the solution

Approximation function: Polynomials normally used as they


are easy to manipulate

Let us take a linear one dimensional element as in the figure above.


Let us interpolate or approximate the function with a line i.e.
(1)

Function approximation or shape function


construction
Referring to the figure, we can see
that

On solving for the unknowns ,

Putting these results into the interpolation function (eqn. 1),

Or,

It can be seen that are the Lagrange polynomials.


In matrix form,
..(2)

shape function construction


are known as shape functions/basis functions/trial functions
/interpolation functions
Advantages of the Lagrange format

Discretized equation for an element:


Let us concentrate on a single element as shown in the previous slide.
For this element the solution is approximated as:

Elemental discretized equation


The residual can be obtained as

Galerkins method:
in this method the shape functions are used as the
weighting
function.
Hence
in our case,

Putting the expression for the residual we get,

Elemental discretized equation


Applying integration by part , the LHS term can be
simplified as

.(4)
This expansion is known as the weak form, since the order of
the differential equation has been weakened /reduced

Let us now explicitly evaluate the terms of


equation (3)

Galerkins Method

Putting the expression for the residual in eqn. (3a) , we get,

Integrating by
parts,

(5a)

Galerkins Method

contd.

Similarly , we get from eqn. (3b) :

Integrating by
parts,

(5b)

Discretization

Using equations 5a & 5b , the original equation (3) can be written as


below
For

Similarly, for

Elemental discretised equation


Thus for the element ,the discretized system of
equations is:

.. (6)
A few observations:
Neumann(derivative) boundary condition has been directly
incorporated into the element equations because of
integration by parts
Lowering
of the 2nd derivative to 1st derivative means that the
approximation function needs to preserve continuity of value
but
not
slope at the nodes
On
the
RHS:

First term represent boundary condition of the element


Second term represents the systems forcing function
/load function

LHS represents the internal mechanisms that governs the


distribution of over the element

Elemental discretized equation

Let us now evaluate the LHS integrals explicitly:

also,

Using the preceding results,

Hence,

Similarly,

Elemental discretized equation

Thus equations (6) can be written as,

.(8)
In matrix form, it can be written as,

(9)

More than 1 element (Assembling of element equations)


Let us consider the two element grid as shown
below,
Element
1
s:
x
x2
Node
s:
1

he shape functions are given by:


Point 1:

Point 2:

Point 3 :

2
x3

Assembling of element equations


Let us apply Galerkins finite element
formulation,

Writing explicitly,

Let us evaluate the integrals corresponding to the boundary points 1 & 3. Take
the 1st integral,

Assembling the element equations


Or,

This is the same integral we have evaluated earlier for a single


case.
element
As we saw
there, integrating by parts and re-arranging the terms
gives the following result (refer to equation 8),

For point 3: a similar process gives

As for point 1 above, referring to equation (8) again, we


get,

Assembling the element equations


For point 2: the Galerkin formulation
gives,

Here, both the integrals has to be evaluated as is defined in both the


intervals.
But these
integrals has been evaluated earlier.
Now using integration by parts to each integrals and re-arranging
(homework & refer to equation 8), we get,

Thus we get 3 equations corresponding to the shape function (weighting

function) of the 3 points. This forms the system equation. Assuming ,we can
write

Assembling the element equations

The system of equations can be written as,

In matrix form, we can write as,

or,

Assembling of element equations


An alternative way to remember the assembling process is as
below.the two element grid as
discussed
Let us consider
shown below:
Element
s:
Node
s:

1
x

2
x2

x3

The element equations are of the form (assuming unit grid


size i.e. 1),

Element 1:

Element 2:

Since there are a total of three nodes, the global equation will have
three unknowns viz., .
The above element equations can be transformed as below to include all
the 3 unknowns:

Element 1: ;

Element 2:

Assembling the element equations


Now the two equations can be combined (added) into a single global
matrix as below:

Or,

This is equivalent to adding the individual element stiffness & load


vectors at the joining point.
Conclusion: To assemble the global system of equation
Form the stiffness and load vectors for each individual
elements
Add/combine
the element stiffness & load vectors
at their joining nodes

Example problem
Solve the DE,

using the grid given below:


Element
s:
Node
s:

1
x1=0

2
x3
=5.0

x2
=2.5

4
x4
=7.5

Ans:
Please refer to equation (9). Let us evaluate the RHS integrals
explicitly using
For element 1:

x5
=10

Example problem
thus the elemental equation for element 1 is given by,

Repeat the process for other elements,


For element 2:

the element equation is,

Example problem
For element 3:

the element equation is,

For element 4:

the element equation is,

Example problem -Assembling element equation


Using the technique described previously, the 4 element equations of
the example problem can be assembled as below:

; (on applying the BCs)

Example problem Solving the discretised system


Rearranging the terms
(homework: verify
it)can re-write the equation as,
, we

Homework: Solve the above equation and compare it


to the exact solution

Comparision of FEM & Exact solution

Improving the accuracy

Increase the number of sub-divisions

Matrix formulation of element equation


The function approximation is,

where,

The Galerkin formulation is,

But,(plz. see previous notes) :

Hence, in matrix form, Galerkins formulation is

Matrix formulation of element equation


Putting this in the previous Galerkins formulation,
we get

Applying integration by parts,

.(10)

Let us evaluate the terms explicitly for a linear element (refer


the fig.) Recall that,

Now,

x2

Matrix formulation of element equation


LHS is:

1st term of RHS:

2nd term of RHS:

Matrix formulation of FEM


Putting these results in equation (10), we get,

which is the same equation (9) derived earlier.

Advantage of matrix formulation:


it allows generalization of the finite element formulation
to any type of shape function

Quadratic elements
Refer to the figure below which shows the difference between
approximating a function with linear and quadratic functions
Clearly the use of quadratic functions can drastically improve
the accuracy as they adds curvature

Exac
t
Linear

Quadrat
ic

Quadratic elements

A general quadratic or parabolic functions is of the form:

..(11)

Let us use a quadratic polynomial as the


interpolation
function
forelement
an element
shown in figure.
Such an
has as
3 nodes.

Since the interpolation function has to pass


through the 3 points, we get(similar to linear
case),

L/
2

Quadratic element
The above equation can be solved for the unknown
coeffs.

(left as homework

Substituting these solutions back into equation (11) and rearranging /collecting the terms for , we get the shape functions,

where
(verification left as homework),

Now,

Quadratic element
Now the stiffness matrix for a quadratic element is then given by
(refer to eqn. 10)

Quadratic element
On integration, the stiffness matrix is given by,

The boundary flux term is given by,

Quadratic Element

The load vector is given by (refer eqn. 10)

Important Observations:

Obviously, even higher-order elements e.g. cubic (degree=3), quartic


(degree=4), quantic (degree=5) etc. can be constructed by adding more
interpolation nodes in an element
Even though the derivatives of quadratic elements are functions of x
(independent variable), they will not be continuous at the inter-element
nodes
The interpolation type used here is called Lagrangian& it only
guarantees continuity of function across inter-element boundaries
(C0 elements)
Elements that also interpolate derivatives at the nodes can also be
constructed (Hermite polynomials) e.g. cubic Hermites interpolates the
function and its first derivative at the 2 nodes located at the ends of the
element (C1 elements)
C1 elements: function and its 1st derivative is continuous
everywhere in the domian

Important observations

More sophisticated elements can be constructed;

there is virtually no limitation to the degree of complexity or predetermined element behaviour that can be attained
=> enormous flexibility/possibility in FEM

However, the more sophisticated the element, the more computationally


expensive it will be
The element interpolation functions considered so far possess Kronecker
delta function property i.e.

The type of interpolation chosen defines the shape that the dependent
variable (variable being solved) can take within an element i.e. linear,
quadratic etc.
Hence the name shape function is used to denote
s
Higher order functions always reduce exactly to the lower-order ones. For
example,
quadratic elements exactly represent linear & constant
functions,
cubic elements represents quadratic, linear & constant
functions etc.

2D elements (triangles)
Consider the linear triangular element as shown in the figure

Linear triangular element (2D)

The interpolation polynomial (2D) is given by


.
(12)
Since the polynomial has to pass through the 3 points viz. , we have the
following interpolation conditions,

In matrix form,

On solving,
(Homework)

Linear triangular element (2D)


Here,

; A is the area of the triangle

Substitute the solutions for into equation (12) and re-arrange /collect the terms
we will get an expression of in terms of three shape functions & (Homework)
nodal values:

where,

And,

Linear triangular element - Example


Example: Calculate the value of the pressure at point A (shown in figure) if the
nodal
pressure values (in N/m2) are given as in the Figure. Coordinates of A are (2, 1.5)

(homework)

Homework: verify that the shape functions derived for the linear triangular
element satisfies the Kronecker delta property.

Higher order elements

uadratic triangular element


It has six nodes (figure). The interpolating polynomial is of the
form,

Quadratic triangular
element

As can be seen, determination of the shape functions for this case


becomes very tedious. In fact, for higher 2D polynomials, it
becomes almost prohibitive.
Using area coordinates makes the shape function derivation
easier (or makes it possible)

Time-dependent problems (review of


FDM)

Consider the following equation


with given boundary and initial conditions
As you might be aware, in finite difference method, the
discretization in time is done using the -method which in this case
will be ,

The parameter is usually specified in the range . It is used to


control the convergence/accuracy and stability of the algorithm.
When , the algorithm is unconditionally stable
When the algorithm is only conditionally stable e.g. in explicit
method () it is stable if
Commonly used values are:
backward implicit method
Centered implicit method (Crank-Nicolson method)
explicit Euler forward scheme

Time-dependent problem -FEM

-method is generally applied in FEM formulation of time The


dependent
problems. Let us discuss the problem discussed
in previous slide

Let us approximate using the shape functions as below:

The important point to note is that the shape function is not


affected by time; only the dependent variable is a function of
time. Hence,

Applying Galerkins formulation we get,


(

Time-dependent problem -FEM

M is called the mass matrix. The presence of the


The
massmatrix
matrix is a major difference between FEM and FDM.
Let us denote the stiffness matrix by K. Then the above
eqn. can be written as,

If the boundary flux remains constant with time(which is


generally the case) then, the third term is just a constant.
Let us denote it by F. In the -method the time-derivative by
a simple forward difference as,

Introducing the relaxation parameter , the dependent


variable can be expressed as,

Using the above results, we get,

Time-dependent problem -FEM

the terms (HW: verify) we get,


Re-arranging

The above formulation is known as semi-discrete Galerkin


formulation since only the spatial variable has been
discretized, but not the time derivative term
The stability and convergence of the method is controlled
by the value of the relaxation parameter . As mentioned
earlier, for unconditional stability

Concluding remarks on FEM

FEM is a very versatile and robust technique for solving PDEs


Extensive research and field applications has proven its
robustness. It is a well established technique.
It offers virtually unlimited flexibilities in term of function
approximation, domain discretization & element construction,
choice of weight functions etc.
Nowadays most modeling softwares are written in FEM. Even
the old FDM codes are re-written or FEM version is produced.
Major areas where FEM has been successfully applied are
Computational Fluid Dynamics (CFD) which involves aerodynamics of
everything from missile, submarine , aircraft design to channel flow
analysis
structural analysis
Heat transfer
Plus many engineering and scientific endeavors

Concluding remarks on FEM

But FEM is not without its disadvantages :


The biggest drawback of FEM is the requirement of mesh
creation which has been found to be computationally very
expensive. In many cases the mesh creation itself became the
major component than the problem itself
Usually meshing process is done by computer without human
intervention; this compromise the mesh quality
Wherever re-meshing or re-zoning is required FEM is very
expensive computationally
Some areas where FEM application is not suitable are:
Simulation of Crack growth & propagation
Modeling breakage of material with large number of fragments
Large deformation modeling

The root of the above issues with FEM is the use of mesh. Meshfree
or meshless methods are being proposed to do away with the
requirement of meshes but they are in research stage currently

Concluding remarks on FEM


In this class we have avoided the use of advective /convective
term (first derivative of the dependent variable) as it leads to
upwinding issues
Singular sources needs some treatment though not as serious
a problem as in FDM
Some popular FEM softwares are
ANSYS : mainly for engineers
COMSOL Multiphysics: easy coupling of different phenomenon, fully
implemented in GUI (3D capability)
MATLAB has also a PDETOOL written in FEM and a suite of library
functions to implement FEM for any problem type (only 2D)

Reference books: thousands of titles have been published. For


beginners following are suggested
Introduction to FEM by D. Pepper and J. Heinrich
FEM by L. Segerlind
FEM by Hutton /by Huebner

GOOD LUCK FOR YOUR


EXAM

Domain representation
Solve

the equation in the given domain:

Approximation of equation
-discretization

At point (i,j)

Discretization of equation

Hence , the discretized Poissons


equation at point is,

This discretization is performed at all the internal


points (i,j). At the boundary proper boundary
conditions are applied.

The resulting set of simultaneous linear


equations is solved to get the solution, :

Integration by parts
Rule for integrating product of two
functions

Approximation of the solution

Approximation function: Polynomials normally used as they


are easy to manipulate

Let us take a linear one dimensional element as in the figure above.


Let us interpolate or approximate the function with a line i.e.
(1)

Elemental discretized equation


The residual can be obtained as

Galerkins method:
in this method the shape functions are used as the
weighting
function.
Hence
in our case,

Putting the expression for the residual we get,

Elemental discretised equation


Thus for the element ,the discretized system of
equations is:

.. (6)
A few observations:
Neumann(derivative) boundary condition has been directly
incorporated into the element equations because of
integration by parts
Lowering
of the 2nd derivative to 1st derivative means that the
approximation function needs to preserve continuity of value
but
not
slope at the nodes
On
the
RHS:

First term represent boundary condition of the element


Second term represents the systems forcing function
/load function

LHS represents the internal mechanisms that governs the


distribution of over the element

Contd.

Similarly , for

Using these results,


we get,

..(5a)

And,

(5b)

Das könnte Ihnen auch gefallen