Sei sulla pagina 1di 3

First course assignment

Luiz Felipe Machado Votto - 8504006

1 Introduction
The advection-reaction equation can be described as

∂u
∇2 u + u(1 − u) = , (1)
∂t
∂2 ∂2
where u : Ω × R+ → [0, 1], Ω = [−1, 1]2 ⊂ R2 and ∇2 = ∂x2 + ∂y 2 is the laplacian differential operator
defined in R2 . With initial condition

 1 , if x ≤ 0

2
u(x, 0) = u0 (x, y) = (2)
0,

otherwise

and forcing the boundary conditions

u(x, t) = u0 (x) ∀t > 0, ∀x ∈ ∂Ω. (3)

This work tries to translate Eq. (1) numerically by assembling 3 schemes:

1. Discretizing the ∇2 u term using central differences;

2. Discretizing the ∇2 u term using a Alternating Direction Implicit scheme – ADI – and the u(1 − u)
term explicitly;

3. Discretizing the ∇2 u term using ADI and the u(1 − u) term implicitly, then solving the resulting
non-linear systems of equations using Newton’s method.

2 Numerical Schemes

2.1 Central differences

First, we discretize the laplacian operator using central differences by:

ui−1,j + ui+1,j − 2uij ui,j−1 + ui,j+1 − 2uij


∇2(∆x,∆y) uij = δx2 uij + δy2 uij = 2
+ , (4)
∆x ∆y 2

where ∆x and ∆y are the grid spacings in both cartesian axes, such that

xi = −1 + i∆x, i = 0, 1, . . . , (m − 1)

1
For the sake of making the scheme possible, we read uij = ui+(m−1)j so that dim(u) = m and rank(u) = 1.

Assume ∆x = ∆y hereon. This results in the following discretization:


uni−1,j + uni+1,j + uni,j+1 + uni,j−1 − 4unij n n 2
un+1
ij − unij
+ u ij − (uij ) = , (5)
∆x2 ∆t
hence
uni−1,j + uni+1,j + uni,j+1 + uni,j−1 − 4unij
 
un+1
ij = unij + ∆t + un
ij − (u n 2
ij ) . (6)
∆x2
In vector notation:

un+1 = I + ∆t Dx2 + Dy2 + I un − ∆t(un )2 ,



(7)

where I is the m2 × m2 identity matrix, and


 
−2 1 0 0 0 ... 0
 
 1 −2 1 0 0 ... 0
 
 
0 1 −2 1 0 ... 0
 
2 1  
Dx = 0 0 1 −2 1 ... 0 , (8)
 
∆x2  
0 0 0 1 −2 ... 0
 
 .. .. .. .. .. 
 
..
 . . . . . . 
 
0 0 0 0 0 ... −2
m2 ×m2

 
−2Im Im 0 0 0 ... 0
 
 Im −2Im Im 0 0 ... 0 
 
 
 0 Im −2Im Im 0 ... 0 
 
1  
Dy2 =  0 0 Im −2Im Im ... 0  , (9)
 
2
∆x  
 0 0 0 Im −2Im ... 0 
 
 .. .. .. .. .. 
 
..
 . . . . . . 
 
0 0 0 0 0 ... −2Im
m×m

where Im is the m × m identity matrix.

2.2 Alternating Direction Implicit Method with Explicit Reactive Term

The Alternating Direction Implicit method (ADI) can be generalized as follows. If F1 and F2 are operators
s.t.

un+1 = F1 un + F2 un , (10)

then one may write this scheme as:


  
un+ 12

= un + ∆t 1
F1 un+ 2 + F2 un
2
1
 . (11)
n+ 12
un+1 = un+ 2 + ∆t F u + F un+1

2 1 2

2
In our case, we can say simply that

∆t
F1 u = u + δx2 u

2
. (12)
∆t
F2 u = u + δy2 u

2

This results in

∆t 2
 n+ 12 ∆t 2

 1−
2 δx uij = 1+ 2 δy unij

(13)
n+ 12
∆t 2
un+1 ∆t 2 ∆t n ∆t
 1−   n 2
2 δy = 1+ 2 δx uij + 2 uij − 2 (uij )

ij

which translates in vector form to:



 I − ∆t Dx2 un+ 21 ∆t 2
 
= I+ 2 Dy un

2
. (14)
1
 I − ∆t D2  un+1 = I+ ∆t 2

un+ 2 + ∆t n
− ∆t n 2
2 Dx 2 u 2 (u )

2 y

2.3 Alternating Direction Implicit Method with Implicit Reactive Term

To make the reactive term implicit, we apply ADI just as before; resulting in:

 I − ∆t Dx2 un+ 21 = I + ∆t
 2
 n
2 Dy u

2
. (15)
 I − ∆t D2 + I  un+1 − ∆t (un+1 )2 = I + ∆t D2  un+ 12

2 y 2 2 x

Then, we solve the non-linear system in the second part of Eq. (15) using Newton’s Method. That is,

un+1 n+1
(k+1) = u(k) + d(k)
, (16)
J (G, un+1 n+1
(k) ) d(k) = −G(u(k) )

where
   
∆t ∆t n+1 2 ∆t 2 1
G(un+1 2 n+1
Dx un+ 2

(k) ) = I− Dy + I u(k) − (u ) − I+ (17)
2 2 2

and J (G, un+1


(k) ) is the jacobian matrix of the function G.

Potrebbero piacerti anche