As a fluid dynamic engineer, I’m very aware of the complexity of CFD. It’s absolutely stunning not just that you wrote a basic cfd code in 200 lines, but that it even runs on a browser and, most of all, that you could explain it in 10 minutes. Astonishing
As a functional programmer I see a great deal of redundancy and excess in this code so it could be shortened too. It's rather impressive that they kept it so small.
h1 = 1/h var x0 = Math.min(Math.floor((x-dx)*h1), this.numX-1); var tx = ((x-dx) - x0*h) * h1; second line (x-dx) * h1 - (x0*h) * h1 x0 - x0 * h1 in other words real_x - sim_grid_x So, why does your simulation work?
This is exactly what I have wanted to understand for years now. I have long thought it would be so cool to simulate a lava lamp, or the waves on the surface of a swimming pool. Every time I try to read about fluid mechanics, it's page after page of differential equations. You have made this so clear and intuitive. Thank you so much!
Glad to see this channel finally get the attention it deserves :) PS: Matthias, consider putting the Discord server in the description of these, since we have a bunch of people there willing to help out others and discuss these videos.
I don't understand why the pressure can be calculated like that. What am I missing? If it's incompressible d will be 0 "after projection"(@7:03), and if you mean the d before the projection then the liquid is no longer incompressible(it compresses/expands momentarily before propagating the corrected values).
I know that you have little views, but the content you makes me delightet! It is very hard to find University level tutorials or explanations for fluids and softbodies, so your well made videos are a treasure! Especially for me as a Games Engineer it is very funny to know the math and algorythms.
I'm a programmer and aerospace engineer. Love this video and it's simplicity. For clarification though, the full code is 700+ lines, although I give credit to the fact that only 200+ are needed for the fluid flow mathematics. Thanks for sharing and please keep making content.
That's incredible, congratulations! But there's something that's not very clear to me. How is it possible to have vortex shedding if fluid viscosity is not modeled? In an inviscid fluid with initial zero vorticity (potential flow), vorticity would remain zero everywhere in subsequent time steps. In this case, for an inviscid fluid the flow around a cylinder would not have vortex shedding, but would be symmetrical and produce no net drag (D'Alembert paradox).
Love your videos, Matthias! Such a great initiative to create this video series, and to use web-based tech so that it's easy to play around with your interactive demos. Keep up the great work. ~ Eran.
A great video for aspiring numerical analysts. Amazing to see how you covered incompressibility to the Gauss-Seidel method within 10 minutes and a code that demonstrates all that 👏
Thank you so much for this information! This is such valuable content for people who are interested but don't have the opportunity or time to acquire this knowledge at a university or by reading specialist literature!
Ohh my, i never thought i will see a tutorial from THE Matthias Müller. Im such a huuuuuuuuuge fan of your works and papers! You are probably the most cited person in my bachelor and masters thesis - both about fluids. And damn i like your research. So awesome! Keep up your work! Youre freakn awesome in what youre doing!
Awesome! That is the little programm that I always wanted to write myself to simulate the flow around airfoils or sails, but I never managed to get this done. I got a s far as translating the equations to discrete cells, but then I always ended up with very large scarce equation systems, which needed an engine like Matlab to solve. Your choice of the staggered grid and all the other tricks are so elegant and make the solution so lean and efficient. Too bad that you did not post this video years ago, it would have saved me a lot of time. Great job!! Now I am looking forward to your solution of the full Navier-Stokes equations. OK, I'll give you a budget of 300 lines of code for that...😀
You cant find analytic solutions to fluid dynamics unless in some very simple cases like laminar flow through a pipe, which your case definitely isn't. The only solution is discrete CFD simulation and then verify it is close enough to reality
@@miguelguerrero3394 Yes, I know that. Thats why solving the Navier-Stokes equations is on the list of the Millennium Problems, for which the Clay Mathematics Institute offered a US $7 million prize fund ($1 million per problem). CFD is the only option to approach these problems for now...
Very good vidéo ! Just a little remark, Lagrange was born in Italy but worked in France with "L'Académie des Sciences", lived through the French Revolution and his body is actually in the Pantheon so it should probably be Franco-Italian. (the concept of nationality came with the Revolution so it's a bit fuzzy)
Cool stuff, just finished my aerospace engineering masters. My favorite course was a class in CFD theory. Maybe you could make some videos on the finite volume method as well, or finite elements.
This **was** finite volume (the volume we are talking about is one Cell) - for each volume (cell) you are enforcing applying body forces, the divergence is zero (incompressible fluid and no sources or sinks) and the advection of velocities.
I just stumbled on your channel. It is great how much good explanations you pack into a dozen minutes. I will recap all the videos in your series and try out the code.
Omg, are you the same Matthias who used to present awesome physics simulation stuff as an Nvidia researcher years and years ago? If yes, I can't believe I found another of your channels after so many years haha :-)
Dear Matthias, great tutorial! Please consider removing the statement that inviscid fluid is a good approximation for water and air. This is not true, and may be misleading for people looking at this without a strong enough STEM background. Inviscid fluid, for example, flows through a pipe without any pressure drop. If water was inviscid, pumps would not be needed.
Thanks, I am glad you like it! Well I should have mentioned that this is true from a graphics perspective. Nobody adds the viscosity term in our field. In contrast, it is almost a research field of its own to remove numerical damping and inject vorticity and turbulence both for gases and water.
@@TenMinutePhysics But can you add in the effect of viscosity between the advection step and the divergence correction step? I just did this and it seems to work so far ...
Hi, good job! I'd like to understand some things to my own implementations, if you will. 1. How do you avoid high order harmonics due to non-linearity? 2. How does the flow evolve into a von Karman vortex street without viscosity? what is causing the separation of the cylinder?
If you adjust the velocities of a cell using the divergence so that they add up to zero, then wouldn't the velocity of the left edge get messed up again when you adjust the velocities on the cell that's on the left of it? That's the part I don't get: how does the operation work for the edges given that they are part of two cells, each one with a different divergence value
Good question! I should have addressed this point in the video. You are right with your remark. After one pass the cells are not divergence free. The Gauss-Seidel method simply goes through the cells multiple times (the iterations) which reduces the errors in every pass.
at 9:44 , the subscript of weights of last 2 terms seems like typo. Its w00w11 and w01w11. This was an amazing tutorial thou... Most understandable vdo... Thanks for making this.
Is there a paper written about this method? I've never seen such a simple method before. It is reminiscent of Stam's Stable Fluids, but much simpler. I wonder how it compares, in terms of stability and ability to simulate aesthetic details. The vortices looked neat.
Hi! Have you also looked into eulerian simulation of advection? I used the same approach as you, however I find that semi-Lagrangian advection has a problem of energy loss. The problem arises when velocity vector is so great, that it "skips" a few cells and can end up inside a wall. In such cases, advected velocity becomes 0. I haven't been able to find a better method though.
Heh, I've been staring at solveIncompressibility at 11:26 for probably half an hour now. All of the disagreements I have are coder vs scientist (possibly mathematician) things yet I can't help being annoyed at the letter s being used for three different things on lines 133 to 138 and left, right, up and down being called sx0, sx1, sy0 and sy1 to confuse poor programmers ;)
I would still love to see a video about rigidbodies, since they tend to be the most common type of simulation in games and film :) Maybe a more detailed tutorial (especially in regards to angular velocity) based on your XPBD bodies paper could be possible ?
Hi i really liked the explanation, but i miss a point. In the simulation you clearly force incompressibility by forcing the divergence to zero (as requested by the continuity equation), but it seems that is not considered the conservation of momentum that is needed to completely define the fluid problem (the Navier-Stokes system of equations). Is the incompressibility condition sufficient to get a velocity field for a fluid?
Something I've noticed in my physics course is that simulations of complex systems can be incredibly simple. The difficult bit is determining what is the best way to program something, so that it is both accurate and has reasonable computation costs. The programming itself will almost invariably result in a very short program. From what I can tell the huge thousands-of-lines projects that people spend years developing are tools which have many different methods of doing many different things for many different purposes. Each thing is short, the collation of them all into one widely useable toolkit so that no one ever has to code any of it again is not.
I love the explanation in the video, but, reading the code, you could do the same with better performance in fewer lines. Look out for lines doing nothing of interest and variables never used.
@Matthias: Talking about divergence, in theory your video should be five times more informative than the ones on "Two Minute Papers". However, I find this so much more interesting and useful. So, thanks for the additional information inflow. Keep up the great work!
Congrats for this amazing video. I had never seen this method for forcing the Incompressibility before. Is there any paper in which this method is presented? Could you please share paper or how did you discover it?
Is there a name for the method that is being used in Gauss-Seidel loop? I am new to this and I have seen examples of solvers solve for pressure in the iterative loops, then update velocity after. Here we directly update velocity.
Great video, thanks for posting this. I first wrote a MAC-type simulation for incompressible viscous flow back in the early 1980's. Seeing what you have done in 200 lines of code is amazing - we have come a long way! Your explanations are excellent and are a first rate introduction to a complex topic.
When you said that the pressure values are still correct, This means that you confirm these values doing a real life experiment? Like in a water tank or something? Or what means correct in this context? Thanks
Are all these videos people presenting their Uni projects like it’s groundbreaking or something? Don’t get me wrong I’m not hating it’s just I’m clueless to the subject and there is a lot of these videos recently and the first time I seen it I thought the person was going to get a scholarship or something. The current volume of videos suggest this is not true and there for it must be considered a relatively simple task in terms of creating an algorithm. If this is considered easy does that mean they’ve narrowed down the maths required for this kind of simulation to a relatively simple calculation that can be used in a modular sense with other simulations? What I’m asking in a nut shell is what are the implications of this becoming available as common knowledge? Does it mean this is what labs are using or does it mean that their R&D is a lot further down the road than what is presented here?
3:11 The staggered grid is sometimes called the Arakawa grid, after Akio Arakawa, the scientist who popularized it during the nascent years of fluid simulations.
I have a question . What if non zero velocity is initial condition and not coming from previous step/location. So x-dV*t will go into zero velocity point and will not work. ie if initial condtion is Ux=1 in one point and zero in all others?
So glad I got this channel recommended to me. The videos along with the PDF overviews are amazing. I'm looking to try them in another language and will be happy to share
I can't believe I just found this !! I wanted to do CFD for a school project this year but I had given up because i after doing quite extensive research on she topic and trying to write a simple code twice that never worked i got overwelmed and settle for something I find way less interresting. This however gives me hope again thank you so much !! How hard would it be to account for compressibility ? I would really like to manage to implement it.
This is amazing. I'm going to see if I can reimplement this in unity with as much optimization I can shove into it and see what is the largest resolution I can simulate in real time.
I've read Bridson's book on Fluid Simulation for Computer Graphics, but you give an excellent and brief, yet detailed explanation. It cleared some things up for me. Thank you! Subscribed.
So effective! 15 years ago I was doing these simulations with industrial level CFD software and I was writing much more code just to analyze results. [feels nostalgic]
Gauss-Seidel is an iterative method. When you fix one cell you might "unfix" a neighbor cell. With multiple iterations the solution converges to a global one. You could measure the total error and if it goes below a threshold you stop iterating. Or, typical for real-time apps, you just choose a fixed number.
What is the reason for using the staggered grids? It seems like a lot more work, and bugs, to code, and think about, so I'm guessing there must be a strong advantage somewhere? Maybe something to do with handling projection?
Thank you so much for this explanation, Matthias! I just found this video : it's fascinating. I've subscribed (of course) and now I'll get a (large) mug of coffee and watch your other videos. Actually, you only need 1000 kgf /cm² to compress water more than 3% , but only an engineer who works in high pressure hydraulics would notice that. Don't worry. 😁
Man, Your knowledge is fantastic!! You should start experimenting with Houdini. Do you accept paid code requests? I have some ideas I would like to implement but don't know the math enough.
Is there something wrong with the image of general grid interpolation? The code is right, but the image in the video show W010W11 for Vi,j+1, which should be W00W11.
THANKYOU! SO many talks about fluid simulations (and fluid/water in general) mistakingly claim (orimply) that water *is* incompressable. this is the first time i've seen someone correctly assert its "functionally incompressable" XD
Thanks a lot for the video. Quick question. If we are using Jacobi method instead of the Gauss-Seidel method in order to do parallel implementation. Can Overrelaxation be used with the Jacobi method?
When playing around with smoke in a closed box. The total smoke (sum of the m field values) changes, despite it being closed and me not removing any smoke? Why is that and is there a fix?
Fluid pressure in a tank demo Advection Pressure distribution Guass seidel method Water tunnel Wind tunnel Divergence = 0 Pixels Pixels of television Depends on the resolution of the television Great sir thank you
11 месяцев назад
Thank you very much. Greetings from Popayan, Colombia.
Great... Great... Great job guy !! Thanks so much for sharing !!! (I wrote such simulator for meteorological applications long time ago, but the code was far from this beauty...)
I am having trouble understanding how the advection part works computationaly... it there any place i can further read about this step because i have tried reading your code but it doesnt have and comments so its hard to follow through.
Good day, again. Is this method stable for any values of parameters? E.g. flow speed. Because I set up the speed of the flow to 10000 and it is seems that simulator started to multiple the smoke, i.e. it started to ruin the conservation of mass. Is there any information regarding the physical consistency at any parameters values or are there boundaries?
As a fluid dynamic engineer, I’m very aware of the complexity of CFD. It’s absolutely stunning not just that you wrote a basic cfd code in 200 lines, but that it even runs on a browser and, most of all, that you could explain it in 10 minutes. Astonishing
It's a nice piece of code, but it's literally CFD 101. Everybody's first fluid sim looks like this.
@@nathan87 Perhaps intended for people like me who are new to the topic?
Lattice Boltzmann is even simpler, a basic C implementation is 100 lines. Yet it's a lot faster and much more accurate :)
@@ProjectPhysX This is super cool stuff for someone just learning about it.
As a functional programmer I see a great deal of redundancy and excess in this code so it could be shortened too. It's rather impressive that they kept it so small.
Hello Matthias, Thank you so much for your video series
Beautiful video, subscribed
I can't believe this are so few views.
h1 = 1/h
var x0 = Math.min(Math.floor((x-dx)*h1), this.numX-1);
var tx = ((x-dx) - x0*h) * h1;
second line
(x-dx) * h1 - (x0*h) * h1
x0 - x0 * h1
in other words
real_x - sim_grid_x
So, why does your simulation work?
Everything is easy when you are both a programmer and a physicist
Me too..I am a mechanical engineer with a ardent interest and hands-on working knowledge of python,C,C++ to simulate physics
you forgot mathematicians ;-;
@@wallbrick2170 yeah, mostly methematician, because if you know math then you are able understand physics as well
@@this_is_mayhem Well, not really
@@this_is_mayhem meth?
These videos are such a nice breath of fresh air after reading simulation papers
This is exactly what I have wanted to understand for years now. I have long thought it would be so cool to simulate a lava lamp, or the waves on the surface of a swimming pool. Every time I try to read about fluid mechanics, it's page after page of differential equations. You have made this so clear and intuitive. Thank you so much!
Hi all, thanks so much for all your positive feedback! A great motivation to do more videos!
Glad to see this channel finally get the attention it deserves :)
PS: Matthias, consider putting the Discord server in the description of these, since we have a bunch of people there willing to help out others and discuss these videos.
These r awesome! Physicist content creator
Incredible!!!
yes please
It would be great if you could use variables names that were slightly more self-describing. Readability is far more important than brevity.
I don't understand why the pressure can be calculated like that. What am I missing?
If it's incompressible d will be 0 "after projection"(@7:03), and if you mean the d before the projection then the liquid is no longer incompressible(it compresses/expands momentarily before propagating the corrected values).
I know that you have little views, but the content you makes me delightet! It is very hard to find University level tutorials or explanations for fluids and softbodies, so your well made videos are a treasure!
Especially for me as a Games Engineer it is very funny to know the math and algorythms.
absolutely
I am glad you like it. The numbers will go up with more videos. 3K subs for only 17 videos is actually quite good :-)
This is the shortest, clearest explanation I have ever heard of method like this. Do you have any sources I could look into to learn more? Thanks.
I'm a programmer and aerospace engineer. Love this video and it's simplicity. For clarification though, the full code is 700+ lines, although I give credit to the fact that only 200+ are needed for the fluid flow mathematics. Thanks for sharing and please keep making content.
That's incredible, congratulations! But there's something that's not very clear to me.
How is it possible to have vortex shedding if fluid viscosity is not modeled? In an inviscid fluid with initial zero vorticity (potential flow), vorticity would remain zero everywhere in subsequent time steps.
In this case, for an inviscid fluid the flow around a cylinder would not have vortex shedding, but would be symmetrical and produce no net drag (D'Alembert paradox).
His advection method introduces computational (i.e. non-physical) viscosity. Which, to be fair, he mentions in the video (9:06)
Love your videos, Matthias! Such a great initiative to create this video series, and to use web-based tech so that it's easy to play around with your interactive demos. Keep up the great work. ~ Eran.
Thanks! I am happy to hear that people like it and will definitely make more videos
I have been looking for this eloquent lecture for the last 15 years.
A great video for aspiring numerical analysts. Amazing to see how you covered incompressibility to the Gauss-Seidel method within 10 minutes and a code that demonstrates all that 👏
Thank you so much for this information! This is such valuable content for people who are interested but don't have the opportunity or time to acquire this knowledge at a university or by reading specialist literature!
Took that challenge in Stam 1999 personally did ya?
Ohh my, i never thought i will see a tutorial from THE Matthias Müller. Im such a huuuuuuuuuge fan of your works and papers! You are probably the most cited person in my bachelor and masters thesis - both about fluids. And damn i like your research. So awesome!
Keep up your work! Youre freakn awesome in what youre doing!
Very amazing effect ! Will fluid simulation from Lagrange perspective (e.g. SPH) be covered in the future ?
Awesome! That is the little programm that I always wanted to write myself to simulate the flow around airfoils or sails, but I never managed to get this done. I got a s far as translating the equations to discrete cells, but then I always ended up with very large scarce equation systems, which needed an engine like Matlab to solve. Your choice of the staggered grid and all the other tricks are so elegant and make the solution so lean and efficient. Too bad that you did not post this video years ago, it would have saved me a lot of time. Great job!! Now I am looking forward to your solution of the full Navier-Stokes equations. OK, I'll give you a budget of 300 lines of code for that...😀
You cant find analytic solutions to fluid dynamics unless in some very simple cases like laminar flow through a pipe, which your case definitely isn't. The only solution is discrete CFD simulation and then verify it is close enough to reality
@@miguelguerrero3394 Yes, I know that. Thats why solving the Navier-Stokes equations is on the list of the Millennium Problems, for which the Clay Mathematics Institute offered a US $7 million prize fund ($1 million per problem). CFD is the only option to approach these problems for now...
@@veitheld167 oh ok, nevermind then.
Inviscid vortex shedding? I am intrigue.
Very good vidéo ! Just a little remark, Lagrange was born in Italy but worked in France with "L'Académie des Sciences", lived through the French Revolution and his body is actually in the Pantheon so it should probably be Franco-Italian. (the concept of nationality came with the Revolution so it's a bit fuzzy)
Cool stuff, just finished my aerospace engineering masters. My favorite course was a class in CFD theory. Maybe you could make some videos on the finite volume method as well, or finite elements.
This **was** finite volume (the volume we are talking about is one Cell) - for each volume (cell) you are enforcing applying body forces, the divergence is zero (incompressible fluid and no sources or sinks) and the advection of velocities.
I just stumbled on your channel. It is great how much good explanations you pack into a dozen minutes. I will recap all the videos in your series and try out the code.
Omg, are you the same Matthias who used to present awesome physics simulation stuff as an Nvidia researcher years and years ago? If yes, I can't believe I found another of your channels after so many years haha :-)
Dear Matthias,
great tutorial!
Please consider removing the statement that inviscid fluid is a good approximation for water and air. This is not true, and may be misleading for people looking at this without a strong enough STEM background. Inviscid fluid, for example, flows through a pipe without any pressure drop. If water was inviscid, pumps would not be needed.
Thanks, I am glad you like it! Well I should have mentioned that this is true from a graphics perspective. Nobody adds the viscosity term in our field. In contrast, it is almost a research field of its own to remove numerical damping and inject vorticity and turbulence both for gases and water.
@@TenMinutePhysics But can you add in the effect of viscosity between the advection step and the divergence correction step? I just did this and it seems to work so far ...
Why only 2.59K subs!
What a redundant video. Who DOESN'T know how to write a Eulerian fluid simulator??
Hi, good job! I'd like to understand some things to my own implementations, if you will.
1. How do you avoid high order harmonics due to non-linearity?
2. How does the flow evolve into a von Karman vortex street without viscosity? what is causing the separation of the cylinder?
I'm not sure of my answer but finite difference method is diffusive so that using it add numerical diffusion in the resolution
If you adjust the velocities of a cell using the divergence so that they add up to zero, then wouldn't the velocity of the left edge get messed up again when you adjust the velocities on the cell that's on the left of it? That's the part I don't get: how does the operation work for the edges given that they are part of two cells, each one with a different divergence value
Good question! I should have addressed this point in the video. You are right with your remark. After one pass the cells are not divergence free. The Gauss-Seidel method simply goes through the cells multiple times (the iterations) which reduces the errors in every pass.
at 9:44 , the subscript of weights of last 2 terms seems like typo. Its w00w11 and w01w11.
This was an amazing tutorial thou... Most understandable vdo... Thanks for making this.
I didn't ask for more. What can I say except a very big thank you. Tank you really.
Is there a paper written about this method? I've never seen such a simple method before. It is reminiscent of Stam's Stable Fluids, but much simpler. I wonder how it compares, in terms of stability and ability to simulate aesthetic details. The vortices looked neat.
Hi! Have you also looked into eulerian simulation of advection? I used the same approach as you, however I find that semi-Lagrangian advection has a problem of energy loss. The problem arises when velocity vector is so great, that it "skips" a few cells and can end up inside a wall. In such cases, advected velocity becomes 0. I haven't been able to find a better method though.
Heh, I've been staring at solveIncompressibility at 11:26 for probably half an hour now. All of the disagreements I have are coder vs scientist (possibly mathematician) things yet I can't help being annoyed at the letter s being used for three different things on lines 133 to 138 and left, right, up and down being called sx0, sx1, sy0 and sy1 to confuse poor programmers ;)
I would still love to see a video about rigidbodies, since they tend to be the most common type of simulation in games and film :) Maybe a more detailed tutorial (especially in regards to angular velocity) based on your XPBD bodies paper could be possible ?
Sure, eventually I will cover everything I have been doing. However, since people seem to like fluid sim a lot the next one will be about FLIP 🙂
Hi i really liked the explanation, but i miss a point.
In the simulation you clearly force incompressibility by forcing the divergence to zero (as requested by the continuity equation), but it seems that is not considered the conservation of momentum that is needed to completely define the fluid problem (the Navier-Stokes system of equations). Is the incompressibility condition sufficient to get a velocity field for a fluid?
Something I've noticed in my physics course is that simulations of complex systems can be incredibly simple.
The difficult bit is determining what is the best way to program something, so that it is both accurate and has reasonable computation costs. The programming itself will almost invariably result in a very short program.
From what I can tell the huge thousands-of-lines projects that people spend years developing are tools which have many different methods of doing many different things for many different purposes. Each thing is short, the collation of them all into one widely useable toolkit so that no one ever has to code any of it again is not.
If viscosity can be implemented, will fluids with a very high viscosity retain their shape when moving around?
I love the explanation in the video, but, reading the code, you could do the same with better performance in fewer lines. Look out for lines doing nothing of interest and variables never used.
@Matthias: Talking about divergence, in theory your video should be five times more informative than the ones on "Two Minute Papers". However, I find this so much more interesting and useful. So, thanks for the additional information inflow. Keep up the great work!
Congrats for this amazing video. I had never seen this method for forcing the Incompressibility before. Is there any paper in which this method is presented? Could you please share paper or how did you discover it?
Wow, it's really good. It's very attractive and the AD is very interesting
Is there a name for the method that is being used in Gauss-Seidel loop? I am new to this and I have seen examples of solvers solve for pressure in the iterative loops, then update velocity after. Here we directly update velocity.
Great video, thanks for posting this. I first wrote a MAC-type simulation for incompressible viscous flow back in the early 1980's. Seeing what you have done in 200 lines of code is amazing - we have come a long way! Your explanations are excellent and are a first rate introduction to a complex topic.
Congratulation!!! Greetings from Bolivia.
When you said that the pressure values are still correct, This means that you confirm these values doing a real life experiment? Like in a water tank or something? Or what means correct in this context? Thanks
Are all these videos people presenting their Uni projects like it’s groundbreaking or something?
Don’t get me wrong I’m not hating it’s just I’m clueless to the subject and there is a lot of these videos recently and the first time I seen it I thought the person was going to get a scholarship or something.
The current volume of videos suggest this is not true and there for it must be considered a relatively simple task in terms of creating an algorithm.
If this is considered easy does that mean they’ve narrowed down the maths required for this kind of simulation to a relatively simple calculation that can be used in a modular sense with other simulations?
What I’m asking in a nut shell is what are the implications of this becoming available as common knowledge?
Does it mean this is what labs are using or does it mean that their R&D is a lot further down the road than what is presented here?
3:11 The staggered grid is sometimes called the Arakawa grid, after Akio Arakawa, the scientist who popularized it during the nascent years of fluid simulations.
Why do you have to multiply the pressure, computed as the divergent, by that factor rho h / dt?
I have a question . What if non zero velocity is initial condition and not coming from previous step/location. So x-dV*t will go into zero velocity point and will not work. ie if initial condtion is Ux=1 in one point and zero in all others?
I've read paper named "Real-time fluid dynamics for games" before, which follows similar idea
This explanation is a lot more insightful though
Nice job Matthias! I developed the same code in c++ based in part on yours, I put a demo on youtube.
Nice work!
This is exceptionally well and clearly explained, many thanks, now to work out how to make the force flow around a 2D planet .....
in your code you have minus sign, why?
float p = - div / s_sum;
Very good ! could you in an other video simulate high frequency propagation into electric circuit? (antenna)
Very Very impressive.
Just wondering if you could add other 2D shapes as obstacles.... may be multiple 2D shapes.... !
Its so beautiful. I am just going to cry with joy.
Do you expect to have any upcoming example of Semi-Lagrangian simulations like the kind used in oceanic+atmospheric models?
素人が一からこのシミュレーションを作ろうとすることはできますかね?
fluid simulations in javascript 💀
Very impressive make me build an interest in programming
So glad I got this channel recommended to me. The videos along with the PDF overviews are amazing. I'm looking to try them in another language and will be happy to share
Awesome, very very awesome. Thank you so much.
You're doing god's work here. Thank you! Your XPBD research and educational media is enabling me to make a game that I would otherwise not be able to.
I can't believe I just found this !! I wanted to do CFD for a school project this year but I had given up because i after doing quite extensive research on she topic and trying to write a simple code twice that never worked i got overwelmed and settle for something I find way less interresting. This however gives me hope again thank you so much !!
How hard would it be to account for compressibility ? I would really like to manage to implement it.
This is amazing. I'm going to see if I can reimplement this in unity with as much optimization I can shove into it and see what is the largest resolution I can simulate in real time.
So did you? How did it go?
That was very interesting! I’ve been wanting to work towards a fluid simulation for a while, and your explanation really helped!
Видеопоток, можно считать на декодере mp4.
Let's convert this into GLSL shader code.
I've read Bridson's book on Fluid Simulation for Computer Graphics, but you give an excellent and brief, yet detailed explanation. It cleared some things up for me. Thank you! Subscribed.
Very well done, many thanks!
Question: why do we ignore the pressure term in navier-stokes when updating the velocity?
I was wondering this too! Did you find a good answer?
So effective! 15 years ago I was doing these simulations with industrial level CFD software and I was writing much more code just to analyze results. [feels nostalgic]
So that is when this would of been groundbreaking?
Amazing
Why do "n iterations" when forcing incompressibility for the whole grid (6:20)? How is the value of "n" chosen?
Gauss-Seidel is an iterative method. When you fix one cell you might "unfix" a neighbor cell. With multiple iterations the solution converges to a global one. You could measure the total error and if it goes below a threshold you stop iterating. Or, typical for real-time apps, you just choose a fixed number.
much better no library uses.
What is the reason for using the staggered grids? It seems like a lot more work, and bugs, to code, and think about, so I'm guessing there must be a strong advantage somewhere? Maybe something to do with handling projection?
Another excellent tutorial. Thank you very much for this!
Why did you use one dimensional arrays? Doesn't java script have two dimensional arrays?
Typed arrays like the Float32Array are compact and accessing the data is very fast.
Quite appreciate the way you articulate variables. “Boldface V”, “italic u and v”. Great work
Thank you so much for this explanation, Matthias! I just found this video : it's fascinating. I've subscribed (of course) and now I'll get a (large) mug of coffee and watch your other videos. Actually, you only need 1000 kgf /cm² to compress water more than 3% , but only an engineer who works in high pressure hydraulics would notice that. Don't worry. 😁
Also, I notice you do not use the pressure-Poisson approach to removing divergence. What is the benefits and trade-offs of each approach?
Man, Your knowledge is fantastic!! You should start experimenting with Houdini.
Do you accept paid code requests? I have some ideas I would like to implement but don't know the math enough.
Is there something wrong with the image of general grid interpolation? The code is right, but the image in the video show W010W11 for Vi,j+1, which should be W00W11.
Really nice explanation! I feel like I can go implement it immediately. A small typo at 4:04, g should be in m/s^2, not m/s
Thanks! Yes I noticed it before. There are other typos which I all fixed in the slides.
@@TenMinutePhysics Ah, I see now that the slides are updated. Thanks again for a great explanation :)
THANKYOU! SO many talks about fluid simulations (and fluid/water in general) mistakingly claim (orimply) that water *is* incompressable. this is the first time i've seen someone correctly assert its "functionally incompressable" XD
Elegant as always, thanks for taking the time to share such informative videos.
Thanks a lot for the video. Quick question. If we are using Jacobi method instead of the Gauss-Seidel method in order to do parallel implementation. Can Overrelaxation be used with the Jacobi method?
When playing around with smoke in a closed box. The total smoke (sum of the m field values) changes, despite it being closed and me not removing any smoke? Why is that and is there a fix?
Fluid pressure in a tank demo
Advection
Pressure distribution
Guass seidel method
Water tunnel
Wind tunnel
Divergence = 0
Pixels
Pixels of television
Depends on the resolution of the television
Great sir thank you
Thank you very much. Greetings from Popayan, Colombia.
Hi, can you describe the concept of Coupled Eulerian Lagrangian with example problem and code? Thanks.
Great... Great... Great job guy !! Thanks so much for sharing !!! (I wrote such simulator for meteorological applications long time ago, but the code was far from this beauty...)
Any chance the source code is available for playing with?
Wow that's amazing! I'm really excited about your channel! Thanks for sharing your knowledge
I am having trouble understanding how the advection part works computationaly... it there any place i can further read about this step because i have tried reading your code but it doesnt have and comments so its hard to follow through.
Good day, again. Is this method stable for any values of parameters? E.g. flow speed. Because I set up the speed of the flow to 10000 and it is seems that simulator started to multiple the smoke, i.e. it started to ruin the conservation of mass. Is there any information regarding the physical consistency at any parameters values or are there boundaries?
That was so great. Thanks