Graphics Reference
In-Depth Information
Another way of interpreting the discrete divergence we have defined here
is through a direct estimate of the total rate of fluid entering or exiting the
grid cell. Remember that this (in the exact continuum setting) is just the
integral of the normal component of velocity around the faces of the grid
cell:
u
·
n.
cell
This is the sum of the integrals over each grid cell face. Since we have the
normal component of velocity stored at the center of each face, we can es-
timate the integral easily by just multiplying the normal component by the
area of the face (though be careful with signs here—in the above integral
the normal is always outwards-pointing, whereas the velocity components
stored on the grid always are for the same directions, as shown in Figure
2.1, for example). After rescaling, this leads to exactly the same central
difference formulas—I'll let you work this out for yourself if you're inter-
ested. This numerical technique, where we directly estimate the integral of
a quantity around the faces of a grid cell instead of looking at the differ-
ential equation formulation, is called the finite volume method—more on
this at the end of the chapter.
Finally we can explain why the MAC grid is so useful. If we used a reg-
ular collocated grid, where all components of velocity were stored together
at the grid points, we would have a dicult time with the divergence. If
we used the central difference formula, for example,
u i +1 ,j
u i− 1 ,j
x
+ v i,j +1
v i,j− 1
x
u ) i,j
(
∇·
,
then we have exactly the null-space issues we mentioned back in Chapter 2.
Some highly divergent velocity fields such as u i,j =((
1) j ) will
evaluate to zero divergence. Therefore, the pressure solve won't do anything
about correcting them, and so high-frequency oscillations in the velocity
field may persist or even grow unstably during the simulation. There are
two possible fixes to get around this while still using a collocated grid.
The first is to use a biased, one-sided difference approximation—and while
this works, it does introduce a peculiar bias to the simulation that can
be disturbingly obvious. The second is to filter out the high-frequency
divergent modes (i.e., smooth the velocity field) before doing the pressure
solve, to explicitly get rid of them—unfortunately, our major goal is to
avoid numerical smoothing wherever possible, so this isn't a good idea for
animation either. Thus we stick to the MAC grid.
1) i , (
Search WWH ::




Custom Search