# question in transient simulation residual control

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 7, 2020, 11:53 question in transient simulation residual control #1 Member     Junting Chen Join Date: Feb 2016 Location: Ontario Canada Posts: 37 Rep Power: 10 Hello, I am running a transient simulation in pimple mode. The output message looks like this: PIMPLE: iteration 1 smoothSolver: Solving for Ux, Initial residual = 0.000440701, Final residual = 4.72948e-07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.00289414, Final residual = 3.24e-06, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.00359891, Final residual = 4.18849e-06, No Iterations 1 GAMG: Solving for p, Initial residual = 0.0437064, Final residual = 0.000168448, No Iterations 3 time step continuity errors : sum local = 3.08156e-09, global = 1.22026e-11, cumulative = 3.97829e-08 GAMG: Solving for p, Initial residual = 0.00118827, Final residual = 1.07359e-05, No Iterations 13 time step continuity errors : sum local = 1.91293e-10, global = 7.26332e-13, cumulative = 3.97836e-08 PIMPLE: iteration 2 smoothSolver: Solving for Ux, Initial residual = 1.38144e-06, Final residual = 1.38144e-06, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 7.85471e-06, Final residual = 7.85471e-06, No Iterations 0 smoothSolver: Solving for Uz, Initial residual = 9.58205e-06, Final residual = 9.58205e-06, No Iterations 0 GAMG: Solving for p, Initial residual = 0.00719454, Final residual = 4.54821e-05, No Iterations 3 time step continuity errors : sum local = 8.11247e-10, global = 3.20639e-12, cumulative = 3.97868e-08 GAMG: Solving for p, Initial residual = 0.000324782, Final residual = 3.15394e-06, No Iterations 11 time step continuity errors : sum local = 5.62928e-11, global = 2.55802e-13, cumulative = 3.97871e-08 PIMPLE: iteration 3 smoothSolver: Solving for Ux, Initial residual = 1.14465e-08, Final residual = 1.14465e-08, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 7.12225e-08, Final residual = 7.12225e-08, No Iterations 0 smoothSolver: Solving for Uz, Initial residual = 8.70611e-08, Final residual = 8.70611e-08, No Iterations 0 GAMG: Solving for p, Initial residual = 0.000141656, Final residual = 1.29472e-06, No Iterations 9 time step continuity errors : sum local = 2.31057e-11, global = 1.21503e-13, cumulative = 3.97872e-08 GAMG: Solving for p, Initial residual = 9.54773e-06, Final residual = 8.854e-08, No Iterations 29 time step continuity errors : sum local = 1.58007e-12, global = 8.1018e-15, cumulative = 3.97872e-08 PIMPLE: iteration 4 smoothSolver: Solving for Ux, Initial residual = 2.24401e-10, Final residual = 2.24401e-10, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 1.40553e-09, Final residual = 1.40553e-09, No Iterations 0 smoothSolver: Solving for Uz, Initial residual = 1.6992e-09, Final residual = 1.6992e-09, No Iterations 0 GAMG: Solving for p, Initial residual = 3.71452e-06, Final residual = 3.49174e-08, No Iterations 10 time step continuity errors : sum local = 6.23125e-13, global = 3.26394e-15, cumulative = 3.97872e-08 GAMG: Solving for p, Initial residual = 3.90144e-07, Final residual = 3.90144e-07, No Iterations 0 time step continuity errors : sum local = 6.9624e-12, global = 3.21656e-15, cumulative = 3.97872e-08 smoothSolver: Solving for nuTilda, Initial residual = 0.000829544, Final residual = 1.03796e-06, No Iterations 1 bounding nuTilda, min: -0.0189538 max: 1.91802 average: 0.0553777 PIMPLE: converged in 4 iterations ExecutionTime = 92823 s ClockTime = 92968 s In the fvSolution file I set the residuals tolerance of p, U and nuTilda at 1e-04 and relative tolerance as 0. I am guessing right now pimpleFoam solver judges the initial residual of each variable and first iteration of the GAMG solver. Shouldn't pimple solver compare the final residual and last iteration of the GAMG solver with the tolerance I set in the fvSolution file? Since that is the residual of the "real" results been carried on into the next time step? Junting Chen

 August 14, 2020, 10:53 #2 Senior Member     Chris DeGroot Join Date: Nov 2011 Location: Canada Posts: 414 Rep Power: 17 The initial residuals are used to judge how well the solution to the linear system approaches the solution to the non-linear governing equations. The final residual can be used to judge how well the linear solver has solved the linear system. Consider the system Ax = b which is solved by the GAMG solver to find x, given A and b. The final residual is then: However, A and b are functions of x, since the system is non-linear. With the new solution for x, the updated matrix can be called A* and the updated right side vector can be called b*. The initial residual is then the value with the updated system but the old solution: Therefore, the initial residual is the appropriate one to determine when to move on to the next timestep. If the initial residual is small then it means that the linearized solution is a good approximation of the non-linear solution (i.e. A* is close to A and b* is close to b). If you are used to other CFD codes (e.g. Fluent) the residual that is reported is roughly equivalent to the initial residual of OpenFOAM. Other CFD codes do not report an equivalent to the final residual since it is of little importance to judging non-linear convergence. jherb, thiagopl, chen112p and 5 others like this. __________________ Chris DeGroot, PhD, PEng CEO, Maple Key Labs www.maplekeylabs.com

 August 19, 2020, 09:38 #3 Member     Junting Chen Join Date: Feb 2016 Location: Ontario Canada Posts: 37 Rep Power: 10 Thanks a lot!