Commit fb3d288a authored by Julio's avatar Julio
Browse files

JUC: updated notes. I obtained the 4th order scheme. I now need to improve the...

JUC: updated notes. I obtained the 4th order scheme. I now need to improve the text and implement it.
parent 51ac7422
......@@ -107,14 +107,130 @@ and the following at the boundary:
\left( \frac{\partial u}{\partial x} \right)_0 \approx \frac{1}{2}\left[ \left( \frac{\partial u}{\partial x} \right)_{\nicefrac{1}{2}} + \left( \frac{\partial u}{\partial x} \right)_{-\nicefrac{1}{2}} \right].
\end{align}
\subsection{Own approach}
\subsection*{Own approach}
We will use the following fourth order Compact Finite Differences approximation:
First, we will use the chain rule
\begin{align}
\frac{du}{dx}\Big|_{n} = \frac{du}{d\xi}\Big|_{n} \cdot \frac{d\xi}{dx}\Big|_{n}
\end{align}
for the second term on the right hand side, we can use the mapping between grids:
\begin{align}
x(\xi) = -c \ln(1-\xi) &\iff \xi(x) = 1 - e^{-\nicefrac{x}{c}}
\end{align}
and calculate its derivative
\begin{align}
\frac{\partial \xi}{\partial x}\Big|_n &= \frac{1}{c} e^{-\nicefrac{x}{c}}\Big|_n = \frac{1}{c}\left( 1 - \xi \right) = \frac{1}{c}\left( 1 - \frac{n}{N} \right).
\end{align}
We then have
\begin{align}
\frac{du}{dx}\Big|_{n} = \frac{du}{d\xi}\Big|_{n} \cdot \frac{1}{c}\left( 1 - \frac{n}{N} \right)
\end{align}
We will approximate the remaining term by using the following fourth order Compact Finite Differences approximation, the so-called Pade's approximation:
\begin{align*}
- 2 \frac{\partial u}{\partial \xi}\Big|_{n-\nicefrac{1}{2}} + \frac{\partial u}{\partial \xi}\Big|_{n} - 2 \frac{\partial u}{\partial \xi}\Big|_{n+\nicefrac{1}{2}} = -\frac{3}{4d} \left( u_{n+1} - u_{n-1} \right)
\frac{1}{4} \frac{\partial u}{\partial \xi}\Big|_{n-1} + \frac{\partial u}{\partial \xi}\Big|_{n} + \frac{1}{4}\frac{\partial u}{\partial \xi}\Big|_{n+1} = \frac{3}{4d} \left( u_{n+1} - u_{n-1} \right)
\end{align*}
obtained from the paper ``Compact Finite Difference Schemes with Spectral-like Resolution'' by Sanjiva K. Lele.
with $d = \xi_{1} - \xi_{0}$, for the interior points, i.e. $0 < n < N-1$ and
\begin{align*}
\frac{\partial u}{\partial \xi}\Big|_{0} + 3\frac{\partial u}{\partial \xi}\Big|_{1} = \frac{1}{d} \left( -\frac{17}{6}u_{1} + \frac{3}{2}u_{2} + \frac{3}{2}u_3 - \frac{1}{6}u_4 \right)
\end{align*}
for the left boundary. This scheme is obtained from the paper ``\emph{Compact Finite Difference Schemes with Spectral-like Resolution}'' by Sanjiva K. Lele, taking a fourth order approximation on both the boundary and the interior points.
Therefore, we get the following system
\begin{align*}
\underbrace{
\begin{bmatrix}
1 & 3 & 0 & 0 & 0 & \dots & 0 \\
\nicefrac{1}{4} & 1 & \nicefrac{1}{4} & 0 & 0 & \ddots & 0 \\
0 & \nicefrac{1}{4} & 1 & \nicefrac{1}{4} & 0 & \ddots & 0 \\
0 & 0 & \nicefrac{1}{4} & 1 & \nicefrac{1}{4} & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
0 & \dots & \dots & \dots & 0 & \nicefrac{1}{4} & 1
\end{bmatrix}}_{=:M}
\underbrace{
\begin{bmatrix}
\frac{\partial u}{\partial \xi}\Big|_{0} \\
\frac{\partial u}{\partial \xi}\Big|_{1} \\
\frac{\partial u}{\partial \xi}\Big|_{2} \\
\vdots \\
\frac{\partial u}{\partial \xi}\Big|_{N-2}
\end{bmatrix}}_{=:\frac{\partial \bf{u}}{\partial \xi}}
+
\begin{bmatrix}
0 \\
0 \\
0 \\
\vdots \\
\cancelto{0}{\frac{\partial u}{\partial \xi}\Big|_{N-1}}
\end{bmatrix}
= \\
+ \frac{1}{d}
\underbrace{
\begin{bmatrix}
-\nicefrac{17}{6} & \nicefrac{3}{2} & \nicefrac{3}{2} & -\nicefrac{1}{6} & 0 & \dots & 0 \\
-\nicefrac{3}{4} & 0 & \nicefrac{3}{4} & 0 & 0 & \ddots & 0 \\
0 & -\nicefrac{3}{4} & 0 & \nicefrac{3}{4} & 0 & \ddots & 0 \\
0 & 0 & -\nicefrac{3}{4} & 0 & \nicefrac{3}{4} & \ddots & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
0 & \dots & \dots & \dots & 0 & -\nicefrac{3}{4} & 0
\end{bmatrix}}_{=:A}
\underbrace{
\begin{bmatrix}
u_{0} \\
u_{1} \\
u_{2} \\
\vdots \\
u_{N-2}
\end{bmatrix}}_{=:\bf{u}}
+
\begin{bmatrix}
0 \\
0 \\
0 \\
\vdots \\
\cancelto{0}{u_{N-1}}
\end{bmatrix}
\end{align*}
in short
\begin{align*}
M \frac{\partial \bf{u}}{\partial \xi} = \frac{1}{d} A \bf{u},
\end{align*}
therefore
\begin{align*}
\frac{\partial \bf{u}}{\partial \xi} = \frac{1}{d} M^{-1} A \bf{u}.
\end{align*}
which can be used in the expression of the $x-$derivative
\begin{align}
\frac{\partial \textbf{u}}{\partial x} = \mathcal{G} \frac{\partial\bf{u}}{\partial\xi} \approx \frac{1}{d} \mathcal{G} M^{-1} A \bf{u}.
\end{align}
where
\begin{align}
\mathcal{G} :=
\begin{bmatrix}
\frac{\partial \xi}{\partial x}\Big|_0 & 0 & 0 & \dots & 0 \\
0 & \frac{\partial \xi}{\partial x}\Big|_1 & 0 & \dots & 0 \\
0 & 0 & \frac{\partial \xi}{\partial x}\Big|_2 & \dots & 0 \\
\vdots & \ddots & \ddots & \ddots & \vdots \\
0 & \dots & \dots & 0 & \frac{\partial \xi}{\partial x}\Big|_{N-1}
\end{bmatrix}
\end{align}
which is a first-derivative operator of order 4. We will then obtain a second order operator by considering this first-derivative operator twice,
\begin{align}
\frac{\partial}{\partial x} \left( \frac{\partial \bf{u}}{\partial x} \right) &\approx \frac{1}{d} \mathcal{G} M^{-1} A \frac{\partial \bf{u}}{\partial x} \approx \\
&\approx\left(\frac{1}{d} \mathcal{G} M^{-1} A \right) \left( \frac{1}{d} \mathcal{G} M^{-1} A\right) \textbf{u} = \frac{1}{d^2} \left( \mathcal{G} M^{-1} A \right)^2 \bf{u}
\end{align}
\end{document}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment