Skip to content

D3Q7 MRT velocity directions

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB Bug Reports D3Q7 MRT velocity directions

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #5380

    Dear devs,

    I was looking into the D3Q7 MRT implementation in mrtLatticeDescriptors.h, and I found that the matrix M<3,7> “looks odd”, compared to M<2,5> and M<2,9>
    Before continuing, I want to say that I am not 100% familiar with the MRT and how OpenLB changes the velocity directions, so I might very well be wrong.

    That being said, it looks as if currently the velocity set is: rest, +x, -y, -x, +z, +y, -z
    Shouldn’t the velocity set look like this?: rest, -x, -y, -z, +x, +y, +z

    Looking at M<2,5> that velocity set is also: rest, -x, -y, +x, +y
    The M<2,9> also has a more structured velocity direction, with negative first followed by positive.
    That is why I think the M<3,7> looks odd.



    Dear Julius,

    thank you for your bug report.
    You are right with your observations.

    First, please note that the MRT Basis compiled in M for D3Q7 is designed for anisotropic diffusion, though used in OpenLB strictly for isotropic cases via setting off diagonal relaxation values in S to 0 [see Ref. Li, Yang, Zhang 2016 International Journal of Heat and Mass Transfer 94].

    Second, the matrix M for D3Q7 in the code has incorrectly arranged columns, as you claimed in your post.
    This becomes clear when considering its rows nr. 1,2,3 (counted from 0).
    The ordering should be fitted to the velocity set for D3Q7 in /src/dynamics/latticeDescriptors.h, i.e. the correct MRT Matrix should read:
    {1, 1, 1, 1, 1, 1, 1},
    {0, -1, 0, 0, 1, 0, 0},
    {0, 0, -1, 0, 0, 1, 0},
    {0, 0, 0, -1, 0, 0, 1},
    {6, -1, -1, -1, -1, -1, -1},
    {0, 2, -1, -1, 2, -1, -1},
    {0, 0, 1, -1, 0, 1, -1}

    Correspondingly, the corrected inverse of M can be calculated with a basic linear algebra package.
    I’ll, leave that up to you.
    Anything else belonging to the D3Q7 MRT configuration in the file mrtLatticeDescriptors.h should still uphold correctness.
    Please contact me directly via email in case you need further information (stephan.simonis “at”

    Thank you again for pointing out the bug.
    We will include the correction in the next version of OpenLB.


    • This reply was modified 3 years, 6 months ago by stephan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.