Тёмный

Simple Lattice-Boltzmann Simulator in Python | Computational Fluid Dynamics for Beginners 

Matias Ortiz
Подписаться 993
Просмотров 57 тыс.
50% 1

Опубликовано:

 

29 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 55   
@PEGuyMadison
@PEGuyMadison 11 месяцев назад
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.
@RonM_1971
@RonM_1971 9 месяцев назад
Now you see the code that I have pasted in. What is your proposal to speed it up a bit, please?
@mikhailnikolaev7282
@mikhailnikolaev7282 Год назад
It's incredible , your explanations are very clear !
@aydencook03
@aydencook03 2 года назад
Great video, although longer/more-explanatory variable names would really help with following along and understanding.
@incognitojoseph3914
@incognitojoseph3914 9 месяцев назад
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.
@AJ-et3vf
@AJ-et3vf 2 года назад
The screen is very zoomed out so the text is small. Barely readable. Otherwise, very helpful.
@pigsmart6315
@pigsmart6315 2 года назад
Great and intuitive video
@ttequenmartin4372
@ttequenmartin4372 2 года назад
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?
@carmineschiavone5060
@carmineschiavone5060 2 года назад
Could you share your matlab code?
@RUSHILRAJESHBME
@RUSHILRAJESHBME Год назад
tau shudnt go bellow 0.5 it will go unstbale
@sumairahmad9464
@sumairahmad9464 Год назад
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!
@yusufe-g4p
@yusufe-g4p 8 месяцев назад
Nice video! I have a question: is there a particular reason why you didn't go the object oriented route?
@ricard458
@ricard458 Год назад
Amazing video! Will you teach us more simulations?
@Farhad1333Farzan
@Farhad1333Farzan 5 месяцев назад
Would you please make more of these and coding them it's really helpful
@kyunbumlee8241
@kyunbumlee8241 Год назад
Thank you for sharing this video!
@arminamani8503
@arminamani8503 Год назад
hello , thank you very much for this great teaching . unfortunately Im not undrestand in initial condition in line 17 and 18
@AJ-et3vf
@AJ-et3vf 2 года назад
Awesome video! Thank you!
@eelcogg
@eelcogg 11 месяцев назад
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?
@venkatagonella8412
@venkatagonella8412 8 месяцев назад
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
@pablobotin9974
@pablobotin9974 9 месяцев назад
Matias (or anyone else)! Could you please share the code?
@roopakbaliyan5935
@roopakbaliyan5935 Год назад
Thank. If possible please upload more videos
@TR1ZZA
@TR1ZZA 5 месяцев назад
How would you calculate drag coefficient from this?
@Plazmeer3705
@Plazmeer3705 Год назад
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
@halilibrahimcetin9448
@halilibrahimcetin9448 Год назад
what happens if we rotate the cylinder? Can we simulate that?
@xmnemonic
@xmnemonic Год назад
good video. would double the sound volume though.
@JitaoCai
@JitaoCai 6 месяцев назад
May I ask why the boundaries at four walls are reflective? The program does not define the boundaries at four walls.
@dibyajyotinayak9079
@dibyajyotinayak9079 2 месяца назад
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
@charlesperry7300
@charlesperry7300 2 года назад
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 .
@charlesperry7300
@charlesperry7300 2 года назад
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. .
@ArminRamezanzadkerati
@ArminRamezanzadkerati Год назад
Thank you for the video. Is there anyway for 3D model?
@Martin-iv5rp
@Martin-iv5rp Год назад
great video, it helps me a loit. thanks, but i have a question. How to plot the streamline?
@andyliu9377
@andyliu9377 Год назад
you might need other libraries or software to draw it, such as pyvista(library) and paraview(software)
@nemhos666
@nemhos666 Год назад
it was amazing!
@h.e.a311
@h.e.a311 Год назад
excellent
@hernanllano9711
@hernanllano9711 2 года назад
Thanks!
@vrj97
@vrj97 Год назад
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?
@samahnert8909
@samahnert8909 10 месяцев назад
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.
@alreadyghosts7727
@alreadyghosts7727 Год назад
The article you link to is locked up behind a paywall.
@mrduckl
@mrduckl Год назад
you can see it with free acount
@edwinrobert3507
@edwinrobert3507 2 года назад
Can we have multiple obstacles of different shape and size?how will they affect flow?
@Martin-iv5rp
@Martin-iv5rp Год назад
yes we can do that, it'll make the difference with pattern of the vortex
@mktsp2
@mktsp2 2 года назад
what is the best editor for python? Can i use rstudio?
@Martin-iv5rp
@Martin-iv5rp Год назад
i've never use rstudio, but so far, i like using pycharm, but we can use sublime text for more lightly python editor
@archi_designer
@archi_designer Год назад
how to use another shape for example from dxf file?
@omkamat9797
@omkamat9797 Год назад
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.
@luisbarba9532
@luisbarba9532 Год назад
How can i do this with a 3D object?
@omkamat9797
@omkamat9797 Год назад
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.
@ch.narasimhakrishna2779
@ch.narasimhakrishna2779 2 года назад
i get pictures after 50 iteriations how do i animate it and save it on my pc
@omkamat9797
@omkamat9797 Год назад
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.
@daleeason9687
@daleeason9687 Год назад
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?
@HiddenSongsByHowlsSongbird
@HiddenSongsByHowlsSongbird 9 дней назад
#CFD
@ch.narasimhakrishna2779
@ch.narasimhakrishna2779 2 года назад
How can we save data in csv file
@michaelsteinhof9022
@michaelsteinhof9022 2 года назад
pog
@ch.narasimhakrishna2779
@ch.narasimhakrishna2779 2 года назад
How to can we store data at every time step in csv file to plot graphs later
@isaciocca325
@isaciocca325 2 года назад
pog
Далее
But How DO Fluid Simulations Work?
15:12
Просмотров 380 тыс.
The million dollar equation (Navier-Stokes equations)
8:03
Coding Adventure: Simulating Fluids
47:52
Просмотров 1,9 млн
I coded one project EVERY WEEK for a YEAR
13:13
Просмотров 682 тыс.
The simplest flow physics that still makes sense
40:45
Просмотров 139 тыс.
Introduction to Lattice Boltzmann Method
1:03:56
Просмотров 37 тыс.
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 723 тыс.
Machine Learning for Computational Fluid Dynamics
39:14