crawLBM
A bare-bones 2D Lattice Boltzmann Method (LBM) fluid solver written in Python. The logic is simply: crawl before walking or running.
Features
- BGK (single-relaxation-time) collision operator
- D2Q9 lattice structure
- Periodic and halfway bounce-back boundary conditions (including moving walls)
- Taylor-Green Vortex and Couette Flow test problems
- Physical unit conversion (SI inputs → lattice units)
Installation
From PyPI
pip install crawLBM
From source
git clone https://github.com/biboyd/crawLBM.git
cd crawLBM
pip install .
For development (editable install):
pip install -e .
Usage
After installation, run the solver from the command line:
# Taylor-Green Vortex (default)
crawlbm --init TG-vortex --domain_resolution 64 --max_step 1000 --plot_dir ./output
# Couette Flow
crawlbm --init Couette --domain_resolution 32 --tau 0.8 --max_step 2000 --plot_dir ./output
Key options
| Flag | Default | Description |
|---|---|---|
--init |
TG-vortex |
Initialization type: TG-vortex or Couette |
--domain_size Lx Ly |
1 1 |
Physical domain size in SI units |
--domain_resolution |
64 |
Grid points along the longest dimension |
--tau |
0.8 |
Relaxation time (must be > 0.5) |
--nu |
1e-6 |
Physical kinematic viscosity (m²/s) |
--U_ref |
0.01 |
Reference velocity scale (m/s) |
--max_step |
1000 |
Number of time steps |
--plot_int |
100 |
Save a plotfile every N steps |
--plot_dir |
./ |
Output directory for plotfiles |
Python API
from crawlbm import Grid, advance_sim
from crawlbm._cli import init_TG_vortex
grid = Grid(nx=64, ny=64)
init_TG_vortex(grid, Lx=1.0, Ly=1.0, U_0=0.01)
advance_sim(grid, tau=0.8, max_step=500, plot_int=100, plot_dir='./output')
Running tests
pip install pytest
pytest unit_tests/ -v
Dependencies
- Python >= 3.8
- NumPy
Matplotlib is an optional dependency used by the plotting scripts in plotfiles/ and test_problems/. Install it with:
pip install crawlbm[plot]
LLM Acknowledgement
Core functions and functionality were written by Brendan Boyd. Unit tests, convergence tests, and cleaning up the codebase to work as a python package was implemented via Claude Code.
Additionally, some bug fixes were found via Claude Code.
Metadata
Release files for crawlbm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crawlbm-0.1.0.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crawlbm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.8 kB
Release files / crawlbm-0.1.0.tar.gz
| Download URL | crawlbm-0.1.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
646641b053f1ca8618a0b65ed8af9546da194666a917d2fe454f27ee2624f909
|
|
BLAKE2b-256 checksum How to use checksums |
82a5ae1704886580b1e2723ac2a21736db5d4f4c928df7f9d13f9abf9f98922b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / crawlbm-0.1.0-py3-none-any.whl
| Download URL | crawlbm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dd8c658e7f2f26af1fc1a68679e4c95a7a1d340e24367fd093a7f0a87b9e014
|
|
BLAKE2b-256 checksum How to use checksums |
d16192296d85d9e60794f8d6c1943e21bf4fcd8971808f8b6ea2860508a7ab86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency log