High-Level Solution Overview
Incompressibility Condition Reviewed
Recall Equation 1 from the last chapter:
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:
- Matter is being created or destroyed within that cell
- 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:
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:
- Calculate a new velocity field that has a non-zero divergence
- Correct the vectors in the new velocity field to create a divergence-free velocity field somehow… (spoiler: it’s the next chapter)