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.[1] 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.
The classical Pade scheme for the first derivative at a cell with index
i
f'i
1 | |
4 |
f'i-1+f'i+
1 | |
4 |
f'i+1=
3 | |
2 |
fi+1-fi-1 | |
2\Delta |
.
Where
\Delta
i-1, i \& i+1
f'
f'i=
-fi+2+8fi+1-8fi-1+fi-2 | |
12\Delta |
,
the former (implicit) method is compact as it only uses values on a 3-point stencil instead of 5.
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):
\alpha1f'i-1+f'i+\alpha2f'i+1=b1fi+1+afi+b2fi-1.
From a symmetry argument we deduce
\alpha1=\alpha2=\alpha
a=0
b1=-b2=-b
\alphaf'i-1+f'i+\alphaf'i+1+bfi+1-bfi-1=0.
We write the expansions around
xi
dnf | |
dxn |
=fn
\begin{align} fi+1&=&fi+\Delta&f'i+
1 | |
2 |
\Delta2&f
2 | |
i |
+
1 | |
6 |
\Delta3
3 | |
&f | |
i |
+
1 | |
24 |
\Delta4f
4 | |
i |
+etc.,\\ fi-1&=&fi-\Delta&f'i+
1 | |
2 |
\Delta2&f
2 | |
i |
-
1 | |
6 |
\Delta3
3 | |
&f | |
i |
+
1 | |
24 |
\Delta4f
4 | |
i |
+etc.,\\ f'i&=&&f'i,\\ f'i+1&=&&f'i+
2 | |
\Delta&f | |
i |
+
1 | |
2 |
\Delta2&f
3 | |
i |
+
1 | |
6 |
\Delta3f
4 | |
i |
+
1 | |
24 |
\Delta4f
5 | |
i |
+etc.,\\ f'i-1&=&&f'i-
2 | |
\Delta&f | |
i |
+
1 | |
2 |
\Delta2&f
3 | |
i |
-
1 | |
6 |
\Delta3f
4 | |
i |
+
1 | |
24 |
\Delta4f
5 | |
i |
+etc.,\\ \end{align}
Each column on the right-hand side gives an equation for the coefficients
\alpha,b
\begin{align} fi:& b-b&=0,& (Trivial)\\ f'i:& 2\Deltab+1+2\alpha&=0,& (eq. 1)
2 | |
\\ f | |
i:& b |
-b+\alpha-\alpha&=0,
3 | ||||
& (Trivial)\\ f | ||||
|
b\Delta3+\Delta2\alpha&=0.& (eq. 2). \end{align}
We now have two equations for two unknowns and therefore stop checking for higher-order-term equations.
\begin{align} eq. 2:& b=
-3 | |
\Delta |
\alpha, → \\ eq. 1:& -6\alpha+1+2\alpha=0, → \\ &\alpha=
1 | |
4 |
, and, → \\ &b=-
3 | |
4\Delta |
, \end{align}
which is indeed the scheme from the example.
f'i
4th order central scheme:
1 | |
4 |
f'i-1+f'i+
1 | |
4 |
f'i+1=
3 | |
2 |
fi+1-fi-1 | |
2\Delta |
.
6th order central scheme:
1 | |
3 |
f'i-1+f'i+
1 | |
3 |
f'i+1=
14 | |
9 |
fi+1-fi-1 | |
2\Delta |
+
1 | |
9 |
fi+2-fi-2 | |
4\Delta |
.