Lattice Boltzmann Units Example

From what I see in the discussions, I suspect that some people are still uncomfortable with the two-step unit conversion (physical variables) -> (dimensionless variables) -> (lattice variables). Let me link to the following thread on the OpenLB forum, in which the procedure is explained step by step for a simple case. This should make clear how to translate, in practice, a physical problem into a numerical setup and vice versa.

mmatadu Wrote:

Hi All,

I have read all the discussions on lattice units to physical units conversions, including the ‘Howtos’ article on www.lbmethod.org. However, the pressure/density conversion is not clear to me. Consider the pressure/density conversion relation given in the above discussion:
rho_{LB} = 1+1/c_s^2 p_{Phys}dt_{Phys}^2 / dx_{Phys}^2

Since in LB, we have rho_{LB} ~ 1 (I initialize rho_{LB} = 1 and sometimes during solving it becomes <1), this would sometimes give a negative p_{Phys} right? Then, the conversion above would not be valid.

It is not very clear how one can convert mass. Pressure units (in SI system) = N/m^2 = kg/m-s^2. The conversion could go like:

p_{LB} = p_{Phys}*dx_{Phys}*dt_{Phys}*dt_{Phys} / dmass_{Phys}

This dmass_{Phys} should be some mass conversion. Is this correct? If so, could you’ll please help me define this mass conversion.

If this is not correct, could you’ll explain the correct pressure conversion from lattice units to physical units?

Thank you all!

Hi,

For your first question, remember that we are working in the framework of the incompressible Navier-Stokes equations, in which it is OK to have a negative pressure. Once more (I wonder how many times this has been said on this forum), what matters are pressure differences, and not absolute values of the pressure. When you convert to real-world physics, add a constant pressure offset everywhere to recover an always-positive value.

For the second question, I am not entirely sure. The argument is probably that mass is density times volume, density is constant, and therefore dmass_{Phys} goes like dx_{Phys}^3.

Thank you for your answer Dr. Latt.

It clears up a lot of things for me! So the p_{Phys} to p_{LB} conversion could go like:

p_{LB} = p_{Phys}*dt_{Phys}dt_{Phys} / ( rho_{Phys} * dx_{Phys} dx_{Phys} )

The unit of pressure in 3D is N/m[sup]2[/sup] or (kg/m[sup]3[/sup]) * (m[sup]2[/sup] / s[sup]2[/sup]). This can also be seen from p = c[sub]s[/sub][sup]2[/sup] rho.
Thus, for the pressure, the conversion factor is rho[sub]p[/sub] * dx[sub]p[/sub][sup]2[/sup] / dt[sub]p[/sub][sup]2[/sup]. An index p refers to the physical value, e.g. rho[sub]p[/sub] = 1000 kg/m[sup]3[/sup].
The conversion factor for the mass then simply is rho[sub]p[/sub] dx[sub]p[/sub][sup]3[/sup].
You just have to find the unit of the quantity you want to convert and express it by a combination of density, length and time. Then you will directly get the conversion factor.

1 Like

jlatt Wrote:

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: = cm
    and = 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.

rho_{LB} = 1+1/c_s^2 p_{Phys}dt_{Phys}^2 /
dx_{Phys}^2
what does this formula mean?

I failed to open this link: http://www.lbmethod.org/_media/howtos:lbunits.pdf
File name is: How to chose lattice units in a LB simulation (updated on May 30, 2008).

Can anyone help to upload this file?

thanks a lot!
Liang

Hello
I would like to return to this topic, because I face with small problem/mistery when I use the proposed there equation to convert p_{Phys} to rh0_{LB} in constant pressure BC, namely:
rho_{LB} = 1+1/c_s^2 p_{Phys}dt_{Phys}^2 / dx_{Phys}^2

I have such input data: p_{Phys}=12650 [Pa], dx_{Phys}=0,0125[cm], dt_{Phys}=1,66169E-05[s]
so rho_{LB}=
1 + 1/0.333 * (12650 [kg/(m*s^2)]) * (1,76717E-06 [s^2/cm^2]) =
1 + 1/0.333 * (12650/100 [kg/(cm*s^2)]) * (1,76717E-06 [s^2/cm^2]) =
1 + 0,000670642 [kg/cm^3]

when I change data from [cm] to [m], dx_{Phys}=0,000125[m]
and rho_{LB}=
1 + 1/0.333 * (12650 [kg/(ms^2)]) * (0,017671725 [s^2/m^2]) =
1 + 1/0.333 * (12650 [kg/(m
s^2)]) * (0,017671725 [s^2/m^2]) =
1 + 670,642 [kg/m^3]

I know that I can convert 670,642 [kg/m^3] to 0,000670,642 [kg/cm^3]
but WHY?
So does it mean that this/above equation to convert p_{Phys} to rho_{LB} is only valid for kg/cm^3
A little strange

I hope that this is only my mistake, but really I cannot find it.
Thanks for any help

Without reading everything of your post in detail: I strongly suggest to use only m, s, kg and other derived SI units without SI prefixes like centi or milli. Before computing the LB units, first convert everything to pure SI units.

Yes, I always did it in such a way, that firstly I use only m, s, kg.
But next I check the behaviour, of equation for cm, s, kg:
rho_{LB} = 1+1/c_s^2 p_{Phys}dt_{Phys}^2 / dx_{Phys}^2

and I receive strange things:) which I rescribe above.

You cannot sum up a dimensionless number and a number with a dimension. That’s the explanation. The conversion factor has also to be applied to the average density of your fluid which is 1 in LB units. In other words, the lattice mean density is 1, but it is 1000 kg/m^3 or 1 g/cm^3. Please take this into account.

To sum up, If I understand good, it means that equation:
rho_{LB} = 1+1/c_s^2 * p_{Phys} * dt_{Phys}^2 / dx_{Phys}^2

is valid with such a units ??
[ g/cm^3 ] = [g/cm^3] + [g / (cm * s^2)] * s^2 / cm^2

And also such a form is valid
rho_{LB} = 1000+1/c_s^2 * p_{Phys} * dt_{Phys}^2 / dx_{Phys}^2
but with units
[ kg/m^3 ] = [kg/m^3] + [kg / (m * s^2)] * s^2 / m^2

And now going/coming to LBM simulation, when I use second equation, the density will oscillate about 1000
and this is not good for numerical stability, therefore is better to use first equation ??

I know that physicaly these two equations are the same. But do I understand this translation problem in good manner?
Thanks in advance for answer.

No matter which equation you take, you set the lattice density to 1. I mean, it is very clear that the same equation cannot lead to different result if another unit system is used.
Example: lattice density is 1. If you take kg, m, s as units, the density conversion factor for water is delta rho = 1000 kg/m^3. right? If you take g, cm, s instead, the conversion factor is delta rho = 1 g/cm^3. However, both conversion factors are exactly the same since 1 kg = 1000 g and 1 m = 100 cm. The density of water in the one unit system is 1000 kg/m^3 leading to a lattice density of 1. The density of water in the other unit system is 1 g/cm^3 leading also to a lattice density of 1. Clear?

1 Like

Thanks, it is now clear like the sun, we were talking about the same but in slightly different manner.

And one more question but still connected with the same subject:
So when I want to use He&Luo imcompressible model where I need q and q0 and in distribution function instead of ‘f’ we have ‘p’, in order to obtain q0 (rh0) I should use the conversion factor 1000/3 [kg/m^3]
(or consequently (1 / 3) [g/cm^2]) ??

Thanks in advance for answer

jlatt Wrote:

2>

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.

According to Timm, the conversion factor between P[sub]p[/sub] and P[sub]lb[/sub] is rhop * dxp2 / dtp2, then
P[sub]p[/sub]=rhop * dxp2 / dtp2*P[sub]lb[/sub], so P[sub]lb[/sub]=P[sub]p[/sub]dtp2/(rhopdxp2). Given P=cs[sup]2[/sup]rho,
so rho[sub]p[/sub]=1/cs^2
[P[sub]p[/sub]dtp2/(rhopdxp2)].
I wonder where is the first term 1 of the RHS function Latt mentioned comes from.

Hi.
I’m simulating thermal flow in a 2-d micro-couette using LBM. I have a serious problem with thermal unit conversion in LB.
I want to reproduce the results of the DSMC method in (XIAO-JUN GU et. al. “A high-order moment approach for capturing non-equilibrium phenomena in the transition regime”, J. Fluid Mech. (2009), vol. 636, pp. 177–216. c ,Cambridge University Press 2009, doi:10.1017/S002211200900768X) Part 6. Results and discussion, for thermal-micro-couette flow in the transition regime (namely, Knudsen number Kn>0.1). But I don’t know how to convert the values of the wall temperature (Tw) and the gas constant ® to lattice units.
as we know the sound speed in the LBM is Cs=C/SQRT(3) and C=SQRT(3RT). Then what should I do with the value of the R and T in the calculation of the C.
Please help me. I’m working on my thesis and I’m in a bad hurry.
I appreciate any help in advance.

I have a question regarding multicomponent LBM. What is the significance of the density values we put into our simulations? Are they just indicators (showing which part of a domain is occupied by a certain fluid)?

No, of course not. In reality, two different components or phases may have a quite different density (e.g., water and air much more than water and oil). This is of significant physical relevance since the density ratio can influence the flow dynamics. I believe that, in general, not all properties of a multiphase system can be correctly recovered when the density ratio is wrong.

Timm

Thanks Timm.

I am simulating Co-current immiscible two-phase flow in a 2D channel, the wetting phase flows along the upper
and lower plate while non-wetting phase flows in the center region using SC model.
My objective is to verify my model with the results of:

" Shan-and-Chen-type multiphase lattice Boltzmann study of viscous coupling effects for two-phase flow in porous media"
by Haibo Huang?, Zhitao Li, Shuaishuai Liu and Xi-yun Lu

I am using the same LB kinematic viscosity \nu_{lb} for both fluids (the value is 1/6) and the density of wetting and nonwetting fluids are 1 and 0.1, respectively. After the end of my simulation, I see a single parabolic velocity profile for velocity in the direction of flow {x-direction} which does not account for phase change (density change). In other words, it is just like plotting velocity profile for flow of SINGLE Phase through a channel!!!

Could you please help me on that?

Sincerely,