# How to calculate simulation time?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 25, 2011, 09:18 How to calculate simulation time? #1 New Member   Join Date: Aug 2011 Posts: 17 Rep Power: 7 Hello guys, I would like to know, if there is a proper way to calculate the simulation time and the number of timesteps. Thanks.

 August 25, 2011, 10:21 #2 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 557 Rep Power: 12 What do you mean by simulation time? The physical time you are trying to cover in your simulation? That's something you fix/decide upon.... The wall clock time your code needs to perform a certain # of iterations? That's something you can deduce from benchmarks done with your code.... not clear what you mean exactly.... cheers...

 August 25, 2011, 10:51 #3 New Member   Join Date: Aug 2011 Posts: 17 Rep Power: 7 Sorry for the confusion. With the simulation time, I mean actually the physical size of one timestep. I've read somewhere, that it could be calculated with the CFL number, but I don't really know where to start with this.

 August 25, 2011, 12:03 #4 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 557 Rep Power: 12 There are two things that govern your timestep: a) physics. Find out which is the timestep that governs your physics, i.e. what is the smallest time phenomena in your solution. Let's say if something occurs at a frequency of 1000 Hz, then certainly that would give you an estimate for your upper bound on the time step b) numerical stability. (talking about explicit schemes): CFL condition is an expression of the fact that you have a wave speed in your system, which governs the transport of information. Your time stepping scheme should be compatible with physics in a sense that your timestep should allow the information to travel only to an adjacent control volume in a single time step, i.e. you have to respect the natural way of information transport in the fluid. You might google the CFL condition or check standard text books on it, the gist is the following: Compute your fastest wave speed in the system (largest EV of the flux jacobi matrix) and divide grid cell length by it. that gives you the characteristic time information needs to cross one grid cell. Take a fraction of this time (= safety margin = CFL number) as this timestep for your computation. This might be an oversimplification for hyperbolic 1d probs only, but it should give you an idea about what to do. cheers!

 August 25, 2011, 13:39 #5 New Member   Join Date: Aug 2011 Posts: 17 Rep Power: 7 My finest grid cell size is 0.5mm and characteristic speed is 55m/s. So if I understand this correctly , I have to do the following, to get the value of one time step : 0.0005 * 55 = 0.0275 0.0275 / 340 (speed of sound ) = 0.00008 sec This would be one time step right? And just another noob question. One timestep is the time needed to calculate equations over one cell or the time one particle takes to calculate one flowpass in a simulation volume?

August 25, 2011, 13:53
#6
Senior Member

cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 12
Quote:
 Originally Posted by Yur My finest grid cell size is 0.5mm and characteristic speed is 55m/s. So if I understand this correctly , I have to do the following, to get the value of one time step : 0.5 * 55 = 27,5
ehh...no first, you mixed your units... mm * m/s...
then, to the get characteristic time, you would have to divide the length by the velocity, NOT multiply it...
Quote:
 27,5 / 340 (speed of sound ) = 0.08 sec
the speed of sound in your calculation will most likely NOT be fixed, since it is calculated from c= sqrt(gamma * R * T), so it will depend on your local T(p,rho)...

Quote:
 This would be one time step right?
no, unfortunately not. the characteristic wave speeds (eigenvalues) of the Euler part are (2d), u, u, u-c, u+c,...
so what you have to do is to calculate these speeds locally (c, abs(u) everywhere), THEN determine the max velocity and take that.... I suggest you do some reading on this...

Quote:
 And just another noob question. One timestep is the time needed to calculate equations over one cell or the time one particle takes to calculate one flowpass in a simulation volume?
the timestep you calculate is the maximum allowable time step you can advance your solution in time without the simulation becoming unstable due to numerical errors. Let's say you want to simulate the flow from 0s to 10s... and you find out that your max timestep is 1s...then you would have to perform 10 timesteps, each integrating the solution over 1 s.....

hope this helps!

cheers!

 August 25, 2011, 16:47 #7 New Member   Join Date: Aug 2011 Posts: 17 Rep Power: 7 Thank you very much for the explanation. I definitively gonna do some reading on this.

 August 25, 2011, 16:53 #8 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 557 Rep Power: 12 No problem. Come back if you have any more questions!

 Tags sim, time, timestep

 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 cyberbrain OpenFOAM 4 March 16, 2011 10:20 iampolaris OpenFOAM Post-Processing 0 March 10, 2011 23:03 carsten OpenFOAM Bugs 11 September 12, 2008 11:16 m9819348 OpenFOAM Running, Solving & CFD 7 October 27, 2007 00:36 skabilan OpenFOAM Running, Solving & CFD 12 September 17, 2007 17:48

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