pylbm.Scheme

class pylbm.Scheme(dico, check_inverse=False, need_validation=True)

Create the class with all the needed informations for each elementary scheme.

Parameters:
dicoa dictionary that contains the following key:value
  • dim : spatial dimension (optional if the box is given)

  • scheme_velocity : the value of the ratio space step over time step (la = dx / dt)

  • schemes : a list of dictionaries, one for each scheme

Notes

Each dictionary of the list schemes should contains the following key:value

  • velocities : list of the velocities number

  • conserved moments : list of the moments conserved by each scheme

  • polynomials : list of the polynomial functions that define the moments

  • equilibrium : list of the values that define the equilibrium

  • relaxation_parameters : list of the value of the relaxation parameters

  • source_terms : dictionary do define the source terms (optional, see examples)

  • init : dictionary to define the initial conditions (see examples)

If the stencil has already been computed, it can be pass in argument.

Examples

see demo/examples/scheme/

Attributes:
dimint

spatial dimension

dxdouble

space step

dtdouble

time step

ladouble

scheme velocity, ratio dx/dt

nschemesint

number of elementary schemes

stencilobject of class Stencil

a stencil of velocities

Plist of sympy matrix

list of polynomials that define the moments

EQlist of sympy matrix

list of the equilibrium functions

slist of list of doubles

relaxation parameters (exemple: s[k][l] is the parameter associated to the lth moment in the kth scheme)

Msympy matrix

the symbolic matrix of the moments

Mnumnumpy array

the numeric matrix of the moments (m = Mnum F)

invMsympy matrix

the symbolic inverse matrix

invMnumnumpy array

the numeric inverse matrix (F = invMnum m)

Methods

set_source_terms(scheme)

set the source terms functions for the conserved moments.

vue