Great video.. yes the text is hard to see, but one item I would suggest for real time programming is to get rid of the distance sort function.. use distance_squared and compare against a squared value. The SQRT function uses the iterative Newtonian method which can be too expensive and you can just compare distance_squared.
For anyone wondering how to implement constrained LBM with bounce-back condition, just use the same method implemented for cylinder. However the values might still leak through to the other side, hence just keep the previous value in place.
Very good idea, i reproduced it in Matlab and it works fine. Unfortunately, as i decreased the tau to see what happens with higher Reynolds, the simulation quickly becomes unstable. Even tau=0.3 is too low. Do you know if there is a way to avoid that, using maybe different propagation methods?
how did you get to setting the relaxation time to exactly 0.53 and the velocity profile to 2.3 ? Any semi-formulation or trial and error? Also I am a bit confused about the time step , it is one lattice unit in general. Any formulation that you might know where I can set into SI units! Much obliged!
This is cool, but the simulation appears to be very unstable. Even just changing the size of the cylinder causes it to crash. Are we missing a normalization step somewhere?
Hey Matias, thank you for this video. I want to read an STL file directly, create boundary and fluid particles and then simulate. I mean I wanted to read any general geometry, group the boundaries and then read the data into my LBM code. Kindly do suggest how to do this. currently I wrote 3D LBM code and hard coded for Lid driven cavity. I wanted to make my code generally applicable for any complex geometry. Kindly suggest
how do i make it like its a wind tunnel because it appears that the pressure is created at the objects surface instead of the very left wall furthermore could i create a point of temporary high pressure to simulate a cannon or rocket combustion chamber
sir can you plese send me the matlab codes for " A numerical model to simulate the vertical velocity distribution in an open channel withdouble-layered rigid vegetation" on lattice boltzman method
Great application of Python's 'power. In studying the codes. i don't understand that in the streaming process, the cylinder does not appear to exist. As long as each pair of F swap for ALL the nodes in the cylinder region. ux and uy are not zero in the cylinder region. They are set be zero in the plot for the vorticity Anyway, it works magically. Apprecite any helpful comments .
Because of the order of execution: collision ,streaming and then applying reflective boundary condition. Whatever the F components computed within the cylinder will never propagate outside of the cylinder, and thus has no effect at all This is is the key to understand how the boundary conditionis implemented in the algorithm. .
Very nice video! Does anyone have a detailed explanation of how to relate the quantities in the simulation to physical units? Like if I have a mean stream velocity of 10cm/s, does that just mean that my delta_x and delta_t should be chosen such that delta_x/delta_t = 10? And I can think of the spacing in cm? I was reading about this and it seems a little more complicated, relating to how Navier-Stokes gets non-dimensionalized. Also somehow the speed of sound matters?
I’m not an expert in lattice Boltzmann but Im doing my phd in unsteady flows and I can share how I do things. Across the board in cfd research in canonical problems (such as the cylinder) it’s common practice to non-dimensionalize your system before running a simulation. For every flow, we pick a characteristic length scale (let’s say L) and velocity scale (let’s say U) giving a characteristic timescale (L/U), and we’ll choose a mass scale that’s supposed to represent fluid density. These are often all just set to 1 in the code so that the only free variable is viscosity. With this, we can define a reynolds number that will fully dictate how the flow behaves. Thus, I think it’s more helpful to think about these simulations in terms of reynolds number, not in terms of the free stream velocity since the reynolds number is what really matters. In terms of how to determine the delx/y, this is more dependent on the numerical scheme you choose to use to solve for the flow (I would refer you to read about the CFL number when designing the dx/y of your mesh). Again, I wouldn’t really think about this in terms of cm, I would just define a characteristic length and let that equal 1. For the final question, I want to emphasize that I am very much not a lattice Boltzmann person lol, so idk if this answer will be what you’re looking for. but in more mainstream cfd, speed of sound will not matter for incompressible flows. The speed of sound is actually “infinite” if you enforce incompressibility by solving the poisson equation for pressure (all this means is that pressure is nonlocal and changes everywhere instantaneously). Hopefully some of this was helpful, sorry I went on a tangent. I saw you asked for a “detailed explanation” and couldn’t help myself lol.
I was using this as a skeleton code to implement in some other types of simulation. Usually, you can convert dxf to a png, and then turn that into a numpy array of 0 and 1. Then, with a few simply for loops, you can turn this into an array of true and false. You then simply make sure that the number of lattices are updated to match the size of the numpy array.
you will have to use a D3Q19 instaed of the D2Q9. This will add an extra dimention to the F array and other array. I mean it should work probably, but I haven't tried it.
i used spyder, and use the save all plots option. Then I just found a free gif making website online, and uploaded all the images there, and it made a gid, showing the animation.
I'm interested in the topic and what changes you make to the existing code. I'm not interested in watching you type the code with the usual typo corrections taking up my time. Is there a link to the final code somewhere?