CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Large number of iterations using PCG in pressure equation (https://www.cfd-online.com/Forums/openfoam-solving/162115-large-number-iterations-using-pcg-pressure-equation.html)

mgg November 3, 2015 16:28

Large number of iterations using PCG in pressure equation
 
I am running a DNS case using buoyantPimpleFoam (OF V2.4). The case is a long pipe with an inlet and outlet. The fluid is air. Inlet Re is about 5400.

For getting better scalability, I use PCG for pressure equation. If I use perfect gas equation of state, the number of iterations will be around 100, which is acceptable. If I use icopolynom or rhoConst to describe the density, the number of iterations will be around 4000! If I use GAMG for p equation, number of iteration will be under 5, but the scalability is poor with above 500 cores. Does anyone has any opinion?

How can I improve PCG solver to decrease the number of iterations? Thank you.

fvSchemes
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.2                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        backward;//CrankNicolson 1.0;//
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss linear;//midPoint;//
    div(phi,h)      Gauss QUICK phi;//
    div(phi,e)      Gauss linear;
    div(phi,K)      Gauss linear;
    div(phi,epsilon) Gauss linear;
    div(phi,R)      Gauss linear;
    div(phi,Ekp)    Gauss linear;
    div(R)          Gauss linear;
    div((muEff*dev2(T(grad(U))))) Gauss linear;// corrected;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;//skewCorrected;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p_rgh;
}

fvSolution

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.2                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "rho.*"
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      0;
        relTol          0;
    }

      p_rgh
    {       
        solver          PCG;
        preconditioner  DIC;
        tolerance        1e-07;
        relTol          0.01;
        maxIter          4000;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    "(U|h|e|k|epsilon|R)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-8;
        relTol          0.01;
    }

    "(U|h|e|k|epsilon|R)Final"
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 1;
    nCorrectors    3;
    nNonOrthogonalCorrectors 0;



}


RodriguezFatz November 5, 2015 07:12

Did you try the obvious things such as trying a different preconditioner?

mgg November 5, 2015 12:55

Yes, I did. I tried GAMG as preconditioner but this leads to a bad scalability. I found that the PCG solver can decrease the residual to about 1e-5 within about 100 iterations. But from computation of residual from 1e-5 to 1e-7 costs several thound time of iterations. Adding number of correctors does not work.

I also tried different different BC on the wall like simple zeroGradient, but it does not bring anything.

I also tried different schemes in fvschemes e.g. backward/Crank Nicolson for time, and so on.

Quote:

Originally Posted by RodriguezFatz (Post 572022)
Did you try the obvious things such as trying a different preconditioner?


calf.Z January 8, 2019 02:23

I am also interested in this topic, any suggestion is highly appreciated.


All times are GMT -4. The time now is 14:07.