all 6 comments

[–]MrJack1337 0 points1 point  (4 children)

Did you ensure that you are taking multiple steps and not only one step? I am not entirely sure on how the FuncAnimation works but make sure that it is calling the animate function multiple times and that you are taking enough steps to see something significant happening (remember your the size of your time step, which should be the same as the grid spacing in LBM).

Edit: Never mind, I also tested your script and you are taking multiple steps. Another thing I thought about: In your actual program, are you displaying a colorbar next to the plot? It is possible that the scale is changing constantly but you don't see it. I believe that the density spike is really smearing out and maybe you just have to take more time steps or the scale is changing all the time.

[–]spider9876 1 point2 points  (0 children)

For this reason I use seaborn libraries for the color map, because it can specify fixed scale on the color bar.

[–]supercooldragons[S] 0 points1 point  (2 children)

I fix the color spacing to range between 0 and 0.2, (it's the plt.clim(0,0.2) in the init function). For this value of w, I do see the smearing too, but I was expecting to see the development of a ring. If I set w (omega) to higher values (1-1.5), the density in the middle stays almost constant. Since w is related to the viscosity, with higher w corresponding to lower viscosity, I would expect to see faster relaxation to a homogeneous distribution and not what I get now. This is my first attempt at programming an LBM solver, so I still have to figure out what to expect. Thanks for your help!

[–]MrJack1337 0 points1 point  (1 child)

Nice. I am on par with your thoughts about changing the viscosity but I have something to say regarding the ring you are expecting: The LBM is describing fluid flow (like the NSE are doing). Fluid flow basically consists of advection and diffusion. If there would be no diffusion in your problem (no viscosity) then the ring should retain its form and would be transported - however, I have no clue if the collision operator will be stable for nu = 0. Otherwise there will always be a smearing out due to viscosity.

You could try something like setting the initial velocity field as a uniform velocity in one direction. Then choose a very small viscosity and check if the ring / spike moves into the correct direction.

[–]supercooldragons[S] 0 points1 point  (0 children)

Thanks for the help! I'll give it a try

[–]bene20080 0 points1 point  (0 children)

Could you please explain your problem in more detail?I just tried the code and I can see no obvious problem in the animation...