↑ arvau

Wikipedia / MacCormack method

In computational fluid dynamics, the MacCormack method (/məˈkɔːrmæk ˈmɛθəd/) is a widely used discretization scheme for the numerical solution of hyperbolic partial differential equations. This second-order finite difference method was introduced by Robert W. MacCormack in 1969. The MacCormack method is elegant and easy to understand and program.

The algorithm

The MacCormack method is designed to solve hyperbolic partial differential equations of the form

, the MacCormack method uses a "predictor step" and a "corrector step", given below

Linear Example

To illustrate the algorithm, consider the following first order hyperbolic equation

The application of MacCormack method to the above equation proceeds in two steps; a predictor step which is followed by a corrector step.

Predictor step:) is estimated as follows

The above equation is obtained by replacing the spatial and temporal derivatives in the previous first order hyperbolic equation using forward differencess.

Corrector step: is corrected according to the equation

Note that the corrector step uses backward finite difference used in the predictor step.

term by the temporal average

to obtain the corrector step as

Some remarks

The MacCormack method is well suited for nonlinear equations (Inviscid Burgers' equation, Euler equations, etc.) The order of differencing can be reversed for the time step (i.e., forward/backward followed by backward/forward). For nonlinear equations, this procedure provides the best results. For linear equations, the MacCormack scheme is equivalent to the Lax–Wendroff method.

Unlike first-order upwind scheme, the MacCormack does not introduce diffusive errors in the solution. However, it is known to introduce dispersive errors (Gibbs phenomenon) in the region where the gradient is high.

See also

References