CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Time-step for steady state solutions

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2015, 02:13
Default Time-step for steady state solutions
  #1
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Hey,

According to many popular text-books the size of the time-step should not matter when a steady-state solution is sought. Is this also true if the order of the transient discretization is lower than the spatial discretization?

I would guess that a low order time-step discretization have the possibility to pollute the entire solution and hence we are doing mesh independence tests in both space and time.

So why do so many texts state the opposite?
Simbelmynė is offline   Reply With Quote

Old   September 14, 2015, 03:24
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
Hey,

According to many popular text-books the size of the time-step should not matter when a steady-state solution is sought. Is this also true if the order of the transient discretization is lower than the spatial discretization?

I would guess that a low order time-step discretization have the possibility to pollute the entire solution and hence we are doing mesh independence tests in both space and time.

So why do so many texts state the opposite?

you should consider the local truncation error of the equation, it contains the order of the time step (for example dt for a first order discretizaton) but it multiplies time derivatives that vanish at the steady steate....

also more rigorous explanation can be provided, I suggest a reading of some specific textbook of numerical analysis
FMDenaro is offline   Reply With Quote

Old   September 14, 2015, 04:20
Default
  #3
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
you should consider the local truncation error of the equation, it contains the order of the time step (for example dt for a first order discretizaton) but it multiplies time derivatives that vanish at the steady steate....
So you agree with the assessment that the size of the time-step has no impact on the steady-state solution?

Quote:
Originally Posted by FMDenaro View Post
also more rigorous explanation can be provided, I suggest a reading of some specific textbook of numerical analysis
If you give me a suggestion to which book you are referring that would be helpful.
Simbelmynė is offline   Reply With Quote

Old   September 21, 2015, 11:52
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
Hey,

According to many popular text-books the size of the time-step should not matter when a steady-state solution is sought. Is this also true if the order of the transient discretization is lower than the spatial discretization?

I would guess that a low order time-step discretization have the possibility to pollute the entire solution and hence we are doing mesh independence tests in both space and time.

So why do so many texts state the opposite?
In specific contexts it can be true but in general this is not true.

For 1st order systems (systems that don't have inherent oscillations), the time-step size is arguably arbitrary, up to stability limits. If you have a scheme that is numerically stable then sure you can use any time-step to arrive at the steady-state point. But you can have schemes that are numerically unstable and the time-step is therefore limited. I would consider guaranteed divergence to be "some impact" on the steady state solution. This is a stability problem and not really an accuracy problem as the system monotonically approaches the steady state value.

For 2nd order problems it is well known that transient effects must be resolved (otherwise controls engineering would be a joke), i.e. a system with inherent oscillations such as wave propagation. Numerical diffusion/damping can destroy the wave before it attains the standing wave solution. This isn't a stability problem but an accuracy problem, as the system response isn't monotonic.
Simbelmynė and shizuka like this.

Last edited by LuckyTran; September 22, 2015 at 01:08.
LuckyTran is offline   Reply With Quote

Old   September 28, 2015, 13:33
Default
  #5
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
In specific contexts it can be true but in general this is not true.

For 1st order systems (systems that don't have inherent oscillations), the time-step size is arguably arbitrary, up to stability limits. If you have a scheme that is numerically stable then sure you can use any time-step to arrive at the steady-state point. But you can have schemes that are numerically unstable and the time-step is therefore limited. I would consider guaranteed divergence to be "some impact" on the steady state solution. This is a stability problem and not really an accuracy problem as the system monotonically approaches the steady state value.

For 2nd order problems it is well known that transient effects must be resolved (otherwise controls engineering would be a joke), i.e. a system with inherent oscillations such as wave propagation. Numerical diffusion/damping can destroy the wave before it attains the standing wave solution. This isn't a stability problem but an accuracy problem, as the system response isn't monotonic.
So, going back to this question. I have an explicit incompressible code that produce different results depending on the size of the time-step for the cavity flow benchmark @ Re=1000.

If the time-step is within the stability region then I get a steady-state solution, however the accuracy is far better if I choose a small time-step (say if I decrease it two orders of magnitude). At a certain point I see no change in the steady-state solution with a further decrease in the time-step.

With a small enough time-step the results are fully comparable with the literature.

Any ideas about this behavior?
Simbelmynė is offline   Reply With Quote

Old   September 28, 2015, 15:26
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
My idea is that you need an analytical solution to check accuracy...the lid-drive test case is not suitable to check the slope in the errors curve
FMDenaro is offline   Reply With Quote

Old   September 29, 2015, 00:27
Default
  #7
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
If the time-step is within the stability region then I get a steady-state solution, however the accuracy is far better if I choose a small time-step (say if I decrease it two orders of magnitude). At a certain point I see no change in the steady-state solution with a further decrease in the time-step.

With a small enough time-step the results are fully comparable with the literature.

Any ideas about this behavior?
Just because your time-step is stable does not mean that it is accurate (error-free). Having a time-step in the stability region just means that numerical oscillations do not become unbounded, but the oscillations (if any) are still present.

Even if the physical problem does not have inherent oscillations, your numerical schemes can have oscillations.
LuckyTran is offline   Reply With Quote

Old   September 29, 2015, 01:18
Default
  #8
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
My idea is that you need an analytical solution to check accuracy...the lid-drive test case is not suitable to check the slope in the errors curve
OK, thank you. Any suggestion to which analytical solution I should test against?

I do not fully understand what you mean though. Do you suggest that I should check the error curve and see if the time-step has an influence on the order of the method? Reading your previous post I understand that the time-step size should have no effect on the steady-state solution. My code clearly has this kind of behavior though so I have likely done something wrong (unless the cavity flow @ Re=1000 is a second order type of system as LyckyTran put it).

My time-stepping method is first order and if I use a large time-step (still within the stability region) then the central difference spatial solution looks like a first order upwind solution (average L1 norms still go down to machine precision).
Simbelmynė is offline   Reply With Quote

Old   September 29, 2015, 03:07
Default
  #9
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
OK, thank you. Any suggestion to which analytical solution I should test against?

I do not fully understand what you mean though. Do you suggest that I should check the error curve and see if the time-step has an influence on the order of the method? Reading your previous post I understand that the time-step size should have no effect on the steady-state solution. My code clearly has this kind of behavior though so I have likely done something wrong (unless the cavity flow @ Re=1000 is a second order type of system as LyckyTran put it).

My time-stepping method is first order and if I use a large time-step (still within the stability region) then the central difference spatial solution looks like a first order upwind solution (average L1 norms still go down to machine precision).

Using an analytical solution, you can check any possible bugs in the code... You are serching a steady state via time-dependent solution, I suggest checking a fully time dependent analytical case such as

http://www.mie.utoronto.ca/labs/bsl/...ctSolution.pdf

then, the steady Poiseuille solution can be also checked to see the effects of the walls.
Simbelmynė likes this.
FMDenaro is offline   Reply With Quote

Old   September 29, 2015, 07:44
Default
  #10
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Using an analytical solution, you can check any possible bugs in the code... You are serching a steady state via time-dependent solution, I suggest checking a fully time dependent analytical case such as

http://www.mie.utoronto.ca/labs/bsl/...ctSolution.pdf

then, the steady Poiseuille solution can be also checked to see the effects of the walls.
So I did some tests with Poiseuille flow and the effect is similar as in the cavity flow case.

The attached figures show the difference. As far as I can tell, the convergence criteria of the pressure equation has no effect (i.e. I have tried reducing the criteria but the results remain the same). Furthermore there is no improvement if I run the simulation longer (this was a test to see if the number of iterations played an effect, but evidently they do not, which is good).

It is clear that the larger time-step gives completely wrong results and that the smaller time-step is a much better choice.

But why...

Attached Images
File Type: jpg 33x512_Poiseuille_large_timestep.jpg (27.4 KB, 25 views)
File Type: jpg 33x512_Poiseuille.jpg (25.3 KB, 21 views)
Simbelmynė is offline   Reply With Quote

Old   September 29, 2015, 08:05
Default
  #11
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Are you sure that the case at larger time-step is runned until the time derivatives of the velocities are enough small?
FMDenaro is offline   Reply With Quote

Old   September 29, 2015, 09:57
Default
  #12
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Are you sure that the case at larger time-step is runned until the time derivatives of the velocities are enough small?
For the case of large time-step there is a slight oscillation about the steady state value of the average norm abs(U_new-U_old)/dT, so it does not decrease. I tried running the simulation 100 times longer when using a 100 times larger time-step (getting approximately the same amount of iterations), and the oscillating behavior is found quite early.

For the smaller time-step case the average norm decreases to approx. 1e-10 and if I continue further then it goes to 1e-15 (this is very close to machine precision).
Simbelmynė is offline   Reply With Quote

Old   September 29, 2015, 10:23
Default
  #13
Member
 
Join Date: Jul 2013
Posts: 55
Rep Power: 12
Alex C. is on a distinguished road
Quote:
Originally Posted by Simbelmynė View Post
For the case of large time-step there is a slight oscillation about the steady state value of the average norm abs(U_new-U_old)/dT, so it does not decrease. I tried running the simulation 100 times longer when using a 100 times larger time-step (getting approximately the same amount of iterations), and the oscillating behavior is found quite early.

For the smaller time-step case the average norm decreases to approx. 1e-10 and if I continue further then it goes to 1e-15 (this is very close to machine precision).
If the convergence is not monotone (oscillating), I expect the system to have a 2nd order behavior.

If you respect the time-step constraint, you will avoid a negatively damped system, with unbounded oscillations. But if you use exactly, or very close to, the maximum time-step, you may very well be creating a lightly damped system. Such a system will take very long to reach steady-state.

Two solutions appears to me :
  1. Implement variable time-step. Use large time step until the convergence slows down, then reduce the time step. This is the same idea as multigrid acceleration.
  2. Add numerical damping to the system. This can be seen as adding a PID controller to your solver.
Alex C. is offline   Reply With Quote

Old   September 29, 2015, 10:29
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
For the case of large time-step there is a slight oscillation about the steady state value of the average norm abs(U_new-U_old)/dT, so it does not decrease. I tried running the simulation 100 times longer when using a 100 times larger time-step (getting approximately the same amount of iterations), and the oscillating behavior is found quite early.

For the smaller time-step case the average norm decreases to approx. 1e-10 and if I continue further then it goes to 1e-15 (this is very close to machine precision).

So, withoute reaching exactly the same steady state, you cannot compare the two cases, the large time-step is likely to be cause of the onset of oscillations. Are you sure you are well within the stability region? It seems as a case producing eventually instability for long time simulation.
At what Re number the Poiseuille case is runned?
FMDenaro is offline   Reply With Quote

Old   September 29, 2015, 13:57
Default
  #15
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
So, withoute reaching exactly the same steady state, you cannot compare the two cases, the large time-step is likely to be cause of the onset of oscillations. Are you sure you are well within the stability region? It seems as a case producing eventually instability for long time simulation.
At what Re number the Poiseuille case is runned?
Re=100

I use a variable time-step according to:

\Delta t = \beta * min(\frac{0.5\Delta x^2}{\nu}, \frac {\Delta x}{u_{max}})

where \beta is set to 0.33 for the case of large time-step and to 0.002 for the case of small time-step (and as Alex C. suggests I already use a large time-step for a period of time before I switch to the smaller one, however this time is arbitrary and not based on any convergence criteria since the large time-step case produce an oscillatory convergence).
Simbelmynė is offline   Reply With Quote

Old   September 29, 2015, 14:05
Default
  #16
Member
 
Join Date: Jul 2013
Posts: 55
Rep Power: 12
Alex C. is on a distinguished road
Quote:
Originally Posted by Simbelmynė View Post
Re=100

I use a variable time-step according to:

\Delta t = \beta * min(\frac{0.5\Delta x^2}{\nu}, \frac {\Delta x}{u_{max}})
Are you able to tell which of the minimum argument is limiting the time step? Is it convective or diffusive discretization?
Alex C. is offline   Reply With Quote

Old   September 29, 2015, 14:09
Default
  #17
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by Alex C. View Post
Are you able to tell which of the minimum argument is limiting the time step? Is it convective or diffusive discretization?
In the present test case it is the diffusive part.
Simbelmynė is offline   Reply With Quote

Old   September 29, 2015, 14:13
Default
  #18
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
Re=100

I use a variable time-step according to:

\Delta t = \beta * min(\frac{0.5\Delta x^2}{\nu}, \frac {\Delta x}{u_{max}})

where \beta is set to 0.33 for the case of large time-step and to 0.002 for the case of small time-step (and as Alex C. suggests I already use a large time-step for a period of time before I switch to the smaller one, however this time is arbitrary and not based on any convergence criteria since the large time-step case produce an oscillatory convergence).

I doubt this criterion is accurate...are you using the FTCS? The linear stability analysis show a stability region (cfl, Re_h) much more critical...at Re=100 you are working with Reh=O(1) and the cfl is very low.
FMDenaro is offline   Reply With Quote

Old   September 29, 2015, 14:19
Default
  #19
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I doubt this criterion is accurate...are you using the FTCS? The linear stability analysis show a stability region (cfl, Re_h) much more critical...at Re=100 you are working with Reh=O(1) and the cfl is very low.
For the cavity flow case I used several different convective discretizations. Upwind, CD, 4th order CD and a mix of everything.

Time is always forward Euler though.

In the Poiseuille case I switched to Upwind since it is so much faster (which is a bit strange, but that is another question..), however a couple of initial runs with CD showed identical behavior.
Simbelmynė is offline   Reply With Quote

Old   September 29, 2015, 14:38
Default
  #20
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
For the cavity flow case I used several different convective discretizations. Upwind, CD, 4th order CD and a mix of everything.

Time is always forward Euler though.

In the Poiseuille case I switched to Upwind since it is so much faster (which is a bit strange, but that is another question..), however a couple of initial runs with CD showed identical behavior.
your criterion should account for the fact that you have a multidimensional case...for example the case of pure diffusion would give

ni*dt* (1/dx^2 + 1/dy^2) <= 1/2

or for the upwind case applied on a pure convective equation

dt*(u/dx + v/dy) <=1

when you have both convection and diffusion the stability region involves a functional relation of them
FMDenaro 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
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
Modeling in micron scale using icoFoam m9819348 OpenFOAM Running, Solving & CFD 7 October 27, 2007 00:36


All times are GMT -4. The time now is 19:22.