# Lattice Boltzmann Units Example

I was wondering if it would be possible to make a sticky post for a units example. It seems
that units can be frustrating to figure out for people new to LBM. I did an example below. I had one
question about the pressure conversion and multiplying by rho.

Units example of LBM

Have a 2-D channel flow that is 4 cm long and 1 cm wide

`````` ___________________________________________
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |  1 cm
|                                                                          |
|                                                                          |
|                                                                          |
|__________________________________________ |

4 cm
``````

The grid is 100 x 25

The physical viscosity and rho are knownâ€¦
nu_{Phys} = 0.035 cm^2/s
rho_{Phys} = 1 g/cm

Calculations

dx_{Phys} = 1/25 = 100/4 = .04 cm

assign a value to tau
tau = 1.5

given that nu_{Phys}=dt_{Phys}/(dx_{Phys}*dx_{Phys})*nu_{LB}

and that nu_{LB} = c_s^2(tau-1/2)

dt_{Phys} = nu_{Phys}*dx_{Phys}*dx_{Phys}/c_s^2/(tau-1/2)

dt_{Phys} = .035*.04*.04*3/(1.5-.5)

dt_{Phys} = 0.000168 s

Assume there is an applied pressure at the inlet of
P_{Phys} = 16000 Pa

1 Pa = Kg/m-s^2

P_{LB} = P_{Phys}* 1000g/kg * 1m/100cm * dx_{Phys} cm/LU *dt_{Phys}^2/TU
P_{LB} = 0.00018 g/LU-TU^2

rho_{LB} = rho_{Phys} * dx_{Phys}^3/LU^3
rho_{LB} = 1 gm/cm^3 * .04^3
rho_{LB} = 0.000064 g/LU^3

Does the pressure need to be multiplied by rho at this point???

1 Like

Hi,

I like the idea of producing a show-case example for unit conversion. There are two points that are not clear to me in your post though.

1. You define the discrete space and time steps in such a way that they carry physical units: [dx] = cm and [dt] = s. On this assumption, a dimensional analysis of your equation which relates nu_{phys} to nu_{LB} is erroneous. Shouldnâ€™t this formula be as follows, in order to get the right units:

nu_{Phys}=(dx_{Phys}*dx_{Phys})/dt_{Phys}*nu_{LB} ?

1. I am not sure which lattice Boltzmann model you are referring to. If it is BGK, then pressure and density are not independent parameters. They are related through the law of an ideal gas: p = c_s^2 rho. I have the feeling that most people who use BGK use it to simulate an incompressible fluid. In that case, the physical value of the density rho is irrelevant (although variations of rho are still relevant in simulation, as they are proportional to pressure variations). Even if you do use BGK to simulate a compressible fluid (in which case you should be aware of the many limitations, such as being constraint to a low Mach-number regime, impossibility to adjust the speed of sound, and impossibility to adjust the bulk viscosity), I am not sure if it is a good idea to adapt the LB density as a function of the physical density. In practice, everybody I know of uses a density value close to 1, and you actually run into numerical instabilities and inaccuracies when you differ too much from this value.

When you implement a boundary condition for the pressure, the translation from physical units to lattice Boltzmann units should, according to me, be as follows:

rho_{LB} = 1+1/c_s^2 p_{Phys}dt_{Phys}^2 / dx_{Phys}^2

where c_s^2 is the constant 1/3, which should be used without units when you proceed to a dimensional analysis of the above equation.

just wondering if this is really a good idea, setting tau to an arbitrary value. shouldnâ€™t it be the other way round, choose a value for delta_t, and then compute tau?

You can do it both ways. The point is that chosing delta_t you can have troubles with the stability of your code (tau could become very close to 1/2).

Hello everybody,
Would you please inform me, If I want to put any constant value (e.g. Boltzman constant Kb=1.38065 J/K or Gas constant R=8.314511 J/mol/K) then how can I put it. Can I just put it directly or need to convert it to LB ? With all the best

Hi,
of course you need to convert them into LB units since they have real world units. The non dimensional numbers are the only quantities you do not need to convert (it sounds quite trivial because they have no unitsâ€¦).

Orestis

A potentially useful reference here might be Sukop and Thorne LB Introductory textbook, pages 56-57 on gravity-forced 2D poiseuille channel flow. This includes:

(1) A slightly reversed case to the original question: how big does the channel need to be (lattice units) in order for the flow to give the desired Re number. In this case, a target value of tau = 1 is used.

(2) How to incorporate gravity by converting from SI to lattive units: ie. have to take 9.8 m/s^2 and find its value in units of (lattice units) / (timestep)^2.

1 Like

Hi malaspin,
Would you please explain how can I convert gas constant R=8.314511 J/mol/K, if I know the lb units of length, time and mass?( J=m^2*kg/s^2). What should I do about Temperature unit(K)?
Yours Truly

Hi,
it depends a bit of the kind of simulation you are performing.

Usually you will convert from lb to real world units using non dimensional numbers like Reyolds, Rayleigh, â€¦

For the temperature you can use the Rayleigh number to transform your quantities between the LB and physical units. You can find details in another post by tovarish here . I hope you can get the information you want from there. If not maybe you should tell me with more details what is your physical problem.

Orestis

is the problem you are trying to resolve isothermal? If the answer is yes, you wont find your answers in the post Orestis told you about.
Is your problem thermal dependent and it is such that you can define a dimensional number called Rayleigh number for it? well â€¦ then the post could be useful. In fact the Rayleigh number depend on the gradient of the temperature.

Is your problem the Couette flow with energy dissipation due to the viscous forces? then still look at the postâ€¦ we refer to a paper that could help.

By the way â€¦
The Boltzmannâ€™s constant should be defined for a reference temperatureâ€¦ no? Iâ€™m not sure but â€¦ then it would a constant that you could get rid off in LB unitsâ€¦ of course you should remember about its value when you go back to the â€śrealâ€ť world. Orestis? am I writing bullshit as usual?

or, as Orestis said, you could look for an interesting dimensionless number where R appears â€¦

really â€¦ could you please post your problem or â€¦the paper that you are looking at? Iâ€™m interested in it. To pass from real units to LB units is something that it has always been super tricky for me.
Do you find R when you define the internal energy of your system (which should depend on the temperature then)?

ciao
And

Hi,
in fact if you are using the standard LBGK model then the model is â€śa-thermalâ€ť, in the sense that you cannot adjust the temperature. The way to convert between temperature and lattice units is through the speed of sound and the ideal gas law.

You remember that p=c_s^2rho, and p=rhokT, then c_s^2=kT, where k is the Boltzmann constant.

I hope that if you are in one the cases mentioned by Tovarish or me.

If not just post your problem and try to help you. Btw you did not say so much bullshit ;p

Cheers,
Orestis

Thanks a lot Masterâ€¦

Andrea

Hi All,
I have a simple problem, just like a channel flow(say L=8mm, H=3mm)in which Lower plate is heated(300 K) and upper plate is maintained at a constant temperatrure(273K), however both plates are fixed .Incoming fluid (say water) velocity is controlled by Reynolds number . As a channel flow, velocity is important but most of Authors suggest me to use Rayleigh number. But we know ,in Rayleigh-Benard Convection, velocity is taken to be zero and Boussinesq approximations are used. So what should I do?
All kind of suggestions are most welcome.
Yours Truly
Sohag

look at this paper â€¦

it could help

Entropy generation in Poiseuilleâ€“Benard channel flow

doi:10.1016/S1290-0729(03)00095-4

let me know if this is what you were looking for â€¦

ciao
And

As there have been many discussions around the choice of units in LB simulations, I have tried to summarize the key ideas in a pdf document. You can retrieve it from the new â€śLB Howtosâ€ť section on lbmethod.org:

http://www.lbmethod.org/doku.php?id=howtos:main

The document contains also a section on thermal fluids with Boussinesq approximation. Please let me know if this answers your question. Of course, I welcome any comments or hints on possible mistakes in the document.

Jonas,

Thank you very very much for the excellent pdf file on units! You have been super on this forum.

Mark

Hi,

This question is about units on the Matlab Lattice Boltzmann Coding:

I am trying to figure out the physical interpretation of the values for uMax, as well as the grid spacing for the Matlab code in â€ścylinder.mâ€ť however the author has failed to document/comment on what the units, is the uMax = 0.02 to mean 0.02 meters/sec?

Note: I have downloaded the other matlab m-files found on this site and none of them document the units.

Hi,
all the values in the m-files are in LB units. Therefore this uMax is not in meters per second. To recover the real life units you have to do a conversion using non dimensional parameters such as Reynolds number in the cylinder case.

Cheers,
Orestis

Hi, I post here because I have a problem of units with the viscosity.

I have 1 geometry where 1 fluid could have 2 different volumetric flows. So I have 2 reynolds number, but the viscosity remains the same, and I canâ€™t calculate same viscosities, from LB units â€¦

I have found in file units.h :

/// viscosity in lattice units
T getLatticeNu() const { return getLatticeU()*getResolution()/Re; }

I donâ€™t understand because :

Here : Nu_{LB}=U_{LB}.N/Re ,
with U_{LB}=dx/dt , N=1/dx
so Nu_{LB}=1/dt .

I have read that Nu_{LB} = dxÂ˛/dt â€¦

Maybe I have wrong, but someone could explain me ?

The reason for this apparent contradiction is that you are mixing up two possible interpretations of the discrete steps dx and dt. As this is a common mistake, I do suggest that you read the tutorial on lattice units to understand the subtleties behind unit conversions.

The bottom line is that the physical units of a velocity scale like Length/Time, and the physical units of a viscosity like Length^2/Time. Now, variables dx and dt in OpenLB are defined so as to restore physical units, and not lattice units. Thus, if one assumes that velocity is unity in a reference physical system, one has

``````
U_{Phys} = dx/dt U_{LB} = 1, and therefore U_{LB} = dt/dx .

``````

Similarly, you have nu_{LB} = dt/dx^2, and everything ends up fine.