Exercise 11 Diffusion in 2D ADI, Thomas algorithm, OpenMP HPCSE I, - - PowerPoint PPT Presentation

exercise 11
SMART_READER_LITE
LIVE PREVIEW

Exercise 11 Diffusion in 2D ADI, Thomas algorithm, OpenMP HPCSE I, - - PowerPoint PPT Presentation

Exercise 11 Diffusion in 2D ADI, Thomas algorithm, OpenMP HPCSE I, Fall 2018 Diffusion Di ff usion Process that describes the spreading of a quantity of interest driven by its concentration gradient towards regions with lower density.


slide-1
SLIDE 1

Exercise 11

Diffusion in 2D ADI, Thomas algorithm, OpenMP HPCSE I, Fall 2018

slide-2
SLIDE 2

Diffusion

  • Process that describes the spreading of a quantity of

interest driven by its concentration gradient towards regions with lower density.

  • In this exercise we consider heat flow in a 2D medium

that can be described by the diffusion equation of the form:

  • is a measure for the amount of heat at position

and time

  • is a constant diffusion coefficient
  • Boundary Condition:
  • Initial Condition:

Diffusion

The movement of molecules from an area of high concentration to an area of low concentration until the concentration on both sides is equal.

egion

∂ρ (r, t) ∂t = Dr2ρ (r, t) ρ (r, t) t D r = (x, y)

ρ(x, y, t) = 0 ∀ t ≥ 0 and (x, y) / ∈ Ω ρ(x, y, 0) = ⇢ 1 |x, y| < 1/2

  • therwise

x

y

ρ = 1 ρ = 0 ρ = 0

slide-3
SLIDE 3

Numerical Integration

  • Explicit Euler:
  • 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.

Condition on step size for stability is very small for 2D: for we get

  • Implicit Euler:
  • 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.

ρ(n+1)

i,j

− ρ(n)

i,j

∆t = D " ρ(n)

i−1,j − 2ρ(n) i,j + ρ(n) i+1,j

∆x2 + ρ(n)

i,j−1 − 2ρ(n) i,j + ρ(n) i,j+1

∆y2 # ρ(n+1)

i,j

− ρ(n)

i,j

∆t = D " ρ(n+1)

i−1,j − 2ρ(n+1) i,j

+ ρ(n+1)

i+1,j

∆x2 + ρ(n+1)

i,j−1 − 2ρ(n+1) i,j

+ ρ(n+1)

i,j+1

∆y2 # ∆x ≈ ∆y ≈ h ∆t ∼ O(h2)

slide-4
SLIDE 4

Alternating Direction Implicit

ρ(n+1/2)

i,j

− ρ(n)

i,j

∆t/2 = D " ρ(n+1/2)

i−1,j

− 2ρ(n+1/2)

i,j

+ ρ(n+1/2)

i+1,j

∆x2 + ρ(n)

i,j−1 − 2ρ(n) i,j + ρ(n) i,j+1

∆y2 # ρ(n+1)

i,j

− ρ(n+1/2)

i,j

∆t/2 = D " ρ(n+1/2)

i−1,j

− 2ρ(n+1/2)

i,j

+ ρ(n+1/2)

i+1,j

∆x2 + ρ(n+1)

i,j−1 − 2ρ(n+1) i,j

+ ρ(n+1)

i,j+1

∆y2 #

step 1: step 2:

ρ(n) ρ(n+1/2) ρ(n+1/2) ρ(n+1)

Tridiagonal systems Tridiagonal systems

…solve tridiagonal systems with Thomas algorithm