diff --git a/docs/moving_bodies.md b/docs/moving_bodies.md index 8175803..ffab1f0 100644 --- a/docs/moving_bodies.md +++ b/docs/moving_bodies.md @@ -14,7 +14,7 @@ cells (M1 `MovingCircleCells`), moving-wall Bouzidi with wall velocity `u + omega x r`, and separate per-body diagnostics. *API.* -- `Simulation.add_body("circle", centre, radius, +- `Simulation.add_body("circle", center=(x, y), radius=r, translation=Translation(offset_box, max_speed))` before `initialize()`; `offset_box = (x_min, x_max, y_min, y_max)` in lattice cells around the base centre (must contain 0), `0 < max_speed ≤ .5`. diff --git a/src/CelerisLab/simulation.py b/src/CelerisLab/simulation.py index 464de2f..c37ef3d 100644 --- a/src/CelerisLab/simulation.py +++ b/src/CelerisLab/simulation.py @@ -122,8 +122,9 @@ class Simulation: D2Q9/FP32/unshifted/DB only; set before initialization or stage a new body. No runtime motion or amplitude setter. translation: ``body.motion.Translation`` declaring a translating - circle (before initialize only; docs/moving_bodies.md). Until - the moving kernels exist, positive-step runs are rejected. + circle (before initialize only; docs/moving_bodies.md). + Positive-step runs are rejected until ``initialize()`` has + attached its moving tables. **kwargs: passed to the geometry constructor. Returns: @@ -360,8 +361,11 @@ class Simulation: Args: id: body_id from add_body(). omega: rotation speed (lattice units). ``None`` = no change. - vx: translation velocity x (future). ``None`` = no change. - vy: translation velocity y (future). ``None`` = no change. + vx: translation velocity x. For a translating circle: the + interval wall velocity of the target, only together with + ``offset``; otherwise stored in the body state (not applied + to stationary walls). ``None`` = no change. + vy: translation velocity y; same rules as ``vx``. offset: target centre offset of a translating circle; with vx/vy (default 0) it replaces the pending target after validation against the applied offset (docs/moving_bodies.md, 4a). Only