Compact finite difference
{{multiple issues|
{{cleanup reorganize|date=January 2015}}
{{more footnotes|date=January 2015}}
{{primary sources|date=January 2015}}
{{Orphan|date=November 2016}}
}}
The compact finite difference formulation, or Hermitian formulation, is a numerical method to compute finite difference approximations. Such approximations tend to be more accurate for their stencil size (i.e. their compactness) and, for hyperbolic problems, have favorable dispersive error and dissipative error properties when compared to explicit schemes.{{Cite journal|last=Lele|first=S.K. |date=August 1992|title=Compact finite difference schemes with spectral-like resolution|journal=Journal of Computational Physics |language=en|volume=103|issue=1 |pages=16–43|doi=10.1016/0021-9991(92)90324-R|bibcode=1992JCoPh.103...16L }} A disadvantage is that compact schemes are implicit and require to solve a diagonal matrix system for the evaluation of interpolations or derivatives at all grid points. Due to their excellent stability properties, compact schemes are a popular choice for use in higher-order numerical solvers for the Navier-Stokes Equations.
Example
The classical Pade scheme for the first derivative at a cell with index () reads;
\frac{1}{4}f'_{i-1} + f'_{i} + \frac{1}{4}f'_{i+1} = \frac{3}{2} \frac{f_{i+1}-f_{i-1}}{2\Delta}.
Where is the spacing between points with index . The equation yields a fourth-order accurate solution for when supplemented with suitable boundary conditions (typically periodic). When compared to the 4th-order accurate central explicit method;
f'_{i} = \frac{-f_{i+2} + 8f_{i+1} - 8f_{i-1} + f_{i-2}}{12\Delta},
the former (implicit) method is compact as it only uses values on a 3-point stencil instead of 5.
Derivation of compact schemes
Compact schemes are derived using a Taylor series expansion. Say we wish to construct a compact scheme with a three-point stencil (as in the example):
\alpha_1 f'_{i-1} + f'_{i} + \alpha_2f'_{i+1} = b_1 f_{i+1} + a f_i + b_2 f_{i-1}.
From a symmetry argument we deduce , and , resulting in a two-parameter system,
\alpha f'_{i-1} + f'_{i} + \alpha f'_{i+1} + b f_{i+1} - b f_{i-1} = 0.
We write the expansions around up to a reasonable number of terms and using notation ,
\begin{align}
f_{i+1} & = & f_i + \Delta &f'_i + \frac{1}{2}\Delta^2&f^2_i + \frac{1}{6}\Delta^3 &f^3_i + \frac{1}{24}\Delta^4f^4_i + \mathrm{etc.},\\
f_{i-1} & = & f_i - \Delta &f'_i + \frac{1}{2}\Delta^2&f^2_i - \frac{1}{6}\Delta^3 &f^3_i + \frac{1}{24}\Delta^4f^4_i + \mathrm{etc.},\\
f'_i & = & & f'_i, \\
f'_{i+1} & = & & f'_i + \Delta&f^2_i + \frac{1}{2}\Delta^2&f^3_i + \frac{1}{6}\Delta^3f^4_i + \frac{1}{24}\Delta^4f^5_i + \mathrm{etc.},\\
f'_{i-1} & = & & f'_i - \Delta&f^2_i + \frac{1}{2}\Delta^2&f^3_i - \frac{1}{6}\Delta^3f^4_i + \frac{1}{24}\Delta^4f^5_i + \mathrm{etc.},\\
\end{align}
Each column on the right-hand side gives an equation for the coefficients ,
\begin{align}
f_i:&\ \ \ b - b & = 0, &\ \mathrm{(Trivial)} \\
f'_i:&\ \ \ 2\Delta b + 1 + 2\alpha & = 0, &\ \mathrm{(eq.\ 1)} \\
f^2_i:&\ \ \ b - b + \alpha - \alpha & = 0, &\ \mathrm{(Trivial)}\\
f^3_i:&\ \ \ \frac{1}{3}b\Delta^3 + \Delta^2\alpha & = 0. &\ \mathrm{(eq.\ 2)}.
\end{align}
We now have two equations for two unknowns and therefore stop checking for higher-order-term equations.
\begin{align}
\mathrm{eq.\ 2}:&\ b = \frac{-3}{\Delta}\alpha, \rightarrow \\
\mathrm{eq.\ 1}:&\ -6\alpha + 1 + 2\alpha = 0, \rightarrow \\
& \alpha = \frac{1}{4},\ \mathrm{and},\ \rightarrow \\
& b = -\frac{3}{4 \Delta},
\end{align}
which is indeed the scheme from the example.
Evaluation of a compact scheme
Compact finite difference schemes are a class of numerical methods used to approximate derivatives with high accuracy while maintaining a minimal stencil size. Unlike standard finite difference methods that use explicit expressions, compact schemes rely on implicit relations between function values and derivatives at neighboring points. This implicitness enables them to achieve spectral-like resolution and higher-order accuracy with fewer grid points. The valuation of a compact finite difference scheme typically refers to assessing its order of accuracy, spectral resolution, dispersion and dissipation errors and computational cost vs. accuracy {{Cite journal|last=LeVeque|first=R.J. |date=2007|title=Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-State and Time-Dependent Problems|journal=Society for Industrial and Applied Mathematics (SIAM) |language=en }}
=Order of Accuracy (Formal Valuation)=
One of the primary measures of value in a finite difference scheme is its order of accuracy, which reflects how rapidly the approximation error decreases as the grid is refined. A compact scheme can achieve an order of accuracy of , where hh is the grid spacing and pp is an integer denoting the formal order.
=Spectral Resolution=
Compact schemes are valued for their ability to resolve a broad range of spatial frequencies, a property often referred to as spectral-like resolution. This makes them particularly effective for problems involving wave propagation, sharp gradients, or turbulent flows, where high-frequency information is critical.
Compared to explicit schemes, compact methods more accurately reproduce the amplitude and phase of sinusoidal components across a wide range of wavenumbers, closely mimicking the behavior of spectral (Fourier-based) methods.
=Dispersion and Dissipation Characteristics=
Another advantage of compact schemes is their favorable dispersion and dissipation properties:
- Low dispersion error ensures that numerical waves travel at speeds close to the true physical wave speeds, preserving phase accuracy.
- Low dissipation error reduces artificial attenuation, which is especially important in simulations of long-term wave phenomena or turbulence.
These properties make compact schemes suitable for Direct Numerical Simulation (DNS) and other high-fidelity fluid dynamics applications.
=Computational Cost vs. Accuracy=
While compact schemes require solving a linear system (typically tridiagonal) to compute derivatives, this modest increase in computational effort is offset by their high accuracy and compactness.
List of compact schemes
=First derivative <math>f'_{i}</math>=
4th order central scheme:
\frac{1}{4}f'_{i-1} + f'_{i} + \frac{1}{4}f'_{i+1} = \frac{3}{2} \frac{f_{i+1}-f_{i-1}}{2\Delta}.
6th order central scheme:
\frac{1}{3}f'_{i-1} + f'_{i} + \frac{1}{3}f'_{i+1} = \frac{14}{9} \frac{f_{i+1}-f_{i-1}}{2\Delta} + \frac{1}{9} \frac{f_{i+2}-f_{i-2}}{4\Delta}.
=Second derivative <math>f''_{i}</math>=
4th order central scheme:
\frac{1}{10}f_{i-1} + f_{i} + \frac{1}{10}f''_{i+1} = \frac{6}{5} \frac{f_{i+1}-2f_{i}+f_{i-1}}{\Delta^2}.
References
{{reflist}}