VesselFlow
A modular, reproducible CFD pipeline for branching-vessel aneurysm growth. VesselFlow constructs a single connected, closed lumen surface, grows aneurysms via svMorph Kelvinlets, hex-meshes with OpenFOAM snappyHexMesh, solves steady incompressible flow with simpleFoam, and renders headless 3D flow and wall-hemodynamics visualizations.
Simulations
|
Traced Velocity Flow ( viz/flow.gif)
|
|
|
Pressure ( viz/pressure.gif)
|
Wall Shear Stress ( viz/wall_wss.gif)
|
Pipeline Stages
-
Vessel Tree — Seeded, curved trunk with tapering side branches (
vessel.n_branches) and an optional U-bend (vessel.u_radius_mm). The trunk supports configurable bend modes (bend_mode), tapering (trunk_taper_frac), and Murray's-law radius step-down at each bifurcation (murray_law). Side branches can be tuned viabranch_angle_deg(bifurcation angle),branch_azimuth_mode/branch_azimuth_deg(departure azimuth),branch_tortuosity(branch meander),branch_radius_frac/branch_taper_frac(branch radius), andbranch_parent_fracs(explicit departure locations along the trunk). -
Connected Surface — Single closed, manifold lumen built via VMTK
PolyBallModeller+MarchingCubes, smoothed withtrimesh, and labeled (wall,inlet,outlet). -
Aneurysm Growth — Self-driven svMorph Kelvinlet deformation on the trunk and/or side branches. Each aneurysm location pins its weak-wall arc window via its own per-aneurysm
start_frac/end_frac(falling back to the shared trunk weak-region window when unset). Two morphologies select a per-vertex weak-region gate that confines/amplifies the raw Kelvinlet kernel:fusiform— symmetric full-circumference axial cosine-bell bulge over[start_frac, end_frac](spindle-shaped, all sides of the segment).saccular— focal one-sided wall-disc bulge of radiusdisk_radius_mmcentred at the force centre, oriented atbulge_angle_degabout the local centreline tangent. A C1-smooth one-sided angular gate (cos_phi <= 0→ 0) applies zero weight to the opposite wall, leaving that circumference intact.
Growth is self-driven:
force_scale,eps_radius_fraction, andgrowth_stepsgovern the emerging sac size, capped atmax_aneurysm_radius_mm. -
Meshing & CFD —
snappyHexMesh(mode inside) hexahedral polyMesh followed by incompressiblesimpleFoam(NewtonianorBirdCarreau,laminarorkOmegaSST). -
Hemodynamics — Computes WSS, Reynolds/Dean/Womersley numbers, pressure drop, clinical vascular resistance, energy dissipation, and vessel/aneurysm morphometrics.
-
Visualisation & Export — Headless
flow.gif(RK2-advected velocity glyphs) andwall_*.gif(WSS, pressure, WSSG, near-wall speed), plus representative.vtkmeshes per GIF.
Installation & Full Pipeline
The install_and_run.sh script installs VesselFlow and OpenFOAM and runs the full pipeline in one go (set MINICONDA_ROOT to override the conda location):
MINICONDA_ROOT=/path/to/miniconda3 ./install_and_run.sh
Manual installation
Conda (recommended, includes OpenFOAM)
conda create -p ./env/vesselflow python=3.12 -y
conda activate ./env/vesselflow
pip install -e .
Install OpenFOAM into its own conda environment, use:
conda create -p ./env/openfoam -c conda-forge openfoam=2412 -y
export OPENFOAM_DIR=./env/openfoam
pip (PyPI)
python3.12 -m venv venv && source venv/bin/activate
pip install vesselflow
Usage
Runs are configured by a single YAML file (default: src/vesselflow/configs/default_config.yaml).
# Run full pipeline (mesh + CFD + hemodynamics + viz)
vesselflow pipeline src/vesselflow/configs/default_config.yaml
# Individual subcommands
python -m vesselflow config src/vesselflow/configs/default_config.yaml # validate config
python -m vesselflow vessel src/vesselflow/configs/default_config.yaml # lumen mesh only
python -m vesselflow centerline src/vesselflow/configs/default_config.yaml # trunk centreline
python -m vesselflow flowviz src/vesselflow/configs/default_config.yaml # re-render flow GIF
The preset names are also exposed via the Python API:
from vesselflow.configs import config_path, available_configs
print(available_configs()) # ['default_config', 'trunk_double', ...]
config_path("trunk_loop") # absolute path to trunk_loop.yaml
Tests
python -m pytest tests/ -v -m "not slow" # fast unit tests
python -m pytest tests/test_aneurysm_shapes.py -v # fusiform vs saccular gate-shape tests
python -m pytest tests/test_pipeline.py -v # full OpenFOAM integration tests
Python API
from vesselflow import build_vessel_tree, build_connected_surface, run_pipeline
from vesselflow.config import VesselConfig
# Build geometry only
tree = build_vessel_tree(VesselConfig(n_nodes=80), seed=1)
pts, tris, region = build_connected_surface(tree, n_ring=24)
# Or run the full YAML-driven pipeline
summary = run_pipeline(config_path="src/vesselflow/configs/default_config.yaml")
Environment Variables
| Variable | Description |
|---|---|
OPENFOAM_DIR |
Path to OpenFOAM installation ($OPENFOAM_DIR/bin). |
VESSELFLOW_OUTPUT_DIR |
Default output directory (overridden by YAML output_dir). The legacy VESSELLFLOW_OUTPUT_DIR spelling is still accepted as a fallback. |
MPLCONFIGDIR |
Matplotlib cache directory (defaults to ~/.mplcfg_vesselflow). |
Note
Stay curious like cats!
License
Licensed under AGPL-3.0-only. See LICENSE for details.
Citation
@software{dhaval_kadia_2026_vesselflow,
author = {Kadia, Dhaval},
title = {VesselFlow: In-Silico Vascular Modeling and Flow Simulation},
version = {0.0.1},
year = {2026},
url = {https://github.com/DhavalKadia/VesselFlow},
license = {AGPL-3.0-only}
}
Metadata
Release files for VesselFlow 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vesselflow-0.0.1.tar.gz | 155.7 kB | With provenance | Details for vesselflow-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vesselflow-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for vesselflow-0.0.1-py3-none-any.whl |
Total release size: 294.6 kB
Release files / vesselflow-0.0.1.tar.gz
| Download URL | vesselflow-0.0.1.tar.gz |
|---|---|
| Size | 155.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5bc94146318ecb50a72bd6c427a0ffaa1415972aa867e19ec501897e919f7df
|
|
BLAKE2b-256 checksum How to use checksums |
463cdfbe25addecfb71c30c310d939c0ef5f2e8b4de2064ea535bdd9c1cce822
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 28, 2026.
Transparency logRelease files / vesselflow-0.0.1-py3-none-any.whl
| Download URL | vesselflow-0.0.1-py3-none-any.whl |
|---|---|
| Size | 138.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
786cad16059b0e39a16edaab528be1a0772232e5c2be2b8263eb57036371a49d
|
|
BLAKE2b-256 checksum How to use checksums |
034881fcde765323e163c3e20e5edd131b3a5c6e9a3226e7ca0d7b32bed62041
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 28, 2026.
Transparency logSecurity for VesselFlow 0.0.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for vesselflow-0.0.1.tar.gz
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 Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.