CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Convergence/Residuals Ending (http://www.cfd-online.com/Forums/openfoam-solving/113085-convergence-residuals-ending.html)

VSass February 12, 2013 05:10

Convergence/Residuals Ending
 
Is there any way to stop automatically the solution when our variables reach convergence?

For example, given only your dT and not endTime, the solution stops when it reaches convergence.

Thanks

sfigato February 12, 2013 05:19

Hi,

you can add to your fvSolution file the following lines;

Quote:

SIMPLE
{
nNonOrthogonalCorrectors 0;

residualControl
{
p 1e-5;
U 1e-5;
"(k|epsilon|omega)" 1e-7;
}
}
So, it will stop once reach the written tolerance!

Regards
Marco

VSass February 12, 2013 05:53

Thanks man!

VSass March 4, 2013 11:41

Marco,

i had problems in controlling the residuals using icoFoam. I added the lines you suggested but nothing happens.

solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-04;
relTol 0;
}

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
}

PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;

residualControl
{
p 1e-3;
U 1e-3;
}
}

I put 1e-03 to check the case and i plot initial residuals on-the-fly. Both u and p pass this limit but the solution continues, it doesn't stop.

(I use OpenFoam 2.1.1)

sfigato March 4, 2013 11:47

Hi,

do you wanna simulate a steady or a transient simulation?
icoFoam solver is inherently transient! So it does not make sense to stop the solution to a steady state!

Regards
Marco

VSass March 4, 2013 12:42

I'm studying the flow over a sphere using icoFoam, which has a transient part 'till the distribution around the sphere reaches a "steady-state", meaning it doesn't change no matter how much time passes from there on.

So, now that i know that ,when my initial residuals have reached e.g. 1e-05 for p, my solution has converged and i don't need to have it running any more, i want it to stop automatically when reaching this values.

Thanks for all your replies,really

Mehrez June 3, 2014 06:53

Quote:

Originally Posted by VSass (Post 411428)
I'm studying the flow over a sphere using icoFoam, which has a transient part 'till the distribution around the sphere reaches a "steady-state", meaning it doesn't change no matter how much time passes from there on.

So, now that i know that ,when my initial residuals have reached e.g. 1e-05 for p, my solution has converged and i don't need to have it running any more, i want it to stop automatically when reaching this values.

Thanks for all your replies,really

Hi dear VSass,
Did you solve your problem ?
I'm trying to do the same thing.
Thank you

VSass June 14, 2014 05:48

Hello Mehrez,

as said above you should add the following lines in fvSolution.

residualControl
{
p 1e-06;
U 1e-06;
}

However, I would recommend this approach only in cases where you know for sure that the flow field is fully developed and no other alteration is going to occur. This comes with experience.

Kind regards


All times are GMT -4. The time now is 14:47.