Vous êtes sur la page 1sur 3

Discretization of N-S and Energy Equation with the ADI Scheme

by Using Finite Differences


Md Rysul Kabir

1 Equations
A vorticity-stream function formulation is used in the N-S equation to cancel out the pressure gradient
term. For this purpose a curl is taken on both sides of the N-S equation.According to vorticity stream
function formulation:
∂2Ψ ∂2Ψ
2
+ = −Ω, (1)
∂X ∂Y 2
 2
∂2Ω

∂(U Ω) ∂(V Ω) µnf ∂ Ω (ρβ)nf ∂T
+ = + + RaP r , (2)
∂X ∂Y ρnf αnf ∂X 2 ∂Y 2 ρnf βf ∂X
αnf ∂ 2 T ∂2T
 
∂(U T ) ∂(V T )
+ = + . (3)
∂X ∂Y αf ∂X 2 ∂Y 2
All three of the above equations are non-dimensional. Here, Ψ , Ω, and T are stream function, vorticity
and temperature respectively. In order to obtain the values of dependent variables(Ψ , Ω, and T ) equations
(1), (2), and (3) are solved numerically. Velocity components for (2) and (3) are calculated from their
typical mathematical relation with stream function. Initially, (1), (2), and (3) are discretized by the
Alternation Direction Implicit (ADI) scheme. The convective terms are discretized by Upwind Implicit
method for stability reasons and center differences are used for the diffusion terms. Afterwards, the
set of linear equations obtained for each of the dependent variables are solved by Tri-Diagonal Matrix
Algorithm (TDMA).

2 Discretization
Equation (1),
∂2Ψ ∂2Ψ
+ = −Ω,
∂X 2 ∂Y 2
Ψi+1,j − 2Ψi,j + Ψi−1,j Ψi,j+1 − 2Ψi,j + Ψi,j−1
⇒ + = −Ωi,j ,
∆x2 ∆y 2
⇒ Ψi+1,j − 2Ψi,j + Ψi−1,j + β 2 Ψi,j+1 − 2β 2 Ψi,j + β 2 Ψi,j−1 = ∆x2 Ωi,j . (4)
Where, ∆ x, ∆ y are uniform difference between two nodes in x and y direction respectively. Also, β is
the ratio of these two differences. Two of the velocity components are calculated from the related we can
obtain from the definition of stream function. After solving equation (4) for the values of Ψ , equations
(5) and (6) are used to calculate U and V respectively for (2) and (3).

∂Ψ Ψi,j+1 − Ψi,j−1
Ui,j = = (5)
∂Y 2∆Y

∂Ψ Ψi+1,j − Ψi−1,j
Vi,j = − = − (6)
∂X 2∆x
Equation (2),
∂2Ω ∂2Ω
 
∂(U Ω) ∂(V Ω) µnf (ρβ)nf ∂T
+ = 2
+ + RaP r ,
∂X ∂Y ρnf αnf ∂X ∂Y 2 ρnf βf ∂X
RaP r(ρβ)nf
⇒ ae Ωi+1,j + aw Ωi−1,j + ap Ωi,j + an Ωi,j+1 + as Ωi,j−1 = (Ti+1,j − Ti−1,j ). (7)
2ρnf βf ∆x

1
where,
µnf
ae = (1−e u)
2∆x Ui+1,j − ρnf αnf ∆x2
µnf
aw = − (1+e u)
2∆x Ui−1,j − ρnf αnf ∆x2
eu ev 2µnf µnf
ap = ∆x Ui,j + ∆y Vi,j + ρnf αnf ∆x2 + 2ρnf αnf ∆y 2
µnf
an = (1−e v)
2∆y Vi,j+1 − ρnf αnf ∆y 2
µnf
as = − (1+e v)
2∆y Vi,j−1 − ρnf αnf ∆y 2
Equation (3),
∂2T ∂2T
 
∂(U T ) ∂(V T ) αnf
+ = 2
+ .
∂X ∂Y αf ∂X ∂Y 2
⇒ ae Ti+1,j + aw Ti−1,j + ap Ti,j + an Ti,j+1 + as Ti,j−1 = 0. (8)
where,
αnf
ae = (1−eu)
2∆x Ui+1,j − αf ∆x2

αnf
aw = − (1+e u)
2∆x Ui−1,j − αf ∆x2

eu ev 2αnf αnf
ap = ∆x Ui,j + ∆y Vi,j + αf ∆x2 + αf ∆y 2
(1−ev ) 2αnf
an = 2∆y Vi,j+1 − αf ∆y 2
αnf
as = − (1+e v)
2∆y Vi,j−1 − αf ∆y 2

In equations (7) and (8) the convective terms are approximated by implicit upwind scheme as equation
(9).In (7) and (8), eu and ev are 1 when the velocity components are in positive direction and -1 when
they are in negative direction.

∂(U Γ ) (1 − eu )(U Γ )i+1,j + 2eu (U Γ )i,j − (1 + eu )(U Γ )i−1,j


= . (9)
∂X 2∆x

3 Alternating Direction Implicit Scheme


For equation (4), horizontal sweep:
k k−1 k−1 k−1
− 2(1 + β 2 )Ψi,j
k k
= − β 2 Ψi,j−1 + ∆x2 Ωi,j
  
Ψi−1,j + Ψi+1,j + Ψi,j+1 . (10)

And the vertical sweep:


k−1
β 2 Ψi,j−1
k
− 2(1 + β 2 )Ψi,j
k
+ β 2 Ψi,j+1
k k k
+ ∆x2 Ωi,j

= − Ψi−1,j + Ψi+1,j . (11)

In the same way for equation (7), horizontal sweep:

k k k k−1 k−1
 RaP r(ρβ)nf k−1 k−1
aw Ωi−1,j + ap Ωi,j + ae Ωi+1,j = − as Ωi,j−1 + an Ωi,j+1 + (Ti+1,j − Ti−1,j ). (12)
2ρnf βf ∆x

And the vertical sweep:

k k k k k
 RaP r(ρβ)nf k−1 k−1
as Ωi,j−1 + ap Ωi,j + an Ωi,j+1 = − aw Ωi−1,j + ae Ωi+1,j + (Ti+1,j − Ti−1,j ). (13)
2ρnf βf ∆x

For equation (8), horizontal sweep:


k k k k−1 k−1

aw Ti−1,j + ap Ti,j + ae Ti+1,j = − as Ti,j−1 + an Ti,j+1 . (14)

And the vertical sweep:


k k k k k

as Ti,j−1 + ap Ti,j + an Ti,j+1 = − aw Ti−1,j + ae Ti+1,j . (15)

Values on the right hand side of the equations (10) to (15) are obtained from the initial guess or previous
iterations. The superscript k denotes a certain iteration. For the vertical sweeps k indicates the value of
the independent variable obtained from the previous horizontal sweep. The error will be calculated from
the differences of vertical and horizontal sweep.

2
4 Tri-Diagonal Matrix Algoritm
Each of the equations from (10) to (15) can be written in a generalized form as below,
k
AΓn−1 + BΓnk + CΓn+1
k
= Dk−1 . (16)

Here, k denotes the node of interest(on a certain number of i or j) and n signifies the current iteration
number.
If the domain is discretized in n×m nodes, then for each horizontal or vertical sweep there will be a
n×n or m×m tri-diagonal coefficient matrix respectively. Each of those matrices will be solved in each
iteration by TDMA algorithm which takes less time [O(N)] for solving a matrix (N ×N ) compared to
Gauss Elimination method [O(N 3 )] or any iterative methods [O(N 2 )].

Vous aimerez peut-être aussi