You are on page 1of 25

In last lecture…

•  The implementation of finite element method can


be summarized as a step-by-step procedure

•  Dividing into simple shape elements

•  Approximate solution of PDE on


each element (Galerkin + local basis
function)
•  Sum up the weak form equation of
each element
•  Applying the boundary conditions

•  Solving the linear algebraic system

•  Displaying results graphically


In last lecture…

•  Taking the one dimensional question as example.

Note: the size and


shape of elements can
be different.
In last lecture…

•  Taking the one dimensional question as example.

Generic element:
Approx. sol.
" x − x2( E ) %
T ( x ) = T $ (E)
1
E
(E) '
# x1 − x2 &
" x − x1( E ) %
E
+ T $ (E)
2 (E) '
# x2 − x1 &
Weak form
x2
∫ x1
RWm (x)dx = 0 m = 1, 2

Some tricky math derivation here.

Elem. Eq. ( dT (x1 ) + ( x2


− f (x)φ1 (x)dx +
1 " 1 −1 % (T1 + .. dx .. . ∫x1 .
$ ') , = ) , + ) x2 ,
x2 − x1 # −1 1 & *T2 - . dT (x2 ) . . f (x)φ (x)dx .
.- * ∫x1
2
.* dx -
In last lecture…

•  Taking the one dimensional question as example.


0.0 10.0

⎡ 0.4 −0.4 0 0 0 ⎤⎧T1 ⎫


⎢ ⎥⎪ ⎪
⎢ −0.4 0.4 + 0.4 −0.4 0 0 ⎥⎪⎪T2 ⎪⎪
⎢ 0 −0.4 0.4 0 0 ⎥⎨T3 ⎬
⎢ 0 0 0 0 0 ⎥⎪ 0 ⎪
⎢ ⎥⎪ ⎪
⎢⎣ 0 0 0 0 0 ⎥⎦⎪⎩0 ⎪⎭
⎧−dT(x1 ) / dx +12.5 ⎫
⎪ ⎪
⎪⎪ dT(x 2 ) / dx +12.5− dT(x 2 ) / dx +12.5 ⎪⎪
= ⎨dT(x3 ) / dx +12.5 ⎬
⎪0 ⎪
⎪ ⎪
⎪⎩0 ⎪⎭
In last lecture…

•  Taking the one dimensional question as example.

0.0 10.0

⎡ ⎧T ⎫
0.4 −0.4 0 0 0 ⎤⎪ 1 ⎪
⎢ ⎥
⎢ −0.4 0.8 −0.4 0 0 ⎥⎪⎪T2 ⎪⎪
⎢ 0 −0.4 0.8 −0.4 0 ⎥⎨T3 ⎬
⎢ 0 0 −0.4 0.8 −0.4 ⎥⎪T4 ⎪
⎢ ⎥⎪ ⎪
⎣ 0 0 0 −0.4 0.4 ⎦⎪⎩T5 ⎪⎭
⎧−dT(x1 ) / dx +12.5⎫
⎪ ⎪
⎪⎪ 25 ⎪⎪
= ⎨25 ⎬
⎪12.5+12.5 ⎪
⎪ ⎪
⎩⎪dT(x5 ) / dx +12.5 ⎭⎪
In last lecture…

•  Taking the one dimensional question as example.

0.0 10.0

⎡ ⎧T ⎫
0.4 −0.4 0 0 0 ⎤⎪ 1 ⎪
⎢ ⎥
⎢ −0.4 0.8 −0.4 0 0 ⎥⎪⎪T2 ⎪⎪
⎢ 0 −0.4 0.8 −0.4 0 ⎥⎨T3 ⎬
⎢ 0 0 −0.4 0.8 −0.4 ⎥⎪T4 ⎪
⎢ ⎥⎪ ⎪
⎣ 0 0 0 −0.4 0.4 ⎦⎩⎪T5 ⎪⎭
⎧−53.5 ⎫
⎪ ⎪ T1 = 40
⎪⎪ 25 ⎪⎪
= ⎨25 ⎬ T2 = 173.75
⎪12.5+12.5⎪ T3 = 245
⎪ ⎪
⎪⎩−21.5 ⎪⎭ T4 = 253.75
T5 = 200
In last lecture…

•  Taking the one dimensional question as example.

0.0 10.0
Department  of  Mechanical  Engineering                                                                                                                                        Monash  University  

MEC3456-MAE3456

Lecture  30  PDE  


Finite  Element  Method:  mul?-­‐
dimensional  problems  
 

Outline  
Outline
Finite  Element  
Method  for  2D   •  Finite element method for 2-dimensional PDE
PDE  
–  Advantage of FEM for 2D question.
Example  

Element  
–  An example.
Equa?ons  

Assembly  

Boundary  
Condi?ons  

Solu?on  

Summary  
 

Outline  
FEM for 2D Partial Differential Equation
Finite  Element  
Method  for  2D   •  Finite difference method is restricted in the case of
PDE  
irregular geometry and interfaces between different
Example   materials
Element   •  Finite element method provides an alternative
Equa?ons  

Assembly  

Boundary  
Condi?ons  

Solu?on  

Summary  

irregular geometry Finite-Different Finite-Element


discretization discretization
 

Outline  
FEM for 2D Partial Differential Equation
Finite  Element  
Method  for  2D   •  The implementation of finite element method
PDE  
follows a standard step-by-step procedure
Example  

Element   •  Dividing into simple shape elements


Equa?ons  

Assembly   •  Approximate solution of PDE on each


element (Galerkin + local basis function)
Boundary  
Condi?ons  
•  Ensure continuity at inter-boundary
Solu?on  

Summary  
•  Applying Dirichlet and Newmann types

•  Solving the linear algebraic system

•  Displaying results graphically


 

Outline  
Example
Finite  Element  
Method  for  2D   •  A two dimensional diffusion/heat partial
PDE  
differential equation. The solution domain is as
Example   shown, i.e., a triangle.
Element  
Equa?ons  

Assembly   ∂ 2u ∂ 2u
2 + 2 = − f (x, y)
Boundary  
∂x ∂y
Condi?ons  

Solu?on  
Step 1 --- discretization
Summary   €
Triangle element is a popular choice in two-dimensional finite
element method
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 2 --- element equation
PDE  
–  Approximate solution using two
Example   dimension Lagrange basis function

Element  
Equa?ons  

Assembly  
∂ 2u ∂ 2u
2 + 2 = − f (x, y)
∂x ∂y
Boundary  
Condi?ons  

Solu?on   u (x, y) = N1u1 + N 2 u2 + N 3 u3


N1 = € [(x 2 y 3 − x 3 y 2 ) + (y 2 − y 3 )x + (x 3 − x 2 )y ]
Summary   1
2A
1
N2 = [(x y − x y ) + (y 3 − y1)x + (x1 − x 3 )y ]
2A 3 1 1 3
€ 1
N3 = [(x y − x 2 y1) + (y1 − y 2 )x + (x 2 − x1)y ]
2A 1 2
where A is the area of the element


 

Outline  
Example
Finite  Element  
Method  for  2D   ∂ 2u ∂ 2u
PDE   2 + 2 = − f (x, y)
u (x, y) = N1u1 + N 2 u2 + N 3 u3
∂x ∂y
Example  

Element  
Equa?ons   •  Step 2 --- element equation
€ €
–  The residual
Assembly  
–  Galerkin Weak form of PDE
Boundary  
Condi?ons  

Solu?on   ∂ 2u ∂ 2u
R= 2
+ 2
+ f (x, y)
Summary   ∂x ∂y

⎡∂ 2 u ∂ 2 u ⎤
∫ D ∫ D Ni ⎢⎣∂ x 2 + ∂ y 2 ⎥⎦ dD = − ∫ ∫ N i f (x, y)dD i = 1, 2, 3
 

Outline  
Example
Finite  Element  
Method  for  2D   ⎡∂ 2 u ∂ 2 u ⎤
PDE   ∫ D ∫ D Ni ⎢⎣∂ x 2 + ∂ y 2 ⎥⎦ dD = − ∫ ∫ N i f (x, y)dD i = 1, 2, 3
Example  

Element  
Equa?ons   •  Step 2 --- element equation
Assembly   –  Mathematical simplification
Boundary  
Condi?ons   #∂ 2u ∂ 2u & ∂ * ∂u , ∂ * ∂u ,
∫Dx ∫Dy N i % ∂x 2 + ∂y 2 (dD = ∫ ∫ N + .N / dD
∂x + i ∂x - ∂y + i ∂ y -
Solu?on   $ '
∂N i ∂u ∂N i ∂u
Summary   −∫ ∫ + dD
∂x ∂x ∂y ∂ y

As we know:
∂v ∂ w
€ ∫∫ ( + )dxdy = ∫ (n x v + n y w)dl
∂x ∂ y
Divergence theorem
or Gauss theorem
 

Outline  
Example
Finite  Element  
Method  for  2D   #∂ 2 u ∂ 2 u &
PDE  
∫D ∫D N i % ∂x 2 + ∂y 2 (dD = − ∫ ∫ N i f (x, y) i = 1,2,3
$ '
Example  

Element  
Equa?ons   •  Step 2 --- element equation

Assembly   –  Mathematical simplification
Boundary   #∂ 2u ∂ 2u & ∂ * ∂u , ∂ * ∂u ,
Condi?ons   ∫Dx ∫Dy N i % ∂x 2 + ∂y 2 (dD = ∫ ∫ N + .N / dD
∂x + i ∂x - ∂y + i ∂ y -
$ '
Solu?on  
∂N i ∂u ∂N i ∂u
−∫ ∫ + dD
Summary   ∂x ∂x ∂y ∂ y

#∂ 2u ∂ 2u & ∂u ∂u ∂N i ∂u ∂N i ∂u
N
∫Dx ∫Dy i ∂x 2 ∂y 2
% + ( dD = ∫ i x ∂x y ∂y ∫∫ ∂x ∂x + ∂y ∂y dD
N (n + n )dl −
€ $ '
∂N ∂u ∂N i ∂u
= ∫ N iQn dl − ∫∫ i + dD
∂x ∂x ∂ y ∂y
 

Outline  
Example
Finite  Element  
Method  for  2D   ∂N i ∂u ∂N i ∂u
PDE  
∫∫ ∂x ∂x + ∂y ∂y dD = !∫ N iQn dl + ∫ ∫ N i f (x, y) dx dy i = 1,2,3
Example  
•  Step 2 --- element equation
Element  
Equa?ons   –  Substituting Ni and u into the above weak form
gives:
Assembly   E
! k k12 k13 $ 'u1E + ' f1E +
# 11 & )) )) )) ))
Boundary   # k21 k22 k23 & (u2E , = ( f 2E ,
Condi?ons   # & ) E) ) E)
#" k31 k32 k33 & )*u3 )- )* f3 )-
%
Solu?on   where
Summary   1
kij = ( βi β j + γ iγ j )
4A
βi = y j − yk i ≠ j ≠ k = 1,2,3
γ i = xk − x j i, j,k permute in natural order

fi = ∫∫ N i
f (x, y) dx dy + !
∫ N iQn dl
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 3 --- assembly
PDE  
–  The spatial layout of element mesh is shown in
Example  
the table
Element  
Equa?ons  
–  Assemble the element matrix based on the
global node number
Assembly   Node  number  
element   local   global  
Boundary   1   1  
Condi?ons   1   2   2  
3   3  
Solu?on   1   5  
2   2   3  
Summary   3   2  
1   2  
3   2   4  
3   5  
1   3  
4   2   5  
3   6  
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 3 --- assembly
PDE  
–  Assemble the element matrix based on the
Example  
global node number
Element   Generic Element Matrix
Equa?ons   Node  number   E
element   local   global   ! k k12 k13 $ 'u1E + ' f1E +
Assembly   # 11 & )) E )) )) E ))
1   1   # k21 k22 k23 & (u2 , = ( f 2 ,
1   2   2   # & ) E) ) E)
Boundary  
Condi?ons  
3   3   #" k31 k32 k33 &% )*u3 )- )* f3 )-
1   5  
Solu?on  
2   2   3  
3   2   Global matrix
Summary  
1   2  
3   2   4   ! K … $ 'u1 + ' f1 +
3   5   # 11 & )u ) ) f )
1   3   # ! " & )) 2 )) )) 2 )
)
4   2   5   # & (u3 , = ( f3 ,
3   6   # &) ) ) )
# & )u4 ) ) f 4 )
#" &% )u ) ) f )
* 5- * 5 -
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 3 --- assembly
PDE  
–  The table represent the mapping between local
Example  
index and global index
Element   Generic Element Matrix
Equa?ons   Node  number   E
element   local   global   ! k k12 k13 $ 'u1E + ' f1E +
Assembly   # 11 & )) E )) )) E ))
1   1   # k21 k22 k23 & (u2 , = ( f 2 ,
1   2   2   # & ) E) ) E)
Boundary  
Condi?ons  
3   3   #" k31 k32 k33 &% )*u3 )- )* f3 )-
1   5  
Solu?on  
2   2   3  
3   2   For element 1
1   2  
Summary  
3   2   4   k11 = K11 f1 E = f1
3   5  
1   3   k12 = K12 f 2E = f 2
4   2   5   … ...
3   6  
Then you can insert these
coefficients in the global matrix.
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 3 --- assembly
PDE  
–  The table represent the mapping between local
Example  
index and global index
Element   Generic Element Matrix
Equa?ons   Node  number   E
element   local   global   ! k k12 k13 $ 'u1E + ' f1E +
Assembly   # 11 & )) E )) )) E ))
1   1   # k21 k22 k23 & (u2 , = ( f 2 ,
1   2   2   # & ) E) ) E)
Boundary  
Condi?ons  
3   3   #" k31 k32 k33 &% )*u3 )- )* f3 )-
1   5  
Solu?on  
2   2   3   For element 2
3   2   k11 = K55
Summary  
1   2   f1 E = f 5
3   2   4   k12 = K53
3   5   f 2E = f 3
1   3   k13 = K52 ...
4   2   5  
3   6   …
Then you can insert these
coefficients in the global matrix.
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 3 --- assembly
PDE  
–  The table represent the mapping between local
Example  
index and global index
Element   Generic Element Matrix
Equa?ons   Node  number   E
element   local   global   ! k k12 k13 $ 'u1E + ' f1E +
Assembly   # 11 & )) E )) )) E ))
1   1   # k21 k22 k23 & (u2 , = ( f 2 ,
1   2   2   # & ) E) ) E)
Boundary  
Condi?ons  
3   3   #" k31 k32 k33 &% )*u3 )- )* f3 )-
1   5  
Solu?on  
2   2   3   For element 3
3   2   k11 = K 22
1   2   f1 E = f 2
Summary  
3   2   4   k12 = K 24
3   5  
f 2E = f 4
1   3   k13 = K 25 ...
4   2   5  
3   6   …
Then you can insert these
coefficients in the global matrix.
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 3 --- assembly
PDE  
–  The table represent the mapping between local
Example  
index and global index
Element   Generic Element Matrix
Equa?ons   Node  number   E
element   local   global   ! k k12 k13 $ 'u1E + ' f1E +
Assembly   # 11 & )) E )) )) E ))
1   1   # k21 k22 k23 & (u2 , = ( f 2 ,
1   2   2   # & ) E) ) E)
Boundary  
Condi?ons  
3   3   #" k31 k32 k33 &% )*u3 )- )* f3 )-
1   5  
Solu?on  
2   2   3   For element 4
3   2   k11 = K 33
Summary  
1   2   f1 E = f 3
3   2   4   k12 = K 35
3   5   f 2E = f 5
1   3   k13 = K 36
4   2   5  
...
3   6   …
Then you can insert these
coefficients in the global matrix.
 

Outline  
Example
Finite  Element  
Method  for  2D   •  Step 4 – Boundary condition
PDE  
–  Similar as the one-dimension problem, the Neumann type
Example   boundary condition is easier to apply (The Qn term)
Element  
–  The Dirichlet boundary condition will be applied
Equa?ons   differently from the 1D example (not introduced in this
subject)
Assembly  
•  Step 5 – Solution
Boundary  
Condi?ons  
–  various numerical methods to solve the linear algebraic
systems
Solu?on  
•  Step 6 – post-processing
Summary   –  displaying the results graphically
–  additional effort may be necessary for the secondary
variable solutions
 

Outline  
Summary
Finite  Element  
Method  for  2D   •  You should be able to describe each of the following
PDE  
after today’s lecture:
Example  
–  The basic idea of FEM and its advantages versus
Element   FDM
Equa?ons  
–  The basic six-step procedure for FEM
Assembly  

Boundary  
Condi?ons  

Solu?on  

Summary  

You might also like