An introduction to FEM V.S.S.Srinivas
May 28, 2015
An introduction to FEM
V.S.S.Srinivas
V.S.S.Srinivas
Plan
Day 1• A brief introduction to Finite Difference Method (FDM) using a simple example • Introduction to the concept of Finite Element Method (FEM) using a top-down
approach– Weighted residuals—illustration using an example– Interpolation functions—illustration using an example– Comparison of the numerical solutions obtained using FEM and FDM against the
analytical solution—discussion– Applying boundary conditions—Natural boundary conditions– Concept of element
Day 2• Revisiting FEM using a bottom-up approach—The Standard Procedure
– Element shape functions– Natural coordinates—Geometric coordinates– Coordinate transformation—Jacobian– Numerical integration—Gauss quadrature– Nodal connectivity—assembly of element matrices—global matrix– Applying boundary conditions—Essential boundary conditions
• Questions session
V.S.S.Srinivas
A glance at Finite Difference Method
• Consider a steady one dimensional heat conduction case
• Approximate the governing equations and boundary conditions with algebraic equivalents
• Impose the equivalent conditions at select locations
q fT T
2
20
@ 0
@
f
d Tk QdxdTk q xdx
T T x l
V.S.S.Srinivas
Illustration by example
1 2 3 4
2
20
d Tk Qdx
21 1
2 2
1 1
2@
@ or
i i ii
i i i ii
T T Td Tx
dx xT T T TdT
xdx x x
12
22
3
4
1 1 0 0
1 2 1 0
0 1 2 1
0 0 0 1 f
q x kT
Q x kT
Q x kT
TT
1 2T T q x k @ 0dTk q xdx
21 2 3
22 3 4
2
2
T T T Q x k
T T T Q x k
@ fT T x l 4 fT T
qfT T
V.S.S.Srinivas
Solution of FDM
2
1 2
2
3 2
4
3
2
3 3
2
3 9
f
f
f
f
lq l QT
k kTlq l Q
T Tk k
Tlq l Q
TTk k
T
V.S.S.Srinivas
Summary
• Derivatives are approximated using Taylor series • The resultant difference (algebraic) equations
are imposed at nodes• The set of linear algebraic equations are solvedA solution is obtained for the
approximated system of equationsAt the outset, Finite Element Method
differs from FDM in the above aspect
V.S.S.Srinivas
Finite Element Method
• We approximate the solution• Interpolation functions• Let l=1
1N x
3N x 4N x
1 1 2 2 3 3 4 4T N x T N x T N x T N x T
2N x
V.S.S.Srinivas
Finite Element Method-Galerkin Weighted Residuals
• Analytical solution is the exact solution for a system of differential equations
• We seek approximate solution when there is no exact one
• How do we go about it• Can we satisfy the equations in an average
sense?
• How can we improve upon the solution we are seeking
V.S.S.Srinivas
FEM-Galerkin Weighted Residuals
2
20
@ 0
@ f
d Tk QdxdTk q xdx
T T x l
2
20
0 0
0
0, 1,2 & 3
l
i
l li
i i
d Tk Q N dxdx
dNdT dTk N k QN dx idx dx dx
1
2
3 4
3 3 0 6
3 6 3 3
0 3 6 3 3
k l k l T q lQ
k l k l k l T lQ
k l k l T lQ kT l
2
2
2
2
6 4 9 9
6 5 18 18
f
f
f
lq k l Q k T
lq l Q kT k
lq l Q kT k
V.S.S.Srinivas
Analytical solution and comparison
• Analytical solution
• Comparison of all the three solutions
2 2
2 2f
Qx qx ql QlT T
k k k k
V.S.S.Srinivas
Other Weighted Residual Methods
• Least squares method
• Point collocation method
• Subdomain collocation method
V.S.S.Srinivas
Concept of assembly
• The total integral can be considered as the sum of integrals over a set of sub-domains
• In finite element terminology, they are called elements
1 2 3
1 2
3 4
V.S.S.Srinivas
Concept of Assembly
/3 2 /3
0 /3 2 /3
l l li i i
i i i
l l
dN dN dNdT dT dTk QN dx k QN dx k QN dxdx dx dx dx dx dx
0
li
i
dNdTk QN dxdx dx
11 12
21 22 11 12
21 22 11 12
21 22
0 0
0
0
0 0
a a
a a b b
b b c c
c c
00
/3 2 /3
0 /3 2 /3
ll
i i
l l l
i i il l
d dT dTk N dx k N
dx dx dx
dT dT dTk N k N k Ndx dx dx
Assembled matrix
V.S.S.Srinivas
Contd..
• Boundary term can also be decomposed into sum of integrals over each subdomain
• If you notice, except at the end points, the integral cancels at every other point or node in the domain.
• Essentially, this is to say that the whole integral can be seen as the sum of integral over each subdomain
• Till now, we dissected the whole integral and saw the details. We depart at this point and resume FEM by assembling the integrals of every subdomain (element)
• In this process, we will visit the standard procedure of finite element method
V.S.S.Srinivas
Revisiting interpolation functionsElement point of view
• Non-zero functions in element 1: N1, N2• Non-zero functions in element 2: N2, N3• Non-zero functions in element 3: N3, N4• For every element, the components of interpolation functions are
presenting a common picture• It is easy to obtain the matrix for every element and then assemble
them to obtain the global matrix
V.S.S.Srinivas
Interpolation functions from an element point of view
V.S.S.Srinivas
FEM-Standard Procedure
• Reconsider the example discussed before, resuming from the last point of departure
• The integrand in the equation cannot be always analytically integrated
• For example, if • Or k can also be a function of Temperature.• What is the way out?
3
0xk k e
2
1
1 1 2 2
, 1, 2
e
e
x
ii
x
e e
dNdTk QN dx i e edx dx
T N T N T
V.S.S.Srinivas
Element shape functions
• Most of the times, the integrand is not numerically integrable
• We resort to numerical integration then
2
1
, 1, 2e
e
x
ii
x
dNdTk QN dx i e edx dx
1 1 2 2e eT N T N T
1 1e eN x l
2e eN x l
V.S.S.Srinivas
FEM Standard Procedure- Coordinate Transformation
• Numerical integration, popularly known as gauss quadrature
• This rule is for a generic element
• Limits of the integration are from -1 to 1 instead of xe1 and xe2
• Necessitates a coordinate transformation• Old coordinates‒Geometric coordinates • New non-dimensional coordinates‒Natural coordinates• The coordinate transformation brings in a scaling factor
named Jacobian
V.S.S.Srinivas
Pictorial representation-coordinate transformation
• Notion of isoparametric formulation
1ex 2ex 1 1
11
2 1 2 1
21 2 ,e
e e e e
x x d d
x x dx dx x x
1 2
1 1
2 2e ex x x
1 2
1 1
2 2e eT T T
1 2
1 1,
2 2N N
Jacobian
V.S.S.Srinivas
Assembly of element matricesnodal connectivity-1D
1 2 3 41 2 3
1 2
Local node no.
Global node no.Element Local to global
1 1 - 1, 2 - 2
2 1 - 2, 2 – 3
3 1 - 3, 2 – 4
V.S.S.Srinivas
Nodal Connectivity-2D
1 2 3
4
1
5 6
7 8 9
2
3 4
1 2
34
Global node no.
Local node no.
Element Local to global
1 1 – 1,2– 2, 3 – 5, 4 – 4
2 2 – 2, 2 – 3,3 – 6,4 – 5,
3 1 – 4, 2 – 5,3 – 8, 4 – 7
3 1 – 5, 2 – 6, 3 – 9, 4 – 8
(i,j) entry in every element conductivity matrix goes to (I,J) entry in global conductivity matrix
(i,j)—local node nos, (I,J)—Global node nos.
V.S.S.Srinivas
Applying Boundary Conditions
• Natural or neuman boundary conditions are applied in the integral form
• Number of ways to impose essential (dirichlet) conditions
• Revisiting the example,T4 is known, T1, T2, T3 have to be solved
• Considering the assembled system of equations
11 1 12 2 13 3 14 4 1
21 1 22 2 23 3 24 4 2
31 1 32 2 33 3 34 4 3
41 1 42 2 43 3 44 4 4
a T a T a T a T b
a T a T a T a T b
a T a T a T a T b
a T a T a T a T b
11 12 13 14 1 1
21 22 23 24 2 2
31 32 33 34 3 3
41 42 43 44 4 4
a a a a T b
a a a a T b
a a a a T b
a a a a T b
V.S.S.Srinivas
Contd..
• We can take any set of three equations• Consider the first three equations
• Subtract the term associated with T4 from both sides
• Solve for the unknowns
11 1 12 2 13 3 14 4 1
21 1 22 2 23 3 24 4 2
31 1 32 2 33 3 34 4 3
a T a T a T a T b
a T a T a T a T b
a T a T a T a T b
V.S.S.Srinivas
Contd..
11 12 13 14 1 1
21 22 23 24 2 2
31 32 33 34 3 3
41 42 43 44 4 4
a a a a T b
a a a a T b
a a a a T b
a a a a T b
• Subtract the fourth column multiplied by T4 from the right hand side
• Remove the fourth row and column• Remove the fourth entry from the right hand side
• Solve for T1, T2, T3 using the resulting set of linear equations
• Other popular methods are lagrange multiplier, penalty etc.
11 12 13 1 1 14 4
21 22 23 2 2 24 4
31 32 33 3 3 34 4
a a a T b a T
a a a T b a T
a a a T b a T
V.S.S.Srinivas
Summary
• Considered a steady state heat conduction problem as the example problem to illustrate the concepts of FDM and FEM
• To lay a platform for the comparison of FDM and FEM, the problem is solved using FDM
• Next, obtained solution using FEM. In the process, explained the important concepts – Weighted residuals– Integral form– Interpolation functions– Imposition of natural boundary conditions– Notion of element
• Compared the FDM and FEM solutions against the analytical solution
• Finite element method is explained by using a dissection approach• Next, the standard approach of assembly starting from the element stiffness matrices
is explained– Natural or intrinsic coordinates, spatial coordinates are explained– Local-global nodal connectivity, gauss quadrature, applying essential boundary conditions
are explained– The concepts of Jacobian and Gauss Quadrature are introduced
V.S.S.Srinivas
References
• An Introduction to Finite Element Method, J.N.Reddy, McGraw-Hill Science Engineering
• Introduction to Finite Elements in Engineering (3rd Edition) by Tirupathi R. Chandrupatla and Ashok D. Belegundu,
• Differential equations with exact solutions: http://eqworld.ipmnet.ru
V.S.S.Srinivas
Interpolation functions