Skip to content

LBM parameters

Description

lbm_parameters converts the physical parameters into lattice units. With \(\Delta x\) the grid spacing (computed by domain) and \(\Delta t\) the LBM time step:

\[ \nu_{LBM} = \nu\,\frac{\Delta t}{\Delta x^2} = \frac{\tau - 1/2}{3}, \qquad c = \frac{\Delta x}{\Delta t}, \qquad \mathbf{F}_{LBM} = \mathbf{F}\,\frac{\Delta t^2}{\Delta x}, \qquad c_s^2 = \frac{c^2}{3}. \]

One of three quantities fixes \(\Delta t\):

Given Then
tau \(\Delta t = \Delta x^2 (\tau - 1/2) / (3\nu)\)
dt \(\tau = 3 \nu \Delta t / \Delta x^2 + 1/2\)
neither (default) \(\Delta t = \Delta x / c\) with \(c\) = celerity, then \(\tau = 3\nu_{LBM} + 1/2\)

The density is normalized by avg_rho: \(\rho_{LBM} = 1\) is the reference state, and a lattice density \(\rho_{LBM}\) corresponds to a pressure difference \(\Delta p = c_s^2\,\rho_{ref}\,(\rho_{LBM} - 1)\).

Note

Fixing tau is the preferred approach: it gives direct control over numerical stability and viscosity, independently of the grid resolution. Specifying dt directly is possible but not recommended. tau and dt are mutually exclusive: lbm_parameters aborts if both are given.

YAML syntax

1
2
3
4
5
6
7
set_lbm_parameters:
  - lbm_parameters:
     Fext:     [0.0, 0.0, 0.0]   # body force per unit mass (m/s²)
     nuth:     1e-4              # kinematic viscosity (m²/s)
     avg_rho:  1000.0            # reference density (kg/m³)
     celerity: 1.0               # lattice celerity dx/dt (m/s), used if neither tau nor dt is given
     tau:      0.7               # relaxation time (optional; exclusive with dt)
Parameters' description
Slot Type Default Description
nuth double 1e-4 kinematic viscosity (m²/s)
avg_rho double 1000.0 reference density (kg/m³)
Fext Vec3d [0, 0, 0] body force per unit mass (m/s²), uniform over the domain
celerity double 1 lattice celerity \(\Delta x / \Delta t\) (m/s)
tau double optional relaxation time
dt double 0 LBM time step (s); also an output slot holding the computed \(\Delta t\)

The computed values are printed at startup, for example:

= External forces Fext:           [...] (physical) / [...] (LBM)
= Network celerity celerity:      ... (physical) / 1 (LBM)
= Celerity time step dtLB:        ... (physical) [dx / celerity] / 1 (LBM, by convention)
= Viscosity nuth / nu:            ... (physical) / ... (LBM)

Water at high celerity (pressure waves)

- lbm_parameters:
   nuth: 1.0e-6        # water at 20 °C
   avg_rho: 1000.0
   celerity: 14800.0   # 10 x the speed of sound in water

See the pressurized sphere in water tutorial.