Skip to content

Add experimental kinematic flow coupling - #4

Open
marpaia wants to merge 2 commits into
marpaia/microfluidics-flow-solversfrom
marpaia/microfluidics-experimental-coupling
Open

Add experimental kinematic flow coupling#4
marpaia wants to merge 2 commits into
marpaia/microfluidics-flow-solversfrom
marpaia/microfluidics-experimental-coupling

Conversation

@marpaia

@marpaia marpaia commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Purpose

This PR depends on the native flow fields introduced by #3 and defines how those fields move rod-shaped cells and how models replace spatial reaction fields during a run. It is the first stack layer that couples solved flow to cell geometry.

Coupling method

  • Endpoint-sampled kinematic drift: each non-fixed rod samples the face-staggered velocity field at both capsule centerline endpoints. Translation is the mean endpoint velocity times dt; rotation is dt * (axis cross (v2 - v1)) / length, capped by the mechanics rotation limit. Degenerate rods do not rotate.
  • Operator order: drift runs after growth and before contact relaxation. Contact relaxation then resolves cell-cell and cell-wall overlaps introduced by the drift step. Sampling clamps to the grid boundary, and an all-solid stencil returns zero velocity.
  • Backend boundary: Add native CPU, Metal, and CUDA microfluidic flow solvers #3 computes the velocity field through the selected CPU, Metal, or CUDA Simulation. Drift consumes the committed field through the common simulation contract, so the kinematic rule is identical across backends.
  • Checkpoint behavior: flow_drift is validated and restored with the mechanics configuration. A regression test compares uninterrupted motion with save, load, and resume.
  • Reaction feedback: Simulation.set_signal_reaction validates and atomically replaces affine grid source and loss fields, allowing a controller to update colony-dependent sinks during a run.

Scientific scope

  • Drift is passive kinematic advection, not force-balanced fluid-structure interaction. It contains no hydrodynamic drag law, wall-dependent slip, fluid force or torque in the mechanics solve, hydrodynamic cell-cell interaction, or Brownian motion.
  • The split update is first order in time. Quantitative studies must keep max_speed * dt small relative to a cell radius and report timestep sensitivity.
  • Colony-to-flow feedback retains the phenomenological mobility or drag closures from Add native CPU, Metal, and CUDA microfluidic flow solvers #3 and requires coefficient, grid, and refresh-cadence sensitivity analysis.

Stack

PR 3 of 5.

Base: #3 (marpaia/microfluidics-flow-solvers).

Next: #5 (marpaia/microfluidics-device-assets).

Validation at 47f4c33

  • Python suite: 265 passed, 42 skipped
  • Full pre-commit suite: passed
  • The inherited CPU and Metal native flow and conformance gates passed after the rebase
  • CUDA 12.8 compile and link gate passed; no NVIDIA runtime was exercised

@marpaia
marpaia force-pushed the marpaia/microfluidics-experimental-coupling branch from 7d9191a to b3610b8 Compare August 20, 2026 17:08
@marpaia
marpaia force-pushed the marpaia/microfluidics-experimental-coupling branch from b3610b8 to 885bd38 Compare August 20, 2026 17:10
@marpaia
marpaia force-pushed the marpaia/microfluidics-experimental-coupling branch from 885bd38 to 668b93a Compare August 20, 2026 20:52
@marpaia
marpaia force-pushed the marpaia/microfluidics-experimental-coupling branch from 934a484 to 7dc6c0d Compare August 20, 2026 22:05
@marpaia
marpaia marked this pull request as ready for review August 20, 2026 23:48
@marpaia
marpaia force-pushed the marpaia/microfluidics-experimental-coupling branch from 7dc6c0d to 47f4c33 Compare August 29, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant