How to add external force

Hi, everyone.

I am doing natural convection model with LB method. I read the example with Matlab code from, which helps me a lot, but I have problem with the unit and gravity. The gravith unit in physics is m/s^2, how to transfer it to LB unit. And I am confused how to get the gravity as 0.001.

If anyone has comments, please reply. Your help is highly appreciated.

Thanks for your time.

Best regards.


This code treats the system in dimensionless units; this means that the system is fully determined once the Reynolds and the Rayleigh number are set. You can then figure out the physical parameters by taking a physical system with the same Reynolds and Rayleigh number (this has nothing to do with lattice Boltzmann).

The gravity which is 0.001 is the “gravity in lattice units”, which has nothing to do with the physical gravity. It is rather a numerical parameter, used to fix the discrete time step dt. You can find out more about this in the tutorial on lattice units (

Hi, Jlatt,

Thanks for your response.
You said “The gravity of 0.001 in lattice units has nothing to do with physical gravity”, so, my understanding from your word is that I can not get the 0.001 in lattice unit from the physics units(9.8m/s^2). Do you mean it is a constant in lattice units for any LB system (like gravity is 9.8m/s^2 in physics units, we do not need to calculate this gravity in physics)? or is it a random number? If not, how come?