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¶
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)
See the pressurized sphere in water tutorial.