# Fire simulation

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  by Jos StamHowever, 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

\begin{aligned} u:&\mathbb R\times \mathbb R^3& \to & \mathbb R^3\\ &(t,x)&\mapsto& u(t,x)=(u_1(t,x),u_2(t,x),u_3(t,x)) \end{aligned}

and the pressure

\begin{aligned} p:&\mathbb R\times \mathbb R^3& \to & \mathbb R\\ &(t,x)&\mapsto& p(t,x) \end{aligned}

that depend on the time $t$ and position $x.$ Each fluid has a viscosity constant $\nu>0.$ The Navier-Stokes equation is given by the system of equations

\begin{aligned} &\frac{\partial}{\partial t} u+ (u \cdot\nabla)u=\nu \Delta u-\nabla p,\\ &\nabla \cdot u=0,\\ &u(0,x)=u_0(x). \end{aligned}

Given a smooth initial velocity field $u_0(x),$ a global smooth solution of the Navier-Stokes equation is a smooth velocity field $u:[0,+\infty)\times\mathbb{R}^3\to\mathbb{R}^3$ and a pressure function $p:[0,+\infty)\times\mathbb{R}^3\to\mathbb{R}$ 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 $u$ of the Navier-Stokes equation is said to blow up if $\sup_{x\in\mathbb{R}^3}|u(t,x)|\to +\infty$ as $t\to +\infty,$ 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.

Simulations

The Simulations showed here were made using some examples provided in the software Fire Dynamics Simulator (FDS) and Smokeview (SMV).

Applications

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:

1. Weather forecasting.
2. Chemical and Energy industries.
3. 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].

4. Ventilation design of the ocean, cities, buildings, miners, computers, etc.
5. 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.
6. Design of anti-tsunami systems.
7. Mathematical Cardiology, i.e. the modelling and simulation of the circulatory system.
8. 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.