CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Adaptive time stepping (https://www.cfd-online.com/Forums/main/14707-adaptive-time-stepping.html)

Simon January 29, 2008 08:14

Adaptive time stepping
 
What is adaptive time stepping. what are advantages and disadvantages of it in the context of large eddy simulation. Thank you very much in advance for your reply.

With regards Simon

Patrick January 29, 2008 09:48

Re: Adaptive time stepping
 
The time step is never taken to be constant as far as I know it is always "adaped" to the velocity, grid size and viscosity (or even radiation).

For a sound velocity c and flow velocity v (say in one dimension x), then the CFL (Courant Friedrich Levy) condition is

delta x / delta t > (c+v)

where delta x is the grid spacing and delta t is the time step, such that the velocity of the numerical integration delta x/ delta t is larger than the velocity in the fluid equations (so that it can follows the flow/evolution of the flow). THis gives

delta t < (delta x) / (c+v)

If it is a viscous flow with mu = rho * nu then

delta t < (delta x)^2 / nu

A similar restriction applies for a radiative term taken in the diffusion approximation, etc...

So each time step the size of the time step is adapted to the grid size, velocity of the fluid and sound and value of the viscosity nu = mu/rho

Mani January 29, 2008 10:10

Re: Adaptive time stepping
 
Hi patrick thanks for your reply. You didnt tell me about its advantages and disadvantages particularly in the context of LES. If you can direct me to some material that will also be very useful. Help documentations have virtually nothing. Thank you

Patrick January 29, 2008 10:32

Re: Adaptive time stepping
 
What I wrote is for any non-steady flows, not only for LES. Because any non-steady flow will have changing flow and sound velocities and viscosity coefficient nu.

In a LES usually the actual viscosity is rather small (large Reynolds number) and one even introduce an artificial viscosity to "kill" the high frequency noise (small scale oscillations).

If the artificial viscosity is given in the equation like a normal viscosity then you just use what I wrote. Sometimes the artificial viscosity is given with a higher derivative of the space dimension.

Usually one has (normal viscosity): dv/dt = nu*d^2v/dx^2 + ... from which it is derived

that delta t < (delta x)^2/nu

artificial viscosityy is written

dv/dt = nu*d^2n v/dx^2n + ... and then the time step restriction becomes

delta t < (delta x)^2n / nu

It is important for a LES that these conditions and the CFL conditions be met in order to avoid divergence and numerical instabilities. LES is a turbulent flow and in 3D the energy cascades from the large scale to the smallest scale where it is dissipated by the (artificial) viscosity. If your time step is too large then you don't allow for this dissipation to take place numerically and your code diverges and leads to numerical non-sens. So in order to avoid that you need these restrictions. You need to chose delta t smaller than the smallest of all 3

(1) CFL delta t_1 < delta x / (v +c) (2) viscosity : delta t_2 < (delta x)^2 / nu (3) artificial viscosity : delta t_3 < (delta x)^2n /nu_a

where n=1,2,3, ... depending on the code and nu_a is the value of the artificial viscosity coefficient.

and delta t = min (delta t_1, delta t_2, delta t_3)

Here this is not about advantages and disadvantages, the time step must be adapted to the smallest in order to avoid numerical instabilities. IN LES if you get instabilities you might think of them as Physical (turbulence), but if you do not use the time step restrictions above you will get numerical instabilities and you might think there are turbulence, while they really are numerical.

Try Numerical Recipes online to find the restrictions and references on the time stepping.

All what I wrote is when solving for the time explicitly, if you solve for the time implicitly, you will still have some restriction coming from the inversion of a matrix, they will be different restriction but you will still have some restrictions. So you also need to check if your code is time-explicit or time-implicit. If your code is just some Runge-Kutta or Adam-Baschford, etc.. then it is implicit... Crank-Nicholson method is explicit, etc...

Chris January 29, 2008 10:45

Re: Adaptive time stepping
 
Hi Patrick

You have cleared some of my doubts regarding time-stepping. Thanks for that! My code uses fully implicit scheme. I guess most of the things that you have said will have no relevance to time-implicit code. I am just confused how should i choose my time step for an implicit code. Its quite simple for an explicit code because one needs to keep courant number below 1. However, for an implict code courant has no relevance what so ever. Thats why i wanted to use adaptive time stepping. How would you choose your time step for LES simulation. Thank you very much

Patrick January 29, 2008 10:54

Re: Adaptive time stepping
 
IN the implicit case the restriction on the time step comes from restriction on the size of the elements of the matrix you have to invert. If the viscous term only is taken implicitly then you still need the CFD condition for the explicit terms. You also need to check the conservation of energy and momenta as a function of the size of the time step as part of the errors.

Usually also one uses only a fraction (say 0.5) of the "theoretical" time step. Here this needs to be first tested with the code and the problem to decide how large this fraction can be.


Chris January 29, 2008 10:56

Re: Adaptive time stepping
 
Thank you patrick.

Chris

agg February 6, 2008 23:15

Re: Adaptive time stepping
 
Hello Chris,

One point I would like to add for implicit time stepping. Using an implicit time step, you may be able to use a larger time step as compared to an explicit scheme. This is just a numerical artifact. When you want to capture certain physics in the flow, such as vortex structures, you might want to tune your time step, so as to be able to actually visualize small structures. If your time step is larger than the time scale of certain structures, you will never see them ! Sometimes we capture things when we least expect them - serendipity :)


Chris February 7, 2008 06:23

Re: Adaptive time stepping
 
How can one tune time step during a simulation? Thank you for your answer. It was helpful!

agg February 7, 2008 11:41

Re: Adaptive time stepping
 
Well, based on intuition. You are trying to capture structures. Maybe you have experimental data that can give you an estimate of time scales for such structures. Even if you don't, you can try to guesstimate.


All times are GMT -4. The time now is 11:12.