High-Level Solution Overview

Incompressibility Condition Reviewed

Recall Equation 1 from the last chapter:

u=0  (Incompressible Flow)(1)\tag{1} \nabla \cdot \vec{u} = 0 \; \textrm{(Incompressible Flow)}

This equation enforces the incompressibility condition. It says that the divergence of the fluid’s velocity field (called $\vec{u}$) is zero.

If the divergence of the velocity field is non-zero, then that means the amount of fluid entering a cell is not equal to the amount of fluid exiting that same cell. This would indicate either:

  1. Matter is being created or destroyed within that cell
  2. The fluid is compressible

Statement 1 would violate the law of conservation of mass, and statement 2 contradicts our assumption that the fluid is incompressible. We want to avoid compressible fluids because the math governing them is significantly more complex. We know both statements must be false:

Therefore the divergence of the velocity field must be zero.\textbf{Therefore the divergence of the velocity field must be zero.}

The Problem

Our issue is that in the process of updating our fluid simulation we need to make changes to the velocity field, which is will almost definitely result in us creating some kind of non-zero divergence within the velocity field.

Solution Overview

Our goal then for each step of our fluid simulation can be broken down into the following high-level steps:

  1. Calculate a new velocity field that has a non-zero divergence
  2. Correct the vectors in the new velocity field to create a divergence-free velocity field somehow… (spoiler: it’s the next chapter)