Enumerations¶
- class Stencil(value)¶
The Stencil enumeration represents all possible lattice Boltzmann stencils that are available in lbmpy. It should be passed to
lbmpy.stencils.LBStenil
. This class then creates a stencils representation containing the concrete neighbour directions as a tuple of tuples.The number of spatial dimensions d and the number of discrete velocities q are stated in the DdQq notation
- D2Q9 = 1¶
A two dimensional stencil using 9 discrete velocities.
- D2V17 = 2¶
A two dimensional stencil using 17 discrete velocities. (long range stencil).
- D2V37 = 3¶
A two dimensional stencil using 37 discrete velocities. (long range stencil).
- D3Q7 = 4¶
A three dimensional stencil using 7 discrete velocities.
- D3Q15 = 5¶
A three dimensional stencil using 15 discrete velocities.
- D3Q19 = 6¶
A three dimensional stencil using 19 discrete velocities.
- D3Q27 = 7¶
A three dimensional stencil using 27 discrete velocities.
- class Method(value)¶
The Method enumeration represents all possible lattice Boltzmann collision operators that are available in lbmpy. It should be passed to
lbmpy.creationfunctions.LBMConfig
. The LBM configuration dataclass then derives the respective collision equations when passed to the creations functions in thelbmpy.creationfunctions
module of lbmpy.Note here, when using a specific enumeration to derive a particular LBM collision operator, different parameters of the
lbmpy.creationfunctions.LBMConfig
might become necessary. For example, it does not make sense to define relaxation_rates for a single relaxation rate method, which is essential for multiple relaxation rate methods. Important specific parameters are listed below to the enum value. A specific creation function is stated for each case which explains these parameters in detail.- SRT = 1¶
See
lbmpy.methods.create_srt()
, Single relaxation time method
- TRT = 2¶
See
lbmpy.methods.create_trt()
, Two relaxation time, the first relaxation rate is for even moments and determines the viscosity (as in SRT). The second relaxation rate is used for relaxing odd moments and controls the bulk viscosity. For details in the TRT collision operator see [IVDHumieres08]
- MRT_RAW = 3¶
See
lbmpy.methods.create_mrt_raw()
, Non-orthogonal MRT where all relaxation rates can be specified independently, i.e. there are as many relaxation rates as stencil entries. Look at the generated method in Jupyter to see which moment<->relaxation rate mapping. Originally defined in [DHumieres92]
- MRT = 4¶
See
lbmpy.methods.create_mrt_orthogonal()
Orthogonal multi relaxation time model, relaxation rates are used in this order for shear modes, bulk modes, third-order modes, fourth-order modes, etc. Requires also a parameter weighted that should beTrue
if the moments should be orthogonal w.r.t. weighted scalar product using the lattice weights. IfFalse
, the normal scalar product is used. For custom definition of the method, a nested_moments can be passed. For example: [ [1, x, y], [x*y, x**2, y**2], … ] that groups all moments together that should be relaxed at the same rate. Literature values of this list can be obtained throughlbmpy.methods.creationfunctions.mrt_orthogonal_modes_literature()
. WMRT collision operators are reported to be numerically more stable and more accurate, whilst also having a lower computational cos [FBL17]
- CENTRAL_MOMENT = 5¶
See
lbmpy.methods.create_central_moment()
Creates moment based LB method where the collision takes place in the central moment space. By default, a raw-moment set is used where the bulk and the shear viscosity are separated. An original derivation can be found in [Gei06]
- TRT_KBC_N1 = 6¶
See
lbmpy.methods.create_trt_kbc()
Particular two-relaxation rate method. This is not the entropic method yet, only the relaxation pattern. To get the entropic method also entropic needs to be set toTrue
. There are four KBC methods available in lbmpy. The naming is according to [BoschCK15]
- TRT_KBC_N2 = 7¶
See
lbmpy.methods.create_trt_kbc()
Particular two-relaxation rate method. This is not the entropic method yet, only the relaxation pattern. To get the entropic method also entropic needs to be set toTrue
. There are four KBC methods available in lbmpy. The naming is according to [BoschCK15]
- TRT_KBC_N3 = 8¶
See
lbmpy.methods.create_trt_kbc()
Particular two-relaxation rate method. This is not the entropic method yet, only the relaxation pattern. To get the entropic method also entropic needs to be set toTrue
. There are four KBC methods available in lbmpy. The naming is according to [BoschCK15]
- TRT_KBC_N4 = 9¶
See
lbmpy.methods.create_trt_kbc()
Particular two-relaxation rate method. This is not the entropic method yet, only the relaxation pattern. To get the entropic method also entropic needs to be set toTrue
. There are four KBC methods available in lbmpy. The naming is according to [BoschCK15]
- CUMULANT = 10¶
See
lbmpy.methods.create_with_default_polynomial_cumulants()
Cumulant-based LB method which relaxes groups of polynomial cumulants chosen to optimize rotational invariance. For details on the method see [GSchonherrPK15]
- MONOMIAL_CUMULANT = 11¶
See
lbmpy.methods.create_with_monomial_cumulants()
Cumulant-based LB method which relaxes monomial cumulants. For details on the method see [GSchonherrPK15] and [CCL19]
- class CollisionSpace(value)¶
The CollisionSpace enumeration lists all possible spaces for collision to occur in.
- POPULATIONS = 1¶
Population space, meaning post-collision populations are obtained directly by relaxation of linear combinations of pre-collision populations. Default for
lbmpy.enums.Method.SRT
andlbmpy.enums.Method.TRT
. Results in the creation of an instance oflbmpy.methods.momentbased.MomentBasedLbMethod
.
- RAW_MOMENTS = 2¶
Raw moment space, meaning relaxation is applied to a set of linearly independent, polynomial raw moments of the discrete population vector. Default for
lbmpy.enums.Method.MRT
. Results in the creation of an instance oflbmpy.methods.momentbased.MomentBasedLbMethod
.
- CENTRAL_MOMENTS = 3¶
Central moment space, meaning relaxation is applied to a set of linearly independent, polynomial central moments of the discrete population vector. Default for
lbmpy.enums.Method.CENTRAL_MOMENT
. Results in the creation of an instance oflbmpy.methods.momentbased.CentralMomentBasedLbMethod
.
- CUMULANTS = 4¶
Cumulant space, meaning relaxation is applied to a set of linearly independent, polynomial cumulants of the discrete population vector. Default for
lbmpy.enums.Method.CUMULANT
andlbmpy.enums.Method.MONOMIAL_CUMULANT
. Results in the creation of an instance oflbmpy.methods.cumulantbased.CumulantBasedLbMethod
.
- compatible(method)¶
Determines if the given
lbmpy.enums.Method
is compatible with this collision space.
- class ForceModel(value)¶
The ForceModel enumeration defines which force model is used to introduce forcing terms in the collision operator of the lattice Boltzmann method. A short summary of the theory behind is shown in
lbmpy.forcemodels
. More precise definitions are given in Chapter 6 and 10 of [KrugerKK+17]- SIMPLE = 1¶
- LUO = 2¶
- GUO = 3¶
- BUICK = 4¶
- SILVA = 5¶
- EDM = 6¶
- KUPERSHTOKH = 7¶
- HE = 8¶
- SHANCHEN = 9¶
- CENTRALMOMENT = 10¶