CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

residual in OpenFOAM and Fluent

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 6, 2022, 22:31
Question residual in OpenFOAM and Fluent
  #1
Senior Member
 
-
Join Date: Oct 2021
Location: -
Posts: 139
Rep Power: 5
FluidKo is on a distinguished road
Dear OpenFOAMers.
As I know, residual in Fluent means difference between left hand side and right hand side of 3 Momentum equations and 1 continuity equation(If we adopt turbulence model, then turbulence quantity).

In OpenFOAM, as we can see from fvSolution file, criteria of residual is written at solvers(final residual is written that determines whether outer iteration is going to be carried out or not) and residualControl(initial residual is written that determines whether inner iteration is going to be carried out or not).
(By the way, is it right? I can't make sure that I understand well.)

Well, when we see fvSolution file in OpenFOAM criteria of residual is written as physical quantity for instance p, U, k, epsolon. Below is code in fvSolution.
Code:
solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-06;
        relTol          0.05;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    "(U|k|epsilon|omega|R|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0;
    }

    "(U|k|epsilon|omega|R|nuTilda)Final"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0;
    }

}


PIMPLE
{
    nNonOrthogonalCorrectors 2;
    nCorrectors          3;
    nOuterCorrectors    1000;

    residualControl
    {
        U
        {
                tolerance  1e-5;
                relTol      0;
        }
        p
        {
                tolerance  5e-4;
                relTol      0;
        }
     }

}


relaxationFactors
{
    fields
    {
        p      0.4;
        pFinal   1;
    }
    equations
    {
        "(U|k|epsilon|omega|R|nuTilda)"     0.4;
        "(U|k|epsilon|omega|R|nuTilda)Final"   1;
    }
}
Among this code

Code:
solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-06;
        relTol          0.05;
    }
Code:
    "(U|k|epsilon|omega|R|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0;
    }
Code:
    residualControl
    {
        U
        {
                tolerance  1e-5;
                relTol      0;
        }
        p
        {
                tolerance  5e-4;
                relTol      0;
        }
     }
These codes are representing criteria of residual but they are expressed by physical quantity.
But in Fluent, as we can see from uploaded picture, residual is expressed by 3 Momentum equations and 1 continuity equation.
So it looks like they are not same.

In my opinion, upper codes have relation to equations.
I think p is related to inner iteration because inner iteration is pressure correction.
And also I think U is related to outer iteration because outer iteration is momentum prediction.
But I'm not sure whether it is right or not.
If I'm wrong, what is truth?
Thank you~!

PS: Must both initial residual and final residual are satisfied for convergence? I can't make sure. If both must be satisfied, then why initial residual must be satisfied also? I think only final residual is matter.
Attached Images
File Type: gif img217.gif (32.5 KB, 40 views)
FluidKo is offline   Reply With Quote

Old   October 9, 2022, 06:34
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
I think that you are confusing a number of issues here, and that you probably need to read up a little more on the subject - perhaps try https://doc.cfd.direct/notes/cfd-gen...ative-solution

The tolerance settings in fvSolution.solvers.<variable> are the convergence tolerance for the solver for that variable ... i.e. they tell the solver when to stop iterating on the solution (when the residual falls below the tolerance, or hits the limit on number of iterations). The name for these iterations varies - "sweeps", "inner iterations" - whatever.

The pressure corrector iterations are something entirely different - with the PIMPLE algorithm you can run a number of pressure corrector stages, again until it either hits an iteration limit or hits a convergence criterion. These are sometimes called "outer" iterations.

The residualControl settings are used to determine when convergence of the solution has been obtained, and refer to the initial residual I believe (i.e. the value of the residual at the start of the set of inner iterations).

That's just a high level overview - I recommend reading up more, and remember that the residuals are normalised, and that this normalisation method often varies between different CFD codes.
FluidKo likes this.
Tobermory is offline   Reply With Quote

Old   October 10, 2022, 03:11
Question
  #3
Senior Member
 
-
Join Date: Oct 2021
Location: -
Posts: 139
Rep Power: 5
FluidKo is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
I think that you are confusing a number of issues here, and that you probably need to read up a little more on the subject - perhaps try https://doc.cfd.direct/notes/cfd-gen...ative-solution

The tolerance settings in fvSolution.solvers.<variable> are the convergence tolerance for the solver for that variable ... i.e. they tell the solver when to stop iterating on the solution (when the residual falls below the tolerance, or hits the limit on number of iterations). The name for these iterations varies - "sweeps", "inner iterations" - whatever.

The pressure corrector iterations are something entirely different - with the PIMPLE algorithm you can run a number of pressure corrector stages, again until it either hits an iteration limit or hits a convergence criterion. These are sometimes called "outer" iterations.

The residualControl settings are used to determine when convergence of the solution has been obtained, and refer to the initial residual I believe (i.e. the value of the residual at the start of the set of inner iterations).

That's just a high level overview - I recommend reading up more, and remember that the residuals are normalised, and that this normalisation method often varies between different CFD codes.
But in below video
https://youtu.be/ahdW5TKacok?t=1237
He is saying that outer corrector means that start from momentum predictor and inner corrector means that start from pressure corrector.
I'm confused.
Thank you.
FluidKo is offline   Reply With Quote

Old   October 10, 2022, 12:41
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
Yes - apologies - I wrote the last post in a hurry, and the part about outer iterations was wrong. The best picture is probably in:

(https://doc.cfd.direct/notes/cfd-gen...mple-algorithm)

The PIMPLE loop, or "outer iteration" in OpenFOAM terminology, does a full update of both the momentum and pressure fields, based on the previous PIMPLE iteration values. The PISO loop is just performing additional pressure correction updates. Some call these latter "inner iterations", but I have also seen that term used for the linear solver iterations.

Regardless, hopefully you are clear on what the solver settings in fvSolution dop now? Good luck.

PS If you really want to understand the mechanics behind pressure-corrector algorithms, I can strongly recommend the book by Ferziger & Peric.
Tobermory is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Here! nan value error mgkid3310 OpenFOAM Running, Solving & CFD 1 October 6, 2016 01:59
Question on transient simulation in OpenFOAM and FLUENT nicklj OpenFOAM Running, Solving & CFD 4 May 8, 2014 23:30
Omega goes infinity callumso OpenFOAM Running, Solving & CFD 5 October 2, 2013 08:52
porousSimpleFoam - crash Sebaj OpenFOAM 2 January 4, 2012 17:16
pipe flow with heat transfer Fabian OpenFOAM 2 December 12, 2009 05:53


All times are GMT -4. The time now is 04:43.