I was playing the nice video game Ni no Kuni. To be more specific, I was playing a stage called The Mountain of Fire, about a volcano that is going to erupt (in three minutes!). In the scene there are molten rocks, lava and fire. A natural question at this point is: how does the game simulate fire?
A short answer by a mathematician is using the Navier-Stokes Equation, and the one by a ”wikipedian” is using the paper “Real-Time Fluid Dynamics for Games“ by Jos Stam. However, this problem is far more fascinating than this. My goal here is to explain in a few simple words why. I will start exhibiting the Navier-Stokes Equation, then I will comment about how to simulate fire and I will exhibit some simulations. Finally, I will enumerate current applications and possible ones.
The Navier-Stokes Equation
The Navier-Stokes equation is a basic model for incompresible fluids, like the water. We start by considering a velocity field
and the pressure
that depend on the time and position Each fluid has a viscosity constant The Navier-Stokes equation is given by the system of equations
Given a smooth initial velocity field a global smooth solution of the Navier-Stokes equation is a smooth velocity field and a pressure function satisfying the system of equations.
The justification of the Navier-Stokes equation will not be discussed here, a note on its more important points can be found here, for example.
A solution of the Navier-Stokes equation is said to blow up if as i.e., at some time there is flow with arbitrarily high velocity. Whether is theoretically possible to always find global solutions that do not blow up is an open problem. You can read an explanation of why it is a complicated problem in Terry weblog.
How to simulate Fire
There is a well developed research field called Computational Fluid dynamics, that in particular, studies algorithms to simulate solutions of the Navier-Stokes equation. Numerical simulations using real data suggest, indeed, that there is always a global solution that do not blow up (as it is expected). If you are interested in understanding how to simulate solutions of the Navier-Stokes equation you can read this paper, for example.
The Simulations showed here were made using some examples provided in the software Fire Dynamics Simulator (FDS) and Smokeview (SMV).
As I motivated this post, the Navier-Stokes equation can be applied to simulate fire and smoke in modern video games. However, there are many other applications. I can enumerate some natural examples:
- Weather forecasting.
- Chemical and Energy industries.
- Evacuation routes and placement of fire alarms in case of smoke or fire in cities, forest, buildings, etc. See for example
[RUSHMEIER, H. 1994. Rendering Participating Media: Problems and Solutions from Application Areas. In Proceedings of the 5th Eurographics Workshop on Rendering, 35–56].
- Ventilation design of the ocean, cities, buildings, miners, computers, etc.
- Design of planes, trains, ships, cars, bikes, etc. More in general, the design of any device that interact with a fluid in order to accomplish a specific function, like, high stability, high velocity, etc.
- Design of anti-tsunami systems.
- Mathematical Cardiology, i.e. the modelling and simulation of the circulatory system.
- Increasing the velocity of transmission of information about certain properties that depend on fluids.
Artistic representation of fluids
The representation of fluids in arts is typical of an artistic movement called Expressionism. Expressionist artists combine together the representation of certain specific physical phenomena and the representation of daily life situations, as a results, they create an emotional response to the viewer. Usually, the expressionism is studied from the point of view of the psychology, however, from a mathematical physic point of view we are interested in the specific physical phenomena that the artists use. We show examples of artistic representation of fluids by expressionist artists.
The Scream (or The Cry) 1893, Edvard Munch.
The Cry is a representation of different fluids interacting together: a human being, a river and the atmosphere.
The Starry Night 1889, Vincent van Gogh.
The Starry Night has been studied by many people, I will limite myself here to mention that the astronomer Charles A. Whitney studied the painting from the astronomic point of view. In particular, the brightest star is Venus and the moon was waning gibbous. From my point of view van Gogh is a step away (in physical terms) from the Navier-Stokes equation model of incompressible flows, because he is more likely representing the superfluidity of the lights. Even though, you can experimentally check (by watching here) that The Starry Night is closer related to the Navier Stokes equation than you may had thought.