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,
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.

http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6WHY-4MG1X30-1&_user=2459750&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_acct=C000057394&_version=1&_urlVersion=0&_userid=2459750&md5=db37a5e868f9f4b3e42f2d42c6862f9b

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:

http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6WHY-4MG1X30-1&_user=2459750&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_acct=C000057394&_version=1&_urlVersion=0&_userid=2459750&md5=db37a5e868f9f4b3e42f2d42c6862f9b

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.
Timm

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.