Graphics Reference
In-Depth Information
-4-
Making Fluids
Incompressible
In this chapter we'll look at the heart of a fluid simulation, making the fluid
incompressible and simultaneously enforcing boundary conditions: imple-
mentation of the routine project t, u ) we mentioned earlier in Chapter 2.
We'll first cover the classical approach to this and then later talk about
boundary condition issues.
The project routine will subtract off the pressure gradient from the
intermediate velocity field u :
Δ t 1
u n +1 = u
ρ
p,
so that the result satisfies incompressibility inside the fluid:
u n +1 =0
∇·
and satisfies the solid wall boundary conditions:
u n +1
·
n = u solid ·
n.
Thus, the first thing we need to do is write down the discretization of the
pressure update: how do we approximate the pressure gradient on the MAC
grid (assuming we know pressure)? After that we'll look at defining the
discrete divergence on the MAC grid and, putting the two together, come
up with a system of linear equations to solve to find the pressure. We'll
cover both the system and an effective way to solve it.
The classical MAC grid approach we'll outline first really only applies
to boundaries that are aligned with the grid: it's not obvious how to handle
sloped or curved boundaries. We will later find a reinterpretation of the
pressure equation that leads to a simple way of handling these irregular
boundary conditions accurately and robustly.
41
Search WWH ::




Custom Search