Incompressible Navier-Stokes
- add force
- advect
- diffuse
- project
A) Thin flame tracked by level set $\phi$ 1
- Implicit surface where (
$\phi=0$ ) defines the interface between-
Fuel (
$\phi>0$ ) blue-core reaction zone -
Hot Gas (
$\phi<0$ )
-
Fuel (
- velocity of surface
$$w = \vec{u}_{fuel} + S\vec{n}$$ - Implicit surface unit normal vector (central differencing)
$$\vec{n} = \nabla\phi/|\nabla\phi|$$ - Time derivative of level set (upwind differencing for
$\nabla\phi$ )$$\phi_t = -(\vec{u}_f + S\vec{n})\cdot\nabla\phi$$
- evolve fuel and hot gas velocity fields separately
B) Velocity updated via Stam's 4-step loop2
1. Add Force (before advection)3
- Buoyancy
$$f_{buoy} = \alpha(T - T_{air})\hat{z}$$ - Vorticity Confinement
- Vorticity vector
$$\vec{\omega} = \nabla\times\vec{u}$$ - Normalized vorticity location vector (central differencing)
$$\vec{N} = \nabla|\vec{\omega}|/|\nabla|\vec{\omega}||$$ - Force of vorticity confinement
$$f_{conf} = \varepsilon h(\vec{N}\times\vec{\omega})$$
- Vorticity vector
- Add Force
$$\vec{\text{w}}_1 = \vec{u}_t + \triangle t\ \vec{f}$$
2. Advection2
- Stable Semi-Lagrangian
-
semi_lagrangian_advect$$\text{Advection of }\vec{\text{w}}_1(P_0)\text{ where } P_0 := (x_0, y_0)$$
-
- backtrace half-step
$$P_{-1/2} = P_0 - \vec{\text{w}}_1(P_0)\frac{\Delta t}{2h}$$ - sample velocity* $$\vec{\text{w}}1(P{-1/2}) \approx \text{bilinear_sample}(\vec{\text{w}}1,; P{-1/2})$$
- backtrace full-step $$P_{-1} = P_0 - \vec{\text{w}}1(P{-1/2})\frac{\Delta t}{h}$$
- sample velocity* $$\vec{\text{w}}_2(P_0) \approx \vec{\text{w}}1(P{-1}) \approx \text{bilinear_sample}(\vec{\text{w}}1,; P{-1})$$
- (mass conservation)
$\nabla\cdot\vec{u}=0$ - i.e. when hot gas advection samples fuel, synthesize correct cross-interface value
-
$V_h^{ghost} = V_f + (\rho_f/\rho_h - 1)S$ - (normal velocity of fuel)
$V_f = \vec{u}_f\cdot\vec{n}$
- (normal velocity of fuel)
$\vec{u}_h^{ghost} = V_h^{ghost}\vec{n} + \vec{u}_f - (\vec{u}_f\cdot\vec{n})\vec{n}$ $\vec{u}_h^{ghost} = (\rho_f/\rho_h - 1)S + \vec{u}_f$
-
- with implicit diffusion
-
diffuse_velocity$$\pdv{\vec{\text{w}}_2}{t} = \nu\nabla^2\vec{\text{w}}_2$$ $$\vec{\text{w}}_3 = \vec{\text{w}}_2 + (\nu\Delta t)\nabla^2\vec{\text{w}}_2$$
-
- Onto divergent free fields
- and a Poisson solve for pressure
-
project_hot$$\nabla^2q = \nabla\cdot\vec{\text{w}}_3$$ $$\vec{\text{w}}_4 = \vec{\text{w}}_3 - \nabla q$$
-
- (advected and decreased by 1 per unit time)
- time since crossing blue core
- with radiative cooling
- proportional to
$(T - T_{air})^4$ $T_t = -(\vec{u}\cdot\nabla)T - c_T\Big(\frac{T - T_{air}}{T_{max} - T_{air}}\Big)^4$
- proportional to
-
$c_T$ : cooling constantp.k_cool
- By Fourier's law for an isotropic medium, the rate of flow of heat energy per unit area through a surface is proportional to the negative temperature gradient across it:
$\vec{q}_{heat flow} = -k\nabla T(\vec{x}, t)$
- not full Monte-Carlo ray marcher, but good first pass)
- for full correctness, see stochastic ray marching of the RTE (stanford)
- Diffusion (via Jacobi or CG) not applies to
T,Y, orD
| Variable | Description |
|---|---|
| N | grid length (Vectors are N x N) |
| h | grid spacing |
| phi | (grid-center) level set function |
| p | (grid-center) pressure |
| T | (grid-center) temperature |
| vf | velocity of fuel |
| vg | velocity of gas |
- (phi = 0) defines interface between fuel and gas
- velocity units of 'cells / time'
- cell-centered fields
- Conjugate-Gradient Poisson solver (SPD 5-point Laplacian)
- Ghost-velocity
- (applied during semi-Lagrangian sampling of hot-gas field)
- pressure jump conditions not enforced in the linear system
Staggered Field Grids3
Defined at faces/edges of grid cells
Defined at center of grid cells
Advection for a conserved quantity described by a scalar field
For a generic scalar field
-
$k_S$ : diffusion constant -
$a_S$ : dissipation rate
Footnotes
-
Nguyen, Duc & Fedkiw, Ronald & Jensen, Henrik. (2002). Physically Based Modeling and Animation of Fire. ACM Transactions on Graphics. 21. 10.1145/566570.566643. ↩
-
Stam, Jos. (2001). Stable Fluids. ACM SIGGRAPH 99. 1999. 10.1145/311535.311548. ↩ ↩2
-
Fedkiw, Ronald & Stam, Jos & Jensen, Henrik. (2001). Visual Simulation of Smoke. ACM SIGGRAPH2001, 2001.. 10.1145/383259.383260. ↩ ↩2