(Video Credit: http://physbam.stanford.edu/~fedkiw/)
Water is incredibly common, all of us see it on a daily basis, we know what it looks like and how it behaves. This makes life very hard for the people working in the animation business because our day to day observations alert us when the fluid isn’t acting as we would have expected. This can detract from the movie going experience. Animators have looked to engineering for the solution.
We have known for a while that the flow of fluids can be modeled using the Navier Stokes equations, a set of second order, nonlinear, partial differential equations. Unfortunately this equation is so hard to solve that it’s solution has been named one of the Millennium Problems, 7 of the hardest problems in all of mathematics. It is essentially impossible to solve, at least analytically; that is to say that the solution of the Navier Stokes equations is impossible in the traditional “solve for x” way most people are used to.
This is where numerical techniques come in; these are ways to reduce equations to the basic +,-,*,/ operations and then solve the equations a huge number of times in order to approximate (or get closer to) a real solution. This math is still quite complicated, requiring several hours to days of processing on supercomputers to solve; but, if a few assumptions are made and the initial conditions are properly set, close enough solutions can be found.
Animation is just one of the more recent adopters of this technology, called Computational Fluid Dynamics (CFD) which utilizes computer-based numerical techniques to solve for approximate solutions of the Navier Stokes equations in order to analyze how fluids flow. CFD can be used to increase your car’s fuel efficiency, make fighter jets faster, improve swimsuits for Olympic swimmers, find out why dogs have such an acute sense of smell and many many more things.
If you want to learn a bit more about the math look into the Taylor Series. It’s the little mathematical bridge that takes the calculus normally associated with solution of the Navier Stokes equations and turns it into the simpler arithmetic utilized by CFD programs.