Nice video. Reminds me of my talks in the early 2000s. I also wrote a book about this. The Art of Fluid Animation. We also implemented this into the Maya software and has been used in blockbuster movies. We got a tech Academy Award for this in 2008.
Man, I'm a Unity dev and UA-camr. I came here from reddit, when I saw the video I thought you had somewhat around 100k subs bro. Keep griding you'll easily reach there :) Good Luck!
Your video is really well made ! The animations, the pace, the narration, the music, everything looks like a professionnal channel with many thousands of followers. Keep up the great work ! I can't wait to see more videos from you
Wow! Awesome video, I always hated how science videos never went deep into how equations actually worked and how to implement/use them, but you did both! Thank you! Awesome video, subscribed and I hope to receive new notifications from you :)
Too bad I found about this video after I did the same thing. It took me over a year to understand the theory and algorithms behind Stam's papers, but you explained it in 15 minutes! Great video anyway!
@@pinkyrng7104 just start one step at a time, try and get the basic system working so that you only need to learn one new concept at a time to eventually get it all working
Same for me. But it's not an easy subject though and contains many different algorithms and approaches. I also skipped the lerp part, because on the GPU you are able interpolate between pixels by default, with the filtering step. Overall very detailed and well made video! It helps a lot of curious people.
@@pinkyrng7104 You're making it sounds complicated more than it is. You just look at the N solver equation and implement an N loop for it. I did it in 1 time watching the video and just rewinding it to where the equations are.
It wasn't that hard to follow. The hardest part was actually the lerp for density redistributions. The rest was purely vector calculus and was nothing new.
Finally, I’ve been looking all over for information on health physics simulations in general work but literally every single one just tells you to get a library and doesn’t actually go over the math. Thank you for making this video
This video doesnt even come close to what really happens. Btw the book that has complete navier stokes solver as used in industry is by milovan peric. Google cfd and peric.
thanks for this video man. with the help of this video, jos stams paper, a paper by nvidea and weeks of my life spent understanding everything i was able to implement jos stams fluid simulation, while understanding all the processes involved in it. your visualizations we're really valuable in the way they helped me visually grasp everything.
Careful viewers! I might be wrong, but the equations shown for diffusion in the video are incorrect. If you look at the paper by Jos Stam, the simple, unstable equation for the next density is dn = dc + k(sc-4dc) (where sc means the sum of the densities in surrounding cells), which is not the same as the equation shown in the video, dn = dc + k(sc-vc), where sc is the average of densities in the surrounding cells. I saw that when implementing the method seen in the video, density was lost after diffusion even though it should just spread out.
Honestly, the best content. I dont understand why youtube didn't put this high up on the search results when I was searching for something similar a week back - all I got was shitty lectures and some other crap. Keep going @Inspecto.
Hey, I recently changed from engineering at Uni to computer science/math, I’ve been feeling a little Gino because I miss physics concepts and understanding things, but this video reminded me that with math and computer science I can recreate all the sciences that lie between using mathematical models and programming skills. Thanks :)
if you ever touch bits of game dev, its full of math/physics (a lot more than people realize), would totally recommend trying it out, the math is very interesting and visual.
Great job with all the videos. The level is very good and the explanations are great. Most of all the topic/topics are a good niche - they're not some sort of basic tutorial, but they're not at an advanced academic level either discussing the details of the respective topics they cover. They're very much the type of stuff I'd love to see if I just want to get an actual technical introduction to something I've never thought about before.
Slight correction on the diffusion step, the equation according to original paper is x0[IX(i,j)] = x[IX(i,j)] - a*(x[IX(i-1,j)]+x[IX(i+1,j)]+x[IX(i,j-1)]+x[IX(i,j+1)] -4*x[IX(i,j)]), which would be d_n = d_c + k (s_c - 4 * d_c). Without doing 4 * d_c, the amount donated to the 4 surrounding cells would only be subtracted once from the original, resulting in a net increase in density/velocity from nowhere and breaking conservation of mass. Additionally, I believe the equation d_n = d_c + k (s_c - 4 * d_c) explains why its necessary to diffuse density reverse in time, because it blows up under certain scenarios, resulting in negative values. An example is if you have a really high value cell (say 100) surrounded by really small value cells (say 1). Let K=1. On the next iteration, the high value cell will have -396. While having negative velocity possible, having "negative density" is not and will cause the simulation to blow up.
You are the 3B1B of computers. You are going to get reeealy big eventualy. And i will love to say that i was here while you only had 4 videos and not even 10k subs. Thanks for the absolutely top notch content
Algorithm brought me here and you got me super interested in Fluid Simulations, extremely well-made video and I'm also leaving this comment to help the algorithm pick up your video for engagement!
Excellent presentation dude. Insta-subscribed. A couple of weeks ago I simulated a boat by voxelizing it and using buoyancy and drag laws, then I wanted to simulate a fluid next... and found your channel. This is pure gold.
I've read this paper myself and tried to implement it but it all flew over my head-- the elaboration on the Gauss-Seidel approximation and the vector field calculations helped a lot
Great video! The part about subtracting the divergence was especially fascinating. Having never implemented any actual fluid dynamics, I sort of assumed you'd rely on the density to pull and push to even it out, close your eyes, and hope you don't have any rounding errors.
7:35 I found when I restricted myself to the four square of sharing sides in the diffusion I would get horizontal and vertical line artifacts, especially at k = 1 from the original equation. Including the four corners at a 1/sqrt(2) ratio prevented those artifacts.
This kind of stuff if the stuff I want to make more of but don't know how. You just earned a sub :) keep up the good work and make more!! Things like this are hard to learn on your own but things like this make it possible. Thanks.
Assuming that the divergence is 0 is indeed valid in most cases. This is based on the assumption that the fluid is incompressible. However with compressible flows one should use the continuity equation which allows you to solve it. But great video!
Really nice video, despite having read several papers about fluidsim recently, I still feel like I walked away with a clearer understanding of the fundamental implementation details.
I'm a CS student and I have a critical paper review to write on Stam's Real Time Fluid Dynamics for Games paper, your video really explained fluid simulations well! Also realised I'm already subbed to your channel from your sound synthesis video I used to understand the concept for a personal project implementing a sound synth in C++ from last year. Cheers!
Fantastic video. As a Chemical Engineer I've seen lots of references to CFD studies, and always wanted to implement my own CFD and Finite Element (for heat transfer problems) solver. One thing that is freaking me out is the casual treatment of density, i.e. just using a few equations to move density around. It feels wrong as density is the result of temperature and mass of material within a certain volume. I guess k is dependent on all those properties, but converting those properties to a number seems a bit magical / "ignore the man behind the curtain" type of thing. But then again I suck at maths, as I said an engineer not a scientist. The advice to calculate dn with a hyperbolic function will be really helpful for me in my mathematical journey. Thanks!
Please do a whole lot of videos on fluid (and other) simulations. It seems many places love to show them in math, but not in code or explained in a way that can be done in code. (without excessive math skills) I'd love to see one on the 2D FFT ocean simulation. I've been wanting to learn how to do this one for ages on the GPU but it seems like there are very scarce public resources for it and many leave out key parts or assume you're incredible with math. Thanks! you've got a new subscriber :)
The reason it is shown in a math heavy fashion is because it is as math dependent as it gets. Even if you're using an off the shelf CFD solver, you must know the math behind to judge if the simulation you have just run makes physical sense, since the computer will always spit an answer no matter if it physically has any meaning
@@JokerTheDank If they could express them in a code type of way, rather than a math type of way, it would probably be far easier to check that you're getting correct results since it's more about logical steps than crazy symbols and memorized random rules/formulas.
@@nk361 you haven't understood. Math is the reason you get certain results. You have a set PDEs, in a Continuum which are the real description of the fluid. You then have to feed them to a computer, but a computer cannot deal with continuums as they are by definition an infinite data set. So what do you do? You discretise the continuum PDEs in many many tiny ODEs. But what has happened then? You mathematically approximated a mathematically correct description with a mathematically incorrect description introducing a mathematical discretization error. So now exactly tell me where would the code tell you anything about the errors you're making in this approximation. Everything is mathematical
@@JokerTheDank I wrote a whole comment and then clicked one thing and youtube decided not to hold on to what I wrote. :/ Pretty much the gist is that summation for example turns into a for loop with either a function passed in or a hard coded function per use case. You have to know both how the math itself actually works and how the code actually works for you to write that in code and get the results you want. That's where the difficulty is, most programmers don't know enough math to translate it and most math savvy folks don't know enough programming to translate it. If math was explained in pieces of code in languages that don't rely on prewritten math libraries (like matlab, octave, etc) then I think there would be so many more amazing software projects made by single developers or very small teams. Saying people need to learn math on that level to use it is like saying you should learn assembly on an advanced level in order to write c++. You don't because it's abstracted and made far easier for the public to get the results they need.
Absolutely! I just graduated with a mechanical engineering degree. The knowledge I gained from math and fluid physics made programming my own fluid sim relatively easy.
So I've just recently started on a computational fluid dynamics journey myself, so I was Stokes-d (sorry) to see your video! I love this video, and am really looking forward to your next ones! I often struggle with the disconnect between math on the page, and code on the screen, and learn best by having examples to pick apart. So, will you be planning to have some comprehension implementation / code videos?
I loved on how this video was crafted, and your other videos too, like legit, you somehow exploit most of human senses to really impart a rather complex idea to someone brain in a really engaging way. It would be highly appreciated if you can make a video or any other form of guidance detailing on how this video is produced, like how you do your research, what tools, to do the research, the video editing software or even the content brainstorming management. I'm so sorry if this is too much to ask for but you would really help me or maybe others in communicating our own ideas or any other complex ideas to the layman. Again, your videos are already on the top notch category and you'll definitely reach a bigger audience and prospects in no time!!
Thank you for the video, i think it is the most helpfull in existence. One Question, how did you do your visuals/ how did you implement the concept? Unity?
As someone who had to rush through a fluid dynamics class and Numerical Analysis class due to covid, this makes an excellent recap on the useful stuff you can make with this knowledge. Thank you very much for this video.
1:10 It seems to me that ∇ ⋅ u = 0 also requires that no compression of expansion is happening, not just conservation of mass. That's important because many fluids, such as gases, actually CAN expand or contract significantly, and all can somewhat. That's confusing to me, though, because the simulation you described allows density to vary, yet still has zero divergence. I guess that's because it models the motion of mass that changes density as diffusion rather than as the motion that it measures "velocity" for, so the "velocity" that doesn't include this "diffusion" of density doesn't have any divergence. I'm still not sure I really understand it though. For one thing, compression and expansion aren't the only ways that density could "diffuse". If the fluid is made of more than one substance, and the different substances have different densities, then diffusion of these different substances between different parts of the fluid would also allow density changes and diffusion of density without any compression or expansion.
So that's where the advance mathematics and CFD equations come to play in real life! Also I thought I'd never be seeing those iterative equation solving methods. You've no idea what this video is to an enthusiastic mechanical engineer! Thanks alot!
Thanks for this, I was able to make my own using it. I'd looked at other explanations but this was the best, especially for the part about clearing divergence
Sorry, i don't quite understand what exactly i need to do at Gauss-seidel Method. we supply dn(x±1, y±1) function a random value, then solve for dn(xc, yc) we solve for entire grid, then do it again some more iterations and by doing this we will get a solved grid eventually with correct approximations of values?
at 6:12, can you please explain how it is linear? If k < 1, then you will never reach the desired density as you are always adding something less than the difference, and each time you are adding less and less. Also at 9:35, how can each square depend on the new value of every other square. That doesn't seem solvable.
Whoa, I expected this to have a million views or more, this video is SO DAMN HELPFUL. The editing is perfect, the content is concise but gives all relevant information, and the statement you made about Navier Stokes being important to fluids but not to the simulation - you've got huge talent man, hope to see this channel grow!
"Navier Stokes being important to fluids but not to the simulation" -- the problem is, that just isn't true. Numerical simulations of fluid dynamics directly use the Navier-Stokes equations -- just discretized versions of the equations. And we use the NS equations to guide what sort of discretizations to use, and what resolution is required to get an accurate simulation. Sometimes even the top-level code looks like the NS equations (e.g. OpenFOAM open source computational fluid dynamics code)!
@@almostthefool "Sometimes even the top-level code looks like the NS equations" Exactly. We directly implement the NS equations *sometimes* and for top level code too. This was a beginner's intro to fluid dynamics, not a phd thesis on it XD Every other video out there tells me to directly substitute values in the formula, but not HOW to USE the formulas, so finding a video that actually taught me to create the simulation without sticking to the technicalities like "discretized versions of the equations" was a nice breath of fresh air and highly appreciated.
@@boiimcfacto2364 I worry about any "beginner's intro to fluid dynamics" which states that the Navier-Stokes equations "are almost useless in telling us what the simulation process actually looks like" (2:19). Because they're NOT "almost useless" -- you build the whole simulation on them! The code consists of discretizing diffusion, discretizing advection, and then finding the pressure field (called "clearing divergence" in the video, but this is the same thing as finding the pressure field -- which is why the letter "p" is used). Which IS just discretizing the Navier-Stokes equation term by term. I agree that it's useful to look at each term individually, and go into the details of how to code each term up, which this video does a good job of explaining. But at the end of the day the whole simulation *is* directly based on the NS equations so saying they're "not useful" is a bit daft.
@@almostthefool Bruh who's saying the equations aren't important to the simulation? The simulation wouldn't EXIST without them. The point the creator was making was that dissecting the equation into its bare terms and trying to understand each part completely (as most new learners do) isn't particularly helpful when it comes to BUILDING the simulation. Using me as an example, the formula on its own doesn't make much sense to me, but the step by step explanation of the programmatic implementation kind of does.
@@boiimcfacto2364"Who's saying the equations aren't important to the simulation?" You, in your original comment: "Navier Stokes being important to fluids but not to the simulation". And the creator, when they said NS "are almost useless in telling us what the simulation process actually looks like" at 2:19, and "while you might be able to see *some* links between the Navier-Stokes equations and the procedures which we are implementing, there are some other mathematical concepts which are much more relevant" at 2:27. The video does a decent job of explaining the implementation of the advection, diffusion, pressure ("clearing divergence") etc. parts of a fluid simulation code. So why not link those implementations back to the NS equations? Even just saying at the end of e.g. the diffusion section "this represents the second term on the right hand side of the second Navier-Stokes equation we saw earlier" (with the term highlighted on the screen)would work, so that you can see it's not just black magic. And then it would be clear to the viewer that what the video does *is* write a discretization of the Navier-Stokes equations.
I just got this video in my recommended, and hot damn it's well done! You could probably make something like density functional theory or quantum hydrodynamics understandable to a kindergartner.
I like your funny words magic man
man
😂😂😂 your comment cracked me up
Dumb cant
Says any competent programmer could do it..instantly loses me in math...been coding for 30 years..not the imposter I swear
@@forbiddenera relatable
Nice video. Reminds me of my talks in the early 2000s. I also wrote a book about this. The Art of Fluid Animation. We also implemented this into the Maya software and has been used in blockbuster movies. We got a tech Academy Award for this in 2008.
it advanced a lot since then
@@podemosllegara840anti-tikt7 and?
Maya in the 00's was the MVP, I remember booting the silicon graphics stations and play with it for hours.
Amazing!!!
Nice to see you here, Jos!!
When I finished the video I expected it to have at least 100k views with how well made this is. You deserve many, many subs
50 views away from 100k as im typing this
@@t4ky0n hello fellow anarcho-troll-ist
@@David-zy1lr YOOOOOO
There is 100k views now
check braintruffle bro
Hey, I found this video via a Reddit post. This is really well-made, thank you!
What sub?
@Caleb Landry Wow you used a bot account to market some scam and reply to it using another bot account to make it seem reputable?? that's disgusting
Gonkee used to be SOOOO much better.
Under a minute in and ive never been this excited to watch a video by someone ive never heard of before
The craziest thing: this seems to be this guy's first video from what I can find
Man, I'm a Unity dev and UA-camr. I came here from reddit, when I saw the video I thought you had somewhat around 100k subs bro. Keep griding you'll easily reach there :) Good Luck!
Gdrinding*
@@AkariInsko *grainding
@@makra2077 *grdinaining
Are "subs" so important to you? Who cares how many subs. The world is not only about money. Good is minority, stupidity is majority.
@@user-cw3nb8rc9e 110k now hehe
Your video is really well made ! The animations, the pace, the narration, the music, everything looks like a professionnal channel with many thousands of followers. Keep up the great work ! I can't wait to see more videos from you
Wow! Awesome video, I always hated how science videos never went deep into how equations actually worked and how to implement/use them, but you did both! Thank you! Awesome video, subscribed and I hope to receive new notifications from you :)
This channel is gonna blow past 1M subs if videos like these keep getting posted
Too bad I found about this video after I did the same thing. It took me over a year to understand the theory and algorithms behind Stam's papers, but you explained it in 15 minutes! Great video anyway!
If it took you a year, I'm sure you won't forget it anytime soon! :)
@@Gonkee I still have no clue how to program that. Have to watch the video 5 more times :D
@@pinkyrng7104 just start one step at a time, try and get the basic system working so that you only need to learn one new concept at a time to eventually get it all working
Same for me. But it's not an easy subject though and contains many different algorithms and approaches. I also skipped the lerp part, because on the GPU you are able interpolate between pixels by default, with the filtering step.
Overall very detailed and well made video! It helps a lot of curious people.
@@pinkyrng7104 You're making it sounds complicated more than it is. You just look at the N solver equation and implement an N loop for it. I did it in 1 time watching the video and just rewinding it to where the equations are.
This is extremely high quality, well made and really drives my interest in modeling and simulations. Thank you
I can’t believe people can actually understand this stuff. Great job man, this is amazing stuff. I just subscribed
It wasn't that hard to follow. The hardest part was actually the lerp for density redistributions. The rest was purely vector calculus and was nothing new.
UA-cam just recommended this video to me. Hope you get picked up by the algorithm!
i looked for this
if not the best than one of the best ever youtube explanaion here of CFD.... Did't knew it was so easy to understand the CFD.... Appriciated mate
This channel is amazing! The quality of production this video has is incredible, keep up the great work!
Finally, I’ve been looking all over for information on health physics simulations in general work but literally every single one just tells you to get a library and doesn’t actually go over the math. Thank you for making this video
This video doesnt even come close to what really happens.
Btw the book that has complete navier stokes solver as used in industry is by milovan peric. Google cfd and peric.
thanks for this video man. with the help of this video, jos stams paper, a paper by nvidea and weeks of my life spent understanding everything i was able to implement jos stams fluid simulation, while understanding all the processes involved in it. your visualizations we're really valuable in the way they helped me visually grasp everything.
Cool video! (U got that Jos Stam reply, epicccc.)
Careful viewers! I might be wrong, but the equations shown for diffusion in the video are incorrect. If you look at the paper by Jos Stam, the simple, unstable equation for the next density is dn = dc + k(sc-4dc) (where sc means the sum of the densities in surrounding cells), which is not the same as the equation shown in the video, dn = dc + k(sc-vc), where sc is the average of densities in the surrounding cells. I saw that when implementing the method seen in the video, density was lost after diffusion even though it should just spread out.
Thank you! :D
Honestly, the best content. I dont understand why youtube didn't put this high up on the search results when I was searching for something similar a week back - all I got was shitty lectures and some other crap. Keep going @Inspecto.
woah I just realised how less subs and views this guy has. This video deserves way more views with such good animation and narration.
Hey, I recently changed from engineering at Uni to computer science/math, I’ve been feeling a little Gino because I miss physics concepts and understanding things, but this video reminded me that with math and computer science I can recreate all the sciences that lie between using mathematical models and programming skills. Thanks :)
if you ever touch bits of game dev, its full of math/physics (a lot more than people realize), would totally recommend trying it out, the math is very interesting and visual.
As a fellow cs student, a degree in cs is just tools that need to be applied to some other field, and physics is a fun and interactive one to program
Great editing and informative video, you deserve a lot more acknowledgement for the quality you put out!
Great job with all the videos. The level is very good and the explanations are great. Most of all the topic/topics are a good niche - they're not some sort of basic tutorial, but they're not at an advanced academic level either discussing the details of the respective topics they cover. They're very much the type of stuff I'd love to see if I just want to get an actual technical introduction to something I've never thought about before.
Duuude! 11:59 is something I've been trying to wrap my head around for ages. Thanks!
Slight correction on the diffusion step, the equation according to original paper is x0[IX(i,j)] = x[IX(i,j)] - a*(x[IX(i-1,j)]+x[IX(i+1,j)]+x[IX(i,j-1)]+x[IX(i,j+1)] -4*x[IX(i,j)]), which would be d_n = d_c + k (s_c - 4 * d_c).
Without doing 4 * d_c, the amount donated to the 4 surrounding cells would only be subtracted once from the original, resulting in a net increase in density/velocity from nowhere and breaking conservation of mass.
Additionally, I believe the equation d_n = d_c + k (s_c - 4 * d_c) explains why its necessary to diffuse density reverse in time, because it blows up under certain scenarios, resulting in negative values. An example is if you have a really high value cell (say 100) surrounded by really small value cells (say 1). Let K=1. On the next iteration, the high value cell will have -396. While having negative velocity possible, having "negative density" is not and will cause the simulation to blow up.
Where do I find the original paper? The link in the description is not working.
@@srbbt graphics.cs.cmu.edu/nsp/course/15-464/Fall09/papers/StamFluidforGames.pdf
@@srbbt just google the paper title: Jos Stam - Real Time Fluid Dynamics for Games (2003)
You are the 3B1B of computers. You are going to get reeealy big eventualy. And i will love to say that i was here while you only had 4 videos and not even 10k subs.
Thanks for the absolutely top notch content
video got reccomended to me! it was really good. I hope you hit algorithm gold with this one.
Wow! Can not believe you have this little subs. Fantastic video and you have inspired me to give fluid simulation a try.
Very happy to find a kind of beautiful genuine, well understand concept channel.
Algorithm brought me here and you got me super interested in Fluid Simulations, extremely well-made video and I'm also leaving this comment to help the algorithm pick up your video for engagement!
Very nice video! I randomly came across your channel via my recommended lol
I like the pacing and the animations a lot. Keep going!
Excellent presentation dude. Insta-subscribed. A couple of weeks ago I simulated a boat by voxelizing it and using buoyancy and drag laws, then I wanted to simulate a fluid next... and found your channel. This is pure gold.
Probably the best explanation I have seen on the topic. Please can you do another one on the advanced topics
Came across your video from YT algorithm. It's really well-made! Subbed
This is an amazing video with great information which I will promptly use in about 20 years.
I've read this paper myself and tried to implement it but it all flew over my head-- the elaboration on the Gauss-Seidel approximation and the vector field calculations helped a lot
This is such a great video, I probably won't be making fluid simulations, but I really enjoyed that
Thank you so much for your efforts in making this amazing video!
Really enjoyed it!
Great video! The part about subtracting the divergence was especially fascinating.
Having never implemented any actual fluid dynamics, I sort of assumed you'd rely on the density to pull and push to even it out, close your eyes, and hope you don't have any rounding errors.
7:35 I found when I restricted myself to the four square of sharing sides in the diffusion I would get horizontal and vertical line artifacts, especially at k = 1 from the original equation. Including the four corners at a 1/sqrt(2) ratio prevented those artifacts.
Yeah i was wondering about that. I got those lines in some of my pps experiments before I debugged.
I just found this channel today. Quite underrated :)
I read the same paper before I watched this video and I must say this video is amazing
This kind of stuff if the stuff I want to make more of but don't know how. You just earned a sub :) keep up the good work and make more!! Things like this are hard to learn on your own but things like this make it possible. Thanks.
Assuming that the divergence is 0 is indeed valid in most cases. This is based on the assumption that the fluid is incompressible. However with compressible flows one should use the continuity equation which allows you to solve it. But great video!
Really nice video, despite having read several papers about fluidsim recently, I still feel like I walked away with a clearer understanding of the fundamental implementation details.
I'm a CS student and I have a critical paper review to write on Stam's Real Time Fluid Dynamics for Games paper, your video really explained fluid simulations well! Also realised I'm already subbed to your channel from your sound synthesis video I used to understand the concept for a personal project implementing a sound synth in C++ from last year. Cheers!
Your explanations for these very complex are amazing
I like how you explained such complicated thing in quite simple words. The video is very well made. Keep it up.
this channel deserve a lot more subs!!
I thought you had 800k subs until I looked at the comments. This is next level, well done
Fantastic video. As a Chemical Engineer I've seen lots of references to CFD studies, and always wanted to implement my own CFD and Finite Element (for heat transfer problems) solver.
One thing that is freaking me out is the casual treatment of density, i.e. just using a few equations to move density around. It feels wrong as density is the result of temperature and mass of material within a certain volume. I guess k is dependent on all those properties, but converting those properties to a number seems a bit magical / "ignore the man behind the curtain" type of thing. But then again I suck at maths, as I said an engineer not a scientist.
The advice to calculate dn with a hyperbolic function will be really helpful for me in my mathematical journey. Thanks!
You are amazing, I don't remember ever clikcing the bell button, but today I did.
You explain Jos Stam's code and theory extremely well
Please do a whole lot of videos on fluid (and other) simulations. It seems many places love to show them in math, but not in code or explained in a way that can be done in code. (without excessive math skills) I'd love to see one on the 2D FFT ocean simulation. I've been wanting to learn how to do this one for ages on the GPU but it seems like there are very scarce public resources for it and many leave out key parts or assume you're incredible with math. Thanks! you've got a new subscriber :)
The reason it is shown in a math heavy fashion is because it is as math dependent as it gets. Even if you're using an off the shelf CFD solver, you must know the math behind to judge if the simulation you have just run makes physical sense, since the computer will always spit an answer no matter if it physically has any meaning
@@JokerTheDank If they could express them in a code type of way, rather than a math type of way, it would probably be far easier to check that you're getting correct results since it's more about logical steps than crazy symbols and memorized random rules/formulas.
@@nk361 you haven't understood. Math is the reason you get certain results.
You have a set PDEs, in a Continuum which are the real description of the fluid.
You then have to feed them to a computer, but a computer cannot deal with continuums as they are by definition an infinite data set. So what do you do? You discretise the continuum PDEs in many many tiny ODEs. But what has happened then? You mathematically approximated a mathematically correct description with a mathematically incorrect description introducing a mathematical discretization error.
So now exactly tell me where would the code tell you anything about the errors you're making in this approximation. Everything is mathematical
@@nk361 and please, do not think of CFD as "crazy symbols and random rules"
@@JokerTheDank I wrote a whole comment and then clicked one thing and youtube decided not to hold on to what I wrote. :/ Pretty much the gist is that summation for example turns into a for loop with either a function passed in or a hard coded function per use case. You have to know both how the math itself actually works and how the code actually works for you to write that in code and get the results you want. That's where the difficulty is, most programmers don't know enough math to translate it and most math savvy folks don't know enough programming to translate it. If math was explained in pieces of code in languages that don't rely on prewritten math libraries (like matlab, octave, etc) then I think there would be so many more amazing software projects made by single developers or very small teams. Saying people need to learn math on that level to use it is like saying you should learn assembly on an advanced level in order to write c++. You don't because it's abstracted and made far easier for the public to get the results they need.
You're very underated but ik that you'll grow and I'll gladly say I've been here before 1k
I just came to revisit this video and yes I’d like to say the same. He has 3k subs now.
I*
This channel is severely underrated
Incredible video! Needs more views! I feel like with a few more years of learning math (I'm in Algebra 2) I could program my own fluid sim!
Absolutely! I just graduated with a mechanical engineering degree. The knowledge I gained from math and fluid physics made programming my own fluid sim relatively easy.
this is a hidden gem of a channel
Awesome stuff, I came from reddit and i really like the quality of your video keep it up.
Amazing! Amazing source for research!
great video! Can't wait for the next
Great video! That was really insightful
So I've just recently started on a computational fluid dynamics journey myself, so I was Stokes-d (sorry) to see your video! I love this video, and am really looking forward to your next ones!
I often struggle with the disconnect between math on the page, and code on the screen, and learn best by having examples to pick apart. So, will you be planning to have some comprehension implementation / code videos?
I loved on how this video was crafted, and your other videos too, like legit, you somehow exploit most of human senses to really impart a rather complex idea to someone brain in a really engaging way. It would be highly appreciated if you can make a video or any other form of guidance detailing on how this video is produced, like how you do your research, what tools, to do the research, the video editing software or even the content brainstorming management. I'm so sorry if this is too much to ask for but you would really help me or maybe others in communicating our own ideas or any other complex ideas to the layman. Again, your videos are already on the top notch category and you'll definitely reach a bigger audience and prospects in no time!!
Keep it going man, your content is really great.
I believe your channel will grow really well.
+1 subscriber
This is really easy. Thanks for the good explanation and the paper.
Thank you for the video, i think it is the most helpfull in existence. One Question, how did you do your visuals/ how did you implement the concept? Unity?
As someone who had to rush through a fluid dynamics class and Numerical Analysis class due to covid, this makes an excellent recap on the useful stuff you can make with this knowledge. Thank you very much for this video.
1:10 It seems to me that ∇ ⋅ u = 0 also requires that no compression of expansion is happening, not just conservation of mass. That's important because many fluids, such as gases, actually CAN expand or contract significantly, and all can somewhat. That's confusing to me, though, because the simulation you described allows density to vary, yet still has zero divergence. I guess that's because it models the motion of mass that changes density as diffusion rather than as the motion that it measures "velocity" for, so the "velocity" that doesn't include this "diffusion" of density doesn't have any divergence. I'm still not sure I really understand it though. For one thing, compression and expansion aren't the only ways that density could "diffuse". If the fluid is made of more than one substance, and the different substances have different densities, then diffusion of these different substances between different parts of the fluid would also allow density changes and diffusion of density without any compression or expansion.
u is momentum
This is awesome. Thank you for making this.
So that's where the advance mathematics and CFD equations come to play in real life! Also I thought I'd never be seeing those iterative equation solving methods. You've no idea what this video is to an enthusiastic mechanical engineer! Thanks alot!
Great video, looking forward to more.
Thanks for this, I was able to make my own using it. I'd looked at other explanations but this was the best, especially for the part about clearing divergence
quality content! good job, very helpful
LieAr
I don't know why youtube has been recommending me some really interesting videos lately but I like it
Thank you for this video, it really helped me :)
Exactly what I was looking for! Thanks man!
What's the easiest way to do surface tension in this model? Can I simply modify the diffusion formulation or there's more to it?
Jus what I was looking for! thanks
This was extremely helpful and well made video.
Sorry, i don't quite understand what exactly i need to do at Gauss-seidel Method.
we supply dn(x±1, y±1) function a random value, then solve for dn(xc, yc)
we solve for entire grid, then do it again some more iterations
and by doing this we will get a solved grid eventually with correct approximations of values?
Thank you, this demystified it a lot!
this was best explained, I saw many but I was not able to understand the simulation, thx for tutorial
Hella underrated channel
i will need to rewatch this a couple times but it's extremely interesting
Thanks for explaining this! I appreciate it.
Here before this channel blows up.
This work is underrated!
at 6:12, can you please explain how it is linear? If k < 1, then you will never reach the desired density as you are always adding something less than the difference, and each time you are adding less and less. Also at 9:35, how can each square depend on the new value of every other square. That doesn't seem solvable.
Very good video! Exactly what I was searching for 👍👍👍
Whoa, I expected this to have a million views or more, this video is SO DAMN HELPFUL. The editing is perfect, the content is concise but gives all relevant information, and the statement you made about Navier Stokes being important to fluids but not to the simulation - you've got huge talent man, hope to see this channel grow!
"Navier Stokes being important to fluids but not to the simulation" -- the problem is, that just isn't true. Numerical simulations of fluid dynamics directly use the Navier-Stokes equations -- just discretized versions of the equations. And we use the NS equations to guide what sort of discretizations to use, and what resolution is required to get an accurate simulation. Sometimes even the top-level code looks like the NS equations (e.g. OpenFOAM open source computational fluid dynamics code)!
@@almostthefool "Sometimes even the top-level code looks like the NS equations" Exactly. We directly implement the NS equations *sometimes* and for top level code too. This was a beginner's intro to fluid dynamics, not a phd thesis on it XD
Every other video out there tells me to directly substitute values in the formula, but not HOW to USE the formulas, so finding a video that actually taught me to create the simulation without sticking to the technicalities like "discretized versions of the equations" was a nice breath of fresh air and highly appreciated.
@@boiimcfacto2364 I worry about any "beginner's intro to fluid dynamics" which states that the Navier-Stokes equations "are almost useless in telling us what the simulation process actually looks like" (2:19). Because they're NOT "almost useless" -- you build the whole simulation on them! The code consists of discretizing diffusion, discretizing advection, and then finding the pressure field (called "clearing divergence" in the video, but this is the same thing as finding the pressure field -- which is why the letter "p" is used). Which IS just discretizing the Navier-Stokes equation term by term. I agree that it's useful to look at each term individually, and go into the details of how to code each term up, which this video does a good job of explaining. But at the end of the day the whole simulation *is* directly based on the NS equations so saying they're "not useful" is a bit daft.
@@almostthefool Bruh who's saying the equations aren't important to the simulation? The simulation wouldn't EXIST without them. The point the creator was making was that dissecting the equation into its bare terms and trying to understand each part completely (as most new learners do) isn't particularly helpful when it comes to BUILDING the simulation. Using me as an example, the formula on its own doesn't make much sense to me, but the step by step explanation of the programmatic implementation kind of does.
@@boiimcfacto2364"Who's saying the equations aren't important to the simulation?" You, in your original comment: "Navier Stokes being important to fluids but not to the simulation".
And the creator, when they said NS "are almost useless in telling us what the simulation process actually looks like" at 2:19, and "while you might be able to see *some* links between the Navier-Stokes equations and the procedures which we are implementing, there are some other mathematical concepts which are much more relevant" at 2:27.
The video does a decent job of explaining the implementation of the advection, diffusion, pressure ("clearing divergence") etc. parts of a fluid simulation code. So why not link those implementations back to the NS equations? Even just saying at the end of e.g. the diffusion section "this represents the second term on the right hand side of the second Navier-Stokes equation we saw earlier" (with the term highlighted on the screen)would work, so that you can see it's not just black magic. And then it would be clear to the viewer that what the video does *is* write a discretization of the Navier-Stokes equations.
ive always been mystified by navier stokes so super looking forward to watching this series
Phenomenal. Amazing video.
Great explanation for this topic.. simply intellegence Thank you!
Attempting to make my own fluid sim right now and this is extremely helpful!
I just got this video in my recommended, and hot damn it's well done! You could probably make something like density functional theory or quantum hydrodynamics understandable to a kindergartner.
Great explanation, nice job ^^
Great video, earned yourself another subscriber
Really well made Video and you manage to get to the point of the subject. Can you do something like structural simulation next?