pmocz / latticeboltzmann-python

Lattice Boltzmann fluid simulation
https://medium.com/swlh/create-your-own-lattice-boltzmann-simulation-with-python-8759e8b53b1c
GNU General Public License v3.0
173 stars 48 forks source link

Collision implementation #5

Closed Janos95 closed 1 year ago

Janos95 commented 1 year ago

In the collision step it looks like the python code uses ux * ux + uy * uy = dot(u, u) https://github.com/pmocz/latticeboltzmann-python/blob/e85dd009cf57f548b733864e0e9b661160783b67/latticeboltzmann.py#L74 In comparison in the equation in your medium post, the collision expression uses dot(u,u)^2: image Am I missing something or is the code missing a square?

On a different note, thanks for the great work on the small, self-contained simulation examples, they are very educational.

Janos95 commented 1 year ago

Looking a bit more into it, I think the formula in the the blogpost might be wrong?

pmocz commented 1 year ago

Great catch @Janos95 ! There is a typo in the writeup. The (u.u) term in the collision expression is not supposed to be squared. I am correcting the blog post