This repository contains the Unity project created for the mini project of the course Game Physics. In our project we created a simulation modeling fluid flow as a velocity field on a MAC grid. The velocity field was modeled using the Navier-Stokes equations. The implementation is based on the paper Fluid Flow for the Rest of Us by Cline et al [1]. In the simulation the fluid is placed on a planet and the influence of an orbiting planet is shown. The influence of the planets on the fluid is found using Newton's law, as is the planet's orbit itself. The planetary physics are based on Sebastian Lague's solar system tutorial video. [2].
The project can be run in Unity, the scene PlanetFluidScene contains the main simulation. The scene FluidScene contains a basic fluid simulation, without the planetary influences and the scene PlanetScene contains a simulation of only planetary orbits. When running the PlanetFluidScene in Unity various parameters can be tweaked in the inspector by selecting the right game objects. The SimulationMaster object contains the most interesting parameters influencing the fluid simulation. The project can also be built using the default buildsettings, resulting in a more performant simulation.
[1] Cline, D., Cardon, D., & Egbert, P. K. (2013). Fluid flow for the rest of us: Tutorial of the marker and cell method in computer graphics. Brigham Young University.
[2] Lague, S., Coding Adventure: Solar System (2020). https://github.com/SebLague/Solar-System/tree/Episode_01
- Planet materials: Vast Outer Space by Prodigious Creations. https://assetstore.unity.com/packages/3d/environments/sci-fi/vast-outer-space-38913
- Skybox: MilkyWay by Adam Bielecki https://assetstore.unity.com/packages/2d/textures-materials/milky-way-skybox-94001
The slides we used to present this project, with some extra nifty gifs! https://docs.google.com/presentation/d/1yF8JSPgMaA5EDUk05qkS8yagaiCC8VXLZ4ETxP38NDQ/edit?usp=sharing