52
3. Finite Difference Methods
of boundary conditions so a trade-off has to be made. Second-order approximations usually offer a good combination of ease of use, accuracy, and costeffectiveness in engineering applications. Schemes of third and fourth order
offer higher accuracy for a given number of points when the grid is sufficiently
fine but are more difficult to use. Methods of still higher order are used only
in special cases.
For the conservative form of the diffusive term (3.1), one has to approximate the inner first derivative @/ax first, multiply it by r and differentiate
the product again. As shown above, one does not have to use the same approximation for the inner and outer derivatives.
The most often used approximation is a second-order, central-difference
approximation; the inner derivative is approximated at points midway between nodes, and then a central difference with a grid size Ax is used. One
obtains:
Other approximations are easily obtained using different approximations for
the inner and outer first derivatives; any of the approximations presented in
the previous section can be used.
3.5 Approximation of Mixed Derivatives
Mixed derivatives occur only when the transport equations are expressed in
non-orthogonal coordinate systems; see Chap. 8 for an example. The mixed
derivative, d24/axdy may be treated by combining the one-dimensional approximations as was described above for the second derivative. One can write:
a24 a a4
axay - ax (a,) .
The mixed second derivative at (xi, yj) can be estimated using CDS by first
evaluating the first derivative with respect to y at (xi+l, yj) and (xi-1, yj)
and then evaluating the first derivative of this new function with respect t o
x, in the manner described above.
The order of differentiation can be changed; the numerical approximation
may depend on the order. Although this may seem a drawback, it really poses
no problem. All that is required is that the numerical approximation become
3. Finite Difference Methods
of boundary conditions so a trade-off has to be made. Second-order approximations usually offer a good combination of ease of use, accuracy, and costeffectiveness in engineering applications. Schemes of third and fourth order
offer higher accuracy for a given number of points when the grid is sufficiently
fine but are more difficult to use. Methods of still higher order are used only
in special cases.
For the conservative form of the diffusive term (3.1), one has to approximate the inner first derivative @/ax first, multiply it by r and differentiate
the product again. As shown above, one does not have to use the same approximation for the inner and outer derivatives.
The most often used approximation is a second-order, central-difference
approximation; the inner derivative is approximated at points midway between nodes, and then a central difference with a grid size Ax is used. One
obtains:
Other approximations are easily obtained using different approximations for
the inner and outer first derivatives; any of the approximations presented in
the previous section can be used.
3.5 Approximation of Mixed Derivatives
Mixed derivatives occur only when the transport equations are expressed in
non-orthogonal coordinate systems; see Chap. 8 for an example. The mixed
derivative, d24/axdy may be treated by combining the one-dimensional approximations as was described above for the second derivative. One can write:
a24 a a4
axay - ax (a,) .
The mixed second derivative at (xi, yj) can be estimated using CDS by first
evaluating the first derivative with respect to y at (xi+l, yj) and (xi-1, yj)
and then evaluating the first derivative of this new function with respect t o
x, in the manner described above.
The order of differentiation can be changed; the numerical approximation
may depend on the order. Although this may seem a drawback, it really poses
no problem. All that is required is that the numerical approximation become
