tflow- a Python package to analyze 2D/3D (laminar/turbulent) velocity fields
Research articles which used tflow:
- Matsuzawa, et al, "Creation of an isolated turbulent blob fed by vortex rings", Nature Physics, 2023; see Supplementary Information for details.
- Matsuzawa, Zhu, et al, "Nonlinear Diffusion and Decay of a Blob of Turbulence Spreading Into a Quiescent Fluid", PNAS in press, 2026
This package includes useful modules to analyze turbulent velocity fields.
The only key assumption is the incompressibility of the medium; however, one should feel free to fork this repo to develop the package for the compressible fluids. It would require many but minor modifications overall.
This package is perhaps more attractive to experimentally obtained velocity fields because all of the functions for analysis does not assume periodicity or finiteness of the velocity fields. (Numerically obtained velocity fields are often simulated in ideal conditions, which lead to many advantages.)
Key modules
- velocity.py: a core analysis module
- graph.py: a wrapper of matplotlib to efficiently plot the output of velocity.py
Key scripts
- davis2hdf5.py: LaVision Inc. offers a cutting-edge PIV/PTV software called DaVis. This converts their txt output to a single hdf5 to store a velocity field data.
A typical workflow
A. Experiments
- Conduct PIV/PTV experiement using DaVis
- Convert the velocity field data into a hdf5 (One may use davis2hdf5 for DaVis txt output)
- Import tflow.velocity
- Analyze and plot
B. Numerics
- Generate a velocity field data (DNS, LES, etc.)
- Import tflow.velocity
- Analyze and plot