MacCormack method

Short description: Equation in computational fluid dynamics

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.[1] The MacCormack method is elegant and easy to understand and program.[2]

## Contents

* 1 The algorithm
* 2 Linear Example
* 2.1 Some remarks
* 3 See also
* 4 References

## The algorithm

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

∂u∂t+∂f(u)∂x=0

To update this equation one timestep Δt on a grid with spacing Δx at grid cell i, the MacCormack method uses a "predictor step" and a "corrector step", given below[3]

uip=uin−ΔtΔx(fi+1n−fin)uin+1=12(uin+uip)−Δt2Δx(fip−fi−1p)

## Linear Example

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

∂u∂t+a∂u∂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 at time level n+1 (denoted by uip) is estimated as follows

uip=uin−aΔtΔx(ui+1n−uin)

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

Corrector step: In the corrector step, the predicted value uip is corrected according to the equation

uin+1=uin+1/2−aΔt2Δx(uip−ui−1p)

Note that the corrector step uses backward finite difference approximations for spatial derivative. The time-step used in the corrector step is Δt/2 in contrast to the Δt used in the predictor step.

Replacing the uin+1/2 term by the temporal average

uin+1/2=uin+uip2

to obtain the corrector step as

uin+1=uin+uip2−aΔt2Δx(uip−ui−1p)

### 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.[4]

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

* Lax–Wendroff method
* Upwind scheme
* Hyperbolic partial differential equations

## References

1. ↑ MacCormack, R. W., The Effect of viscosity in hypervelocity impact cratering, AIAA Paper, 69-354 (1969).
2. ↑ Anderson, J. D., Jr., Computational Fluid Dynamics: The Basics with Applications, McGraw Hill (1994).
3. ↑ Cameron, Maria (2011). "Notes on Burger's Equation". https://www.math.umd.edu/~mariakc/burgers.pdf#page=13.
4. ↑ Tannehill, J. C., Anderson, D. A., and Pletcher, R. H., Computational Fluid Mechanics and Heat Transfer, 2nd ed., Taylor & Francis (1997).

* v
* t
* e

Numerical partial differential equations by method

Finite difference|

| Parabolic|

* Forward-time central-space (FTCS)
* Crank–Nicolson

|

Hyperbolic|

* Lax–Friedrichs
* Lax–Wendroff
* MacCormack
* Upwind
* Method of characteristics

Others|

* Alternating direction-implicit (ADI)
* Finite-difference time-domain (FDTD)

Finite volume|

* Godunov
* High-resolution
* Monotonic upstream-centered (MUSCL)
* Advection upstream-splitting (AUSM)
* Riemann solver
* essentially non-oscillatory (ENO)
* weighted essentially non-oscillatory (WENO)

Finite element|

* hp-FEM
* Extended (XFEM)
* Discontinuous Galerkin (DG)
* Spectral element (SEM)
* Mortar
* Gradient discretisation (GDM)
* Loubignac iteration
* Smoothed (S-FEM)

Meshless/Meshfree|

* Smoothed-particle hydrodynamics (SPH)
* Moving particle semi-implicit method (MPS)
* Material point method (MPM)
* Particle-in-cell (PIC)

Domain decomposition|

* Schur complement
* Fictitious domain
* Schwarz alternating
* additive
* abstract additive
* Neumann–Dirichlet
* Neumann–Neumann
* Poincaré–Steklov operator
* Balancing (BDD)
* Balancing by constraints (BDDC)
* Tearing and interconnect (FETI)
* FETI-DP

Others|

* Spectral
* Pseudospectral (DVR)
* Method of lines
* Multigrid
* Collocation
* Level-set
* Boundary element
* Immersed boundary
* Analytic element
* Particle-in-cell
* Isogeometric analysis
* Infinite difference method
* Infinite element method
* Galerkin method
* Petrov–Galerkin method
* Validated numerics
* Computer-assisted proof

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/MacCormack method. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=MacCormack_method&oldid=4348587"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template