Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

MacCormack method

From Wikipedia, the free encyclopedia
Equation in computational fluid dynamics

Incomputational fluid dynamics, theMacCormack method (/məˈkɔːrmæk ˈmɛθəd/) is a widely used discretization scheme for the numerical solution ofhyperbolic partial differential equations. This second-orderfinite difference method was introduced by Robert W. MacCormack in 1969.[1] The MacCormack method is elegant and easy to understand and program.[2]

The algorithm

[edit]

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

ut+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 celli{\displaystyle i}, the MacCormack method uses a "predictor step" and a "corrector step", given below[3]

uip=uinΔtΔx(fi+1nfin)uin+1=12(uin+uip)Δt2Δx(fipfi1p){\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

[edit]

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

ut+aux=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; apredictor step which is followed by acorrector step.

Predictor step: In the predictor step, a "provisional" value ofu{\displaystyle u} at time leveln+1{\displaystyle n+1} (denoted byuip{\displaystyle u_{i}^{p}}) is estimated as follows

uip=uinaΔtΔx(ui+1nuin){\displaystyle u_{i}^{p}=u_{i}^{n}-a{\frac {\Delta t}{\Delta x}}\left(u_{i+1}^{n}-u_{i}^{n}\right)}

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

Corrector step: In the corrector step, the predicted valueuip{\displaystyle u_{i}^{p}} is corrected according to the equation

uin+1=uin+1/2aΔt2Δx(uipui1p){\displaystyle u_{i}^{n+1}=u_{i}^{n+1/2}-a{\frac {\Delta t}{2\Delta x}}\left(u_{i}^{p}-u_{i-1}^{p}\right)}

Note that the corrector step usesbackward finite difference approximations for spatial derivative. The time-step used in the corrector step isΔt/2{\displaystyle \Delta t/2} in contrast to theΔt{\displaystyle \Delta t} used in the predictor step.

Replacing theuin+1/2{\displaystyle u_{i}^{n+1/2}} term by the temporal average

uin+1/2=uin+uip2{\displaystyle u_{i}^{n+1/2}={\frac {u_{i}^{n}+u_{i}^{p}}{2}}}

to obtain the corrector step as

uin+1=uin+uip2aΔt2Δx(uipui1p){\displaystyle u_{i}^{n+1}={\frac {u_{i}^{n}+u_{i}^{p}}{2}}-a{\frac {\Delta t}{2\Delta x}}\left(u_{i}^{p}-u_{i-1}^{p}\right)}

Some remarks

[edit]

The MacCormack method is well suited fornonlinear equations (InviscidBurgers' 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 theLax–Wendroff method.[4]

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

See also

[edit]

References

[edit]
  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"(PDF).University of Maryland.
  4. ^Tannehill, J. C.,Anderson, D. A., and Pletcher, R. H., Computational Fluid Mechanics and Heat Transfer, 2nd ed., Taylor & Francis (1997).
Finite difference
Parabolic
Hyperbolic
Others
Finite volume
Finite element
Meshless/Meshfree
Domain decomposition
Others
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=MacCormack_method&oldid=1328722757"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp