Skip to main content

Code Generation for Lattice Boltzmann Methods

Project description

lbmpy

[!note] This is the code of lbmpy version 1.4. This version of lbmpy is no longer being developed, and receives only basic support. Please switch to lbmpy 2.0 instead, which is hosted by the master branch of https://i10git.cs.fau.de/pycodegen/lbmpy.

Binder Docs pipeline status coverage report

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 installed
  • opencl: use this to enable the target opencl (execution using OpenCL)
  • alltrafos: pulls in additional dependencies for loop simplification e.g. libisl
  • interactive: 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:

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


Download files

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

Source Distribution

lbmpy-1.4.1.tar.gz (286.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lbmpy-1.4.1-py3-none-any.whl (272.0 kB view details)

Uploaded Python 3

File details

Details for the file lbmpy-1.4.1.tar.gz.

File metadata

  • Download URL: lbmpy-1.4.1.tar.gz
  • Upload date:
  • Size: 286.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for lbmpy-1.4.1.tar.gz
Algorithm Hash digest
SHA256 d7e3bb9a13e8005c79f72da12c2cfaba83b32f31d01a82f486e194f9ba90c32a
MD5 9170fee2b5db27e19d0a42e51d14200b
BLAKE2b-256 8c3599c4b4279a4cc9caf759d5234fe89a3bb91c5a37468653490934eb924d48

See more details on using hashes here.

File details

Details for the file lbmpy-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: lbmpy-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 272.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for lbmpy-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1525fa4fc3d53de6990b838bd0e8f3d5f2b92a88f8047abc91ae6f9ddd6570d7
MD5 f7b34a5903d6ee46da9e9852bdccfa58
BLAKE2b-256 7c828c47d0ae1fd6f96b37ae0091cab9d6830ad7c3151ed1df307027f95282a5

See more details on using hashes here.

Supported by

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