of 16 /16
NATIONAL TECHNICAL UNIVERSITY OF ATHENS Parallel CFD & Optimization Unit Laboratory of Thermal Turbomachines Μέθοδος Πολυπλέγματoς (Multigrid) Κυριάκος Χ. Γιαννάκογλου, Καθηγητής ΕΜΠ Βαρβάρα Ασούτη, Δρ. Μηχ. Μηχανικός ΕΜΠ

trinhdan
• Category

## Documents

• view

218

0

Embed Size (px)

### Transcript of Μέθοδος Πολυπλέγματoς -...

NATIONAL TECHNICAL UNIVERSITY OF ATHENS

Parallel CFD & Optimization Unit

Laboratory of Thermal Turbomachines

Μέθοδος Πολυπλέγματoς

(Multigrid)

Κυριάκος Χ. Γιαννάκογλου, Καθηγητής ΕΜΠ

Βαρβάρα Ασούτη, Δρ. Μηχ. Μηχανικός ΕΜΠ

[email protected]

[email protected]

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Example

Problem:

Boundary Conditions:

Initialization:

02 11 iii uuu

00 Muu

0 1 M M-1

M

ikui

sin

Mi 0

2

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Discretization

)(22

1

)()(2)(

02

0

1111

2

2

1111

2

11

2

2

iiiiii

iiiiii

ii

uuuuuxrhsu

xrhsuuuuuu

x

uuu

x

u

3

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

dx = 1.d0/dfloat(nx)

c1p = -1.d0

c1m = -1.d0

cc = 2.d0

do ic=0,ncyc

do i=0,nx

du(i) = 0.d0

enddo

restot = 0.d0

do i=1,nx-1

au = -u(i-1) + 2.d0*u(i) - u(i+1)

resid(i) = rhs(i) - au

du(i) = (dx*dx*rhs(i)-au - c1m*du(i-1) - c1p*du(i+1))/cc

restot = restot + resid(i)*resid(i)

enddo

restot = dsqrt(restot)/dfloat(nx+1)

error = 0.d0

do i=1,nx-1

u(i) = u(i) + du(i)

error = u(i)*u(i)

enddo

enddo

Coding

Compute Δu

Update u

4

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Convergence

5

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Geometric Multigrid: The Idea

Different grid sizes:

Ability to solve all wave lengths

Rapid convergence

6

x

2x

4x

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Operators

Restriction

Mapping from the fine grid to the coarse grid

Injection

Full weighting

Prolongation

Mapping from the coarse grid to the fine grid

h

i

H

i uu 2

h

i

h

i

h

i

H

i uuuu 12212 24

1

H

i

H

i

h

i

H

i

h

i

uuu

uu

112

2

2

1

7

hh

H

H

hHh

H

I

I

:

HH

h

h

HhH

h

I

I

:

h: Fine grid

H: Coarse grid

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

V-cycle using two grids (fine/h, coarse/H) :

1. Solve (2-3 Jacobi or Gauss-Seidel iterations)

2. Restrict the residual to the coarse grid

3. Solve (2-3 Jacobi or Gauss-Seidel iterations)

4. Prolongate (interpolate) to fine grid

and correct

5. Go to step 1, using the updated

Multigrid Algorithm

hhh ubuA

hhhh uAbr h

H

hH rIr

HHHH ErEA

HE

hhh Euu

hu

H

h

Hh EIE

8

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Multigrid Schemes

9

4 (h)

3 (2h)

2 (4h)

1 (8h)

V-cycles

and

W-cycles

Full Multigrid

(FMG-cycles) 4 (h)

3 (2h)

2 (4h)

1 (8h)

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Multigrid in 2 dimensions

Fine grid:

Coarse grid:

10

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

2D Restriction

Injection:

Weighting:

Half

Full

0 0 0

0 0 1

0 0 0

0 0 1/8

1/8 1/8 1/2

0 0 1/8

1/16 1/16 1/8

1/8 1/8 1/4

1/16 1/16 1/8

h

ji

H

ji uu 2,2,

h

ji

h

ji

h

ji

h

ji

h

ji

h

ji

h

ji

h

ji

h

ji

H

ji

uuuu

uuuuuu

12,1212,1212,1212,12

12,212,22,122,122,2,

16

1

8

1

4

1

h

ji

h

ji

h

ji

h

ji

h

ji

H

ji uuuuuu 12,212,22,122,122,2,8

1

2

1

11

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

2D Prolongation

1/4 1/4 1/2

1/2 1/2 1

1/4 1/4 1/2

H

ji

H

ji

H

ji

H

ji

h

ji

H

ji

H

ji

h

ji

H

ji

H

ji

h

ji

H

ji

h

ji

uuuuu

uuu

uuu

uu

1,11,,1,12,12

1,,12,2

,1,2,12

,2,2

4

1

2

1

2

1

12

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Algebraic Multigrid (AMG)

Method to solve linear systems based on multigrid principles, without

explicit knowledge of the problem geometry (only matrix coefficients)

Determines coarse “grids”, inter-grid transfer operators and the coarse grid

equations are exclusively based on the matrix entries

Two-grid algorithm:

1. Solve

2. Compute residual

3. Solve with

4. Correct

5. Solve

Prolongation: matrix

Restriction:

13

hhh ubuA

hhhhhh eAuAbr

H

T

HH rPeA

Hhh Peuu

hhh ubuA

PRAA hH

Hh

nnnnRRP hH ,:

R

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Agglomeration

14

Mavriplis D., Mani K., “Unstructured Mesh Solution Techniques using the NSU3D Solver”, AIAA Paper 2014-0081

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

Applications

Transonic flow around the M6 wing

M ∞ =0.8395

α ∞ =3.06ο

Re=11.72 106

Fine grid: ~67k nodes

Coarse grid: ~11k nodes

17

Lambropoulos N., “Multigrid techniques and parallel

processing for the numerical prediction of flowfields thtough

thermal turbomachines, using unstructured grids”, Phd

Thesis, NTUA, 2005 (in greek)

K.C. Giannakoglou, Parallel CFD & Optimization Unit, NTUA, Greece

References

18

Brandt A. “Multi-level Adaptive Solutions to Boundary Value Problems”

Mathematics of Computation, 31:333-390, 1977.

Brandt A. “Guide to Multigrid Development” 1984.

Hackbusch W., “Multigrid Methods and Applications” Springer – Verlag 1985.

Briggs W, Henson, V., McCormick S., “A Multigrid Tutorial”, 2nd edition, SIAM

publications 2000.