CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Whats the procedure for choosing tolerances in fvSolution? (http://www.cfd-online.com/Forums/openfoam-pre-processing/119360-whats-procedure-choosing-tolerances-fvsolution.html)

immortality June 15, 2013 11:08

Whats the procedure for choosing tolerances in fvSolution?
 
in sonicFoam/ras/prism the fvSolution is so:
Code:

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

solvers
{
    "rho.*"
    {
        solver          diagonal;
    }

    "p.*"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0;
    }

    "(U|e|R).*"
    {
        $p;
        tolerance      1e-05;
    }

    "(k|epsilon).*"
    {
        $p;
        tolerance      1e-08;
    }
}

PIMPLE
{
    nOuterCorrectors 2;
    nCorrectors      1;
    nNonOrthogonalCorrectors 0;
}

why U and e tolerances has chosen to be less than turbulent residuals?
and what's the general way to have a good selection of tolerances in fvSolution?

wyldckat June 15, 2013 12:55

Hi Ehsan,

Oddly enough, I think I know some parts to this question, although I'm in no way an expert on this topic, so I ask anyone who has more experience on this to fill in the gaps.

First of all, the OpenFOAM User Guide explains what the parameters "tolerance" and "relTolerance" are, in subsection "4.5.1.1 Solution tolerances": http://www.openfoam.org/docs/user/fv...-1190004.5.1.1

Secondly, since it's about "tolerance" you're asking about, as the User Guide indicates, refers to the target final residual for the equation solution, which should be the default option to be used for transient simulations.

As for values, it all depends on the level of accuracy your looking for. But in this case, I suspect it's because the original author doesn't want errors from the turbulence fields to introduce unwanted cumulative errors into the solution, since "U" and "p" are affected by the turbulence fields. Most likely, it's also due to this:
Code:

    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;

Both fields are solved only as 1st degree, so it's probably a good idea to have lower values of final residuals. :D

While for "U", tolerance of 1e-5 is "good enough". AFAIK, "U" and "p" should be at least below 1e-4, so 1e-5 is a good target value. And since (I think) they are solved with 2nd degree div schemes, lower values would be a time waster, unless you were dealing with micro-fluids or something like that (it's just a guess here!).

Best regards,
Bruno


All times are GMT -4. The time now is 23:58.