lbmpy.lattice.Collide#
- class Collide(lattice, config_or_collision=None, /, *, name=None)#
Apply an LBM collision operator to a
Lattice.Collideperforms an LBM collision operation on each node \(\boldsymbol{x}\) of a givenLattice\(\boldsymbol{f}\). It reads the pre-collision state \(\boldsymbol{f}(\boldsymbol{x})\), evaluates the collision operator, and then writes back the post-collision state \(\boldsymbol{f}^{\ast}(\boldsymbol{x})\) to the same lattice:\[\boldsymbol{f}^{\ast}(\boldsymbol{x}) = \Omega \left( \boldsymbol{f}(\boldsymbol{x}) \right).\]The collision operator can be an instance of
LbmCollisionRule(as produced bycreate_lb_collision_rule); otherwise,Collidecan receive anLBMConfigobject which it passes tocreate_lb_collision_ruleinternally.Collideis apystencils.flowflowgraph. To use it, either convert it directly to anOperator, or embed it as a subgraph into a larger operator.When running a simulation, an operator performing LB collision via
Collideshould be immediately followed by the streaming step, using theAdvanceoperator.