PhilosophyArticlesProjectsReferenceAbout

Concepts of fluid dynamics

The air we breath and the water we drink are both fluids. Our world is full of fluids and their behavior is the basis of many natural phenomena. And if we want to create an immersive virtual world, we need to be able to model these fluids in a simulation.

We'll explore some of the basic concepts of fluid dynamics here and the code to set up some scaffolding that will help us explore and interact with the models we're building in order to build a better intuitive understanding. We're intentionally going to be light on the maths and focus on understanding the concepts and translating them into code.

Advection

Advection is described as the movement of something from one place to another. Fundamentally, this is the movement of the actual fluid itself, but we can also attach other properties to the fluid itself and advect those properties as well. Adding a dye (or simply a color) to the fluid is one way that will allow us to easily see how the fluid is moving. Another way is to draw an arrow to show the direction and velocity of the fluid.

Diffusion

Diffusion is the process of a substance spreading out from a high concentration to a low concentration. This is the process that causes the dye to spread out evenly throughout the fluid. This is also the process that causes the heat from a hot cup of coffee to spread out into the surrounding air.

Pressure

Pressure is the force that a fluid exerts on its surroundings. This is what causes the fluid to move from high pressure to low pressure. This is also what causes the fluid to move from high density to low density.

Viscosity

Viscosity is the resistance of a fluid to flow. This is what causes honey to flow slower than water. This is also what causes the fluid to stick to the sides of the container as it moves.

Curl

Curl is the rotation of a fluid around a point. This is what causes the fluid to spin around a point. This is also what causes the fluid to form a vortex.