Stencils¶
- class LBStencil(stencil: Stencil | str | tuple[tuple[int, ...], ...], *, theta0: Expr | None = None, weights: tuple[Expr, ...] | None = None, ordering: str | None = None, temperature: Expr | None = None, stencil_name: str | None = None, stencil_type: StencilType | None = None)¶
Factory class for lattice Boltzmann stencil implementations defined in the lbmpy.velocityspace module.
Stencils are represented in the DxQy notation, where d is the dimension (length of the velocity tuples) and y is the number of discrete velocities. For every dimension many different versions of a certain stencil is available. The reason for that is to ensure comparability with the literature. Internally the stencil is represented as a tuple of tuples, where the ordering of the tuples plays no role.
- Parameters:
stencil – Can be tuple of tuples which represents the stencil, a string like ‘D2Q9’/’d2q9’ or an enum of lbmpy.enums.Stencil
theta0 – The lattice reference temperature. This argument must be specified for custom stencils and is not necessary for pre-defined stencils.
weights – The lattice weights. This argument must be specified for custom stencils and is not necessary for pre-defined stencils.
ordering – The LBM literature does not use a common order of the discrete velocities. Therefore, different common orderings are made available for pre-defined stencils to compare intermediate results with the literature. All orderings lead to the same method, they just have to be used consistently. If not provided, the default “walberla” ordering is used.
temperature – Stencil weights and velocities are, in the most general form, functions of temperature. Stencils can, therefore, be provided with a temperature to evaluate these quantities during run time. If not provided, temperature defaults to the lattice reference temperature.
stencil_name – The name of the stencil. This argument must be specified for custom stencils and is not necessary for pre-defined stencils.
stencil_type – lbmpy.velocityspace.StencilType enum representing the stencil type. This argument must be specified for custom stencils and is not necessary for pre-defined stencils.