from lbmpy.moments import is_shear_moment, get_order
```
%% Cell type:markdown id: tags:
# Demo: Thermalized (Randomized) LBM
This demo notebook shows how to modify the LB collision operator to account for microscopic fluctuations. This technique is also called thermalized or randomized LBM. In these methods a random fluctuation is added to the equilibrium moments. In this simple example we implement a thermalized model by writing our own simple linear congruent random number generator, the draws indepedent random numbers on each cell. A seed is stored for each cell since all cells are processed in parallel.
<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7fee54d8ee80>
<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f53b1d12a90>
%% Cell type:markdown id: tags:
## 2) Creating the kernel equations
%% Cell type:markdown id: tags:
Next we have to define rules how to compute the quantities $rand_0$ and $rand_1$.
We do this using a linear congruent RNG on each cell. We pass in a seed array, and in each time step this seed array is updated with the new random numbers.