14.4. Finite-difference Approximations

Discretization of the differential equations uses conventional finite differencing techniques for non-uniform mesh spacing. Diffusive terms use central differences, with truncation error that is second-order in the mesh spacing. For better convergence, convective terms use upwind differencing, which uses the sign of the velocity to choose which direction the spatial difference will go. If , for example, then the convective term in the energy equation is differenced as:

(14–16)

The truncation error of this approximation is first-order in the mesh spacing, leading to what is often called "artificial diffusion", but this form avoids unwanted oscillations during the solution on a coarse mesh. Alternatively, the convective terms can be centrally differenced, but the default windward differencing is recommended.