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/)
-   -   Final residual greater than initial residual? (https://www.cfd-online.com/Forums/openfoam-solving/85572-final-residual-greater-than-initial-residual.html)

jsumner March 1, 2011 17:11

Final residual greater than initial residual?
 
Hi Foamers,

I have a small question regarding residuals. I am simulating a fairly straightforward problem involving steady turbulent 2D flow over a uniformly rough surface with simpleFoam in 1.6.x and (until recently) everything has gone quite smoothly. I noticed however that at times the final residual for pressure is actually higher than the initial residual and I'm at a loss to explain this (e.g. see below).

Some background: p boundary conditions are all zeroGradient with pRefValue = 0 at cell 0. The inflow is specified for U, k and epsilon, while a fully-developed condition is imposed at the outflow. Wall functions are used at the ground to account for roughness and the top boundary uses gradient conditions for all variables.

The solver for p is PCG and the problem arises whether I use DIC as a preconditioner or none.

Is there a simple explanation?

Cheers!

Time = 1

smoothSolver: Solving for Ux, Initial residual = 7.90254290629e-05, Final residual = 3.32026131229e-09, No Iterations 5
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 4.4404448664e-05, No Iterations 9
nonePCG: Solving for p, Initial residual = 1, Final residual = 4.9598800533, No Iterations 1001
time step continuity errors : sum local = 6.3448224793e-07, global = 1.04228638311e-18, cumulative = 1.04228638311e-18
DILUPBiCG: Solving for epsilon, Initial residual = 0.000112521219714, Final residual = 1.27922932979e-09, No Iterations 2
DILUPBiCG: Solving for k, Initial residual = 0.99999631519, Final residual = 2.73840262525e-05, No Iterations 2
ExecutionTime = 145.33 s ClockTime = 146 s

Time = 2

smoothSolver: Solving for Ux, Initial residual = 2.31445762334e-05, Final residual = 1.48861023313e-09, No Iterations 11
smoothSolver: Solving for Uz, Initial residual = 0.455262029033, Final residual = 3.72189398375e-05, No Iterations 14
nonePCG: Solving for p, Initial residual = 0.782162017916, Final residual = 2.42606552396, No Iterations 1001
time step continuity errors : sum local = 1.38148040504e-06, global = 2.0904130329e-19, cumulative = 1.2513276864e-18
DILUPBiCG: Solving for epsilon, Initial residual = 0.00016588809383, Final residual = 1.64560143453e-09, No Iterations 2
DILUPBiCG: Solving for k, Initial residual = 0.0173546654105, Final residual = 1.06423155388e-06, No Iterations 2
ExecutionTime = 262.33 s ClockTime = 264 s

...

Chris Lucas March 2, 2011 03:08

Hi,

there is a problem in your simulation. The final residual is greater than the initial residual because the linear (iterative) solver is diverging and can’t find a solution.



Regards,
Christian

jsumner March 2, 2011 08:19

Updated settings in fvSolution
 
Switching the linear solver for p to GAMG seems to have solved the problem.
Code:

p
    {
        solver                    GAMG;
        preconditioner            FDIC;
        smoother                DICGaussSeidel;
        mergeLevels                1;
        agglomerator            faceAreaPair;
        nCellsInCoarsestLevel    100;
        tolerance                0;
        relTol                    1e-4;
    };

With the added benefit that the simulation runs much faster :)


All times are GMT -4. The time now is 20:27.