Skip to content
Snippets Groups Projects
methods.rst 5.37 KiB

Collision models (lbmpy.methods)

This module defines the classes defining all types of lattice Boltzmann methods available in lbmpy, together with a set of factory functions used to create their instances. The factory functions are organized in three levels of abstraction. Objects of the method classes should be created only through these factory functions, never manually.

Methods in lbmpy can be distinguished into three categories:
  • :ref:`methods_rawmomentbased`, including the classical single relaxation-time (SRT, BGK), two relaxation-time (TRT) and multiple relaxation-time (MRT) methods, as well as entropic variants of the TRT method.
  • :ref:`methods_centralmomentbased`, which are multiple relaxation-time methods using relaxation in central moment space.
  • :ref:`methods_cumulantbased`, multiple relaxation-time methods using relaxation in cumulant space.

Abstract LB Method Base Class

Raw Moment-based methods

These methods are represented by instances of :class:`lbmpy.methods.momentbased.MomentBasedLbMethod` and will derive collision equations either in population space (SRT, TRT, entropic TRT), or in raw moment space (MRT variants).

Creation Functions

The following factory functions create raw moment-based methods using variants of the regular hydrodynamic maxwellian equilibrium.

Class

Central Moment-based methods

These methods are represented by instances of :class:`lbmpy.methods.momentbased.CentralMomentBasedLbMethod` and will derive collision equations in central moment space.

Creation Functions

The following factory functions create central moment-based methods using variants of the regular hydrodynamic maxwellian equilibrium.

Class

Cumulant-based methods

These methods are represented by instances of :class:`lbmpy.methods.cumulantbased.CumulantBasedLbMethod` and will derive collision equations in cumulant space.

Creation Functions

The following factory functions create cumulant-based methods using the regular continuous hydrodynamic maxwellian equilibrium.

Class

Default Moment sets

The following functions provide default sets of polynomial raw moments, central moments and cumulants to be used in MRT-type methods.

Low-Level Method Creation Interface

The following classes and factory functions constitute the lower levels of abstraction in method creation. They are called from the higher-level functions described above, or, in special cases, by the user directly.

Custom method variants in population space, raw and central moment space based on the hydrodynamic Maxwellian equilibrium may be created using either :func:`lbmpy.methods.creationfunctions.create_with_discrete_maxwellian_equilibrium` or :func:`create_with_continuous_maxwellian_equilibrium`.

Methods may also be created using custom equilibrium distributions using :func:`lbmpy.methods.creationfunctions.create_from_equilibrium`.

The desired collision space, and the transform classes defining the manner of transforming populations to that space and back, are defined using :class:`lbmpy.enums.CollisionSpace` and :class:`lbmpy.methods.CollisionSpaceInfo`.

Collision Space Info

Low-Level Creation Functions

Conserved Quantity Computation

The classes of the conserved quantity computation (CQC) submodule define an LB Method's conserved quantities and the equations to compute them. For hydrodynamic methods, :class:`lbmpy.methods.DensityVelocityComputation` is the typical choice. For custom methods, however, a custom CQC class might have to be created.