Skip to main content

A single phase 2D lattice Boltzmann solver

Project description

Documentation Status

PyLaBolt is a single phase, 2D, parallel lattice Boltzmann solver for fluid flow. It uses Numba accelerated Python code to run lattice Boltzmann simulations on 2D lattices. Simulations can be run on CPU in parallel via Numba’s own OpenMP parallelization and the mpi4py library. For running on NVIDIA GPUs, PyLaBolt uses Numba’s CUDA bindings.

Installation and Usage

PyLaBolt can be installed via pip via the command:

$ pip install pylabolt

More details on the dependencies and their configuration can be found in the PyLaBolt documentation here.

Tutorial cases are provided in the tutorials folder. For example, consider the lid driven cavity problem in tutorials/cavity/Re_100/. The configuration file that defines the simulation is called simulation.py. After installation just run the following command from the tutorials/cavity/Re_100/ folder:

$ pylabolt --solver fluidLB

The output data is written in the output folder. By default the data is written into binary files with .dat extension. To visualize the data in Paraview / Mayavi, the VTK library is used. For example, to convert the last time-step data to a .vtk file, run the following command from the working directory:

$ pylabolt --toVTK last

The output_<time-step>.vtk files are stored in output/VTK directory which can be opened in Paraview/Mayavi. Sample results for lid driven cavity, plane Poiseuille flow, and flow past a cylinder are shown below.

`lid driven cavity (Re = 100) <https://github.com/Malyadeep/pylabolt/blob/main/tutorials/cavity/cavity_Vcontour.png>_`
`Gravity driven plane Poiseuille flow (Re = 100) <https://github.com/Malyadeep/pylabolt/blob/main/tutorials/poiseuille_flow/gravity_driven/U_contour.png>_`
`Flow past a cylinder (Re = 100) <https://github.com/Malyadeep/pylabolt/blob/main/tutorials/flow_past_cylinder/flowpastcylinder_Vcontour.png>_`

More details on setting up and running simulations can be found in the documentation.

Features

PyLaBolt currently supports the following collision schemes

It also supports the Guo’s forcing scheme <https://doi.org/10.1103/PhysRevE.65.046308>_ for force-driven flows.

The boundary conditions available are

For more information on the schemes and boundary conditions, we urge the reader the go through the following books

PyLaBolt leverages the performance advantages on multi-core CPUs, High Perfomance computing clusters, and GPUs to run large simulations. Currently the parallel computing features supported by PyLaBolt are:

  • Numba accelerated Python code can run in parallel on multi-core CPUs through OpenMP.

  • To run on multiple machines/clusters, PyLaBolt uses OpenMPI via the mpi4py library.

  • PyLaBolt can also run simulations on NVIDIA GPUs through Numba’s CUDA bindings.

  • PyLaBolt provides support to convert output to VTK format, which can post-processed in Paraview/Mayavi.

For more details, refer to the documentation.

Acknowledgements

PyLaBolt grew from the course project of AE6102 course, of the Department of Aerospace Engineering at Indian Institute of Technology, Bombay. We are grateful to Prof. Prabhu Ramachandran of Department of Aerospace Engineering at Indian Institute of Technology, Bombay for exposing us to the necessary skills to write high performance scientific codes.

We are also grateful to Dr. Amol Subhedar at Department of Chemical Engineering, Indian Institute of Technology, Bombay for providing us critical suggestions on the theoretical foundations of the algorithms.

For contributors see the Github contributors page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylabolt-0.2.0.tar.gz (52.5 kB view hashes)

Uploaded Source

Built Distribution

pylabolt-0.2.0-py3-none-any.whl (61.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page