Physical Simulation: Eulerian Fluid Simulation

Overview

Material Derivatives: Lagrangian v.s. Eulerian

We define material derivative as

E.g.,

$\textbf{u}$: material (fluid) velocity. Many other names: Advective/Lagrangian/particle derivative.

Intuitively, change of physical quantity on a piece of material =

  • change due to time $\frac{\partial}{\partial t}$(Eulerian)
  • change due to material movement $\textbf{u} \cdot \nabla$

(Incompressible) Navier-Stokes equations

where $\mu$: dynamic viscosity; $\nu = \frac{\mu}{\rho}$: kinematic viscosity.

Operator splitting

Split the euqations above into three parts:

$\alpha$: any physical property (temperature, color, smoke density etc.)

Eulerian fluid simulation cycle

Time discretization with splitting: for each time step,

  1. Advection: “move” the fluid field. Solve $\textbf{u}^{*}$ using $\textbf{u}^{t}$

  2. External forces (optional): evaluate $\textbf{u}^{*}$ using $\textbf{u}^{}$

  3. Projection: make velocity field $\textbf{u}^{t+1}$ divergence-free based on $\textbf{u}^{**}$

Grid

Spatial discretization using cell-centered grids or staggered grids

cell-centered grids

v.s.

staggered grids

And for any point within a grid, just use bilinear interpolation. As it’s an obvious and straightforward method, we move on

Advection

Advection schemes

A trade-off between numerical viscosity, stability, performance and complexity:

  • Semi-Lagrangian advection
  • MacCormack/BFECC
  • BiMocq
  • Particle advection (PIC/FLIP/APIC/PolyPIC)

Semi-Lagrangian advection

  1. To find a fluid value at grid point $\vec{x}{G}$ at the new time step, we need to know where the fluid at $\vec{x}{G}$ was one time step ago, position $\vec{x}_{P}$, following the velocity field.

Semi-Lagrangian Advection

  1. Now we use bilinear interpolation, our basic semi-Lagrangian formula, assuming the particle-tracing algorithm has tracked back to location $\vec{x}_{P}$ is

Problem: The real trajectory of material parcels can be complex
Semi-Lagrangian Advection Problem

Solve the problem - Backtrace Method

Initial value problem (ODE): simply use explicit time integration schemes

  • Forward Euler (“RK1”)
  • Explicit Midpoint (“RK2”)
  • RK3

BFECC and MacCormack advection schemes

BFECC: Back and Forth Error Compensation and Correction

  • $\textbf{x}^{*} = \text{SL}(\textbf{x}, \Delta t)$
  • $\textbf{x}^{*} = \text{SL}(\textbf{x}^{}, - \Delta t)$
  • Estimate the error $\textbf{x}^{error} = \frac{1}{2}(\textbf{x}^{**} - \textbf{x})$
  • Apply the error $\textbf{x}^{final} = \textbf{x}^{**} + \textbf{x}^{error}$

Be careful: need to prevent overshooting.

Projection

The project routine will subtract the pressure gradient from the intermediate velocity field $\vec{u}$
Projection equations

Actually after we combine the two euqations together we could easily get:

… which is Poisson’s equation

If $f = 0$, the equation is called Laplace’s equation

Spatial discretization (2D)

Recall the euqation for $p$:

Discretize on a 2D grid:

Again, a linear system:

$n, m$: numbers of cells along the $x-$ and $y-$ axis

Solving large-scale linear systems

  • Direct solvers (e.g. PARDISO)
  • Iterative solvers
    • Gauss-Seidel
    • (Damped) Jacobi
    • (Preconditioned) Krylov-subspace solvers (e.g., conjugate gradients)

Extend reading

A great introduction to Eulerian fluid simulation: Fluid simulation for computer graphics by Robert Bridson
An Introduction to the Conjugate Gradient Method Without the Agonizing Pain
A introduction to Conjugate Gradient Method in Chinese