Fluids in Processing

screen
We recently checked out the MSAFluids library for Processing, a fluid simulation engine based on Navier-Stokes equations. This is modeled off of Jos Stam’s algorithms which are used for gaming and animations. Not physically accurate, but visually awesome.

We edited the java library to add interior collisions to the Processing script. This allowed us to import building footprints to the canvas in order to see how fluids would interact with different shapes. We did this by selecting a planar-section in Grasshopper, pixelating its regions, and exporting those regions to Processing through Excel.

Now it’s important to note that these results are neither scalable nor predictable. While we can vary the speed of the fluids tested, we’re not quantifying velocities (and fluid behaves differently at varying speeds). And though the fluids are based on Navier-Stokes equations, they neglect the physical accuracy required for CFD studies (for more info, read Jos Stam’s paper here).

This experiment instead serves as a visual benchmarking exercise, proving to us that the MSAFluid library is lightning fast. With each loop, it’s easily tackling thousands of fluid particles which are collision tested with thousands of pixels. This is promising for future simulations given that Processing is the best tool we have for testing models with high-particle counts.  In the future, we’re looking to apply Processing to other high-particle simulations, like acoustical raytracing.

Leave a Comment