Documente Academic
Documente Profesional
Documente Cultură
f(x+h/2)
f'(x)
f(x-h/2)
f ( x h / 2) f ( x h / 2)
f ' ( x)
h
f ( x h) 2 f ( x ) f ( x h)
f ' ' ( x)
h2
Grid generation in 2D domain
m is the grid point counter in x direction (m ranging from 1 to MM)
n is the grid point counter in y direction (n ranging from 1 to NN)
Dy
m,n
m,n-1
m-½,n m+½,n
Discretization of differential
equation
Take the example of heat diffusion equation:
2 q 1 T
T
k t
k
where is thermal diffusivity, and q is the heat generation.
C p
Assuming steady state and no heat generation, 2T 0
The 1st order differential at intermediate points (m+1/2,n) & (m-1/2,n)
T DT Tm 1,n Tm,n
x ( m 12 , n ) Dx ( m 12 , n ) Dx
T DT Tm ,n Tm1,n
x ( m 12 , n ) Dx ( m 12 , n ) Dx
Finite Difference
Approximation (contd...)
Discretization of the second order differentiation at (m,n)
T T
2T x m 12 , n x m 12 , n Tm 1,n Tm1,n 2Tm,n
x 2 ( m,n )
Dx (Dx) 2
2T Tm ,n 1 Tm ,n 1 2Tm,n
y 2 ( m ,n )
( Dy ) 2
Finite Difference
Approximation (contd...)
2 2
2 T T Tm1,n Tm1, n 2Tm, n Tm, n 1 Tm, n 1 2Tm,n
T 2 2 2
2
x y ( m,n) ( Dx ) ( Dy )
The nodal equations derived above are valid for all interior points.
For each node, there is one such equation.
For example: for nodal point m=2, n=3, the equation is
T3,3 + T1,3 + T2,4 + T2,2 - 4T2,3 =0
Hence, the temperature at (2,3) can be expressed as
T2,3=(1/4)(T3,3 + T1,3 + T2,4 + T2,2)
Nodal Equations for boundary nodes
... … … …
a T
j 1
ij j aiiTi a T
j i 1
ij j Bi
Bi i 1 aij ( k ) N a
ij
Ti (k )
T j T j( k 1)
aii j 1 aii j i 1aii
Procedure:
(i) Start with an initial guess temperature distribution
(ii) Visit a grid point, substitute latest estimate for Tnb , get new T
(iii) Visit all points in this manner
(iv) Iterate until convergence
The Finite Element Method
• The domain is broken into a set of discrete elements.
• The shape of the elements can be arbitrary. In two
dimensions, that are usually triangles or quadrilaterals,
while in three dimensions, tetrahedral or hexahedral
elements are often used.
• The equations are multiplied by a weight function before
they are integrated over the entire domain.
• The solution is approximated by simple piecewise functions
(shape functions) valid on elements to describe the local
variations of the unknown variable (or scalars). Such a
function can be constructed from its values at the corners of
the elements called nodes.
Finite Element Method (contd…)
• This approximation is then substituted into the weighted
integral of the governing equation, and a residual is defined
to measure the deviation from the actual solution. The
algebraic equations to be solved are derived by minimizing
the residual.
• The continuum has an infinite number of degrees-of-freedom
(DOF), while the discretized model has a finite number of
DOF.
• The number of equations is usually large for most practical
applications. Hence, the solution of such large system of
equations requires a computational method.
• The ever-increasing computational power of modern day
digital computers and creation of advanced user friendly
softwares have brought FEM within reach of engineers
working in small industries, and college students.
Theoretical Basis for FEM
Formulation
• In the Galerkin’s method, the weighting functions are the same functions
that were used in the approximating equation.
Variational Method (VM)
• The VM involves the integral of a function to produce a number.
Integration of each function produces a number.
• The function that produces the lowest number has the additional
property of satisfying a specific differential equation.
• Consider the integral
D
p y( x) Qy dx 0 (1)
2
• The numerical value of p can be calculated given a specific
equation y = f(x).
• Variational calculus shows that the particular equation y = g(x)
which yields the lowest numerical value for p is the solution to
the differential equation
Dy( x) Q 0 (2)
Heat Conduction in a 2D domain: FEM
solution
Select triangular shaped element to discretize a 2D domain
Choose a linear temperature function for each element as:
t ( x, y ) a1 a2 x a3 y
a1
a1 a2 x a3 y 1 x y a2
a
3
T N i ti N j t j N m t m
In matrix form :
ti
T N i N j N m t j
t m
T temperature function, N shape function,
t nodal temperature
FEM solution (contd…)
Define Temperature Gradient Relationships
T N i N j N m
x x ti
x x
g tj
T N i N j N m
y y tm
y y
1 i j m
B N
x x i j m
Heat flux/Temperature Gradient :
q x K xx 0
g Dg
q y 0 K yy
FEM solution (contd…)
Derive element matrix and equations for heat diffusion
with a convective boundary condition:
T
k B DBdV hN N dS
T
V S
x
L 1
L x x
tAB D B
T
hP 1 dx
0
x L L
L
AK xx 1 - 1 hPL 2 1
- 1 1
L 6 1 2
FEM solution (contd…)
For heat source term:
1
T QV
f Q Q V dV 1 for constant heat source
V
3
1
f k t for each element
Solution:
Assemble element equations, apply BC’s
F K t
Solve for Nodal Temperatures
Solve for Element Temperature Gradient & Heat Flux
Solving PDEs
• Finite element method
• Finite difference method (our focus)
– Converts PDE into matrix equation
• Linear system over discrete basis elements
– Result is usually a sparse matrix
– Matrix-based algorithms represent matrices
explicitly
– Matrix-free algorithms represent matrix values
implicitly (our focus)
Class of Linear
Second-order PDEs
• Linear second-order PDEs are of the form
Auxx 2Buxy Cu yy Eux Fuy Gu H
where A - H are functions of x and y only
• Elliptic PDEs: B2 - AC < 0
(steady state heat equations with heat source)
• Parabolic PDEs: B2 - AC = 0
(transient heat transfer equations)
• Hyperbolic PDEs: B2 - AC > 0
(wave equations)
MODULE 2: Review Questions
• How do numerical solution methods differ from analytical methods?
What are the advantages and disadvantages of numerical and analytical
methods?
• What is the basis of the finite volume method? State the main
difference between the FVM and FDM?