0% found this document useful (0 votes)
112 views4 pages

Exercise 11: Diffusion in 2D Adi, Thomas Algorithm, Openmp

The document discusses numerical methods for solving the 2D diffusion equation. It describes diffusion as the spreading of a quantity driven by its concentration gradient towards regions with lower density. It presents the explicit and implicit Euler methods, and favors the alternating direction implicit (ADI) method. The ADI method splits each time step into two substeps that solve independent 1D tridiagonal systems, making it efficient to implement while maintaining stability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views4 pages

Exercise 11: Diffusion in 2D Adi, Thomas Algorithm, Openmp

The document discusses numerical methods for solving the 2D diffusion equation. It describes diffusion as the spreading of a quantity driven by its concentration gradient towards regions with lower density. It presents the explicit and implicit Euler methods, and favors the alternating direction implicit (ADI) method. The ADI method splits each time step into two substeps that solve independent 1D tridiagonal systems, making it efficient to implement while maintaining stability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Exercise 11

Diffusion in 2D
ADI, Thomas algorithm, OpenMP

HPCSE I, Fall 2018


Diffusion
Diffusion
Diffusion
Diffusion
• Process that describes the spreading of a quantity
‣ describes spread ofof
the quantity
interest driven by its concentration gradient
driven by itstowards
concentration gradient
‣ describes spread of the quantity
regions with lower density. towards regions with lower densitydriven by its concentration gradient
towards regions with lower density

• Examples:
In this exercise we consider heat flow in a 2D medium Examples:
• distribution of heat in given region
that can be described by the diffusion equation
• distribution of the
of heat in given region
• drop of ink in the glass of water
The movement of molecules from an area of high
form: • drop of ink in the glass of water
concentration to an area of low concentration
• teabag diffusion
• teabag diffusion until the concentration on both sides is equal.
@⇢ (r, t) 2
= Dr ⇢ (r, t)
@t

• ⇢ (r, t) is a measure for the amount of heat at position r = (x, y)


and time t
3

• D is a constant diffusion coefficient y


3

• Boundary Condition: ⇢(x, y, t) = 0 8 t 0 and (x, y) 2


/⌦
⇢ ⇢=1 ⇢=0
1 |x, y| < 1/2
• Initial Condition: ⇢(x, y, 0) =
0 otherwise
⇢=0
x
Numerical Integration
(n+1) (n)
" (n) (n) (n) (n) (n) (n)
#
• Explicit Euler: ⇢i,j ⇢i,j ⇢i 1,j 2⇢i,j + ⇢i+1,j ⇢i,j 1 2⇢i,j + ⇢i,j+1
=D +
t x2 y2
• Easy to implement
• Requires few computations and often has acceptable accuracy.
• Drawback: INSTABILITY. Local errors are small but numerical solution will diverge exponentially over time.
2
Condition on step size for stability is very small for 2D: for x ⇡ y ⇡ h we get t ⇠ O(h )

(n+1) (n)
" (n+1) (n+1) (n+1) (n+1) (n+1) (n+1)
#
• Implicit Euler: ⇢i,j ⇢i,j ⇢i 1,j 2⇢i,j + ⇢i+1,j ⇢i,j 1 2⇢i,j + ⇢i,j+1
=D +
t x2 y2
• Always stable.
• Drawback: must solve a system of linear equations with sparse matrix.

• Alternating Direction Implicit (ADI):


• Split one time iteration in two steps to separate “implicitness” in the x- and y- directions.
• Stable method, 2nd order of accuracy in time.
• Easy to solve: Instead of solving one large set of equations with a sparse matrix, solve multiple
independent 1D systems with tridiagonal matrices.
Alternating Direction Implicit
(n) (n+1/2)
⇢ ⇢

Tridiagonal systems
step 1:
(n+1/2) (n)
" (n+1/2) (n+1/2) (n+1/2) (n) (n) (n)
#
⇢i,j ⇢i,j ⇢i 1,j 2⇢i,j + ⇢i+1,j ⇢i,j 1 2⇢i,j + ⇢i,j+1
=D +
t/2 x2 y2

(n+1/2) (n+1)
step 2: ⇢ ⇢
(n+1) (n+1/2)
" (n+1/2) (n+1/2) (n+1/2) (n+1) (n+1) (n+1)
#
⇢i,j ⇢i,j ⇢i 1,j 2⇢i,j + ⇢i+1,j ⇢i,j 1 2⇢i,j + ⇢i,j+1
=D +
t/2 x2 y2

Tridiagonal systems
…solve tridiagonal systems with Thomas algorithm

You might also like