Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w...

35
12 JJJNIII 1/35 JJJNIII 1/35 Implicit Spatial Discretization for Advection-Diffusion-Reaction Equation Kundan Kumar 10-Dec-2008

Transcript of Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w...

Page 1: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 1/35JJ J N I II 1/35

Implicit Spatial Discretization forAdvection-Diffusion-Reaction Equation

Kundan Kumar

10-Dec-2008

Page 2: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 2/35JJ J N I II 2/35

Introduction

Applications of Advection-Diffusion ReactionEquationsChemical Vapor Deposition

Page 3: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 3/35JJ J N I II 3/35

Introduction

Setting:

• Advection-Diffusion-Reaction Equation

•φt + uφx = εφxx + s(x, t),

• Advection Velocity : u

• Diffusion Coefficient : ε

• Source term : s(x, t)

s(x, t) = b2ε cos(b(x− ut)).

Page 4: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 4/35JJ J N I II 4/35

Introduction

Setting:

• Exact Solution:

φ = cos(b(x− ut)) + exp(−a2εt) cos(a(x− ut)).

• Dirichlet Boundary Conditions.

• Initial Condition, φ(x, t) at t = 0.

Page 5: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 5/35JJ J N I II 5/35

Contents

1 Discretization 61.1 Order Condition . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Examples 10

3 Stability 16

4 Time Integration Aspect 18

5 Numerical Computations 19

6 Conclusion 35

Page 6: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 6/35JJ J N I II 6/35

1. Discretization

φt + uφx = εφxx + s(x, t)

Discretization:1∑

k=−1

βkw′j+k(t) = h−2

1∑k=−1

αkwj+k(t)

+

1∑k=−1

βkgj+k(t)

wj(t) ≈ φ(xj, t); gj(t) = s(xj, t);1∑

k=−1

βk = 1.

Page 7: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 7/35JJ J N I II 7/35

Discretization

Vector Notation:

Bw′(t) = Aw(t) +Bg(t),

A = (aij) = (h−2αj−i)

B = (bij) = (βj−i).

Define:ξk = (−1)

kα−1 + α1, ηk = (−1)

kβ−1 + β1.

Page 8: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 8/35JJ J N I II 8/35

1.1. Order Condition

Let φh be the restriction of the exact solution φ to the grid.Spatial truncation error:

σh(t) = Bφ′h(t)− Aφh(t)−Bg(t).

Truncation error in a point (xj, t) equals:

σh,j(t) = h−2(C0φ + hC1φx + h2C2φxx + h3C3φxxx + ...)|(xj ,t)

Order Condition: The discretization has order q if:

σh = O(hq),

translates to:Ck = O(hq+2−k), k = 0, 1, · · · , q + 2.

Page 9: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 9/35JJ J N I II 9/35

Order Condition

Error coefficients:

C0 = −ξ0, C1 = −ξ1 − uhη0,

Ck =−1

k!(ξk + kuhηk−1 − k(k − 1)εηk−2); k ≥ 2.

where,ξk = (−1)

kα−1 + α1, ηk = (−1)

kβ−1 + β1.

Use the order condition to determine αj and βj.

Page 10: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 10/35JJ J N I II 10/35

2. Examples

Explicit Central Difference

w′j =u

2h(wj−1 − wj+1) +

ε

h2(wj−1 − 2wj + wj+1) + gj,

Implicit Central Difference

1

6(w′j−1 + 4w′j + w′j+1) =

u

2h(wj−1 − wj+1)

h2(wj−1 − 2wj + wj+1) +

1

6(gj−1 + 4gj + gj+1)

Page 11: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 11/35JJ J N I II 11/35

Examples

Define:µ = uh/ε (Peclet Number).

Explicit Adaptive Upwinding

w′j =u

2h(wj−1 − wj+1) +

ε + 0.5uhκ

h2(wj−1 − 2wj + wj+1) + gj,

Where κ is defined as:

κ = max(0, 1− 2/µ).

Page 12: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 12/35JJ J N I II 12/35

Examples

Implicit Adaptive Upwinding

1

2κw′j−1 + (1− 1

2κ)w′j =

u

2h(wj−1 − wj+1)

+ε + 0.5uhκ

h2(wj−1 − 2wj + wj+1)

+1

2κgj−1 + (1− 1

2κ)gj.

Page 13: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 13/35JJ J N I II 13/35

Examples

Peclet Number µ:µ = uh/ε.

Explicit Exponential Fitting

w′j =

1∑k=−1

αkwj+k + gj,

α−1 = uhexp(µ)

exp(µ)− 1, α1 = uh

1

exp(µ)− 1, α0 = −(α1 + α−1).

Page 14: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 14/35JJ J N I II 14/35

Implicit Exponential Fitting

β−1w′j−1 + β0w

′j + β1w

′j+1 =

1∑k=−1

αkwj+k + β−1gj−1 + β0gj + β1gj+1.

where

β−1 =1

2

(exp(µ)

exp(µ)− 1− 1

µ

),

β0 =1

2,

β1 =1

2

(1

µ− 1

exp(µ)− 1

).

Page 15: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 15/35JJ J N I II 15/35

Examples

Compact Schemes:

α−1 = ε +1

2uh− uh(β1 − β−1),

α1 = ε− 1

2uh− uh(β1 − β−1),

α0 = −(α−1 + α1),

β−1 =1

γ(6 + 3µ− µ2),

β0 =1

γ(60− 4µ2),

β1 =1

γ(6− 3µ− µ2)

and γ is a scaling factor given by:

γ = 72− 6µ2.

Page 16: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 16/35JJ J N I II 16/35

3. Stability

Requirement:|| exp(tB−1A)|| ≤ C, for all t > 0.

We can write:

A = V diag(ak)V−1, B = V diag(bk)V

−1,

with ak, bk eigenvalues of A,B respectively. Define global error e(t):

e(t) = φh(t)− w(t), e(t) = V −1e(t)

Discretization error σh(t):

σh(t) = Bφ′h(t)− Aφh(t)−Bg(t), σh(t) = V −1σh(t).

Page 17: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 17/35JJ J N I II 17/35

Stability

The error equation then reads:

bkd

dte(t) = ake(t) + σh(t).

Stability if:Re(ak/bk) ≤ 0 and |ak| + |bk| > 0.

Result: For the three point scheme considered with C0 = C1 = 0, C2 =O(h), and assume that:

h−2|α0| + |β0 −1

2| > 0,

then the stability condition holds iff:

2ah(β1 − β−1) ≥ α0, and α0(1− 2β0) ≥ 0.

Page 18: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 18/35JJ J N I II 18/35

4. Time Integration Aspect

Ode system:Bw′(t) = Aw +Bg(t).

Define:F (t, w) = Aw(t) +Bg(t).

• We use the θ method (with θ = 0.5:

Bwn+1 = Bwn + 0.5τF (tn, wn) + 0.5τF (tn+1, wn+1).

• With Explicit method, there is some amount of ’implicitness’!.

• Stability conditions in general become more stringent in case of implicitdiscretization method.

• For an implicit A-stable ODE method for time stepping, little differencebetween the two methods.

Page 19: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 19/35JJ J N I II 19/35

5. Numerical Computations

Error for Implicit vs Explicit Central Difference

Page 20: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 20/35JJ J N I II 20/35

Implicit vs Explicit Adaptive Upwinding

Page 21: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 21/35JJ J N I II 21/35

Implicit vs Explicit Exponential Fitting

Page 22: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 22/35JJ J N I II 22/35

Implicit vs Explicit

Page 23: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 23/35JJ J N I II 23/35

Implicit vs Explicit Central Difference

Page 24: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 24/35JJ J N I II 24/35

Implicit vs Explicit Adaptive Upwinding

Page 25: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 25/35JJ J N I II 25/35

Implicit vs Explicit Exponential Fitting

Page 26: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 26/35JJ J N I II 26/35

Page 27: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 27/35JJ J N I II 27/35

Page 28: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 28/35JJ J N I II 28/35

Page 29: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 29/35JJ J N I II 29/35

Page 30: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 30/35JJ J N I II 30/35

Page 31: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 31/35JJ J N I II 31/35

Page 32: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 32/35JJ J N I II 32/35

Page 33: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 33/35JJ J N I II 33/35

Page 34: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 34/35JJ J N I II 34/35

Page 35: Implicit Spatial Discretization for · 2008-12-10 · n+1 = Bw n +0:5˝F(t n;w n)+0:5˝F(t n+1;w n+1): With Explicit method, there is some amount of ’implicitness’!. Stability

12

JJ J N I II 35/35JJ J N I II 35/35

6. Conclusion

When do we use Implicit Spatial Discretization?

• To achieve higher order without using wider stencils.

• To reduce the artificial oscillations in the numerical solution.

• Provides extra degrees of freedom for the numerical scheme.

Disadvantages

• Positivity may be lost.

• Stringent conditions for explicit time integration methods.