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

initial residual and final residual

Register Blogs Community New Posts Updated Threads Search

Like Tree37Likes
  • 16 Post By Anne Lincke
  • 2 Post By Anne Lincke
  • 5 Post By Manm
  • 11 Post By blais.bruno
  • 3 Post By Manm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2013, 04:16
Default initial residual and final residual
  #1
New Member
 
Maosong Cheng
Join Date: Aug 2012
Posts: 19
Rep Power: 13
mscheng is on a distinguished road
Hi FOAMERs,
what is the definition of the initial residual and final residual, which can be used to decide convergence ?
mscheng is offline   Reply With Quote

Old   May 15, 2013, 05:20
Default
  #2
Senior Member
 
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 15
Anne Lincke is on a distinguished road
The initial residual is evaluated based on the current values of the field before solving an equation for a particular field . The final residual is evaluated after the solution of the equation is performed.
The intial residual is more important to decide whether a computation converges, or not.
Anne Lincke is offline   Reply With Quote

Old   May 15, 2013, 08:23
Default
  #3
Member
 
Timo K.
Join Date: Feb 2010
Location: University of Stuttgart
Posts: 66
Rep Power: 16
timo_IHS is on a distinguished road
Hi Anne,

can you give some rule of thumbs for values, which should be achieved for the initial/final residual and how many iterations should be used for pEqn per cycle e.g. for a transient simulation with a standard PCG solver.

Best Timo
timo_IHS is offline   Reply With Quote

Old   May 15, 2013, 08:29
Default
  #4
Senior Member
 
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 15
Anne Lincke is on a distinguished road
Initial residual: e^-4 or e^-5 is a good result. Final residual has to be smaller (e^-8).
I cannot answer your 2nd question.
lf.lopez18 and wht like this.
Anne Lincke is offline   Reply With Quote

Old   August 17, 2016, 15:45
Default
  #5
New Member
 
Manm
Join Date: Apr 2015
Posts: 16
Rep Power: 11
Manm is on a distinguished road
Quote:
Originally Posted by Anne Lincke View Post
The initial residual is evaluated based on the current values of the field before solving an equation for a particular field . The final residual is evaluated after the solution of the equation is performed.
The intial residual is more important to decide whether a computation converges, or not.


Hi, based on this definition, I was curious as to why the final residual in one time step NOT equal to initial residual in NEXT time step?
Manm is offline   Reply With Quote

Old   August 17, 2016, 15:55
Default
  #6
Member
 
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 12
blais.bruno is on a distinguished road
Assuming you are solving in steady state, it is because the equations are non-linear.

If you solve the momentum equation for U, at the next iteration, P and phi will have been changed. Therefore, the initial residual will be different from the final residual of the last iteration.

If you were to solve a linear equation, non-coupled with any other variables, in steady-state, then you would solve it in a single iteration... and therefore your "next initial" residual would be your last final one...

Quote:
Originally Posted by Manm View Post
Hi, based on this definition, I was curious as to why the final residual in one time step NOT equal to initial residual in NEXT time step?
blais.bruno is offline   Reply With Quote

Old   August 17, 2016, 17:13
Default
  #7
New Member
 
Manm
Join Date: Apr 2015
Posts: 16
Rep Power: 11
Manm is on a distinguished road
Quote:
Originally Posted by blais.bruno View Post
Assuming you are solving in steady state, it is because the equations are non-linear.

If you solve the momentum equation for U, at the next iteration, P and phi will have been changed. Therefore, the initial residual will be different from the final residual of the last iteration.

If you were to solve a linear equation, non-coupled with any other variables, in steady-state, then you would solve it in a single iteration... and therefore your "next initial" residual would be your last final one...
Thank you. That helped to understand my question.

If I understand it right,
Say : U =f(p,phi,t) where f is a complex function

If t0 =0:
During 1 st iteration, we start with a p0, phi0 and dt time step and get U1 =f(p0, phi0,dt) as well as p1, phi1 values. The corresponding final error/ residual is calculated from U1 and true U expected.

Before 2nd iteration starts, a (say) U12 is calculated based on new available values:
U12 =f(p1,phi1,dt) and this is used to calculate the initial error/ residual before the 2nd time step starts.
and then we go on to calculate U2 =f(p1, phi1, dt+dt) and corresponding p2, phi2 and final error/ residual at the end of 2nd time step and so on....
Manm is offline   Reply With Quote

Old   August 18, 2016, 08:31
Default
  #8
Member
 
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 12
blais.bruno is on a distinguished road
Yup, That is exactly so.
OpenFOAM is a segregated solver, that is U, V, W, phi and P are solved segregated. This is why such a thing happen.

There are block coupled solvers in foam-extend, but those are still linear solver and don't implement a non-linear newton method or something like that.



Quote:
Originally Posted by Manm View Post
Thank you. That helped to understand my question.

If I understand it right,
Say : U =f(p,phi,t) where f is a complex function

If t0 =0:
During 1 st iteration, we start with a p0, phi0 and dt time step and get U1 =f(p0, phi0,dt) as well as p1, phi1 values. The corresponding final error/ residual is calculated from U1 and true U expected.

Before 2nd iteration starts, a (say) U12 is calculated based on new available values:
U12 =f(p1,phi1,dt) and this is used to calculate the initial error/ residual before the 2nd time step starts.
and then we go on to calculate U2 =f(p1, phi1, dt+dt) and corresponding p2, phi2 and final error/ residual at the end of 2nd time step and so on....
blais.bruno 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
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 08:35
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 06:37
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24


All times are GMT -4. The time now is 06:26.