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/)
-   -   fvSchemes, Fina residual tolerance not working (https://www.cfd-online.com/Forums/openfoam-solving/98729-fvschemes-fina-residual-tolerance-not-working.html)

Attesz March 17, 2012 09:55

fvSchemes, Fina residual tolerance not working
 
Hi all,

if I set the final residual tolerances, finally the solver doesn't reach the prescribed level. However, if I adjust the tolerance/reltol in the simple U/p etc. it can reach whatever I want. Is it a bug maybe?

Code:

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

solvers
{
    pcorr
    {
        solver          GAMG;
        tolerance      1e-2;
        relTol          0;
        smoother        DICGaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10000;
        agglomerator    faceAreaPair;
        mergeLevels    1;
        maxIter        10;
    }

    p
    {
        $pcorr;
        tolerance      1e-5;
        relTol          0.01;
    }

    pFinal
    {
        $p;
        tolerance      1e-8;
        relTol          0;
    }

   
//parameters for k-omega model
 
    U
    {
        solver          GAMG;
        smoother        DILUGaussSeidel;
    nPreSweeps      0;
        nPostSweeps      2;
        tolerance        1e-4;
        relTol          0;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10000;
        agglomerator    faceAreaPair;
        mergeLevels    1;
        maxIter        5;
    }

    k
    {
        solver          GAMG;
        smoother        DILUGaussSeidel;
    nPreSweeps      0;
        nPostSweeps      2;
        tolerance        1e-4;
        relTol          0;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10000;
        agglomerator    faceAreaPair;
        mergeLevels    1;
        maxIter        5;
    }

    omega
    {
        solver          GAMG;
        smoother        DILUGaussSeidel;
    nPreSweeps      0;
        nPostSweeps      2;
        tolerance        1e-4;
        relTol          0;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10000;
        agglomerator    faceAreaPair;
        mergeLevels    1;
        maxIter        5;
    }
     
    "(U|k|omega)Final"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-8;
        relTol          0;
    }

}


SIMPLE
{
    nNonOrthogonalCorrectors 5;        //because the mesh is highly not orthogonal. maximum 20, 0 is cartesian hexahedral!
    pRefCell        0;
    pRefValue      0;
    residualControl
    {
        p              1e-4;
        U              1e-4;
        "(k|epsilon|omega)" 1e-4;
    }

}

potentialFlow
{
nNonOrthogonalCorrectors 10;
}

relaxationFactors
{
    fields
    {
        p              0.3;
    }
    equations
    {
        U  0.7;
    k  0.5;
    omega  0.5;
    }
}



// ************************************************************************* //


marupio March 17, 2012 16:26

Try prescribing something nonesensical in pFinal to see if it's actually even reading it. e.g. tolerance banana;

alberto March 18, 2012 20:21

I see where your confusion can come from. The SIMPLE algorithm does not have any "final" iteration, so the pFinal entry won't be read. The "Final" entries are only used in solvers based on the PIMPLE algorithm, where indeed each integration (time or pseudo-time) step has more than one iteration. In short, the linear solver will give you the final residual you require in "p".

Also, please note that if tolerance is too small, the linear solver will stop at 1000 iterations by default (you can change this value). If you set a high tolerance (say 1.0e-2), the solver will stop at the first iteration below that value, so it would not surprise me if that would be smaller (say something like 0.004).

P.S. I am not so sure it's convenient to use GAMG on anything but p. For steady-state solutions, smoothSolver seems to work better for me.

Best,

Attesz March 20, 2012 03:26

Alberto, thanks for your comments. Indeed, I didn't see any pFinal nor GAMG for U in tutorial MRFSimpleFoam cases and on the Wiki.

Have a nice day,
Attila


All times are GMT -4. The time now is 20:17.