FVM Fluid Node (with Diffuse-Penalty IBM)#
Module: mime.nodes.environment.fvm.fluid_node
Class: FVMFluidNode
Stability: experimental
Algorithm ID: MIME-NODE-020
Version: 0.2.0
Verification Mode: Mode 2 (Independent)
Summary#
Graph-native finite-volume incompressible Navier–Stokes solver with a diffuse-penalty immersed-boundary method (IBM). Wraps the FVM stack (mesh + operators + PISO + IBM) as a MADDENING/MIME SimulationNode so the volumetric flow can be composed in a GraphManager with rigid-body, magnetic-actuation, and other MIME nodes.
The differentiable face-graph design — gather → compute → scatter on a static-shape Cartesian mesh — follows the DiFVM formulation [@DiFVM] (Du et al., 2026). DiFVM is the very recent (March 2026, arXiv:2603.15920) reference design for a JAX-compatible differentiable FVM; MIME’s solver is structurally a DiFVM-style gather/compute/scatter pipeline, with PISO time stepping [@Issa1986] and Goldstein-style diffuse-penalty IBM [@Peskin2002] layered on top.
The solver targets confined microrobot FSI at moderate \(\mathrm{Re}\)
where LBM’s Mach-number ceiling bites and the Stokeslet BEM
quasi-static assumption breaks. It is the M3 deliverable described in
ARCHITECTURE_PLAN.md.
Governing Equations#
Incompressible Navier–Stokes,
closed with a Goldstein-style diffuse-penalty IBM body force [@Peskin2002]:
where \(\phi\) is the body signed-distance field and \(\chi_{\varepsilon}\) is a smooth indicator of width \(\varepsilon\).
Discretization#
Cell-centred finite volume on a Cartesian face graph (gather → compute → scatter).
PISO/projection time stepping [@Issa1986]; FFT/DST/DCT-diagonalised Poisson and Helmholtz solves.
Rhie–Chow face flux to suppress pressure–velocity decoupling.
IBM bodies are categorised as static (pipe wall, constructed once at node init) and dynamic (robot bodies whose SDF is rebuilt each step from boundary-input pose so SDF gradients with respect to pose remain differentiable).
Three force-extraction modes are supported on the output flux:
brinkman— legacy per-cell penalty momentum sink (biased low at coarse IBM resolution).surface_integral— Cauchy stress integrated on a shell of cells just outside the body. Preferred at moderate \(\lambda\).momentum_deficit— control-volume momentum balance over the pipe cross-section; recommended for confined flows (\(\lambda \gtrsim 0.15\)) where surface integration suffers from IBM-band gradient contamination.
Implementation Mapping#
Equation Term |
Implementation |
Notes |
|---|---|---|
Mesh + face graph |
|
Static-shape pytree |
Gather/compute/scatter operators |
|
|
Pressure Poisson + Helmholtz |
|
FFT/DST diagonalised |
PISO loop |
|
|
Diffuse-penalty IBM force |
|
Brinkman penalty |
Surface-integral force |
|
Cauchy stress on shell |
Momentum-deficit drag |
|
Confined pipe |
SDFs (sphere, cylinder, capsule) |
|
Differentiable in pose |
Lifting (Dirichlet inlet/outlet) |
|
Optional |
Assumptions and Simplifications#
Incompressible, Newtonian fluid; single \(\rho\) and \(\nu\) per node.
No-slip walls (Dirichlet) or periodic boundary conditions only.
Cartesian mesh only — the unstructured-mesh extension is scoped in
ARCHITECTURE_PLAN.mdbut not implemented.Single-device execution:
halo_width()returns{0: 1}(the cell-centred + face stencil needs one-cell connectivity), which marks the node non-pointwise and blocks sharding. See Node API migration.IBM penalty \(\alpha\) large enough that \(\alpha\,\Delta t \gg 1\) to enforce no-slip on the body.
The FVM does not discretise the body — drag is extracted via one of the three methods above so the body’s bounding box never leaves the diffuse band.
Validated Physical Regimes#
Parameter |
Verified Range |
Notes |
|---|---|---|
\(\mathrm{Re}_{\text{pipe}}\) |
0 – 500 |
Tested up to ~200 in M1/M2 |
0 – 10 |
Pulsatile Poiseuille verified at \(\mathrm{Wo}=7\) |
|
Confinement \(\lambda = a/R\) |
0 – 0.30 |
momentum_deficit recommended above 0.15 |
Known Limitations and Failure Modes#
Cartesian mesh only.
Body-force-driven flow only — inflow/outflow BCs are implemented in the operators but not wired through the node.
The IBM diffuse zone (~1.5 cells) shrinks the effective obstacle radius; drag is biased low at coarse resolution. Mesh refinement is the only fix.
Body-force-driven periodic flow takes several diffusion timescales (\(R^2/\nu\)) to reach periodic steady state. The initial transient is not the steady response and should not be reported as such.
force_method="brinkman"is kept for backwards compatibility but is biased low at moderate IBM resolution; prefersurface_integralormomentum_deficit.
Stability Conditions#
PISO is implicit in diffusion; advective CFL still applies on the predictor step.
Diagonalised pressure/Helmholtz solves are unconditionally stable.
IBM penalty: \(\alpha\,\Delta t \gtrsim 10\) recommended.
State Variables#
Field |
Shape |
Units |
Description |
|---|---|---|---|
u |
(Nc, dim) |
m/s |
Cell-centred velocity |
p |
(Nc,) |
Pa |
Cell-centred pressure |
F |
(Nf, dim) |
m³/s |
Face fluxes (Rhie–Chow) |
t |
() |
s |
Accumulated time |
u_pre_ibm |
(Nc, dim) |
m/s |
Velocity before IBM penalty (for force) |
force_ |
(dim,) |
N |
Hydrodynamic force per dynamic body |
torque_ |
(3,) or () |
N·m |
Hydrodynamic torque per dynamic body |
Parameters#
Parameter |
Type |
Default |
Units |
Description |
|---|---|---|---|---|
mesh |
FVMMesh |
— |
— |
Pre-built Cartesian mesh |
bcs |
dict[str, VelocityBC] |
— |
— |
Patch-keyed boundary conditions |
cfg |
PisoConfig |
— |
— |
\(\nu\), \(\rho\), IBM penalty, BC types |
static_bodies |
list[IBMBody] |
() |
— |
Bodies that don’t move (pipe wall) |
dynamic_body_factories |
list[(name, BodyFactory)] |
() |
— |
Pose-driven bodies |
body_force_fn |
callable |
None |
m/s² |
Time-dependent body force |
lifting |
LiftingFunction |
None |
— |
Dirichlet inlet decomposition |
force_method |
str |
“brinkman” |
— |
brinkman | surface_integral | momentum_deficit |
force_shell |
(float, float) |
(1.5, 3.5) |
dx |
Shell location (surface_integral) |
Boundary Inputs#
Per dynamic body name (added by dynamic_body_factories):
Field |
Shape |
Default |
Coupling Type |
Description |
|---|---|---|---|---|
|
(dim,) |
zeros |
replacive |
Body position [m] |
|
(dim,) |
zeros |
replacive |
Body linear velocity [m/s] |
|
(3,) |
zeros |
replacive |
Body angular velocity [rad/s], 3-D only |
Added in version v0.2: Shared fluid-node contract (single body). For the single-immersed-body
case, FVM also accepts the contract-standard body_position /
body_velocity / body_angular_velocity inputs (the names every fluid node
shares — see src/mime/nodes/environment/FLUID_NODE_CONTRACT.md), so the
HydrodynamicModel family can swap FVM for LBM / Stokeslet /
DefectCorrection across the same edges. The per-body <name>_* form above
remains for the multi-body case.
Boundary Fluxes (outputs)#
Per dynamic body name:
Field |
Shape |
Units |
Description |
|---|---|---|---|
|
(dim,) |
N |
Hydrodynamic force on the body |
|
(3,) or () |
N·m |
Hydrodynamic torque on the body |
Added in version v0.2: For the single-body case FVM also exposes the contract-standard
drag_force / drag_torque outputs (the interchangeable subset), alongside
the per-body force_<name> / torque_<name> above.
MIME-Specific Sections#
Anatomical Operating Context#
Compartment |
Flow Regime |
Re Range |
Viscosity Range |
|---|---|---|---|
Iliac artery (millibot) |
oscillatory |
0 – 500 |
3 – 4 mPa·s |
Clinical Relevance#
At clinical actuation frequencies for millimeter-scale UMRs the pulsatile boundary layer is the dominant control variable. FVM with diffuse-penalty IBM resolves it directly without the Mach-number ceiling that constrains LBM. Combined with the Stokeslet BEM Schwarz coupling, FVM provides the volumetric background flow while the BEM resolves the body — the same hybrid architecture documented for IB-LBM, applied at the \(\mathrm{Re}\) regime where compressibility matters.
References#
[@Issa1986] Issa (1986). Solution of the implicitly discretised fluid flow equations by operator splitting. J. Comput. Phys. 62.
[@Peskin2002] Peskin (2002). The immersed boundary method. Acta Numerica 11.
[@DiFVM] Du et al. (2026). DiFVM: A differentiable finite volume method. arXiv:2603.15920. — Foundational design that this node’s gather/compute/scatter face-graph follows.
[@Womersley1955] Womersley (1955). Method for the calculation of velocity, rate of flow and viscous drag in arteries. J. Physiol. 127:553–563.
Verification Evidence#
MIME-VER-fvm-001: steady Poiseuille flow in a circular pipe
MIME-VER-fvm-002: Womersley pulsatile pipe flow (\(\mathrm{Wo} = 7\))
MIME-VER-fvm-003: drag on a sphere vs. analytical Stokes / Schiller–Naumann at \(\mathrm{Re} \in [1, 200]\)
Unit tests:
tests/nodes/environment/fvm/
Changelog#
Version |
Date |
Change |
|---|---|---|
0.1.0 |
2026-05-02 |
Initial implementation — PISO + diffuse IBM with three force-extraction modes |
0.2.0 |
2026-06-11 |
|