body force in MRT

Dear all,

I am trying to implement a MRT model and when adding a body force term, the simulation blows up. Can anyone give me a hint on how to do it or at which literature to look?

Thanks in advance,

Dear Phillipe

From your information is difficult to say why your simulation is crashing…
Therefore, I would recommend you to first look at the way you wrote and included the body force in the collision step in moment space.

If your code is 2D (i.e. you are using the D2Q9 model) please see in the paper:

Multiple-relaxation-time lattice-Boltzmann model for multiphase flow (2005) from PRE.

If your code is 3D (i.e. you are using the D3Q15 or the D3Q19 model) please see in the paper:

Three-dimensional multi-relaxation time (MRT) lattice-Boltzmann models for multiphase flow (2007) from J.Comp. Phys.

Hope the references help.



Sorry the references were missing : -(

For the first:

for the second:

Dear goncalo,

thank you for the hints, I was already able to improve my program so the simulation crashes later :wink:

I triead two ways to add a body force, adding it to the velocity used for the collision step and naively adding

for(int i=0;i<19;i++) f+=scalar_product(c[i],extForce)

and it crashes both ways. Maybe it has to do with the relaxation time settings…

An unrelated hint:
I do not recommend to compute the scalar product on the fly. This is a waste of CPU power since most of the factors are identically zero. I could speed up my LBM code by a factor of 2 by using the known result, e.g.

(1, 0, 0) * (u, v, w) = u

It is less clear when you read the code with 19 different lines for the populations, but the gain in efficiency is justification enough.

Hi Timm,
I do that anyway, just posted it as this pseudo-code for clarity :slight_smile: my speed-up for SRT was of a similar order.