# What residual to look at if p is calculated twice?

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

 October 26, 2021, 05:01 What residual to look at if p is calculated twice? #1 Member   Claudia Join Date: Mar 2021 Posts: 43 Rep Power: 5 Hey guys, i have a question about the residuals of p_rgh / the logfile. Code: ```Solving for fluid region Luft DILUPBiCGStab: Solving for Ux, Initial residual = 5.52396048298e-05, Final residual = 5.52396048298e-05, No Iterations 0 DILUPBiCGStab: Solving for Uy, Initial residual = 0.000329795634347, Final residual = 2.73844961588e-06, No Iterations 1 DILUPBiCGStab: Solving for Uz, Initial residual = 0.000548108495771, Final residual = 4.51712127338e-06, No Iterations 1 DILUPBiCGStab: Solving for h, Initial residual = 3.48039609994e-06, Final residual = 1.74374968305e-10, No Iterations 1 Min/max T:288.15 302.65 GAMG: Solving for p_rgh, Initial residual = 0.00245483936325, Final residual = 1.19266184819e-05, No Iterations 3 time step continuity errors : sum local = 3.93180078034e-05, global = 1.02476345934e-06, cumulative = 1.02476345934e-06 Min/max rho:1.225 1.225 GAMG: Solving for p_rgh, Initial residual = 0.000516682871768, Final residual = 7.25064390756e-05, No Iterations 1 time step continuity errors : sum local = 0.000239004260786, global = 1.03940496747e-06, cumulative = 2.06416842681e-06 Min/max rho:1.225 1.225 DILUPBiCGStab: Solving for epsilon, Initial residual = 0.000101066185136, Final residual = 4.76627361674e-07, No Iterations 1 DILUPBiCGStab: Solving for k, Initial residual = 0.000142459907738, Final residual = 1.03597777104e-06, No Iterations 1``` As you can see, p_rgh is calculated twice. As far as I understand, this is because I use nCorrectors=2, right? So my question is, at which value am I looking at if I want to plot the residuals. Only the last p_rgh entry or is the first one important as well?

 October 26, 2021, 05:14 #2 Member     Join Date: Aug 2017 Location: Algeria Posts: 98 Rep Power: 8 1) Right, because you are using nCorrectors = 2, the pressure will be solved twice. More details can be found in this openfoamwiki blog. 2) I believe you can find many discussions in this forum explaining how residuals are computed. Yes, you need only the value at the first iterations. You don't need to extract them manually, use the residuals function object for that purpose. Use foamMonitor script to plot them.

 October 26, 2021, 05:16 #3 Member   Claudia Join Date: Mar 2021 Posts: 43 Rep Power: 5 Thanks for the fast reply!

 Tags chtmultiregion, logfile, ncorrectors, openfoam, residuals