0% found this document useful (0 votes)
27 views3 pages

In Matrix Form: Solution of Systems of Algebraic Equations in CFD

This document summarizes numerical methods for solving systems of algebraic equations that arise from computational fluid dynamics (CFD) simulations on meshes. It discusses Gaussian elimination, iterative methods like Jacobi and Gauss-Seidel relaxation, and multigrid methods. Multigrid methods solve error equations on progressively coarser meshes to efficiently calculate corrections on the fine mesh and converge more quickly than other methods for large problem sizes.

Uploaded by

samadony
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

In Matrix Form: Solution of Systems of Algebraic Equations in CFD

This document summarizes numerical methods for solving systems of algebraic equations that arise from computational fluid dynamics (CFD) simulations on meshes. It discusses Gaussian elimination, iterative methods like Jacobi and Gauss-Seidel relaxation, and multigrid methods. Multigrid methods solve error equations on progressively coarser meshes to efficiently calculate corrections on the fine mesh and converge more quickly than other methods for large problem sizes.

Uploaded by

samadony
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

In matrix form

S + W 4P + E + N = h 2QP

Solution of systems of algebraic equations in CFD


Dr. Gergely Kristf 26-th September 2009
4 x 4 intervallum

We have 9 unknowns.

-4 1

1 0

0 1 0

0 0 1 0

0 0 0 1 0

0 0 0 0 1 0

0 0 0 0 0 1 0

1 -4 1

0 1 -4 0

=0

Ai,j=

1 0 0 1 0 0 0 0 0 0 0 0

0 -4 1 0 1 0 0 0 0 1 0 0

1 -4 1 0 1 0

1 -4 0 0 1

0 -4 1 0

1 -4 1 1 -4

The system now reads:

Ai , j i = Qi
The number of unknowns for 101x101 mesh N=104, therefore the number of elements of matrix A is 108.

The Poisson equation must be solved in every time step

As efficient as any other method for a general case, but it does not make use of the favorable characteristics of the matrix. 1-st step Elimination: A21/A11 times the first row is subtracted from the second row. A1,1 A1,2 A1,3 The first element of the second row Repeated for every further will become 0. Similarly, we A2 ,1 A2 ,2 A2 ,3 eliminate the other elements of the rows.

Gauss elimination

in - method: in pressure based methods:

A 3,1

A3,2

A3,3

second row up to the column N-1.

P = f

2-nd step Backsubstitution:

U1,1 U1,2 U1,3 0 U 2 ,2 U 2 ,3 0 0 U 3,3

n =

Qn U nn
Qi

U k ,i k
k = k +1

i =

U i ,i

The operation cost of the method is N3/3, out of which the back substitution requires only N2/2 operations. Even if A is sparse U is not spares. The total memory requirement on a 2D mesh of 101x101 nodes is 400 Mb. We dont need such an accurate solution because the discretization error is large anyway.

A simple 2D example
The computational domain:

Iterative methods
The solution is refined step by step: approximation of in the n-th step is n. By omitting the vector notations:

2 x
2

2 y
N
2

A n = Q n

n : residual

=Q

The error:

We discretize this by using compass notations: =0 (BC of 1-st kind) W 4 x 4 intervalls

A = A
Iterative methods:

) = Q (Q ) =
n

Thus, the same matrix describes the error.

P S

M n +1 = N n + Q

For the converged solution:

n +1 = n =

, therefore:

A=M N

1 E P P W 1 N P P S + x x y y y

= QP

Lets subtract M

n from both sides:

On isotropic mesh:

x = y = h

S + W 4P + E + N = h 2QP

M n +1 n = N n + Q M n = Q A n = n 123 4 4 correction: n M n = n This is the correction equation.


The better M approximates A is the faster the method converges. M must be easy to solve eg. diagonal, tri-diagonal, or a matrix.

Jacobi iteration
n n n n n S + W 4P+1 + E + N = h 2QP
n P +1 =

Multigrid method
The correction equation for a simplified 1D problem:

M is a diagonal matrix.

1 n n n n S + W + E + N h 2QP 4

)
1

2 x2

=Q

Example program: - The program... - Major characteristics of the result... - Required number of iterations ...

x 2
1

(i 1 2i + i+1 ) = Qi
+ in 1 = Qi in + + in 1 = in +

=0

x 2

(
1

n n i 1 2i

2p intervals Number of unknowns: (2p-1)2 .

x 2

n n i 1 2 i

Gauss-Seidel relaxation
N W P S E These terms are already known due to the calculation sequence
n P +1 = n n n n n S + W+1 4P+1 + E + N+1 = h 2QP

We omit the iteration indices:

x 2

i 1 2 i

+ i +1 = i

M is a matrix.

x i-2 i-1 I-1 i I X i+1 i+2 I+1

1 n n n n S + W+1 + E + N+1 h 2QP 4

- It requires halve as much iterations - and halve as much memory. - The error is asymmetrically distributed.

1 1 1 1 1 i 2 i 1 + i + i 1 2 i + i +1 + i i +1 + i + 2 = 2 2 2 these terms are cancelled 1 1 = i1 + i + i +1 2 2 1 1 i 2 2 i + i + 2 = ( i 1 + 2 i + i +1 ) 4 4x 2

x 2 2

PROLONGATION

X 2

I 1

2 I + I +1 = I

RESTRICTION

Line relaxation
N W P S E these values are known these obtained line by line from the tri-diagonal system solved by the Thomas algorithm.
n n n n n S + W+1 4P +1 + E+1 + N+1 = h 2QP

Generalization to 2D or 3D:
Restriction: Prolongation:

1. Restriction: i I 2. Calculation of I . Eg. in 3D we have an 8 fold reduced number of unknowns. 3. Prolongation of I to the fine mesh. (i), 4. Smoothing on the fine mesh. Why shouldnt we use an even more coarse mesh when calculating I ? 1. 2. 3. 4. Evaluation of the residuals on the finest mesh. Consecutive restrictions of to every coarser mesh. Solution of the system on the coarsest mesh. (Even by using a direct method.) Consecutively for every finer mesh: - Prolongation of - Smoothing (Eg. by using Gauss-Seidel relaxation.) 5. Correction of . (Only on the finest mesh).

Note - Much more efficient methods based on the tri-diagonal solver also exist: Operator Splitting (or Alternating Direction Implicit, ADI) methods. The problem: The above mentioned methods are only smoothing the solution. The boundary effects need a very long time to penetrate the computational domain. Solution: We need to use coarser meshes too. The first estimates of the correction can be obtained on a coarser mesh, than can be refined on the fine mesh.

Computational cost
Number of iterations in 2D:
p 3 4 5 6 7 Nline 7 15 31 63 127 N 49 225 961 3969 16129 Jacobi 40 160 640 2560 10240 G-S 20 80 320 1280 5120 Line rlx. 10 40 160 640 2560 Multigrid 13 33 59 75 79

Mveletigny / N:
p 3 4 5 6 7 Nline 7 15 31 63 127 N 49 225 961 3969 16129 Jacobi 200 800 3200 12800 51200 G-S 100 400 1600 6400 25600 Line rlx. 50 200 800 3200 12800 Multigrid 260 660 1180 1500 1580

On fine meshes multigrid prevails!

You might also like