# Timestep size

Hello,

I’m working at university in linz austria and have one question to the timestep calculation in palabos.

I have written a code in MatLAB to simulate a karman vortex street at reynoldsnumber 120! Literature speaks in this region from a karman vortex street. Based on the tutorial cylinder2d in palabos I started my simulations with the aim to get the same result as I have calculated with my MatLAB code.

I was very surprised that there is no karman vortex street with Re 600 without placing the cylinder not in the symmetryline.
After some maths I rrealized that Re ist based at 1 in palabos, thats ok, so I must choose my Re for that. That is ok.

But then I also get no karman vortex street for my problem with Re = 120 based on the diameter of the cylinder with cylinder based in real symmetryline.

So I looked closer at units.h and found the calculation of the timestepsize dt called getDeltaT()

I found that there is a complete different equation as I expected, so I changed this to my own equation:

``````/// time step in dimensionless units
//T getDeltaT() const  { return getDeltaX()*getLatticeU(); }

/// my time step
T getDeltaT() const  { return 1.0/3.0*(getTau()-0.5)*getDeltaX()*getDeltaX()/getLatticeNu(); }
``````

WIth this changes I get the same result as with my MatLabcode, which I have tested and compared using the Strouhal number, which must be between 0.14 and 0.21 for 80 < Re < 150, with Re based on diameter of cylinder.

I have a diameter of 0.1 which means the Re based on 1 must be ten times higher set for palabos, because this works with Re based on cells in length 1. With this I get the same results as with my MatLab program. I’m now not sure if I’m wrong or if I have a mistake in my calculations.

Hey there,

I was very surprised that there is no karman vortex street with Re 600 without placing the cylinder not in the symmetryline.

If it´s totaly symmetric then there will be no disturbance and therefore no vortex, so this seems fine to me.

After some maths I realized that Re ist based at 1 in palabos, thats ok, so I must choose my Re for that.

What do you mean by… its based at 1… ?

/// time step in dimensionless units
//T getDeltaT() const { return getDeltaX()*getLatticeU(); }

/// my time step
T getDeltaT() const { return 1.0/3.0*(getTau()-0.5)*getDeltaX()*getDeltaX()/getLatticeNu(); }

With the three input parameters: u[sub]lb[/sub], RE and N, Palabos calculates the others:

Since Nu[sub]lb[/sub]=dt/dx^2 * Nu[sub]d[/sub] and Re = 1 / Nu[sub]d[/sub] Palabos calculates Tau from the equation you use for the timestep.

So Palabos imposes u[sub]lb[/sub] and calculates the other parameters with it.
You impose Tau to get dt (and therefore u[sub]lb[/sub]).
Make sure you have the same lattice velocity in both cases, then you should get the same results.

Hello,

thank you for the answer. With based on 1 I meant, that I thought that the used length in the calculation of RE is 1 in palabos. I thought that if I have a cylinder with diameter 0.1 then I must calculate the RE with 1 and not with 0.1 in palabos, but I’m not really sure if this is correct.

I will try what you have written about the lattice velocity. Thank you.

Hey again,

I think you should read something about unit conversion in palabos, and yes it´s confusing for anybody - but (hopefully not forever^^

A short summary is that palabos does not care about the physical world:

All it requires is a value for RE, the timestep and the grid size (in the parameters-class you define u_lb, but with N (or dx=1/N) already given, dt_lb is calculated with u_lb = dt_lb / dx_lb).
Also, the lattice velocity is just a numerical value, and changing it does by no means change the (underlying) physical velocity.
So if you want physical results, you have to connect the lb-units with physical ones, as described in the links above.

For example, the Reynolds number could be

``````
RE = uref_p * lref_p / visc_p

``````

with uref_p … the physical reference velocity
lref_p … the physical reference length (cylinder diameter)
visc_p… and the physical viscosity of the fluid

cheers,
chris

Hallo

Thank you for the answer and the links, I hope I will understand it with this literature!

Thank you and greetings
David

Hello,

now I have read the literature and get the same results for palabos and my LB-code, but only if the cylinder is not on the symmetryline. If it’s in the middle then I get the instable solution (but that’s also a solution) in palabos, with a small distortion I get the karman vortex street.

Thank you very much for your help.

greetings
david