OpenFOAMs basic solvers for linear systems of equations Solvers, - - PowerPoint PPT Presentation

openfoam s basic solvers for linear systems of equations
SMART_READER_LITE
LIVE PREVIEW

OpenFOAMs basic solvers for linear systems of equations Solvers, - - PowerPoint PPT Presentation

Tim Behrens OpenFOAMs basic solvers for linear systems of equations Solvers, preconditioners, smoothers Linear Solvers in OpenFOAM 1 Tim Behrens What are we going to do? Look at the structure of lduMatrix Compare DIC/FDIC


slide-1
SLIDE 1

Linear Solvers in OpenFOAM 1

OpenFOAM’s basic solvers for linear systems of equations

Tim Behrens

Solvers, preconditioners, smoothers

slide-2
SLIDE 2

Linear Solvers in OpenFOAM 2

What are we going to do?

Tim Behrens

  • Look at the structure of lduMatrix
  • Compare DIC/FDIC preconditioner
  • Set up a multi grid solver
slide-3
SLIDE 3

Linear Solvers in OpenFOAM 3

$FOAM SRC/OpenFOAM/matrices/lduMatrix/

Tim Behrens

  • lduAddressing/
  • lduMatrix/
  • preconditioners/
  • smoothers/
  • solvers/
slide-4
SLIDE 4

Linear Solvers in OpenFOAM 4

$FOAM SRC/OpenFOAM/matrices/lduMatrix/solvers

Tim Behrens

  • diagonalSolver - diagonal solver for both symmetric and asymmetric problems
  • GAMG - Geometric agglomerated algebraic multigrid solver
  • PBiCG - Preconditioned bi-conjugate gradient solver for asymmetric lduMatrices using a

run-time selectable preconditioner

  • PCG - Preconditioned conjugate gradient solver for symmetric lduMatrices using a run-

time selectable preconditiioner

  • smoothSolver - Iterative solver using smoother for symmetric and asymmetric matrices

which uses a run-time selected smoother BICCG, ICCG obsolete

slide-5
SLIDE 5

Linear Solvers in OpenFOAM 5

$FOAM SRC/OpenFOAM/matrices/lduMatrix/solvers

Tim Behrens

For description of the other folders and more information see the report. There is also an example of implementing your own version of the PBiCG solver myPBiCG.

slide-6
SLIDE 6

Linear Solvers in OpenFOAM 6

Preconditioner test

Tim Behrens

Copy cavity test case and change directory: cp -r $FOAM_TUTORIALS/icoFoam/cavity $FOAM_RUN/cavity cd $FOAM_RUN/cavity

slide-7
SLIDE 7

Linear Solvers in OpenFOAM 7

Preconditioner test

Tim Behrens

Change blockMeshDict: blocks ( hex (0 1 2 3 4 5 6 7) (150 150 1) simpleGrading (1 1 1) ); Generate mesh blockMesh

slide-8
SLIDE 8

Linear Solvers in OpenFOAM 8

Preconditioner test

Tim Behrens

Change the controlDict to: endTime 0.4; deltaT 0.005; writeControl timeStep; writeInterval 20; and run icoFoam icoFoam > logDIC &

slide-9
SLIDE 9

Linear Solvers in OpenFOAM 9

Preconditioner test

Tim Behrens

Now changing DIC to FDIC in fvSolution file preconditioner FDIC; and running icoFoam icoFoam > logFDIC & Compare run-time (Execution time in log files), difference in percentage?

slide-10
SLIDE 10

Linear Solvers in OpenFOAM 10

Generalised geometric-algebraic multi-grid

Tim Behrens

Look at some GAMG options

preconditioner select preconditioner mergeLevels 1/2/3, coarsen levels faster, for simple geometric grids; smoother select smoother (GaussSeidel recommended) agglomerator faceAreaPair (recommended) or algebraicPair; nCellsInCoarsestLevel number of cells the coarse level solver has to calculate (important!) Table 1: GAMG options

slide-11
SLIDE 11

Linear Solvers in OpenFOAM 11

Generalised geometric-algebraic multi-grid

Tim Behrens

Change the fvSolution to: p GAMG { preconditioner FDIC; mergeLevels 1; smoother GaussSeidel; agglomerator faceAreaPair; nCellsInCoarsestLevel 100; tolerance 1e-05; relTol 0; };

slide-12
SLIDE 12

Linear Solvers in OpenFOAM 12

Generalised geometric-algebraic multi-grid

Tim Behrens

Change the fvSolution to: U GAMG { preconditioner DILU; mergeLevels 1; smoother GaussSeidel; agglomerator faceAreaPair; nCellsInCoarsestLevel 100; tolerance 1e-05; relTol 0; };

slide-13
SLIDE 13

Linear Solvers in OpenFOAM 13

Generalised geometric-algebraic multi-grid

Tim Behrens

and running icoFoam icoFoam > logGAMG & Speed-up compared to same calculation with PCG/PBiCG: about 3 times faster

slide-14
SLIDE 14

Linear Solvers in OpenFOAM 14

Thank you for your attention

Tim Behrens

Questions?