
[Sponsors] 
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:
then, to the get characteristic time, you would have to divide the length by the velocity, NOT multiply it... Quote:
Quote:
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:
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  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Full pipe 3D using icoFoam  cyberbrain  OpenFOAM  4  March 16, 2011 10:20 
how to calculate the averaged mass flow along a line over time ?  iampolaris  OpenFOAM PostProcessing  0  March 10, 2011 23:03 
Differences between serial and parallel runs  carsten  OpenFOAM Bugs  11  September 12, 2008 11:16 
Modeling in micron scale using icoFoam  m9819348  OpenFOAM Running, Solving & CFD  7  October 27, 2007 00:36 
Transient simulation not converging  skabilan  OpenFOAM Running, Solving & CFD  12  September 17, 2007 17:48 