# initial residual and final residual

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 9, 2013, 04:16 initial residual and final residual #1 New Member   Maosong Cheng Join Date: Aug 2012 Posts: 19 Rep Power: 7 Sponsored Links Hi FOAMERs, what is the definition of the initial residual and final residual, which can be used to decide convergence ?

 May 15, 2013, 05:20 #2 Senior Member   Anne Gerdes Join Date: Aug 2010 Location: Hamburg Posts: 168 Rep Power: 9 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.

 May 15, 2013, 08:23 #3 Member   Timo K. Join Date: Feb 2010 Location: University of Stuttgart Posts: 66 Rep Power: 9 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

 May 15, 2013, 08:29 #4 Senior Member   Anne Gerdes Join Date: Aug 2010 Location: Hamburg Posts: 168 Rep Power: 9 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.

August 17, 2016, 15:45
#5
New Member

Manm
Join Date: Apr 2015
Posts: 16
Rep Power: 4
Quote:
 Originally Posted by Anne Lincke 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?

August 17, 2016, 15:55
#6
Member

Bruno Blais
Join Date: Sep 2013
Posts: 66
Rep Power: 5
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 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?

August 17, 2016, 17:13
#7
New Member

Manm
Join Date: Apr 2015
Posts: 16
Rep Power: 4
Quote:
 Originally Posted by blais.bruno 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....

August 18, 2016, 08:31
#8
Member

Bruno Blais
Join Date: Sep 2013
Posts: 66
Rep Power: 5
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 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....

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08 hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 09:35 sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37 jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24