Skip to main content

Code Generation for Lattice Boltzmann Methods

Project description

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 lbmpy.scenarios import create_channel

ch = create_channel(domain_size=(300,100, 100), force=1e-7, method="trt",
                    equilibrium_order=2, compressible=True,
                    relaxation_rates=[1.97, 1.6], optimization={'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.

Project details


Download files

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

Files for lbmpy, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size lbmpy-0.3.2.tar.gz (196.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page