Professional Documents
Culture Documents
y
Module 4:Numerical Methods I
Lecture 5 and 6: PDE, Hyperbolic
PDE, Stability, Accuracy, Parabolic
PDE, Eliptic PDE
I.Popescu
t x
u nj1 u( A) u An
u=ct u nA interpolated
n 1 between
t u nj 1 and u nj
n A
0 x
j 1 j j 1
0
1/25/2012 Numerical Methods 2
1
5.4. Hyperbolic PDE-MoC schemes
u u u An liniar interpolation between u nj1 and u nj
a 0
t x
t x
n+11
t
at
Cr
n A x
at j
xj-1 j-1 x
xA
xj
x A x j a t
x A x j 1 x j xA
u U An U nj U nj1
x j x j 1 x j x j 1
x
U nj1 U An 1 Cr U nj CrU nj1
n
j-1 at j x
2
Accuracy/consistency
The discretised equations are not the
real ones
The
Th scheme
h does
d not solve
l the
h reall
equations !
u
real
x
u
approximate x
1/25/2012 Numerical Methods 5
Stability
A scheme is stable if any initially finite perturbation
remains bounded as time grows
Verification: Matrix method, Fourier method, Domain of
dependence
3
Accuracy/consistency Consistency
Convergence
x
Numerical diffusion
causes amplitude error
1/25/2012 Numerical Methods 8
4
Accuracy/consistency Convergence Consistency
Stability
Numerical diffusion : profile smearing
1.2 Initial
Analytical
1 Numerical
0.8
u
0.6
0.4
0.2
0
0 2 4 6 8 10 12 14 16 18 20
x
j
2 x 2
O x 3
U t 2 2U
U n 1
j U tn
j
t
2 t 2
O t 3
Into the equation this gives:
U t 2 2U n U x 2 2U t t
U nj t
t
2 t
O t 3
U x
x
2 x
O x 3 a
1 a U nj
x x
2 j 2
5
Accuracy and suitability Convergence Consistency
Stability
Consistency of explicit schemes
After dividing with dt we obtain:
U x 2U
U t 2U
t
2 t 2
O
t 2
2
O x 2 a
x 2 x
or:
U U t 2U x 2U
t
a
x 2 t 2
a O x O t
2 x 2
2
2
2U 2 U
2
Since a
t 2 x 2
U U ax 2U
t
a 1 Cr
x 2 x2
O x 2 O t 2
TE2 TE3
TE 1
1/25/2012 Numerical Methods TE 11
6
Accuracy/consistency
Consistency
Convergence
Stability
What you want to solve :
u u
a 0
t x
x
Numerical diffusion
causes amplitude error
1/25/2012 Numerical Methods 14
7
Accuracy and suitability
Consistency
Stability of schemes for PDEs Convergence
Stability
Because of numerical diffusion we try to use a better scheme,
like for instance Preismann scheme with psi=0.5;
a dispersion
p equation
q
U U U U 3U
a 0 a k 3
t x t x x
Analytical profile,
Initial Advected
u profile downstream Dispersion equation
Numerical dispersion
Due to derivatives estimation
x Sharper profiles and oscilations
Computational
result Create phase errors
Numerical dispersion
1/25/2012 Numerical Methods 15
0.8
u
0.6
0.4
0.2
0
0 2 4 6 8 10 12 14 16 18 20
8
Accuracy/consistency Convergence Consistency
Stability
Numerical dispersion : oscillations
1.2 Initial
1
Analytical
Numerical
0.8
0.6
u
0.4
0.2
0
0 2 4 6 8 10 12 14 16 18 20
-0.2
-0.4
9
Stability
Stability of explicit schemes
Von Neumann stability method (Using Fourier analysis)
Same principle: amplitude factor is less than 1
U nj U 00 e nt ijx
U nj U 00 expnr t cosni t i sinni t cos jx i sin jx
U nj1 U nj1
1 Cr Cr
i
AN n n -1 1
U j U j
-x R
U nj1 U 0 expnt i j 1x
0 0 exp ix
U 0 expnt ijx
Cr
U nj
AN 1 Cr cosx i sin x Cr
Unit
circle
-i
10
Amplitude and phase portraits
0.95
A 0.9
0.85
0.8
0.75 1.2
1 10 100 1
M
0.8
2 2
AN 1 Cr cos i sin Cr
c/u
0.6
M M 0.4
0.2
Arg AN
0
Arg AN
a M
cN
1 10 100
2
M
Cr
1/25/2012 Numerical Methods 21
11
(B)Parabolic PDEs
0 L x 0 T t 0 T t
12
Example : Heat Conduction
Equation governing transfer of heat is:
T(x,t) temperature
T 2T
c p k 2 density
i 1 i i 1 x
1/25/2012 Numerical Methods 25
t uin1 u 2u
n 1 a 2
uin1 uin uin1 t x
n
uin1
n 1
i 1 i i 1 x
u u 2u u
2 n n n
CS: i 1 i i 1
x 2 x 2
uin 1 uin uin1 2uin uin1
n 1
u ui uin a
FT: t x 2
t t
a t
uin 1 uin r uin1 2uin uin1 r
x 2
1/25/2012 Numerical Methods 26
13
Parabolic PDE:Solution Methods Explicit Methods2
t uin1 u 2u
n 1 a 2
uin1 uin uin1 t x
n
uin1 uin 1 uin r uin1 2uin uin1
n 1
i 1 i i 1 x
I.C.: u f (ix )
0
i
B.C.:
u g ( n t )
0
n
u Nn h(nt )
We can calculate the unknown values of uin 1 from the known
n 0
values of ui starting from the initial condition ui
0r
1 u
for k (u u f )
2
k x n
14
Parabolic Equation An example calculation
Solve
u 2u for
0 x 1
a 2
t x 0 t
(Where u represents temperature)
u (0, t ) 0
u (1, t ) 0
15
Parabolic Example : Case 1 (r<0.5)
Values for a, space and time discretisation are:
a 1 x 0.1 at
r 2 0 .1
t 0.001 x
uinn1 uin r (uin1 2uin uin1 )
n=0 u00 0, u10 0.2, u20 0.4 , ... , u 40 0.8 , u50 1.0, u60 0.8, ....
t=0
u11 0.2 0.1(0.4 0.4 0.0) 0.2
n=1 ...
t=0.001
u51 1.0 0.1(0.8 2.0 0.8) 0.96
u12 0.2 0.1(0.4 0.4 0.0) 0.2
n=2 ...
t=0.002
u52 0.96 0.1(0.8 1.92 0.8) 0.928
1/25/2012 Numerical Methods 31
-
n=0 0 0.2000 0.4000 0.6000 0.8000 1.0000
n=1 0 0.2000 0.4000 0.6000 0.8000 0.9600
n=2 0 0.2000 0.4000 0.6000 0.7960 0.9280
n=3 0 0.2000 0.4000 0.5996 0.7896 0.9016
n=4 0 0.2000 0.4000 0.5986 0.7818 0.8792
n=5 0 0.2000 0.3998 0.5971 0.7732 0.8597
sym
16
Parabolic Example : Case 1 (r<0.5)
Plot of the temperature distribution every 10
discretisation points in space for 100 time steps
Evolution of temperature distribution
1
0.9
t=0
0.8
0.7
STABLE 0.6
temperature
solution 0.5
0.4
0.3
0.2
0.1
t=0.1
& analytic solution
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
at
0.7
r 0.5
x 2
0.6
temperature
0.5
0.4
0.3
STABLE
solution but 0.2
t=0.1
not very 0.1 & analytic solution
accurate 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
17
Parabolic Example : Case 3 (r>0.5)
Plot of the temperature distribution at 0 and 18
time steps
Evolution of temperature distribution
1
x 0.1 0.9
t=0
t 0.0055 0.8
0.7
at t=0.1
r 2 0.55 0.6
x
temperature
0.5
analytic
0.4 solution
0.3
UNSTABLE
0.2
solution is
meaningless 0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
Parabolic Example :
Evolution of maximum temperature (r=0.1)
0.9
0.8
maximum temperature
0.7
STABLE
solution
0.6
0.5
0.4
0.3
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
time
18
Parabolic Example :
Evolution of maximum temperature (r=0.5)
Evolution of maximum temperature
1
exact solution
r=0.5 solution
0.9
0.8
maximum temperature
0.7
0.6
STABLE
solution but
not v.
0.5
accurate
0.4
0.3
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
time
Parabolic Example :
Evolution of maximum temperature (r=0.55)
Evolution of maximum temperature
1
exact solution
r=0.55 solution
0.9
0.8
UNSTABLE
maximum temperature
0.7
solution is
0.6 meaningless
0.5
0.4
0.3
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
time
19
Parabolic Example : Explicit Method Error
Comparison of temperature values at x=0.5 and t=0.1 (for N=11)
r M u % error
analytic - 0.3021 -
0.001 10000 0.3071 1.65
0.01 1000 0.3070 1.60
0.1 100 0.3056 1.16 need to
increase N
0.5 20 0.3071 1.64 to reduce
0.55 18 0.6336 109 error
further
unstable 0.6 16 7.2340 2294
(C)Eliptic PDEs
20
Elliptic Equations No time variable
2u 2u 0 x Lx
u ( x, y ) f (u , x, y )
y 2 x 2 0 y Ly
With the particular cases:
2u 2u
- Poisson equation 0 2 2 f (u , x, y )
y x
2u 2u
- Laplace equation 0 and f 0 2 2 0
y x
With different typs of B.C.:
Dirichlet : u is specified at the boundary
Neumann : derivative
d off u is specified
f d at the
h boundary
b d
Mixed(robin): both u and its derivative is specified at
the boundary
i 1 i i 1 x
Approximate solution determined at all grid points
simultaneously by solving single system of algebraic
equations
21
Elliptic PDE:Solution Methods Explicit Methods
y ui , j 1
j 1 2u 2u
0
ui 1, j ui , j ui 1, j y 2 x 2
j
ui , j 1
j 1
i 1 i i 1 x
2u ui 1, j 2ui , j ui 1, j
x 2 x 2 ui 1, j 2ui , j ui 1, j ui , j 1 2ui , j ui , j 1
0
2u ui , j 1 2ui , j ui , j 1 x 2
y 2
y 2 y 2
ui 1, j ui 1, j ui , j 1 ui , j 1 4ui , j 0
Holds for all interior points of the domain
1/25/2012 Numerical Methods 43
22
What you should remember
Numerical solutions to PDEs can be
obtained by discretising both space and
time.
Explicit numerical schemes for PDEs are
subject to stability constraints.
Implicit numerical schemes for PDEs are
always stable.
Iterations are also needed for the implicit
solution of non-linear PDEs.
The notions of consistency, stability and
convergence also hold for numerical
schemes for PDEs.
Numerical Methods
1/25/2012 45
23
What you should remember
Decreasing t or x alone is not sufficient to
reduce the truncation error : t and x should
be reduced together.
Th
The MOC is i a specific
ifi kind
ki d off numerical
i l method
h d
used for advection modelling. Its main
drawback is that it is generally not conservative
(some water, pollutant, or energy, may be lost
artificially).
At least three points in space are needed to
solve a diffusion equation.
The design of 2-D and 3-D computational grid
should be carried out with care, long and
narrow grids should be avoided.
24
FVM principle (1)
FVMs are applicable to conservative equations, i.e. equations of the
form
U F
0 (1D problems)
t x
U F G
0 (2D problems) (5.1)
t x y
U F G H
0 (3D problems)
t x y z
F, G, H : Fluxes in x, y and z
U : Conserved variable
U U U nU nU nU
F F U , , , , , n , n
x y z x y z n
U U U nU nU nU
G G U , , , ,, n , n
x y z x y z n
U U U nU nU nU
H H U , , , ,, n , n
x y z x y z n
1/25/2012 Numerical Methods 49
: Divergence operator
F x G y H z .n d 0
t
U d xd yd z
25
FVM principle (3)
Application:
q if x 0
qx l
qr if x 0
h-discontinuity
hus hus
Qus Qus
hds hds
Qds Qds
26
FVM application (2)
h-discontinuity
hus hus
Qus Qus
hds hds
Qds Qds
F
C
Fj-1/2 Fj+1/2
xj
n C nj C nj1
uC j 1 2 D if u 0
x j 1 x j
F j 1/ 2
n C nj C nj1
uC 2 D if u 0
x j 1 x j
j
27
FVM applications (4)
Applications in 1D
Discontinuous flows
U U
0 (scalar PDE)
t x
U F
0 (system of PDEs)
t x
When F [F] is a non-linear function of U [U], the solution
may become discontinuous
U
A A
x
t
dx/dt = u t1 A B
u = Cst
t0
A B x
28
FVM applications (6)
Applications in 1D (4)
In finite volume methods: the flux is calculated from the
solution of a Riemann problem
U
U = Cst here
Initial
Final
x
t
Algorithm
29
FVM applications (8)
Multidimensional problems
Wave splitting (scalar equations)
U U U
u v 0
t x y
Interface (i 1/2, j)
x
M(xi1/2 ut, yM vt )
Decomposed into
U F U U
0 A 0
t x t x
followed by
U G U U
0 B 0
t y t y
30
FVM applications (10)
Multidimensional problems (3)
P(p, 1) B
(yp1) t
(xp ) t
N(p) (p) M
U
(yp,2 ) t
A
P(p, 2)
31
7. Finite Element Method
What is it FEM?
The finite element method is a numerical method
for solving problems of engineering and
mathematical physics, useful for problems with
complicated
li t d geometries
t i and d di
discontinuities,
ti iti
where analytical solutions can not be obtained.
32
Principle of the method -(1)
Methodology
Approximating the field of a dependent variable by a finite series
expansion in terms of linearly independent analytical functions.
The form of the expansion functions in the finite-element method is in a
such way that they are only locally non zero
f U 0
f Uwd 0
f U 0 Ne
U ( x , y ) N jU j
j 1
f Uwd 0
33
Principle of the method -(3)
Discretization
Model the domain by dividing it into an equivalent system of
smaller domains or units (finite elements) interconnected at
points common to two or more elements (nodes or nodal points)
and/or boundary lines and/or surfaces.
Ne
U ( x , y ) N jU j
j 1
34
Principle of the method -(5)
Methodology
Obtain a set of algebraic equations to solve for unknown
nodal quantity (displacement).
Secondary quantities (stresses and strains) are expressed
in terms of nodal values of primary quantity
History
Hrennikoff [1941] - Lattice of 1D bars
McHenry [1943] - Model 3D solids
Courant [1943] - Variational form
Levy [1947, 1953] - Flexibility & Stiffness
Argryis and Kelsey [1954] - Energy Prin. for Matrix
Methods
Turner, Clough, Martin and Topp [1956] - 2D elements
Clough [1960] - Term Finite Elements
Applications
Fluid Flow
Heat Transfer
Structural/Stress Analysis
Electro-Magnetic Fields
Soil Mechanics
Acoustics
35
Advantages
Irregular Boundaries
Boundary Conditions
Variable Element Size
Easy Modification
Dynamics
Nonlinear Problems (Geometric or
Material)
General Loads
Different Materials
Algorithm
Discretize and Select Element Type
Select a Function Representation for U
Define Relationships between U and other physical
elements ( where applicable)
Derive Element Stiffness Matrix & Eqs.
Assemble Equations and Introduce B.C.s
Solve for the Unknown the system (obtain U)
Solve for the other elemnts ( depending on U-where
applicable)
Interpret the Results
36
Application -1D advection equation
U U L
y y
a 0 t c x w.dx 0 w( x, y )
t x 0
L
U in 1 U in N i *
t
c U in 1 N j .dx 0
x
0 i i
L
Uin1 Uin L
n1 Ni *
t Ui x Nj .dx 0
*
N N
i j .dx c
0 i 0 i
N i
L
1
Ui
n 1 n 1 n 1
N j dx U j 1 U j 1
0 i x 2
a j y nj11 b j y nj 1 c j y nj11 d j
x j 1/ 2 2 x j 1/ 2 x j 1/ 2
x j 1/ 2
aj 1 bj cj 1
3ct 3 ct 3ct
2 x j 1/ 2 n x j 1/ 2 x j 1/ 2 n x j 1/ 2 n
dj U j 1 Uj U j 1
ct 6 3 6
37
Modeling Considerations
Solve the tridiagonal system [A]Y=B
Symmetry - means correspondence in size, shape and position of U and
boundary conditions that are on opposite sides of a dividing line or
plane;
Use of symmetry allows us to consider a reduced problem instead of the actual
problem.
The order of the total (global) stiffness matrix and the total number of equations can be
reduced.
Solution time is reduced!
1 7
L 4 2P
1 3 6 5
4
5
L
2 8
L L
38
2
L 1 4
P
1 3
4
5
L
2
L L
X X 0 X 0 0 0 0 0 0 0 0
X X X X X 0 0 0 0 0 0 0
0 X X 0 X X 0 0 0 0 0 0
X X 0 X X 0 X 0 0 0 0 0
0 X X X X X 0 X 0 0 0 0
0 0 X 0 X X 0 X X 0 0 0
0 0 0 X X 0 X X 0 X 0 0
0 0 0 0 X X X X X X X 0
0 0 0 0 0 X 0 X X 0 X X
0 0 0 0 0 0 X X 0 X 0 0
0 0 0 0 0 0 0 X X 0 X 0
0 0 0 0 0 0 0 0 X 0 0 X
X is a nonzero 2 x 2 block nb
39
Bandwidth
nb = ndof ( m + 1 )
Where:
Wh
nb is the semibandwidth
ndof is the number of degrees of freedom per node.
m is the maximum difference in node
numbers for any element.
Poor Shapes
b >> h >>
h
b
Large aspect ratio Very large and
very small corner
angles
40
Poor Shapes
Quadrilateral degenerating
Q g g
h1 h2 into triangular shape
h1 >> h2
Quadrilateral approaching
triangular shape
Flowchart for a
Finite Element Program.
41
START
Input Data
Do JE=1,NELE
Apply B.C.s
INPUT
Control parameters
Number of Elements
Number of Nodes
Number of B.C.s
Geometry
x,y,z location of each node
Element connectivity (which nodes are
associated with which elements))
42
INPUT
Element Properties
p
Area
Moment of Inertia
Thickness
Location of Neutral Axis
Physical parameters Information
Programs
ALGOR
ANSYS
COSMOS/M
STARDYNE
IMAGES-3D
MSC/NASTRAN
SAP90
ADINA
NISA
43
What you should remember
Finite Element Methods (FEMs) seek a
weak solution to the PDEs.
The solution is sought as the sum of a
set of basis or shape functions. Those
can be piecewise linear, or parabolic, etc.
The Galerkin technique uses a weighting
of the solution by functions that are the
same as the shape functions
44