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:
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.methods_centralmomentbased
, which are multiple relaxation-time methods using relaxation in central moment space.methods_cumulantbased
, multiple relaxation-time methods using relaxation in cumulant space.
lbmpy.methods.LbmCollisionRule
lbmpy.methods.AbstractLbMethod
These methods are represented by instances of lbmpy.methods.momentbased.MomentBasedLbMethod
and will derive collision equations either in population space (SRT, TRT, entropic TRT), or in raw moment space (MRT variants).
The following factory functions create raw moment-based methods using variants of the regular hydrodynamic maxwellian equilibrium.
lbmpy.methods.create_srt
lbmpy.methods.create_trt
lbmpy.methods.create_trt_with_magic_number
lbmpy.methods.create_mrt_orthogonal
lbmpy.methods.create_trt_kbc
lbmpy.methods.momentbased.MomentBasedLbMethod
These methods are represented by instances of lbmpy.methods.momentbased.CentralMomentBasedLbMethod
and will derive collision equations in central moment space.
The following factory functions create central moment-based methods using variants of the regular hydrodynamic maxwellian equilibrium.
lbmpy.methods.create_central_moment
lbmpy.methods.momentbased.CentralMomentBasedLbMethod
These methods are represented by instances of lbmpy.methods.cumulantbased.CumulantBasedLbMethod
and will derive collision equations in cumulant space.
The following factory functions create cumulant-based methods using the regular continuous hydrodynamic maxwellian equilibrium.
lbmpy.methods.create_cumulant
lbmpy.methods.create_with_monomial_cumulants
lbmpy.methods.create_with_default_polynomial_cumulants
lbmpy.methods.cumulantbased.CumulantBasedLbMethod
The following functions provide default sets of polynomial raw moments, central moments and cumulants to be used in MRT-type methods.
lbmpy.methods.default_moment_sets.cascaded_moment_sets_literature
lbmpy.methods.default_moment_sets.mrt_orthogonal_modes_literature
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 lbmpy.methods.creationfunctions.create_with_discrete_maxwellian_equilibrium
or create_with_continuous_maxwellian_equilibrium
.
Methods may also be created using custom equilibrium distributions using 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 lbmpy.enums.CollisionSpace
and lbmpy.methods.CollisionSpaceInfo
.
lbmpy.methods.creationfunctions.create_with_discrete_maxwellian_equilibrium
lbmpy.methods.creationfunctions.create_with_continuous_maxwellian_equilibrium
lbmpy.methods.creationfunctions.create_from_equilibrium
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, lbmpy.methods.DensityVelocityComputation
is the typical choice. For custom methods, however, a custom CQC class might have to be created.
lbmpy.methods.AbstractConservedQuantityComputation
lbmpy.methods.DensityVelocityComputation