Graphics Reference
In-Depth Information
This is unbiased and accurate to O x 2 ) but it doesn't skip over any values
of q like formula (2.11). So if we set this equal to zero we can only have q
constant: the null-space is correct. The MAC grid is set up so that we use
this staggered form of the central difference wherever we need to estimate
a derivative in the pressure solve (i.e., the incompressibility condition).
The staggered MAC grid is perfectly suited for handling pressure and
incompressibility, but it's a little awkward for other uses. For example, if
we actually want to evaluate the full velocity vector somewhere, we will
always need to use some kind of interpolation even if we're looking at a
grid point! At an arbitrary location in space, we'll do separate bilinear
or trilinear interpolation for each component of velocity, but since those
components are offset from each other we will need to compute a different
set of interpolation weights for each component. At the grid locations
themselves, this boils down to some simple averaging. In two dimensions
these averages are
u i,j = u i− 1 / 2 ,j + u i +1 / 2 ,j
2
,
v i,j− 1 / 2 + v i,j +1 / 2
2
,
u i +1 / 2 ,j = u i +1 / 2 ,j ,
,
v i,j− 1 / 2 + v i,j +1 / 2 + v i +1 ,j− 1 / 2 + v i +1 ,j +1 / 2
4
u i,j +1 / 2 = u i− 1 / 2 ,j + u i +1 / 2 ,j + u i− 1 / 2 ,j +1 + u i +1 / 2 ,j +1
4
.
,
i,j +1 / 2
In three dimensions the formulas are similar:
u i,j,k = u i− 1 / 2 ,j,k + u i +1 / 2 ,j,k
2
v i,j− 1 / 2 ,k + v i,j +1 / 2 ,k
2
w i,j,k− 1 / 2 + w i,j,k +1 / 2
2
,
,
v i,j− 1 / 2 ,k + v i,j +1 / 2 ,k
+ v i +1 ,j− 1 / 2 ,k + v i +1 ,j +1 / 2 ,k
4
w i,j,k− 1 / 2 + w i,j,k +1 / 2
+ w i +1 ,j,k− 1 / 2 + w i +1 ,j,k +1 / 2
4
u i +1 / 2 ,j,k =
u i +1 / 2 ,j,k ,
,
u i− 1 / 2 ,j,k + u i +1 / 2 ,j,k
+ u i− 1 / 2 ,j +1 ,k + u i +1 / 2 ,j +1 ,k
4
w i,j,k− 1 / 2 + w i,j,k +1 / 2
+ w i,j +1 ,k− 1 / 2 + w i,j +1 ,k +1 / 2
4
u i,j +1 / 2 ,k =
,v i,j +1 / 2 ,k ,
u i− 1 / 2 ,j,k + u i +1 / 2 ,j,k
+ u i− 1 / 2 ,j,k +1 + u i +1 / 2 ,j,k +1
4
v i,j− 1 / 2 ,k + v i,j +1 / 2 ,k
+ v i,j− 1 / 2 ,k +1 + v i,j +1 / 2 ,k +1
4
u i,j,k +1 / 2 =
,
,w i,j,k +1 / 2
Finally, a word is in order about the curious half indices, such as i +1 / 2.
These are convenient theoretically and conceptually, fixing the location of
Search WWH ::




Custom Search