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,

Philippe

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,

Philippe

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.

http://prola.aps.org/abstract/PRE/v71/i3/e036701

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.

Regards

Goncalo

Sorry the references were missing : -(

For the first:

http://prola.aps.org/abstract/PRE/v71/i3/e036701

for the second:

Dear goncalo,

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

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.

Timm

Hi Timm,

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