CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   AMG as preconditioner (http://www.cfd-online.com/Forums/openfoam-solving/97748-amg-preconditioner.html)

HaZe February 23, 2012 06:54

AMG as preconditioner
 
Hi,

after my first Problems with AMG as solver, I'm trying to use AMG as preconditioner like in the papers [1] and [2] from Hrv.

For GAMG as solver with preconditioner AMG it works well (I did this for proof of concept, if AMG as preconditioner works in my OF installation).

But it doesn't work with CG-methods.
This is my ./system/fvSolution:

Code:

solvers
{
        "(omega|rho|U|Yi|hs|k|epsilon)"
        {
        solver PBiCG;
       
        tolerance 1e-6;
        relTol    0;

        minIter 0;
        maxIter 1000;


                preconditioner
                {     
                        preconditioner AMG; 
                        cycle W-cycle;

                        nMaxLevels 100;
                        scale off;
                        policy AAMG;
                        groupSize 4;
                        minCoarseEqns 20;
                        smoother GaussSeidel;
                        nPreSweeps 2;
                        nPostSweeps 2;

                        scaleCorrection true;
                        directSolveCoarsest false;
                        cacheAgglomeration true;
                        nCellsInCoarsestLevel 10;
                        agglomerator faceAreaPair;
                        mergeLevels 1;
                }
        }


        p
        {
        solver PCG;

        tolerance 1e-9;
        relTol    0;

        minIter 0;
        maxIter 1000;

        preconditioner
                {     
                        preconditioner AMG;           
                        cycle W-cycle;
                        nMaxLevels 100;
                        scale off;
                        policy AAMG;
                        groupSize 4;
                        minCoarseEqns 20;
                        smoother GaussSeidel;
                        nPreSweeps 2;
                        nPostSweeps 2;
                       
                        scaleCorrection true;
                        directSolveCoarsest false;
                        cacheAgglomeration true;
                        nCellsInCoarsestLevel 10;
                        agglomerator faceAreaPair;
                        mergeLevels 1;
                }
        }
}
 
PISO
{
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
}

And the resulting error message:

Code:

Creating field DpDt

Courant Number mean: 2.98621e-05 max: 0.0562667 velocity magnitude: 42.2

Starting time loop

Courant Number mean: 5.30599e-05 max: 0.0999763 velocity magnitude: 42.2
deltaT = 1.77683e-05
Time = 1.77683e-05

Solving chemistry
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
[0] [1]
[1]
[1] --> FOAM FATAL ERROR:
[1] Not implemented[2]
[2]
[2] --> FOAM FATAL ERROR:
[2] Not implemented
[2]
[2]    From function AMG::preconditionT(scalarField& wT, const scalarField& rT, const direction cmpt)
[2] [3]
[3]
[3] --> FOAM FATAL ERROR:
[3] Not implemented
[3]
[3]    From function AMG::preconditionT(scalarField& wT, const scalarField& rT, const direction cmpt)
[3]    in file /build/buildd/openfoam-1.6-ext-1.6.0/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/lduMatrix.H at line
[1]
[1]    From function AMG::preconditionT(scalarField& wT, const scalarField& rT, const direction cmpt)
[1]    in file /build/buildd/openfoam-1.6-ext-1.6.0/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/lduMatrix.H at line 725.
[1]
FOAM parallel run aborting
[1]
    in file /build/buildd/openfoam-1.6-ext-1.6.0/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/lduMatrix.H at line 725.
[2]
FOAM parallel run aborting
[2]

What does this mean? Am I not able to use AMG preconditioning for PCG and PBiCG solvers? But why does it work then for GAMG? I'm using OF1.6ext.

The "banana" test for getting the available preconditioners, shows me AMG among others.

I hope somebody can help me with this.

Greetings,
HaZe.

alberto February 24, 2012 03:32

You should be able to use it with the PCG solver only. In OpenFOAM 2.1.x the syntax is

Code:

   
    p
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance      1e-08;
            relTol          0;
            smoother        DICGaussSeidel;
            nPreSweeps      0;
            nPostSweeps    2;
            nFinestSweeps  2;
            cacheAgglomeration false;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels    1;
        }
        tolerance      1e-08;
        relTol          0;
        maxIter        100;
    }

With PBiCG you can use the DILU preconditioner.

Best,

HaZe February 24, 2012 04:07

Quote:

Originally Posted by alberto (Post 346064)
You should be able to use it with the PCG solver only. In OpenFOAM 2.1.x the syntax is ...

With PBiCG you can use the DILU preconditioner.

Best,

Ok I will try this. But what's the problem with using PBiCG together with AMG as preconditioner? Is it a mathematical issue or just a matter of OF implementation? I thought long about it and searched for answers even more time but I didn't find any.

And another issue: you wrote I should use "GAMG" for preconditioning. Is it really the same as "AMG"? I always thought "GAMG" is just an improvement of the old "amgSolver" in OF 1.5 and "AMG" a completely new implementation.

It would be very nice for me to know the differences between all three of them. Has anyone any sources for that?

alberto February 24, 2012 04:31

Quote:

Originally Posted by HaZe (Post 346075)
Ok I will try this. But what's the problem with using PBiCG together with AMG as preconditioner? Is it a mathematical issue or just a matter of OF implementation? I thought long about it and searched for answers even more time but I didn't find any.

The structure of the matrix is different, and the GAMG implementation only manages one type. It seems to make sense to me, since GAMG is typically used for the pressure equation.

Quote:

And another issue: you wrote I should use "GAMG" for preconditioning. Is it really the same as "AMG"? I always thought "GAMG" is just an improvement of the old "amgSolver" in OF 1.5 and "AMG" a completely new implementation.
I don't know the details of what has been implemented in -extend, since I use the Foundation release from SGI/OpenCFD.

Best,


All times are GMT -4. The time now is 12:10.