Skip to content

set_dp_pressure

Description

Initializes a pressure perturbation \(\Delta p\) (Pa) relative to the reference state of the fluid (\(\rho_{LBM} = 1\), i.e. avg_rho). Unlike set_distribution, \(\Delta p = 0\) always leaves the fluid unperturbed, regardless of the time step. The pressure is converted to a lattice density with the isothermal equation of state (\(p = c_s^2 \rho\), \(c_s^2 = 1/3\) in lattice units):

\[ \Delta p_{LBM} = \Delta p\,\frac{\Delta t^2}{\rho_{ref}\,\Delta x^2}, \qquad \rho_{LBM} = 1 + 3\,\Delta p_{LBM}, \qquad f_i = w_i\,\rho_{LBM}. \]

It can be applied to the whole grid, to an axis-aligned box, or inside / outside a quadric.

YAML syntax

1
2
3
4
5
6
7
8
9
set_distributions:
  - set_dp_pressure:
     delta_p: 1.0e6          # 1 MPa
     quadrics: sphere
     transform:
       - scale:     [0.15, 0.15, 0.15]
       - translate: [1.0,  1.0,  1.0 ]
     inside: true            # false: initialize outside the sphere
     verbosity: true
Parameters' description
Slot Type Default Description
delta_p double required pressure difference (Pa) relative to the reference state
bounds AABB optional restricts the perturbation to this box
quadrics Mat4d optional quadric shape restricting the region
transform Mat4d optional sequence of scale / translate transforms applied to the quadric
inside bool true with a quadric: true sets the nodes inside the quadric, false the nodes outside
verbosity bool false prints the converted lattice density

Usage example

1 MPa sphere in water (lbm_pressure_sphere_water)

set_pressures:
  - set_dp_pressure:
     delta_p: 1.0e6
     quadrics: sphere
     transform:
       - scale:     [ 0.15, 0.15, 0.15 ]
       - translate: [ 1.0,  1.0, 1.0  ]
     verbosity: true

set_distributions:
  - set_distribution:
     value: 1.0
  - set_pressures
dp pressure sphere
1 MPa spherical pressure perturbation expanding in a fully periodic water cube

See the pressurized sphere in water tutorial.