# 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 the `lbmpy.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

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

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 be `True` if the moments should be orthogonal w.r.t. weighted scalar product using the lattice weights. If `False`, 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 through `lbmpy.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 to `True`. There are four KBC methods available in lbmpy. The naming is according to

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 to `True`. There are four KBC methods available in lbmpy. The naming is according to

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 to `True`. There are four KBC methods available in lbmpy. The naming is according to

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 to `True`. There are four KBC methods available in lbmpy. The naming is according to

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

MONOMIAL_CUMULANT = 11

See `lbmpy.methods.create_with_monomial_cumulants()` Cumulant-based LB method which relaxes monomial cumulants. For details on the method see 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` and `lbmpy.enums.Method.TRT`. Results in the creation of an instance of `lbmpy.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 of `lbmpy.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 of `lbmpy.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` and `lbmpy.enums.Method.MONOMIAL_CUMULANT`. Results in the creation of an instance of `lbmpy.methods.centeredcumulant.CenteredCumulantBasedLbMethod`.

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

SIMPLE = 1
LUO = 2
GUO = 3
BUICK = 4
SILVA = 5
EDM = 6
KUPERSHTOKH = 7
CUMULANT = 8
HE = 9
SHANCHEN = 10
{"ft_lang_label":"__label__en","ft_lang_prob":0.77396053,"math_prob":0.92017424,"size":7283,"snap":"2022-27-2022-33","text_gpt3_token_len":1855,"char_repetition_ratio":0.1515318,"word_repetition_ratio":0.24414062,"special_character_ratio":0.20664561,"punctuation_ratio":0.1413485,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.968541,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-06-30T07:08:55Z\",\"WARC-Record-ID\":\"<urn:uuid:5180173e-eb79-4eea-8e69-0e05c790dbe2>\",\"Content-Length\":\"41444\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5e733934-7316-4978-b09b-e58f4a889b13>\",\"WARC-Concurrent-To\":\"<urn:uuid:946ccc88-fee2-431a-b232-3be8123f8120>\",\"WARC-IP-Address\":\"131.188.39.6\",\"WARC-Target-URI\":\"https://pycodegen.pages.i10git.cs.fau.de/lbmpy/sphinx/enums.html\",\"WARC-Payload-Digest\":\"sha1:7EGQ4VB455JPRNQPXDNBHXBSF3UBZJBU\",\"WARC-Block-Digest\":\"sha1:7H5HOPC3CEIRPAGUIYSSRUJR3CIVK54B\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656103669266.42_warc_CC-MAIN-20220630062154-20220630092154-00781.warc.gz\"}"}