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
∂ u ∂ t + ∂ f ( u ) ∂ x = 0 {\displaystyle {\frac {\partial u}{\partial t}}+{\frac {\partial f(u)}{\partial x}}=0}
To update this equation one timestep Δ t {\displaystyle \Delta t} on a grid with spacing Δ x {\displaystyle \Delta x} at grid cell i {\displaystyle i} , the MacCormack method uses a "predictor step" and a "corrector step", given below
u i p = u i n − Δ t Δ x ( f i + 1 n − f i n ) u i n + 1 = 1 2 ( u i n + u i p ) − Δ t 2 Δ x ( f i p − f i − 1 p ) {\displaystyle {\begin{aligned}&u_{i}^{p}=u_{i}^{n}-{\frac {\Delta t}{\Delta x}}\left(f_{i+1}^{n}-f_{i}^{n}\right)\\&u_{i}^{n+1}={\frac {1}{2}}(u_{i}^{n}+u_{i}^{p})-{\frac {\Delta t}{2\Delta x}}(f_{i}^{p}-f_{i-1}^{p})\end{aligned}}}
Linear Example To illustrate the algorithm, consider the following first order hyperbolic equation
∂ u ∂ t + a ∂ u ∂ x = 0. {\displaystyle \qquad {\frac {\partial u}{\partial t}}+a{\frac {\partial u}{\partial x}}=0.}
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: In the predictor step, a "provisional" value of u {\displaystyle u} at time level n + 1 {\displaystyle n+1} (denoted by u i p {\displaystyle u_{i}^{p}} ) is estimated as follows
… excerpt ends here. Continue reading the full article.
