Computational Fluid Dynamics in 2D Game Environments

University essay from Institutionen för datavetenskap

Author: Kalle Sjöström; [2011]

Keywords: ;

Abstract: Games are becoming increasingly realistic. Real-time physics simulation were almost unimaginable just decades ago but are now a vital part of many games. Even dynamic physics simulation e.g. interactive fluids has found a place in game development.This paper investigates and evaluates three methods of simulating fluids with the purpose of testing these in a 2dgame environment. These methods are allLagrangian i.e. particlebased, Sph methods, and chosen because of their dierences but also their importance to the field of interactive fluid simulation. In order to integrate the methods, they will be implemented with use of the 2dmechanics engineBox2dwhich is a popular choice in 2d game development.To evaluate the methods, water is the flluid of choice. Water is the most abundant of fluids and is bound to be found in most games containing fluids. Water is almost incompressible, therefore, the methods ability to withhold incompressibility is tested. Also, the convergence properties of kinetic energy is tested in order to find out more about stability.The results showed that the method based on Muller et al. [2003] demanded a prohibitively small time-step to be especially useful. The method from Clavet et al. [2005] managed to keep a suficiently large time-step but failed in simulating incompressible low-viscosity fluids. However, it excelled in the simulation of highly viscous fluids like gel. Finally, the method based on Bodin et al. [2011] showed impressive result in incompressibility but is more difficult to implement and requires a bit more resources and run-time.The paper concludes that if easy-to-implement cool effect is sought, then the method of Clavet et al. [2005] could be used with great results. However, Bodin et al. [2011] would be the best choice for games where physical accuracy is of greater importance. Also, Box2d is a good choice to extend with a fluid engine. However, it will never be as good as creating a physics engine with an integrated fluid engine.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)