Quadric surface¶
Description¶
register_quadrics registers a quadric surface obstacle. A quadric is defined by a named canonical shape (a
\(4 \times 4\) matrix \(Q\)) and an optional sequence of geometric transforms (scale and/or translate) composed in
order into a matrix \(T\). A point \(\mathbf{p}\) is inside the obstacle when
\[
\tilde{\mathbf{p}}^T \left(T^{-T}\,Q\,T^{-1}\right) \tilde{\mathbf{p}} \le 0,
\qquad \tilde{\mathbf{p}} = (p_x, p_y, p_z, 1).
\]
Available canonical shapes:
| Name | Shape |
|---|---|
sphere |
unit sphere (an ellipsoid with a non-uniform scale) |
cylx |
cylinder of unit radius aligned along the X axis |
cyly |
cylinder of unit radius aligned along the Y axis |
cylz |
cylinder of unit radius aligned along the Z axis |
conez |
cone aligned along the Z axis |
The same quadrics + transform syntax restricts the initial conditions of
set_distribution and set_dp_pressure.
YAML syntax¶
| Slot | Type | Default | Description |
|---|---|---|---|
id |
int |
required | unique identifier of the obstacle |
quadrics |
Mat4d |
required | name of the canonical shape |
transform |
Mat4d |
optional | list of transforms applied in order: scale: [sx, sy, sz] or translate: [tx, ty, tz] |
Usage example¶
Cylinder, ellipsoid and cone (lbm_quadrics)
set_obstacles:
- register_quadrics:
id: 0
quadrics: cyly
transform:
- scale: [ 0.05, 1, 0.05 ]
- translate: [ 0.15, 0.1, 0.1 ]
- register_quadrics:
id: 1
quadrics: sphere
transform:
- scale: [ 0.05, 0.08, 0.05 ]
- translate: [ 0.35, 0.1, 0.15 ]
- register_quadrics:
id: 2
quadrics: conez
transform:
- scale: [ 0.05, 0.05, 0.05 ]
- translate: [ 0.55, 0.1, 0.25 ]
See the flow around parametric shapes tutorial.