Laura MillerMiller Lab · University of Arizona
Open-source code

Fluidlets

Python code for flows at very small scales, where viscosity wins: beating cilia, protein brushes on cells, swimming algae, and flow through porous material. It is written to be read and taught from, in the spirit of IB2d.

The idea

For a cell or a cilium, swimming in water is like a person swimming in honey while moving no faster than a few centimetres a minute: the moment it stops pushing, it stops. Inertia does not matter, so the flow obeys the Stokes equations, which are linear: the flow made by many small forces is the sum of the flows made by each one.

A regularized Stokeslet is the flow made by one small force, smoothed over a tiny blob so that nothing blows up. Fluidlets puts these forces on the surface of a body, solves for the forces that make the body move the way it should, and adds up their flows. There is no mesh of the fluid, so complicated, moving shapes are easy to set up.

What it does now

  • 3D regularized Stokeslets (Cortez, Fauci & Medovikov 2005), with the exact image system for a no-slip wall (Ainley et al. 2008).
  • 3D regularized Brinkmanlets for flow through a sparse porous medium (Cortez, Cummins, Leiderman & Varela 2010).
  • Resistance problems: set the velocity of a structure, and Fluidlets solves for the forces.
  • Free swimming: a cell that moves by changing its shape, with zero net force and torque (after Gallagher & Smith 2018).
  • Fast, parallel sums with Numba.
  • IB2d-style input files, and output you can open in ParaView or VisIt.

Examples

Each example runs with one command and explains the physics in plain language. Each one is checked against a published result or against the code Fluidlets grew from.

Free swimming

A model alga with two flagella

The cell beats its two flagella, and Fluidlets works out how it must move so that the total force and torque on it are zero. The result matches the swimming speed in Gallagher & Smith (2018) once the flagellum is built the same way as in the authors' own code. Tracer particles in the movie show how the flagella sweep the water.

Simulation of a green two-flagellum alga with tracer particles swept by its flagella
A model alga swimming with two flagella. Tracer particles show the flow.
Walls

A sphere moving along a wall

Cells often swim, crawl, or roll near surfaces. A wall changes the flow a lot: fluid cannot slip along it, so it holds back the fluid under the body and raises the drag. Fluidlets builds the no-slip wall into the flow of each force with an exact image system, so no points are needed on the wall. The drag matches the tables of Ainley et al. (2008).

Flow around a sphere moving to the right, far from a wall and just above a wall, with streamlines
A sphere moving to the right, with no wall (top) and with a no-slip wall below it (bottom). The wall slows the fluid underneath and raises the drag by about half.
Porous media

A sphere in a porous medium

Much of the fluid in and around cells is threaded with fibers: mucus, biofilms, the glycocalyx on blood vessel walls. Averaged over the fibers, this is a Brinkman medium. The mesh screens the flow, so a moving body disturbs only the fluid close to it, and the fluid to its sides flows backward. Drag, torque, and flow agree with Cortez, Cummins, Leiderman & Varela (2010) to within a few percent.

Flow around a sphere in plain fluid and in two porous media, showing the flow confined closer to the sphere as the screening length shrinks
The same sphere in plain fluid and in two porous media. As the screening length shrinks, the flow stays closer to the sphere, with backward flow to its sides.
Glycocalyx

Towers in shear flow

Protein towers standing on a wall in a shear flow. This reproduces the original UNC code that Fluidlets grew from, to about one part in ten million (the old code's rounding).

glycocalyx_towers
Classic test

A translating sphere

Drag and torque on a sphere, the standard check of any regularized Stokeslet code, against Cortez, Fauci & Medovikov (2005).

translating_sphere

Tutorials

Jupyter notebooks that teach the method step by step, with the math next to the code. Each one ends with exercises, runs in under a minute on a laptop, and can also be opened on Colab.

01

From blob to regularized Stokeslet

Derive the regularized Stokeslet from the blob and compare it with the singular one.

Open the notebook
02

Choosing ε

How big the blob should be, and how its error trades off against the spacing of the points.

Open the notebook
03

Mobility, resistance, and swimming

Forces in, velocities out, and the reverse; walls; and a cell that swims by changing its shape.

Open the notebook
05

Porous media with Brinkmanlets

Screening, backflow, and the drag on a sphere in a porous medium.

Open the notebook

Where it came from

Fluidlets was the software goal of the NSF Focused Research Group Advanced Algorithms and Software for Problems in Computational Bio-Fluid Dynamics (DMS-0854961, 2009–2013) at UNC Chapel Hill, with Michael Minion, Jan Prins, and Jingfang Huang. It starts from the regularized Stokeslet code written for the group's glycocalyx project. That code is kept unchanged alongside the new one, and the new code was checked against it.

Coming next

  • 2D Stokeslets and Brinkmanlets, and Brinkmanlets near a wall.
  • Oseenlets, for flows with a little inertia.
  • Electrostatics coupled to flow, such as charged pollen landing on flowers.
  • Vortex sheets for flapping and flexible plates.
  • Viscoelastic and shear-thinning fluids.
  • More tutorials and course modules.

Fluidlets needs Python 3.10 or later, NumPy, SciPy, and Numba. Clone the repository and run pip install -e . to install it. Developed by Laura A. Miller and collaborators. BSD 3-Clause License.