Graphics Reference
In-Depth Information
p i,j +1
v i,j +1 / 2
p i− 1 ,j
p i,j
p i +1 ,j
u i− 1 / 2 ,j
u i +1 / 2 ,j
v i,j− 1 / 2
y
p i,j− 1
x
Figure 2.1.
The two-dimensional MAC grid.
at the centers of the vertical cell faces, for example indicated by u i +1 / 2 ,j
for the horizontal velocity between cells ( i, j )and( i +1 ,j ). The verti-
cal v -component is sampled at the centers of the horizontal cell faces, for
example indicated by v i,j +1 / 2 for the vertical velocity between cells ( i, j )
and ( i, j + 1). Note that for grid cell ( i, j )wehavesampledthe normal
component of the velocity at the center of each of its faces: this will very
naturally allow us to estimate the amount of fluid flowing into and out of
the cell.
In three dimensions, the MAC grid is set up the same way, with pressure
at the grid cell centers and the three different components of velocity split
up so that we have the normal component of velocity sampled at the center
ofeachcellface(see Figure2.2 ) .
We'll go into more detail about why we use this staggered arrangement
in Chapter 4, but briefly put it's so that we can use accurate central dif-
ferences for the pressure gradient and for the divergence of the velocity
field without the usual disadvantages of the method. Consider just a one-
dimensional example: estimating the derivative of a quantity q sampled
at grid locations ...,q i− 1 ,q i ,q i +1 ,... .Toestimate ∂q/∂x at grid point i
without any bias, the natural formula is the first central difference:
∂q
∂x
q i +1
q i− 1
x
i
.
(2.11)
This is unbiased and accurate to O x 2 ), as opposed to a forward or back-
Search WWH ::




Custom Search