Pressure / density (rho)¶
Description¶
The rho operator enforces a density — equivalently a pressure — on one or several boundary planes. It is the
natural way to drive a flow with a pressure difference instead of a body force (Fext). The prescribed pressure
delta_p (Pa, relative to the reference state) is converted to a lattice density with the same convention as
set_dp_pressure:
It is applied after streaming, in the boundary_conditions block.
YAML syntax¶
| Slot | Type | Default | Description |
|---|---|---|---|
delta_p |
[Quantity] |
required | pressure differences (Pa), one per region, with explicit units (kg/m/s^2); use opposite signs on inlet and outlet to drive a flow |
regions |
[string] |
required | planes: plan_xy_0, plan_xy_l, plan_yz_0, plan_yz_l, plan_xz_0, plan_xz_l |
U |
Vec3d |
[0, 0, 0] |
velocity (m/s) at the boundary |
Warning
delta_p and regions must have the same length — each pressure value is matched to the corresponding plane in
order. The operator aborts otherwise.
Pressure units
Pressures are given as kg/m/s^2 (1 Pa): see YAML basics.
Usage example¶
Pressure-driven Poiseuille flow (lbm_poiseuille_rho)
For celerity = 1 (the default, \(\Delta t = \Delta x\)), a uniform body force \(F_x\) over a channel of length
\(L_x\) is equivalent to a pressure drop \(\Delta p = \rho_{ref} F_x L_x\) split symmetrically around the reference
state. With \(F_x = 9.512485 \times 10^{-5}\) m/s² and \(L_x = 0.1\) m:
boundary_conditions:
- neumann:
U: [0.0, 0, 0]
regions: [plan_xy_0, plan_xy_l]
- rho:
U: [0.0, 0, 0]
regions: [plan_yz_0, plan_yz_l]
delta_p: [4.756243e-03 kg/m/s^2, -4.756243e-03 kg/m/s^2]
See the Poiseuille flow tutorial.