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/)
-   -   controlDict steady state (https://www.cfd-online.com/Forums/openfoam-solving/102585-controldict-steady-state.html)

CRT May 29, 2012 08:57

controlDict steady state
 
Hi,

I would like to know what is the meaning of : endTime and deltaT for a steady state case. Itīs confusing.
has it a relation with the max amount of iterations ?
is it necessary to have a endTime and a deltaT that let the simulation go on until a convergence is reached ?

Thanks a lot
Carles






Doug68 May 29, 2012 18:54

Hi CRT,

I've been trying to get a grip on the same thing, quoting from here

"Residual/Convergence Control
Solvers using the SIMPLE or PIMPLE algorithms now include convergence controls based on residuals of fields. The controls are specified through a residualControls sub-dictionary in the fvSolution file. The user specifies a tolerance for one or more solved fields and when the residual for every field falls below the corresponding residual, the simulation terminates. The following example sets tolerances for p, U and k and epsilon:"

So on the face of it, it looks as if the time settings need to be long enough for the residuals to resolve and then the simulation will stop at that point.

I've failed to make it work like that yet.

treima May 30, 2012 03:26

Hello,

Like you thought, endTime can be identified with the maximal amount of iterations. For problems, which donīt converge to a solution, the calculation would never stop.

deltaT is necessary, because OpenFoam have to choose, how often the problem is solved. For example, if you choose startTime 0, endTime 5000 and deltaT 5, you have 1000 iterations. Then you could take a look at your solution, if the convergence criterion is full filled.

In a mathematical approch, the time in a steady state problem can be seen as a "pseudo"-time. Your solution is independent of it, but you need it to solve your problem.

CRT May 30, 2012 09:18

Thanks both for the replay.

Quote:

So on the face of it, it looks as if the time settings need to be long enough for the residuals to resolve and then the simulation will stop at that point.
Thatīs true, so we should check if the tolerance in the solver "tolerance 1e-05" must be higher than the residual control. I mean. If you has a more limited criteria for the SIMPLE than the solver. It could be problematic.

Code:

solvers
{
    p
    {
        solver          PCG;
        tolerance      1e-05;
        relTol          0.001;
    maxIter        6000;
        preconditioner  DIC;
    }


    "(U|T|k|epsilon|R)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.001;
    maxIter        6000;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;

    residualControl
    {
        p          1e-7;
        U              1e-7;
        T              1e-7;
        "(k|epsilon|omega)" 1e-5;
    }
}

Quote:

if you choose startTime 0, endTime 5000 and deltaT 5, you have 1000 iterations.
Iīm think it doesnīt work in this way. Since one can watch the iterations counter
Code:

Time = 1
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 0.000936822, No Iterations 66
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 0.00094058, No Iterations 39

I think that, the solver works out equation after equation, until either a maximum number of iteration is done ( 1000 if the user donīt set maxIter ) or reach a value under the previous specified residual (solver tolerance).
the deltaT is used to show how the residuals are going forward and also how you said, to guarantee that the program can do all the iterations that need to get a result, result under the SIMPLEīs condition
Code:

residualControl
    {
        p          1e-7;
        U              1e-7;
        T              1e-7;
        "(k|epsilon|omega)" 1e-5;
    }


flowAlways October 15, 2014 08:10

Understanding Steady State
 
For steady state cases the time step deltaT should be set to 1
since for steady state its role is effectively that of an iteration counter.
source http://www.foamcfd.org/Nabla/guides/ProgrammersGuidese13.html

My Conclusions
For Steady State we use SIMPLE Algorithm which is essentially a guess and correct procedure for the calculation of pressure. So each time step involves a new guess followed by solving a linear system(to obtain the corrections).

Code:

startTime      0;
stopAt          endTime;
endTime        10000;
deltaT          1;

solvers
{  p tolerance 1e-06;
    U|k|epsilon|R|nuTilda tolerance 1e-05;
}

SIMPLE
{
    p 1e-2;
    U 1e-3;
    k|epsilon|omega 1e-3;
}

The above setting would essentially mean we repeat the guess-correct procedure 10000 times.
However the main stopping criteria is the tolerance 1e-02 for p, 1e-03 for U ..etc.
The simple algorithm would run until the above tolerance is achieved for each of p, U etc or the limit of 10000 is reached(which would essentially mean no convergence).

The tolerance for the solver is not really important and the values specified above(taken from pitzDaily simpleFoam tutorial) are good enough. There is no point considering smaller tolerance say 1e-08 because we are trying to obtain corrections for pressure with guessed starting values.

Some Observations(with a furnace geometry similar to pitzDaily but with a much refined mesh)
p 1e-3, U 1e-2; k|epsilon|omega 1e-2;
SIMPLE solution converged in 1572 iterations

p 1e-2, U 1e-1; k|epsilon|omega 1e-1;
SIMPLE solution converged in 281 iterations

p 1e-6, U 1e-5; k|epsilon|omega 1e-5;
SIMPLE solution did not converge even after 10000 iterations.

p 1e-5, U 1e-1; k|epsilon|omega 1e-1;
SIMPLE solution converged in 8910 iterations

Code:

smoothSolver:  Solving for Ux, Initial residual = 2.76007e-06, Final residual = 2.76007e-06, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 8.51021e-06, Final residual = 8.51021e-06, No Iterations 0
GAMG:  Solving for p, Initial residual = 9.7978e-06, Final residual = 8.63712e-07, No Iterations 2
time step continuity errors : sum local = 3.83861e-07, global = -6.94709e-10, cumulative = 0.00612712
smoothSolver:  Solving for epsilon, Initial residual = 9.99271e-06, Final residual = 9.99271e-06, No Iterations 0
smoothSolver:  Solving for k, Initial residual = 9.86906e-06, Final residual = 9.86906e-06, No Iterations 0
ExecutionTime = 2808.42 s  ClockTime = 2818 s

Note: GAMG: Solving for p, Initial residual = 9.7978e-06 is the one that has to be monitored for the tolerance limit.
The Final Residual shows the local improvement.
For Ex Convergence after step 9000 would imply the sequence IR9001 ~ FR9001 ~ IR9002 ~ FR9002 ....

Please email me at a.h.kadar@student.tudelft.nl if you doubt or find the above conclusions wrong.


All times are GMT -4. The time now is 21:13.