Friday, July 12, 2013


     Math is hard for some. Bach is hard for some. Quantum Mechanics is hard for everyone. Fluid simulation based on the discretization of the Navier-Stokes equations for fluid motion is very very hard.
     That is, they're hard for me, they might not be hard for others, in fact, I'm sure it isn't. Lots of people have came to understand the theory and practice of fluid simulation, and a lot of them have written papers on it. A lot of them have made videos of their simulations, and posted them on YouTube. But few, very  few that I have been able to find, have posted their source code, or specifics on exactly What. To. Do.
     Let me be clear, this is not a sentiment shared by all programmers, many masters of fluid simulation, including Mr. Grant Kot, as well as Brochu et al. who published their source code along with their paper. Other source code packages are there for the finding, but few are published in a place that is easy to locate.
     This blog is called X Squared Plus Why Squared, so Why does this happen. The answer seems fairly clear, and resolves into a sort of self-perpetuating cycle, which goes like this:
     A programmer decides to implement a fluid simulator, with little or no prior experience. The more experience with either simulation, programming, or mathematics, the easier it'll be, they work and work and work, research, and research and research, until they finally succeed. They then make a video about it, and post it on YouTube. In the comments section of the video, lots of people ask to see the source codes for this persons simulation, but he is now proud of his work, and does not oblige. He worked hard for what he eventually produced, and is now going to hold on to, and maybe monetize, his creation. This is perfectly understandable, but very unfortunate, because it keeps the magic and awesomeness of fluid simulation in just that realm: that of magic and awe.
     So, what's the answer? This is why I love Processing. Because it is impossible to publish a document with out including the source code. If everyone published a version of their fluid simulator in Processing, then this problem would simply go away, the cycle would break, and the internet would suddenly get very, very, very wet.

No comments:

Post a Comment