Graphics Reference
In-Depth Information
v i,j +1 / 2 ,k
p i,j,k
u i +1 / 2 ,j,k
w i,j,k +1 / 2
y
x
z
Figure 2.2.
One cell from the three-dimensional MAC grid.
ward difference, such as
∂q
∂x
q i +1
q i
i
,
(2.12)
Δ x
which is biased to the right and only accurate to O x ). However, formula
(2.11) has a major problem in that the derivative estimate at grid point i
completely ignores the value q i sampled there! To see why this is so terrible,
recall that a constant function can be defined as one whose first derivative
is zero. If we require that the finite difference (2.11) is zero, we are allowing
q 's that aren't necessarily constant— q i could be quite different from q i− 1
and q i +1 and still the central difference will report that the derivative is
zeroaslongas q i− 1 = q i +1 . In fact, a very jagged function like q i =(
1) i
which is far from constant, will register as having zero derivative according
to formula (2.11). On the other hand, only truly constant functions satisfy
the forward difference (2.12) equal to zero. The problem with formula
(2.11) is technically known as having a non-trivial null-space :thesetof
functions where the formula evaluates to zero contains more than just the
constant functions it should be restricted to.
How can we get the unbiased second-order accuracy of a central differ-
ence without this null-space problem? The answer is by using a staggered
grid: sample the q 's at the half-way points, q i +1 / 2 instead. Then we natu-
rally can estimate the derivative at grid point i as
∂q
∂x
q i +1 / 2
q i− 1 / 2
Δ x
i
.
(2.13)
 
Search WWH ::




Custom Search