CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   How to select Time step (https://www.cfd-online.com/Forums/star-ccm/92694-how-select-time-step.html)

siara817 September 22, 2011 03:50

How to select Time step
 
Hi dear All,
I simulation a ventilated room in unsteady model.
I do not know what is the proper time step for my simulation.
Thanks for your attention.

abdul099 September 22, 2011 17:29

Depends on your desired accuracy. The smaller the timestep, the better for accuracy and stability, but the worse in terms of computational cost.

In most cases, the timestep will be set to allow the residuals to drop by two or three orders of magnitude in every timestep.
Additionally you can monitor the courant number. Although implicit schemes does not explicitly require the courant number to be below 1, best experience is made when the courant number is not higher than 1 (or at least not too much bigger than 1, assumed computational cost is not an issue).

But to be honest, in most cases it will not be possible to keep an ideal timestep. Smaller cells (to reduce errors of discretization in space) means more cells and a smaller ideal timestep. The computational cost will rise too much, therefore the timestep has to be limited as long as you don't have an excessive amount of time to wait for results.

Eike September 28, 2011 06:30

So if I have a rotor with 9 blades rotating at 1450 rpm, what is a good time step?

Btw, my model contains something about 7,000,000 volume cells. I can use a cluster and am allowed for up to 192 cores. How much cores should I use?


Best wishes
Eike

yinjunlian September 28, 2011 07:11

it also depends on what you focus on

Eike September 28, 2011 07:35

There is an inlet, the ventilator and an attatched diffusor ... I need to know the flow of air at 20°C for optimization of blades and diffusor ...

Does look like this, but with a square diffusor and the short section as the inlet:

http://www.wittfan.de/images/diffusor_before_fan_2.gif

BKaus September 28, 2011 19:30

Quote:

Originally Posted by Eike (Post 325889)
So if I have a rotor with 9 blades rotating at 1450 rpm, what is a good time step?

Btw, my model contains something about 7,000,000 volume cells. I can use a cluster and am allowed for up to 192 cores. How much cores should I use?


Best wishes
Eike

A good rule of thumb is about 100,000 cells per core. More than that and your bottleneck may become communication between cores and not computation of cells.

Eike September 29, 2011 05:48

At this time, I use 72 cores for 7,700,000 cells and it works fine steady and unsteady. If I use rigid body motion, does it make sence to use more cores, or is the 100,000-rule independed from steady/unsteady?

Btw, my compute-nodes are 12 core, so the next step would be 84 cores.

abdul099 October 1, 2011 17:50

Using too much cores will decrease efficiency, no matter if it's a steady or unsteady simulation.
What you could do to speed up your simulation is to use less cores per node, because all cores on a node share the memory bandwidth.

You can try to start with a bigger time step, e.g. 0.01s and run for some revolutions. Then reduce the time step for let say one order of magnitude and run for some revolutions...

Eike October 4, 2011 02:34

Quote:

Originally Posted by abdul099 (Post 326378)
What you could do to speed up your simulation is to use less cores per node, because all cores on a node share the memory bandwidth.

That is interesting! Can you tell me how to do this on a Windows system? Unfortunately we are not allowed to use Linux ... at this time, I send the jobs through the windows command promt and I did not find any command to specify for example 6 cores per node using 12 nodes.

abdul099 October 5, 2011 19:25

When it's a usual cluster using a batch system, you have to do it by the batch system. I can't help you with any commands, as there are several batch systems available.

When you don't use a batch system, I think you should have a command line like
"starccm+ -batch -on host1:x,host2:x,host3:x -master host1 #pathtomacro.java #pathtosimfile.sim"
where x is the number of cores to be used on the specified host. Just pick a number you like which is less or equal the number of cores.

But be aware, using only one core per node may also have a negative impact on the solution time as more communication will be carried out via network / infiniband / whateverconnectionyouareusing instead of QPI / HT.

siara817 October 6, 2011 09:53

Thanks Abdul for your kind help :)
My question is that, when I use implicit unsteady, why do I need to have small time step.
My model has 300,000 cells, what is rough time step needed?
Thanks

abdul099 October 6, 2011 18:42

The time step does not depend on the number of cells but on the time frame of your physical phenomena. Read my second post, it's all written there.
I never mentioned, you need a small time step when you choose implicit unsteady. I just wrote, the smaller the time step, the better in terms of accuracy and stability. And there's no definition for a "small" time step. Most people wouldn't say, a year is a small time step. But it is when you try to simulate the thermal behaviour of our earth.

And just think a little bit about your question. I don't know anything about your simulation. It's a ventilated room, that's fine. But is there a fan, is it ventilated by natural convection, is it a room in a doll's house or an aircraft shelter..... It's impossible to give you any advice on the time step without any further information!

siara817 October 7, 2011 03:03

Hi Abdul,
Thanks for the information.
My simulation in about a small room in our laboratory, with two inlets and one outlet. there is no natural ventilation. the room is ventilated by mechanical ventilation with know air velocity (1 m/s). there is no fan in the room. Just I want to see how is the behavior of particle in this specific room.

abdul099 October 11, 2011 17:06

But the cell size is still unknown, therefore it's still impossible to suggest the timestep.
Why don't you try a time step of let's say 0.1 seconds (assuming you don't model the fan itself) and plot the convective courant number? The courant number should be below 1 for best results, although small numbers above 1 doesn't harm. So check this and when the courant number is too high or residuals doesn't drop in every timestep, you should reduce the timestep.

siara817 October 18, 2011 08:06

1 Attachment(s)
Hi Abdul,

Thanks for your kind help.

I looked at the courant number close to the inlet of the model. then I changed the time step and with the time step of 0.1 s, the courant number distribution was as the attached figure. What do you think, is the time step accepted?

Best regards

Siamak

abdul099 October 20, 2011 08:38

You should look for the courant number in your whole domain, not just at the inlet. When you get courant numbers like this in your whole domain, there's nothing to worry about. But you need to know about the whole domain, as the courant number changes with the cell size, the velocity in a cell and the time step.
Just make a threshold and look if there are big areas where the courant number is significantly above 1. And check how much it is above 1. Make some plane sections and plot the courant number in the main area of interest. Then you will see immediately if it's okay or not.

Cheers

hwsv07 April 8, 2015 14:03

Quote:

Originally Posted by abdul099 (Post 328724)
You should look for the courant number in your whole domain, not just at the inlet. When you get courant numbers like this in your whole domain, there's nothing to worry about. But you need to know about the whole domain, as the courant number changes with the cell size, the velocity in a cell and the time step.
Just make a threshold and look if there are big areas where the courant number is significantly above 1. And check how much it is above 1. Make some plane sections and plot the courant number in the main area of interest. Then you will see immediately if it's okay or not.

Cheers

i have some questions on the same issue.

It is mentioned here that the Courant Number, C, should ideally be less than 1 to fulfill the CFL stability criterion. Fulfilling this crtierion would be based on the choice of my timestep.

Im doing LES on an unsteady case and i want to capture the wake velocity, vortex shedding etc.

In my Solver settings, I have Implicit Unsteady and Coupled Implicit. Im rather confused why I can set both timestep and the courant number. shouldnt it be I can only set timestep and I have to monitor courant number?

DaveyBaby April 9, 2015 11:26

Courant number
 
Never refuse to accept the possibility that you just might not have the resources to run the simulations you would like to. If you can't you need to rethink.

If you have Courant numbers (C) higher than 1, the only way you can be confident that it's not a problem is by running another sim with a smaller timestep and checking that the change in results is small (a bit like a grid refinement study). And for this to be relevant, you need to have 'few' instances of C 'much higher' than 1 anyway. You cant do one with C=500 and one with C=400 and say that it's ok because the solution didn't change much.

In other words, to be confident in your results you:

A) Run two sims with C not much higher than 1
OR
B) Run one with C always less than 1 with a margin

B should take less time than A!

In addition to this, if you are running an unsteady simulation where you are claiming to resolve unsteady phenomena (periodic or turbulent) on a timescale t_physics you need timestep<<t_physics.

I am quite uncomfortable still with the general advice on Courant Number as a lot of people say "don't worry, if the simulation runs impractically slowly then just have a higher Courant number!"

This is the same as saying "do it correctly unless you don't like the fact that it is taking a long time to run".

At the least, it is saying "do it correctly up to a point and just hope you can get away with your high Courant numbers. Then present the results to your engineering team/research journals! Hopefully the plane won't crash!"

hwsv07 April 9, 2015 17:29

Quote:

Originally Posted by DaveyBaby (Post 540842)
A) Run two sims with C not much higher than 1
OR
B) Run one with C always less than 1 with a margin

B should take less time than A!

im not sure if you wrote this correctly - i think you wanted to say A takes less than B ; higher C => larger timestep => less iterations to reach simulation end time.

hwsv07 April 9, 2015 17:36

Quote:

Originally Posted by DaveyBaby (Post 540842)
In addition to this, if you are running an unsteady simulation where you are claiming to resolve unsteady phenomena (periodic or turbulent) on a timescale t_physics you need timestep<<t_physics.

if i do not know the timescale of the physics that im trying to resolve - how can I determine the timestep?

or my question does not make sense?


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