CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

High residuals at last itteration

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By Benben
  • 1 Post By jherb
  • 1 Post By Benben
  • 4 Post By Robin.Kamenicky

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2019, 08:40
Default High residuals at last itteration
  #1
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Hello,

I am using a modified rhoBuoyantReactingFoam solver from openFoam 6.0.
I am solving a transient case.

For each time step, my initial residuals are falling as expected until convergence is reached:
Code:
PIMPLE: Iteration 98
DILUPBiCGStab:  Solving for Ux, Initial residual = 9.8539e-06, Final residual = 1.07935e-07, No Iterations 1
DILUPBiCGStab:  Solving for Uy, Initial residual = 2.44866e-05, Final residual = 2.35497e-07, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 3.85062e-05, Final residual = 3.43768e-07, No Iterations 1
DICPCG:  Solving for p, Initial residual = 0.000102216, Final residual = 9.9092e-07, No Iterations 15
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 3.31665e-09, global = -9.50722e-10, cumulative = 8.78471e-05
PIMPLE: Iteration 99
DILUPBiCGStab:  Solving for Ux, Initial residual = 9.59792e-06, Final residual = 1.05153e-07, No Iterations 1
DILUPBiCGStab:  Solving for Uy, Initial residual = 2.3872e-05, Final residual = 2.29636e-07, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 3.74963e-05, Final residual = 3.34476e-07, No Iterations 1
DICPCG:  Solving for p, Initial residual = 9.88698e-05, Final residual = 9.94734e-07, No Iterations 166
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 3.4152e-09, global = -4.49583e-10, cumulative = 8.78466e-05
And at the last itteration, the residuals goes up once again.

Code:
PIMPLE: Converged
        Doing final iteration
PIMPLE: Iteration 100
DILUPBiCGStab:  Solving for Ux, Initial residual = 0.000108962, Final residual = 9.29881e-07, No Iterations 13
DILUPBiCGStab:  Solving for Uy, Initial residual = 0.000238293, Final residual = 6.89688e-07, No Iterations 15
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.000525947, Final residual = 7.80032e-07, No Iterations 19
DICPCG:  Solving for p, Initial residual = 0.196718, Final residual = 9.90858e-07, No Iterations 304
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.80521e-09, global = 4.83121e-12, cumulative = 8.78466e-05
PIMPLE: Converged in 100 iterations
ExecutionTime = 28.24 s  ClockTime = 29 s
Should i worry about the precision of my simulation results ?
Should i use a final relaxation factor different from 1 ?
sfernaferna likes this.
Benben is offline   Reply With Quote

Old   February 3, 2019, 19:43
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
No, this is normal. For the last iteration of a time step, no under-relaxation is down, so the solver for the U field is "disturbing" the solution of p.


By applying under-relaxation in the other iterations the new result of the U-solver is only partly used, so the solution of the p solver is more or less still good and therefore the initial residual is low.
sfernaferna likes this.
jherb is offline   Reply With Quote

Old   February 4, 2019, 04:43
Default
  #3
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Thank you for your help jherb.

Why is the lat itteration's under-relaxation factor different by default ? Is there something to gain to have a different value of under relaxation at the last itteration ?
Benben is offline   Reply With Quote

Old   February 8, 2019, 06:47
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
I think, you do not want under-relaxation in the last iteration, to make sure, that your boundary conditions are really fulfilled. If your simulation has perfectly converged then there would be no problem, because under-relaxation would have no effect. But if it had not converged perfectly then your fields might not match the boundary conditions.



So e.g. for a pipe, you specify a velocity of 1 m/s at the inlet, but due to under-relaxation, the internal value (and the value at the outlet) might be different. By setting the under-relaxation to 1.0, meaning no under-relaxation, you really calculate an internal field corresponding to your boundary conditions.
jherb is offline   Reply With Quote

Old   February 8, 2019, 10:48
Default
  #5
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Thank you Jherb, this was really helpfull.

I made a test with a 10 meters long "pipe" (without walls, a 1D problem) filled with gas at U=1m/s and at T=300K. I set the temperature at the inlet to T=400K.

When i run the simulation for 10 seconds with dt = 1E-3 s:
  • if i set an under-relaxation at the last iteration to 1, the heat travels completly to the extremity of the pipe. Just like the analytical solution.
  • if i set un under relaxation at the last iteration of 0.5, the heat travels to ~ 90% of the pipe's length. There is an error compared to analytical solution.
This mean that I had not realy understood how relaxation is applied mathematically.
Is it the ddt term of the equations that is multiplied by the under-relaxation factor ?
sfernaferna likes this.
Benben is offline   Reply With Quote

Old   February 8, 2019, 18:03
Default
  #6
Member
 
Robin Kamenicky
Join Date: Mar 2016
Posts: 74
Rep Power: 11
Robin.Kamenicky is on a distinguished road
Hi Benoit,

By under-relaxation of the last iteration you can loose some information. If you want to under-relax your final iteration you need to perform a lot of outer iterations.

There are two kinds of relaxation. Field relaxation and matrix relaxation.
Field relaxation can be found in GeometricField.C:949
Code:
 operator==(prevIter() + alpha*(*this - prevIter()));
Code:
\phi^_{n+1} = \phi^{n-1} + \alpha(\phi^n-\phi^_{n-1})
This clearly shows how you can loose the information.

The matrix relaxation makes matrices more diagonal dominant. You can find in fvMatrix class

Kind regards,
Robin
jherb, Benben, Ramzy1990 and 1 others like this.
Robin.Kamenicky is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to understand high resolution scheme and high order scheme iilw1314 Main CFD Forum 7 April 12, 2022 13:29
Fluctuating residuals at high angle of attack for NACA0018 Anand Thamban FLUENT 1 June 20, 2016 08:58
Continuity Residual high but total mass convergence achieved? MichaelStark331 FLUENT 1 February 8, 2016 11:24
High Lift Airfoils At High Angles Of Attack Luiz Pancini FLUENT 2 April 9, 2015 09:01
motorBike Residuals for SST k-omega... and mine JR22 OpenFOAM Running, Solving & CFD 6 August 1, 2013 10:08


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