Find answers, ask questions, and connect with our <br>community around the world.

Home Forums OpenFOAM Forum Solution Stopping criteria

  • Solution Stopping criteria

    Posted by zeinababosedaira on February 25, 2022 at 9:58 am

    Hello all,
    I hope you’re doing great. I have a question when I was walking through the fvSolution folder. It’s that I noticed that each property, i.e., p, U, phi, etc. has its own tolerance and relative tolerance. So my question is whether the solution stops if any of these properties reached their tolerance or reltol, or it’s programmed somewhere in OpenFOAM to terminate if all the minimum tolerance is achieved.
    To sum up my question, I am asking whether there is an AND relation between all the tolerances or an OR relation between them.
    Thank you! Have a good day.

    zeinababosedaira replied 2 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Barış Bicer

    Moderator
    March 2, 2022 at 7:20 am

    Hi Zeinab,

    Thank you for your question.

    First of all, almost all OpenFOAM solvers are segregated solvers which means that equations are solved separately one by one. Thats why we have to define and declare tolerance value for each parameter. So if a tolerance value is reached to smaller than given value for any parameters that equation is not solved anymore.

    For example if we look at the fvSolution of cavity case : it looks as below:

    solvers
    {
    p
    {
    solver PCG;
    preconditioner DIC;
    tolerance 1e-06;
    relTol 0.05;
    }

    pFinal
    {
    $p;
    relTol 0;
    }

    U
    {
    solver smoothSolver;
    smoother symGaussSeidel;
    tolerance 1e-05;
    relTol 0;
    }
    }

    PISO
    {
    nCorrectors 2;

    when we look at the log file of last steps it is seen as below:

    Time = 1

    Courant Number mean: 0.222159 max: 0.852134
    smoothSolver: Solving for Ux, Initial residual = 2.58804e-08, Final residual = 2.58804e-08, No Iterations 0
    smoothSolver: Solving for Uy, Initial residual = 6.1466e-08, Final residual = 6.1466e-08, No Iterations 0
    DICPCG: Solving for p, Initial residual = 8.23011e-07, Final residual = 8.23011e-07, No Iterations 0
    time step continuity errors : sum local = 8.23402e-09, global = -2.52952e-19, cumulative = 7.67715e-18
    DICPCG: Solving for p, Initial residual = 1.01439e-06, Final residual = 2.01785e-07, No Iterations 1
    time step continuity errors : sum local = 3.13812e-09, global = 7.74406e-19, cumulative = 8.45155e-18
    ExecutionTime = 0.25 s ClockTime = 0 s

    End

    What does it mean that? For Ux and Uy tolerance is given 1e-5, so when we look at log file above inital residual is around 2.58804e-08 which is more less than given tolerance thats why it shows no iteration 0 anymore. Since the initial residual is less than given tolerance U equation is not solved anymore. On the other hand for P tolerance is set to 1e-6 where initial tolerance is around 8.23011e-07 that is smaller than given tolerance so there is no iteration again.

    As summary the given tolerance for each parameter does not have any relation such as neither AND nor OR… each parameters works independently.

    I hope that it addresses your questions.

    Best.

    Barış

  • zeinababosedaira

    Member
    March 3, 2022 at 10:22 am

    Hello Dr. Baris,
    Yess thank you. It’s more clear now.

Log in to reply.

error: Content is protected !!