Skip to content

set_distribution

Description

Sets every distribution function to the rest state of a lattice density value:

\[ f_i = w_i \cdot \texttt{value}, \qquad \rho_{LBM} = \texttt{value}, \qquad \mathbf{u} = 0, \]

on the whole grid, in an axis-aligned box (bounds) or inside a quadric (quadrics + transform).

Warning

value is a lattice density: value: 1.5 is a 50 % over-density, i.e. a very large pressure jump. To impose a physical pressure perturbation independent of the time step, use set_dp_pressure.

YAML syntax

set_distributions:
  - set_distribution:
     value: 1.0                   # whole grid
  - set_distribution:
     value: 1.5
     bounds: [[0,0,0], [0.048,1,1]]
  - set_distribution:
     value: 1.2
     quadrics: sphere
     transform:
       - scale:     [0.1, 0.1, 0.1]
       - translate: [0.3, 0.3, 1.5]
Parameters' description
Slot Type Default Description
value double 1.0 lattice density of the rest state
do_update bool false if true, operates on the real nodes only and updates the ghost layers; otherwise applies to all nodes including the ghost layers
bounds AABB optional restricts the initialization to this box
quadrics Mat4d optional quadric shape restricting the initialized region
transform Mat4d optional sequence of scale / translate transforms applied to the quadric

Usage example

High-density region driving a flow (lbm_diff_pressure)

set_distributions:
  - set_distribution:
     value: 1.5
     bounds: [[0,0,0], [0.048,1,1]]

See the pressure-driven flow tutorial.