You are on page 1of 65

Presentation Slides

for
Chapter 6
of
Fundamentals of Atmospheric Modeling
2nd Edition
Mark Z. Jacobson
Department of Civil & Environmental Engineering
Stanford University
Stanford, CA 94305-4020
jacobson@stanford.edu
March 10, 2005
ODEs and PDEs
Ordinary differential equation (ODE)
Equation with one independent variable

Partial differential equation (PDE)


Equation with more than one independent variable
Order
Highest derivative of an equation
Degree
Highest polynomial value of the highest derivative
Initial value problem
Conditions are known at one end of domain but not other
Boundary value problem
Conditions are known at both ends of domain
ODEs and PDEs

Ordinary Differential Partial Differential


Equations Equations
First-order, first- (a) dN  16  4N 2 N uN 
dt (e)  0
degree t x
First-order, first- (b) dN  3AB  4NC u u u
(f) u  v 0
degree
dt t x y
Second-order, d 2 N dN 2 N 2 N
(c)   5t  0 (g)   3t 2 x
first-degree dt 2 dt t 2 x 2
2 2
Second-order, 
d 2 N 
  dN  4  0 
 2 N 
  N  t  x
(d) (h)
second-degree  dt 2  dt  t 2  x
Operator Splitting Scheme

Fig. 6.1
Operator Splitting
Operator-split advection-diffusion equations (6.1-6.3)
N uN    N 
  Kh,xx   0
t x x  x 
N vN   N 
  Kh,yy   0
t y y  y 

N wN   N 
  Kh,zz   0
t z z  z 

Operator-split external source/sink terms (6.4)


Ne,t
N
t
  Rn
n1
Finite-Difference Approximation
Replacement of continuous differential operator (d) with
discrete difference analog (D) written in terms of a finite
number of values along a temporal or spatial direction.

Examples:

dN DN N DN u Du
  
dt Dt x Dx x Dx
Finite Difference Example
First, replace continuous function ux with a finite number of
values in the x direction.

Fig. 6.2
Finite Difference Approximation
Second, define differences of du at point xi
--> Dui  ui 1  ui1 central difference

--> Dui  ui 1  ui forward difference

--> Dui  ui  ui 1 backward difference


Central difference approximation to tangent slope at xi (6.10)
u Dui ui 1  ui1
 
x Dx i xi 1  xi1
Finite-Difference Approximations
Central (AC), forward (BC), and backward (AB) approximations
to slope of tangent at point B

Fig. 6.3
Taylor Series Expansion
Taylor series expansion at point x+Dx (6.11)
Nx 1 2  2 N x 1 3 3 Nx 1 4  4N
x  ...
Nx Dx  Nx  Dx  Dx  Dx  Dx
x 2 x
2 6 x
3 24 x
4

Taylor series expansion at point x-Dx (6.12)


Nx 1 2  2 N x 1 3 3 N x 1 4
4  Nx
Nx Dx  Nx  Dx  Dx  Dx  Dx  ...
x 2 x
2 6 x
3 24 x
4
Finite Difference Approximations
Sum the Taylor series expansions (6.13)
2N 1  4N
Nx Dx  Nx Dx  2Nx  Dx 2 2
x  Dx 4
4
x  ...
x 12 x
Rearrange (6.14)
 2N x
x
2 
N x Dx  2Nx  Nx Dx
Dx
2  O 
Dx 2

Truncation error (neglect 2nd-order terms and higher) (6.15)

  1  4N
O Dx 2   Dx 2 4
x  ...
12 x
2nd-order central difference approx. of 2nd derivative (6.16)
 2N x Nx  Dx  2Nx  Nx  Dx
2  2
x Dx
Finite Difference Approximations
Subtract the Taylor series expansions (6.17)
N x 1 3 3 N x
Nx  Dx  Nx  Dx  2Dx  Dx  ...
x 3 x
3
Rearrange (6.18)
N x N x Dx  N x Dx
x

2Dx  
 O Dx 2

Truncation error (6.19)

  1 3N
O Dx 2   Dx 2 3
x  ...
6 x
2nd-order central difference approx. of 1st derivative (6.20)
N x NxDx  N xDx Ni1  Ni1
 
x 2Dx 2Dx
Finite Difference Approximations
First two terms of Taylor series

1st-order forward difference approx. of 1st derivative (6.21)


N x Nx  Dx  N x Ni1  Ni
 
x Dx Dx

1st-order backward difference approx. of 1st derivative (6.22)

N x Nx  Nx  Dx Ni  Ni1
 
x Dx Dx
Differencing Time Derivative
Central, forward, backward difference approximations (6.23)
Nt Nt h  Nt h

t 2h
Nt Nt h  Nt

t h
Nt Nt  Nt h

t h
Consistency, Convergence
Convergence of finite difference analog (6.6)
N DN
 lim
x Dx 0 Dx

Consistency of finite difference analog (6.7)


DN 
lim T.E.    0
Dx0  Dx 

Convergence of overall solution (6.8)

lim Ne,x,t  N f ,x,t  0


Dx,Dt0
Stability
Stability (6.9)
lim Ne,x,t  N f ,x,t  C
t

Conditionally stable: Stable for limited time-step range


Unconditionally stable: Stable for all time steps
Unconditionally unstable: Unstable for all time steps

An unconditionally unstable scheme cannot be convergent overall,


but individual finite-difference analogs in an unstable scheme
may converge and may be consistent.

In other words, consistency and convergence of individual analogs


do not guarantee stability.

Stability is guaranteed if a scheme is convergent overall and its


finite-difference analogs are convergent and consistent.
Numerical Diffusion, Dispersion
Numerically diffusive scheme:
Peaks spread artificially across grid cells

Numerically dispersive (oscillatory) scheme:


Waves appear ahead of or behind peaks

Unbounded scheme:
Transported values artificially rise above the largest existing value
or fall below the smallest existing value in domain.

Nonmonotonic scheme:
Gradients are not preserved during transport
High Order Approximations
Finite difference approximation of ∂mN/∂xm

• Order of derivative = m
• Approximation expanded across q discrete nodes
• Minimum number of nodes = m + 1
• Maximum order of approximation = q - m

Example
Order of derivative: m=1
Number of nodes: q=5
--> Order of approximation: q-m=4
High Order Approximations
Grid spacing where q=5. Derivative is taken at x3. Fig. 6.4

Distance between two nodes


Dxi  x i1  xi

Approximation to the mth derivative across q nodes (6.24)


q
 mN
x m    iNi   1N1   2N2  ...   qNq
i 1
High Order Approximations
Approximation to the mth derivative across q nodes (6.24)
m q
 N
x m   i Ni 
i 1
Taylor series expansion for each node about point x* (6.25)
N* 1 2 3
2  N* 1 3  N*
Ni  N*  xi  x *   x i  x*   x i  x*   ...
x 2 x 2 6 x 3

Combine (6.24) with (6.25) and gather terms (6.26)


q q q q
 mN 2

x m    i Ni    i N*    i xi  x* 
N*
x
   i x i  x* 
1
2
2  N*
x 2  ...
i 1 i 1 i1 i1
Redefine (6.27)
q q

  i Ni  B0 N*  B1
N*
x
 B2
 2 N*
x 2  ... Bn    i x i  x* 
1
n!
n

i 1 i1
High Order Approximations
q
Bn    i x i  x* 
1
n!
n
for n = 0…q - 1 (6.28)
i1
Multiply (6.28) through by n! and set matrix (6.29)
 1 1 1 ... 1    0!B0 
 
 x  x   1
 1 *
x2  x*  x3  x*  ... x q  x*  
 2 
 1!B 
 1 
 x  x 2
 
2 
 1 *
x2  x* 2 x3  x* 2 ... x q  x*  3 
 
 2!B2 
 
 : : : :  :  
:



 x
 1
 x * q1
x 2  x * q1 x3  x* q1 ... 
xq  x * 
q1  
 q 
 
 q  1!Bq1 
 

• Set Bn=0 for all n, except n = m


• Set Bn=1 when n = m
nd
2 -Order Central Diff. Approx.
Example
Find second-order central difference approx. to ∂N/∂x

Order of derivative: m=1


Order of approximation: q-m=2
--> Number of nodes: q=3

Set matrix (6.32)


 1 1 1  i1  0
    
 Dx 2 0 Dx   i   1
Dx  0 Dx  
 2 
 i1 
 
0

nd
2 -Order Central Diff. Approx.
Solve matrix
1 1
i  0  i1    i1 
2Dx 2Dx

Apply the 's to


(6.24)
N
  1 N1   2 N2   3 N3   i 1 Ni1   i Ni   i1 Ni 1
x

Substitute 's to obtain central difference approx. Table 6.2 (c)


N Ni 1  Ni 1

x 2Dx
st
1 -Order Backward Diff. Approx.
Example
Find first-order backward difference approx. to ∂N/∂x

Order of derivative: m=1


Order of approximation: q-m=1
--> Number of nodes: q=2

Set matrix (6.30)

 1 1 i 1  0 
    
Dx 0  i  1 
st
1 -Order Backward Diff. Approx.
Solve matrix
1 1
 i1   i 
Dx Dx

Apply the 's to (6.24)


N
  i1 Ni 1   i Ni
x

Substitute 's to obtain backward difference approx. Table 6.2 (a)


N Ni  Ni1

x Dx
nd
2 -Order Backward Diff. Approx.
Example
Find second-order backward difference approx. to ∂N/∂x

Order of derivative: m=1


Order of approximation: q-m=2
--> Number of nodes: q=3
Set matrix (6.32)
 1 1 1 i 2  0 
    
 2Dx 2 Dx 0 i1  1 
2Dx 
 Dx 2 0

  i   
0 

Solve (Table 6.2d)
N Ni 2  4Ni1  3Ni

x 2Dx
Higher-Order Approximations
Third-order backward difference (m = 1, q = 4) Table 6.2 (f)
N Ni 2  6Ni1  3Ni  2Ni 1

x 6Dx
Third-order forward difference (m = 1, q = 4) Table 6.2 (g)
N 2Ni 1  3Ni  6Ni1  Ni2

x 6Dx
Fourth-order backward difference (m = 1, q = 5) Table 6.2 (i)
N  Ni 3  6Ni 2  18Ni1  10Ni  3Ni1

x 12Dx
Fourth-order forward difference (m = 1, q = 5) Table 6.2 (j)
N 3Ni1  10Ni  18Ni1  6Ni2  Ni3

x 12Dx
Fourth-Order Approximations
Discretize around furthest cell
Fourth-order backward diff. scheme (m = 1, q = 5) Table 6.2 (k)
 1 1 1 1 1 i 4  0
 4Dx 3Dx 2Dx Dx 0 i 3  1 
    

 4Dx 2
3Dx 2 2Dx 2 Dx 2 0 i 2  0
4Dx 3 3Dx 3 2Dx 3 Dx 3 0 i1  0
    


 4Dx 4
3Dx 4 2Dx 4 Dx 4 0

  i   
0

N 3Ni 4  16Ni3  36Ni2  48Ni1  25Ni

x 12Dx
Fourth-order forward difference (m = 1, q = 5) Table 6.2 (l)
N 25Ni  48Ni1  36Ni2 16Ni3  3Ni 4

x 12Dx
Fourth-Order Central Diff. Approx.
Fourth-order central difference of ∂N/∂x (m = 1, q = 5) (6.33)

 1 1 1 1 1  i 2  0 
 2Dx Dx 0 Dx 2Dx  i1  1 
 2    

 2Dx 2
Dx 2 0 Dx 2 2Dx    i  0 
2Dx 3 Dx 3 0 Dx 3 2Dx 3   0 
  i1   


 2Dx 4
Dx 4 0 Dx 4 2Dx 4 

 i 2 
 
0 


Table 6.2 (h)


N Ni 2  8Ni 1  8Ni1  Ni2

x 12Dx
Fourth-Order Central Diff. Approx.
Fourth-order central difference of ∂2N/∂x2 (m = 2, q = 5)

 1 1 1 1 1  i 2  0 
 2Dx Dx 0 Dx 2Dx  i1  0 
 2    

 2Dx 2
Dx 2 0 Dx 2 2Dx    i  2 
2Dx 3 Dx 3 0 Dx 3 2Dx 3   0 
  i1   


 2Dx 4
Dx 4 0 Dx 4 2Dx 4 

 i 2 
 
0 


Table 6.2 (n)

 2N  Ni 2  16Ni1  30Ni  16Ni1  Ni2


2  2
x 12 Dx
Advection-Diffusion Eqn. Solutions
Species continuity equation in west-east direction (6.1)
N uN    N 
  Kh,xx   0
t x x  x 
CFL stability criterion for
advection
h  Dx min umax
Example:
Dxmin=5 km, |umax|=20 m/s --> h=250 s (Hydrostatic model)
Dxmin=5 km, |umax|=346 m/s --> h=14.5 s (Nonhydrostatic model)
Stability criterion for
diffusion
2
h  Dx min Kmax
Example:
Dzmin=20 m, Kmax=50 m2/s --> h=8 s (in the vertical)
FTCS Solution
Forward in time, centered in space (FTCS) solution (6.35)

1st-order approximation in time

Unconditionally unstable for K=0, large K; otherwise


conditionally stable

Ni,t  Ni,t h uN i1,t h  uNi1,t h



h 2Dx
Ni1,t h  2Ni,t h  Ni1,t h
K 2 0
Dx
Advection-Diffusion Eqn. Solutions
Implicit solution: 1st-order approximation in time (6.36)
Unconditionally stable for all u, K
Ni,t  Ni,th uN i1,t  uNi1,t Ni1,t  2Ni,t  Ni1,t
 K 2 0
h 2Dx Dx
Rearrange and write in tridiagonal matrix form (6.37)
Ai Ni1,t  Bi Ni,t  Di Ni1,t  Ni,t h
(6.38)
 u K   2K 
Ai  h  2  Bi  1 h 2 
2Dx Dx i1 Dx i

 u K 
Di  h  2 
2Dx Dx i1
Advection-Diffusion Eqn. Solutions
Rearrange and write in tridiagonal matrix form (6.39)

B1 D1 0 0 ... 0 0 0  N1,t   N 1,t h   A1 N 0,t 


A B2 D2 0 ... 0 0 0  N 2,t   N 2,t h   0 
 2      
 0 A3 B3 D3 ... 0 0 0  N 3,t   N 3,t h   0 
 0 0 A4 B4 ... 0 0 0  N 4,t   N 4,t h   0 
       
 : : : : : : :  :   :   : 
 0 0 0 0 ... BI 2 DI  2 0 NI 2,t  N I  2,t h   0 
      
 0 0 0 0 ... AI 1 BI 1 DI 1 NI 1,t  N I 1,t h   0 
 0 BI       
 0 0 0 ... 0 AI  NI,t   N I ,t h  DI N I 1,t 
Tridiagonal Matrix Solution
Matrix decomposition: (6.40)
D1 Di i=
1   i   2..I
B1 Bi  Ai  i 1

R1 Ri  Ai  i1
1  i  i=
B1 Bi  Ai  i1 2..I

Matrix backsubstitution: (6.41)

NI ,t   I Ni,t   i   i Ni1,t i = I -1..1, -


1
Tridiagonal Matrix Solution
Matrix for solution for periodic boundary conditions (6.42)
B1 D1 0 0 ... 0 0 A1  N1,t   N1,t h 
A B2 D2 0 ... 0 0 0  N2,t   N 2,t h 
 2    
 0 A3 B3 D3 ... 0 0 0  N3,t   N 3,t h 
 0 0 A4 B4 ... 0 0 0  N 4,t   N 4,t h 
    
 : : : : : : :  :   : 
 0    
0 0 0 ... BI  2 DI  2 0 N I 2,t  N I  2,t h 
 
 0 0 0 0 ... AI 1 BI 1 DI 1 NI 1,t  NI 1,t h 
D BI     
 I 0 0 0 ... 0 AI  NI ,t   N I,t h 

Values at node I are adjacent to those at node


1
Crank-Nicolson Scheme
Crank-Nicolson form (6.44)

Ni,t  Ni,t h  uN i1,t  uNi1,t uN i1,t h  uN i1,t h 


 c  1  c  
h  2Dx 2Dx 

 Ni1,t  2Ni,t  Ni1,t Ni1,t h  2Ni,t h  Ni1,t h 


 K c 2  1   c  2  0
 Dx Dx 

c = Crank-Nicolson parameter
= 0.5 --> Crank-Nicolson solution (unconditionally stable all u, K)
2nd-order approximation in time
= 0. --> explicit (FTCS) solution
= 1 --> implicit solution
Crank-Nicolson Scheme
Tridiagonal form (6.45)
Ai Ni1,t  Bi Ni,t  Di Ni1,t  Ei Ni1,t h  Fi Ni,t h  Gi Ni1,t h

 u K   u K 
Ai  c h  2  Ei  1   c h  2 
2Dx Dx i1 2Dx Dx i 1

 2K   2K 
Bi  1 ch  2  Fi  1 1 c h 2 
Dx i Dx i

 u K   u K 
Di   ch   2  Gi   1 c h  2 
2Dx Dx i1 2Dx Dx i1
Leapfrog Scheme
2nd-order approximation in time (6.48)

Unconditionally unstable for all nonzero K; conditionally stable


for linear equations when K=0; unstable for nonlinear
equations

Ni,t  Ni,t2h uNi1,t h  uNi 1,th Ni1,th  2Ni,th  Ni1,th


 K 2 0
2h 2Dx Dx
Matsuno Scheme
1st-order approximation in time
Conditionally stable for all u when K=0 or small;
unconditionally unstable for large K

Prediction step (6.49)


Ni,est  Ni,t h uNi 1,th  uN i1,t h Ni 1,th  2Ni,th  Ni 1,th
 K 2 0
h 2Dx Dx

Correction step (6.49)


Ni,t  Ni,th uN i1,est  uNi 1,est Ni1,est  2Ni,est  Ni1,est
 K 2 0
h 2Dx Dx
Heun Scheme
2nd-order approximation in time (6.51)
Unconditionally unstable for all u when K=0 and K large;
conditionally stable for other values of K

Ni,t  Ni,th 1 uNi 1,est  uNi1,est K Ni1,est  2Ni,est  Ni1,est


 
h 2 2Dx 2 Dx 2
1 uN i1,t h  uNi1,t h K Ni1,t h  2Ni,t h  Ni1,t h
  2 0
2 2Dx 2 Dx

Prediction step same as first Matsuno step


Adams-Bashforth Scheme
2nd-order approximation in time (6.52)
Unconditionally unstable for all u when K=0 and K large;
conditionally stable for other values of K.

Ni,t  Ni,th 3 uNi 1,th  uN i1,t h 3 Ni1,t h  2Ni,t h  Ni1,t h


  K
h 2 2Dx 2 Dx 2

1 uN i1,t 2h  uNi 1,t2h 1 Ni1,t 2h  2Ni,t2h  Ni 1,t2h


  K 2 0
2 2Dx 2 Dx
Fourth-Order Runge-Kutta Scheme
Conditionally stable (6.53-5)
k1 k 2 k 3 k4
Ni,t  Ni,t h    
6 3 3 6
 uN i 1,t h  uN i1,t h Ni1,t h  2Ni,t h  Ni1,t h 
k1  h K 2 
 2Dx Dx 
k1
Ni,est1  Ni,t h 
2

 uth Nest1   ut h Nest1  Ni1,est1  2Ni,est1  Ni1,est1 


k 2  h  i 1 i1 K 
2

 2Dx Dx 

k2
Ni, est2  Ni, th 
2
Fourth-Order Runge-Kutta Scheme

 ut h Nest2   ut h Nest2  Ni 1,est2  2Ni,est2  Ni 1,est2 


k 3  h i 1 i 1 K 
2

 2Dx Dx 

Ni,est3  Ni,t h  k3

 uth Nest3   ut h Nest3  Ni1,est3  2Ni,est3  Ni1,est3 


k 4  h  i1 i1 K 
2

 2Dx Dx 

Convergence of Four Schemes
-1
10

10 -3
st
1 -order
-5 nd
Error

10 2 -order
Error

-7 th th
10 Runge-Kutta 5 -6
Adams-Bashforth order
-9 M atsuno
10
Forward Euler
-11
10
0.1 1 10
Time step (s)
(Ketefian and Jacobson 2004b) Fig. 6.5
Fourth-Order in Space Solution
Central difference implicit solution (6.56)
Ni,t  Ni,t h uN i 2,t  8uN i1,t  8uNi1,t  uNi 2,t

h 12Dx
Ni 2,t 16Ni1,t  30Ni,t  16Ni 1,t  Ni 2,t
K 2 0
12Dx

Write in Crank-Nicolson and pentadiagonal form

Ai Ni 2,t  Bi Ni 1,t  Di Ni,t  Ei Ni1,t  Fi Ni 2,t

 Pi Ni2,t  h  Qi Ni1,t h  Si Ni,t h  Ti Ni1,t h  Ui Ni 2,t  h


Variable Grid Spacing, Winds
Second-order central difference of advection term (6.57)

uN
  a,i1uNi1   a,i uN i   a,i1 uNi 1
x

Solve matrix equation to obtain coefficients (6.58)

 1 1 1  a,i1  0


    
x i  xi 1  0 x i1  x i    a,i   1
x  x 2 0 2 
 i1 i   a,i1  0

 i i 1 x x
Variable Grid Spacing, Winds
Solve matrix equation to obtain coefficients (6.59)
 xi 1  xi 
 a,i1 
xi  x i1 xi 1  xi1 

 a,i 
x i1  x i   x i  x i1 
x i1  xi x i  xi 1 

xi  x i1
 a,i1 
xi1  x i xi 1  xi1 
Variable Grid Spacing, Diffusion
Expand analytical diffusion term (6.60)

  N  K N 2 N
K   K 2
x  x  x x x
Second-order central-difference approx. to terms (6.61)
K
  a,i1 Ki 1   a,i Ki   a,i 1 Ki1
x
N
  a,i1 Ni1   a,i Ni   a,i1 Ni 1
x

 2N
K
x

2  Ki  d,i1 Ni 1   d,i Ni   d,i 1 Ni1 
Variable Grid Spacing, Diffusion
Solve matrix equation to obtain coefficients (6.63)
2
 d,i1 
x i  x i1 x i1  x i1 
2
 d,i 
xi 1  x i x i  x i1 

2
 d,i1 
x i1  xi x i1  x i1 
Variable Grid Spacing Solution
Crank-Nicolson form (c=0.5--> 2nd order time, space) (6.66)
Ni,t  Ni,th
h
 c  au  K Ni 1   au   K N i   au  K Ni1t
    
 1 c   a u   K N i 1   a u   K N i   a u   K N i1
th
 
Coefficients for diffusion term (6.65)
 
K,i1   a,i1Ki 1   a,i Ki   a,i 1Ki1  a,i1  Ki  d,i1

K,i   a,i1Ki1   a,i Ki   a,i1Ki1 a,i  Ki  d,i


K,i1   a,i1Ki 1   a,i Ki   a,i 1Ki1 a,i1  Ki  d,i 1
Write in tridiagonal form
Ai Ni1,t  Bi Ni,t  Di Ni1,t  Ei Ni1,t h  Fi Ni,t h  Gi Ni1,t h
Two Dimensional Solution
Advection-diffusion equation in two dimensions (6.67)
N uN  vN   N    N 
   Kh,xx  Kh,yy   0
t x y x  x  y  y 
Central difference approximation (6.68)
Ni, j,t  Ni,j,t h uN i 1, j  uNi 1, j vNi, j1  vNi,j 1 
   
h 
 2Dx 2Dy 
t
 Ni1, j  2Ni, j  Ni1, j Ni, j 1  2Ni, j  Ni, j 1 
 Kh,xx 2  Kh,yy 2   0
 Dx Dy t
Solve
Ai, j Ni 1, j,t  Bi, j Ni, j,t  Di, j Ni1,j,t  Ei, j Ni, j1,t  Fi,j Ni, j 1,t  Ni, j,t h
Semi-Lagrangian Method
Concentration at current time t and existing node x (6.69)

Nx,t  Nx  uh,t h

Values at time x-uh, t-h interpolated from existing nodes


Finite Element Method
Advection equation at node i (6.70)
Ni uNi
 0
t x
Trial function = series expansion approximation to N (6.71)
= linear combination of basis functions

N i  Ni x    N j e j x 
j

ej(x) = basis function


j = trial space
Finite Element Method
Residual in advection equation (6.73)

Ni x  N i x   Ni Ni  N i x  N i x 


Ri x    u   u    u 0
 t x   t x   t x 

Minimize residual (6.72)


Force its weighted average to zero over domain

x Ri xei xdx  0
ei(x) = weight function
ei(x) = ej(x) --> Galerkin method of weighted residuals
ei(x) ≠ ej(x) --> Petrov-Galerkin technique
Finite Element Method
Substitute
Ri x  
Ni x 
t
u
N i x 
x
N i x    N j e j x 
j
into
x Ri xei xdx  0
to obtain (6.74)
N i x  Ni x 
 
x  t
u
x
ei x dx


    

 
x t

   N j e j x   u  
x 
N e
j j x e x dx
 i

  j   j 

N j   de j x  
   t
 
x 
 
e j x ei x dx   u N j
 x dx
ei x dx   0

j j
Finite Element Method
Take time difference of (6.74) over three nodes (6.75)
Ni1,t  Ni1,t h xi Ni,t  Ni,t h xi 1
 xi 1 e i1 x e i x dx   xi 1 e i x e i x dx
h h

Ni1,t  Ni1,t h xi 1
 xi ei 1x e i x dx
h

 xi de x  xi 1 de x  
Ni 1,t


xi 1
i 1
dx
e i x dx  Ni,t 
xi 1 dx
i ei x dx
  0
u 
x i1 de x 


 i1,t

N
xi  i1
dx
e i x dx 


Finite Element Method
Define basis functions as chapeau functions (6.76)
 x  xi 1 xi 1  x  x i
x i  xi1

 xi 1  x
e i x    xi  x  xi 1
x i1  xi
0 all other cases



Solve each integral (6.77)


xi x i  x  x  x  x  x  x i1
 xi 1 
e i1 x e i x dx  
i

i 1
dx 
x i1 x i  x i1 x i  xi1  6
Finite Element Method
Substitute integral solutions back into (6.75) (6.78)
Ni1,t  Ni1,t hDxi  Ni,t  Ni,t h 2 Dxi1  Dxi  Ni1,t  Ni1,t hDxi 1
6h

Ni1,t  Ni1,t
u 0
2

Solve with tridiagonal matrix solution -->


4th-order in space, 2nd order in time
Tests with a Finite Element Method
Preservation of a Gaussian peak during finite element transport after
Concentration (generic)
eight revolutions around a circular grid when uh/Dx= 0.02

1200
1000
Concentration
800
600
400
200
0
-200
0 5 10 15 20 25 30
Grid cell number
Fig. 6.8
Tests with a Finite Element Method
Preservation of a Gaussian peak during finite element transport after
Concentration (generic)
eight revolutions around a circular grid when uh/Dx= 0.6
1200
1000
Concentration
800
600
400
200
0
-200
-400
0 5 10 15 20 25 30
Grid cell number Fig. 6.8
Pseudospectral Method
Advection equation (6.87)
N N
u 0
t x
Represent solution with infinite Fourier series (6.88)

Nx,t    ak te ik2x L
k0
For t=0, integrate both sides of (6.88) from 0≤x≤L (6.89)
1 L

ik 2x L
ak 0   N x, 0e dx
L 0
Pseudospectral Method
Truncate infinite series (6.90)
K
Nx,t    ak te ik2x L
k0
Central time-difference approximation of (6.90) (6.91)
 K K 
 
N 1 
 ak,t e ik2x L  ak,t 2h eik2x L 
t 2h  
k0 k0 
Partial derivative of (6.90) with respect to space (6.92)
K
N

ik2ak,th ik2x L
 e
x L
k0
Pseudospectral Method
Substitute (6.91) and (6.92) into (6.87) (6.93)
K K
ak,t  ak,t 2h e 
1 ik2x L ik2ak,t h ik2x L
 u e
2h L
k0 k0

Separate into K equations --> solve (6.94)


ak ,t  ak,t 2h uik2ak,t h

2h L
Traits of a Good Advection Scheme

Fig
6.9

Bounded
Nonoscillatory
Monotonic

Final shape after six rotations around a 2-D grid. Walcek (2000)

You might also like