Coding Challenge #132: Fluid Simulation
In this video, I follow Mike Ash’s guide to Fluid Simulation and port Jos Stam’s "Real-Time Fluid Dynamics for Games" algorithm and code in Processing (Java). Code: https://thecodingtrain.com/challenges/132-fluid-simulation
🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/9kVfB4BF2
🎥 Previous video: https://youtu.be/0j86zuqqTlQ?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Next video: https://youtu.be/bl3nc_a1nvs?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
💾 GitHub Issue: https://github.com/CodingTrain/Rainbow-Topics/issues/178
💻 Real-Time Fluid Dynamics for Games: http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf
💻 MSAFluid: https://www.memo.tv/msafluid/
💻 Lily Pad: https://github.com/weymouth/lily-pad
📓 Fluid Simulation for Dummies: https://mikeash.com/pyblog/fluid-simulation-for-dummies.html
Videos:
🎥 Why Laminar Flow is AWESOME: https://youtu.be/y7Hyc3MRKno
🎥 What DO we know about turbulence?: https://youtu.be/_UoTTq651dE
🚂 Perlin Noise: https://youtu.be/Qf4dIN99e2w
🔴 Livestream Archive: https://youtu.be/_LyC2l8g0R8
Related Coding Challenges:
🚂 #24 Perlin Noise Flow Field: https://youtu.be/BjoM9oKOAKY
🚂 #102 2D Water Ripple: https://youtu.be/BZUdGqeOD0w
🚂 #103 Fire Effect: https://youtu.be/X0kjv0MozuY
Timestamps:
0:00 Introduction
0:59 Topic suggestion from deardanielxd
3:30 Mike Ash's "Fluid For Dummies" thesis
6:42 Incompressible fluid
8:45 Velocity field
9:12 Density of dye
11:14 Port the code to Processing
15:47 addDensity() function
19:34 Diffuse
23:35 Project
25:52 Advect
30:17 Set bounds
33:05 Mirror velocity in edge layers
36:19 Time set function
38:58 Render the density
44:10 Add fade
46:40 Add perlin noise
48:00 Add Pvector
50:35 Recap and next steps
52:22 Adjustments to code
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://discord.gg/hPuGy2g
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter: https://twitter.com/thecodingtrain
📸 Instagram: https://www.instagram.com/the.coding.train/
🎥 Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org
📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#fluidsimulation #turbulentfluidflow #processing