CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to calculate simulation time?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2011, 09:18
Default How to calculate simulation time?
  #1
Yur
New Member
 
Join Date: Aug 2011
Posts: 17
Rep Power: 14
Yur is on a distinguished road
Hello guys,

I would like to know, if there is a proper way to calculate the simulation time and the number of timesteps.

Thanks.
Yur is offline   Reply With Quote

Old   August 25, 2011, 10:21
Default
  #2
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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...
cfdnewbie is offline   Reply With Quote

Old   August 25, 2011, 10:51
Default
  #3
Yur
New Member
 
Join Date: Aug 2011
Posts: 17
Rep Power: 14
Yur is on a distinguished road
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.
Yur is offline   Reply With Quote

Old   August 25, 2011, 12:03
Default
  #4
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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!
cfdnewbie is offline   Reply With Quote

Old   August 25, 2011, 13:39
Default
  #5
Yur
New Member
 
Join Date: Aug 2011
Posts: 17
Rep Power: 14
Yur is on a distinguished road
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?
Yur is offline   Reply With Quote

Old   August 25, 2011, 13:53
Default
  #6
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Quote:
Originally Posted by Yur View Post
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!
cfdnewbie is offline   Reply With Quote

Old   August 25, 2011, 16:47
Default
  #7
Yur
New Member
 
Join Date: Aug 2011
Posts: 17
Rep Power: 14
Yur is on a distinguished road
Thank you very much for the explanation. I definitively gonna do some reading on this.
Yur is offline   Reply With Quote

Old   August 25, 2011, 16:53
Default
  #8
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
No problem. Come back if you have any more questions!
cfdnewbie is offline   Reply With Quote

Reply

Tags
sim, time, timestep


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 16, 2019 23:12
Full pipe 3D using icoFoam cyberbrain OpenFOAM 4 March 16, 2011 09:20
how to calculate the averaged mass flow along a line over time ? iampolaris OpenFOAM Post-Processing 0 March 10, 2011 22: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


All times are GMT -4. The time now is 02:35.