CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Setting time step and number of time steps (http://www.cfd-online.com/Forums/fluent/62842-setting-time-step-number-time-steps.html)

milton.tafadzwa March 22, 2009 00:21

Setting time step and number of time steps
 
I want to model unsteady heat flow in an evacuated tube solar water heater. My problem is on setting time step, number of time steps and and maximum iterations per time step. I have read the modelling and tutorial guide but failed to understand what is considered when setting these parameters.
Please may you assist me with some guidelines on how to solve my problem.
Thank you.

technocrat.prakash March 22, 2009 03:01

Well Mavis, time step, no. of time steps, maximum iterations per step are simple terms.

Time step plays a vital role in explicit method, since its determines the stability criterion. Implicit method is always stable. Make sure you give a low time step value otherwise the solution may diverge. Its a good practise to give a low time step value.

Number of time steps is based on the time upto which the analysis has to be done.

For example, time step be 5 milli seconds (0.005) and number of steps be 2000. So you are doing the analysis for (0.005 x 2000=) 10 seconds.

For each time step there will be some equations has to be numerical solved. So iterations of the equations has to be done and we need some convergence criteria. Some times instead of convergence criteria we will specify the maximum number of iterations. Within the time step, if the equations is not converged with in the maximum iterations, solver will stop iterate after this maximum number of iterations and proceed to next time step. Higher the maximum number of iterations higher the accuracy of solution but time taken may increase.

srjp March 24, 2009 10:59

The time step you define, depends on the mesh and the velocities. i.e. the time step should be able to resolve the flow in the smallest cell.
As a rule of thumb, del t < del x / v
(del t = time step, del x = smallest mesh size, v = velocity)
so if you have the minimum mesh size as 1mm, and velocity as 2 m/s, then your time step should be lower than 1mm/(2m/s) = 0.0005 sec.
Any value higher than this may lead to divergence.

Number of time steps depend on how long you want to run the simulation (flow time required)

Number of iterations required depends on how fast the solution converges. It is a trade-off. At smaller time steps, it takes less number of iterations, but you need to run for more number of time steps any way.
My suggestion is to run for a few time steps with large number of iterations and find out how many iterations it normally takes to converge, and then set this as the limit.

technocrat.prakash March 24, 2009 13:24

Quote:

Originally Posted by srjp (Post 210607)
The time step you define, depends on the mesh and the velocities. i.e. the time step should be able to resolve the flow in the smallest cell.
As a rule of thumb, del t < del x / v
(del t = time step, del x = smallest mesh size, v = velocity)
so if you have the minimum mesh size as 1mm, and velocity as 2 m/s, then your time step should be lower than 1mm/(2m/s) = 0.0005 sec.
Any value higher than this may lead to divergence.

Number of time steps depend on how long you want to run the simulation (flow time required)

Number of iterations required depends on how fast the solution converges. It is a trade-off. At smaller time steps, it takes less number of iterations, but you need to run for more number of time steps any way.
My suggestion is to run for a few time steps with large number of iterations and find out how many iterations it normally takes to converge, and then set this as the limit.

Hope thats a better explanation.

tang400 November 8, 2009 11:02

Quote:

Originally Posted by technocrat.prakash (Post 210642)
Hope thats a better explanation.

Hi Prakash Ayappan,
Your reply is also very helpful for me. But for the single unsteady heat conduction ,how to set the time step? can i set a bigger time step, e.g.60s?
Looking forward to your reply!
Thanks!

santoshgoku November 9, 2009 02:05

Quote:

Originally Posted by tang400 (Post 235489)
Hi Prakash Ayappan,
Your reply is also very helpful for me. But for the single unsteady heat conduction ,how to set the time step? can i set a bigger time step, e.g.60s?
Looking forward to your reply!
Thanks!

As said before, it again depends on your grid size and other conditions. IMO 60 s is too high in general problems. Time step in the order of milliseconds is used for standard problems of unsteady heat conduction.

tang400 November 9, 2009 03:20

Quote:

Originally Posted by santoshgoku (Post 235527)
As said before, it again depends on your grid size and other conditions. IMO 60 s is too high in general problems. Time step in the order of milliseconds is used for standard problems of unsteady heat conduction.

Thanks for your quickly reply.
There are 70 millions 3D cells in my model,and we want to know the temperature distribution after 24 hours later.If time step is in the order of milliseconds,you know,it will cost too long computer time to get the results.And one of my friends,he set time step in the order of milliseconds when simulating the fluidized bed .
Just single conduction exists in my case, can i set time step to several seconds or tens of seconds? can you give me the detail about the time step and grid size?
Thank you very much!

Philipov November 9, 2009 03:35

70 millions CV?!?!?!?! how you intend to solve this!!!
Revise the domain and use adaptive time step if the problem allows...

srjp November 9, 2009 04:56

As said by other members before, the optimum timestep can be found by trial and error. It is best to start with a low timestep, run for few iterations. Check if there are no convergence problems, then you can increase the timestep. In three to four revisions, you would have settled on the optimum timestep.

If your problem involves conduction/convection you can use some thumbrules like delt ~ (delx^2)/alpha

In natural convection
delt ~ sqrt(delx/(g.beta.deltaT))

where:
delt = approximate time step in seconds
delx = ave cell length (m)
alpha = thermal diffusivity = k/(rho.Cp)
k = thermal conductivity
rho = density
Cp = Specific heat of fluid
g = gravitational accelaration
beta = coefficient of thermal expansion
deltaT = temperature difference between the surface and freestream.

If your fluid is air, for a cell size of 1mm, you get delt around 0.05 seconds.
May be you can start with this, and keep increasing.

technocrat.prakash November 9, 2009 08:17

Before thinking about the time consumed for producing the results, make sure the analysis is converging (the results are atable). So start from the smaller time and try to increase the time.

You can use srjp reply.

tang400 November 11, 2009 08:42

Quote:

Originally Posted by technocrat.prakash (Post 235572)
Before thinking about the time consumed for producing the results, make sure the analysis is converging (the results are atable). So start from the smaller time and try to increase the time.

You can use srjp reply.

hi guys,i took your advice and set time step to 0.005s. Result is converging, this is my residuals curve:http://www.cfd-online.com/Forums/C:\...面\0.jpg
now,can i set the time step to a bigger one,for example 0.5s or 5s?
BTW,my cells number is 0.7 millons not 70 millions,hoho,i am sorry.


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