Code Generation for Lattice Boltzmann Methods
Project description
lbmpy
Run fast fluid simulations based on the lattice Boltzmann method in Python on CPUs and GPUs. lbmpy creates highly optimized LB compute kernels in C or CUDA, for a wide variety of different collision operators, including MRT, entropic, and cumulant schemes.
All collision operators can be easily adapted, for example, to integrate turbulence models, custom force terms, or multi-phase models. It even comes with an integrated Chapman Enskog analysis based on sympy!
Common test scenarios can be set up quickly:
from pystencils import Target
from lbmpy.session import *
ch = create_channel(domain_size=(300, 100, 100), force=1e-7, method=Method.TRT,
equilibrium_order=2, compressible=True,
relaxation_rates=[1.97, 1.6], optimization={'target': Target.GPU})
To find out more, check out the interactive tutorial notebooks online with binder.
Installation
For local installation use pip:
pip install lbmpy[interactive]
Without [interactive]
you get a minimal version with very little dependencies.
All options:
gpu
: use this if a NVIDIA GPU is available and CUDA is installedopencl
: use this to enable the targetopencl
(execution using OpenCL)alltrafos
: pulls in additional dependencies for loop simplification e.g. libislinteractive
: installs dependencies to work in Jupyter including image I/O, plotting etc.
Options can be combined e.g.
pip install lbmpy[interactive,gpu,doc]
Documentation
Read the docs here and
check out the Jupyter notebooks in doc/notebooks
.
Contributing
To see how to open issues, submit bug reports, create feature requests or submit your additions to lbmpy please refer to contribution documentation of pystencils since lbmpy is heavily build on pystencils.
Many thanks go to the contributors of lbmpy.
Please cite us
If you use lbmpy in a publication, please cite the following articles:
Overview:
- F. Hennig et al, Advanced Automatic Code Generation for Multiple Relaxation-Time Lattice Boltzmann Methods. SIAM Journal on Scientific Computing, 2023. https://doi.org/10.1137/22M1531348 (Preprint)
- M. Bauer et al, lbmpy: Automatic code generation for efficient parallel lattice Boltzmann methods. Journal of Computational Science, 2021. https://doi.org/10.1016/j.jocs.2020.101269 (Preprint)
Multiphase:
- M. Holzer et al, Highly efficient lattice Boltzmann multiphase simulations of immiscible fluids at high-density ratios on CPUs and GPUs through code generation. The International Journal of High Performance Computing Applications, 2021. https://doi.org/10.1177/10943420211016525
Further Reading
- F. Hennig et al, Automatic Code Generation for the Cumulant Lattice Boltzmann Method. ICMMES, 2021. Poster Link
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lbmpy-1.3.7.tar.gz
.
File metadata
- Download URL: lbmpy-1.3.7.tar.gz
- Upload date:
- Size: 306.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 493d4d2a04a101200b6e217afcf99ed66bfbf430747bacd4cda01f522cbb7ba2 |
|
MD5 | 00e4371fdc21cc5c085e2a06e418edb6 |
|
BLAKE2b-256 | b2c2f430f0fd985efb8e219eacfa337c2cbcad9f6a820b9d033d8638121e3329 |
File details
Details for the file lbmpy-1.3.7-py3-none-any.whl
.
File metadata
- Download URL: lbmpy-1.3.7-py3-none-any.whl
- Upload date:
- Size: 281.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62510dd7c933f89032bb3e7c8b327ddcc58e9859fb3ef9f094ded4177a85969f |
|
MD5 | c7c7bcd64b4a27b233627be7ace13c6b |
|
BLAKE2b-256 | 9fb1b74439c7461d91c9cf669afe6731ae7fb0202d045320ad387c9e60649a25 |