Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discontinuous Galerkin #8

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
06ee49e
Start on DG
IanHawke Feb 18, 2019
9699afe
More on DG.
IanHawke Feb 18, 2019
2307fb8
Correct TeX issue.
IanHawke Feb 18, 2019
d152b43
Correct fluxes, stiffness matrix.
IanHawke Feb 18, 2019
fead422
End of modal part.
IanHawke Feb 18, 2019
2f6e7b4
Typo
IanHawke Feb 18, 2019
299c900
Fix state vector defn.
IanHawke Feb 18, 2019
ab488ff
Start on nodal DG.
IanHawke Feb 19, 2019
20aa001
More on Vandermonde matrix.
IanHawke Feb 19, 2019
0b6cdbd
Refactor to make modal/nodal clearer.
IanHawke Feb 25, 2019
3c66352
Correct bold math. Note: adds new package.
IanHawke Feb 25, 2019
9127f9b
Finish nodal DG description
IanHawke Feb 25, 2019
e62b856
Some DG exercises
IanHawke Feb 26, 2019
04b90f4
Some figures for DG
IanHawke Mar 4, 2019
9d6e285
More DG figures
IanHawke Mar 4, 2019
ca9b177
Fixed figure
IanHawke Mar 4, 2019
8b197bc
Put in figures and text explaining it. Needs other branch WENO correc…
IanHawke Mar 4, 2019
2784b0e
Add references.
IanHawke Mar 5, 2019
96e76a9
Typo
IanHawke Mar 5, 2019
b82d2ae
Update figure with fixed legend
IanHawke Mar 5, 2019
2f594ba
Update efficiency figure
IanHawke Mar 5, 2019
07fa183
Updated efficiency figure
IanHawke Mar 6, 2019
3c1c3d6
Update text for latest efficiency figure.
IanHawke Mar 6, 2019
4184d25
Merge branch 'dg' of github.com:IanHawke/numerical_exercises into dg
IanHawke Mar 6, 2019
f1a440c
Typo
IanHawke Mar 6, 2019
95517af
Update annotated plot
IanHawke Mar 6, 2019
a350143
Correct reference for moment limiting
IanHawke Mar 7, 2019
f93d305
DG Euler figures
IanHawke Mar 7, 2019
331fabc
Merge branch 'dg' of github.com:IanHawke/numerical_exercises into dg
IanHawke Mar 7, 2019
9a0f0ce
Brief text on DG methods for Euler.
IanHawke Mar 8, 2019
186492a
Typo in figure ref.
IanHawke Mar 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CompHydroTutorial.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
% code listings
\usepackage[procnames]{listings}

\lstset{basicstyle=\ttfamily\small,
\lstset{basicstyle=\ttfamily\small,
keywordstyle=\color{keywords},
commentstyle=\color{comments},
stringstyle=\color{red},
Expand All @@ -36,6 +36,9 @@
% AMS symbols
\usepackage{amsmath,amssymb}

% Bold math symbols
\usepackage{bm}

% for forcing a figure to appear on a single page
% see http://tex.stackexchange.com/questions/109219/force-position-of-full-page-sized-figure
\usepackage{afterpage}
Expand Down
838 changes: 761 additions & 77 deletions advection/advection-higherorder.tex

Large diffs are not rendered by default.

Binary file added higher-order/dg_convergence_sine.pdf
Binary file not shown.
Binary file added higher-order/dg_grid.pdf
Binary file not shown.
Binary file added higher-order/dg_limiter.pdf
Binary file not shown.
Binary file added higher-order/dg_shock_entropy_m3_N128.pdf
Binary file not shown.
Binary file added higher-order/dg_shock_entropy_m3_N256.pdf
Binary file not shown.
Binary file added higher-order/dg_sod_128.pdf
Binary file not shown.
Binary file added higher-order/dg_sod_32.pdf
Binary file not shown.
Binary file added higher-order/dg_weno_efficiency.pdf
Binary file not shown.
113 changes: 113 additions & 0 deletions higher-order/higher-order-euler.tex
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,116 @@ \subsection{Extensions}
by maximising over the characteristic speed within the stencil at that point, is
less diffusive but slightly more expensive. Roe-style flux splittings are
possible but not always stable.


\section{Discontinuous Galerkin methods for the Euler equations}
\label{sec:dg_euler}

The Discontinuous Galerkin methods introducted in section~\ref{sec:dg} extend to
nonlinear systems directly. For a nonlinear scalar conservation law,
%
\begin{equation}
q_t + f(q)_x = 0,
\end{equation}
%
the Discontinuous Galerkin method becomes
%
\begin{equation}
\label{eq:dg_nodal_scalar_nonlinear}
M \ddt{\bm{\hat{q}}} + S^T f (\bm{\hat{q}}) = -\left[ \bm{\psi F} \right]_{x_{j-1/2}}^{x_{j+1/2}}.
\end{equation}
%
This should be compared with equation~\eqref{eq:dg_nodal_final}
%
\begin{equation}
\tag{\ref{eq:dg_nodal_final}}
M \ddt{\bm{\hat{a}}} + S^T u \bm{\hat{a}} = -\left[ \bm{\psi F} \right]_{x_{j-1/2}}^{x_{j+1/2}}
\end{equation}
%
for the advection equation with advection speed $u$. The crucial change is that
the stiffness matrix $S$ is now multiplying the nonlinear flux term, and the
boundary flux on the right hand side now needs a nonlinear Riemann solver or an
appropriate approximation. The Lax-Friedrichs flux is often used here. Extending
to a system of nonlinear conservation laws means applying the above scheme
component-by-component, either directly to the conserved variables, or by
transforming to the characteristic variables.

\begin{figure}[t]
\centering
% figure generated by hydro_examples/compressible/dg_euler.py
\includegraphics[width=0.8\linewidth]{dg_sod_32}
\caption[Discontinuous Galerkin methods applied to the Sod problem, low resolution]
{\label{fig:dg-euler-sod32} Various Discontinuous Galerkin methods, using moment
limiting, applied to the Sod problem with $N=32$. We see that the method
struggles near discontinuities, and that increasing $m$ alone does not improve
the results.\\
\hydroexdoit{\href{https://github.com/zingale/hydro_examples/blob/master/compressible/dg_euler.py}{dg\_euler.py}}}
\end{figure}
%

\begin{figure}[t]
\centering
% figure generated by hydro_examples/compressible/dg_euler.py
\includegraphics[width=0.8\linewidth]{dg_sod_128}
\caption[Discontinuous Galerkin methods applied to the Sod problem, high resolution]
{\label{fig:dg-euler-sod128} Various Discontinuous Galerkin methods, using moment
limiting, applied to the Sod problem with $N=128$. We see that the method
now has enough resolution to produce good results, but that increasing $m$ alone
still does not improve the results.\\
\hydroexdoit{\href{https://github.com/zingale/hydro_examples/blob/master/compressible/dg_euler.py}{dg\_euler.py}}}
\end{figure}
%

The strength of the Discontinuous Galerkin method is its high order accuracy and
minimal coupling to neighbouring cells. Its weakness is its behaviour near
discontinuities. As many tests of the Euler equations seen above focus on
results involving shocks, we will not see the DG methods at their best. For
example, in Figures~\ref{fig:dg-euler-sod32} and \ref{fig:dg-euler-sod128} the
Sod problem is solved. The DG method and limiting is applied directly to the
conserved variables. At low resolution the method struggles. There are so few
cells covering the shock and contact that it has difficulty clearly resolving
the jumps, although the oscillations are not large enough to be problematic. As
the resolution is increased the results are much improved, but in both cases it
is the increased resolution through the number of grid cells $N$ rather than the
number of modes $m$ that is important. The is in complete contrast with the
smooth solutions seen for the advection equation, where the larger gains were
seen by increasing $m$.

\begin{figure}[t]
\centering
% figure generated by hydro_examples/compressible/dg_euler.py
\includegraphics[width=0.8\linewidth]{dg_shock_entropy_m3_N128}
\caption[Discontinuous Galerkin methods applied to the shock-entropy problem, low resolution]
{\label{fig:dg-euler-shockentropy-m3-N128} The shock-entropy interaction problem,
solve using Discontinuous Galerkin methods with moment limiting, with $m=3$ and
$N=128$. We see that the method is excellent at resolving the smooth features to
the right, which have not interacted with the shock. The finer features just
after the shock are not well captured. Modifying $m$ has little effect here. The
reference solution uses a WENO method with $r=4$ and $N=1024$.\\
\hydroexdoit{\href{https://github.com/zingale/hydro_examples/blob/master/compressible/dg_euler.py}{dg\_euler.py}}}
\end{figure}
%

\begin{figure}[t]
\centering
% figure generated by hydro_examples/compressible/dg_euler.py
\includegraphics[width=0.8\linewidth]{dg_shock_entropy_m3_N256}
\caption[Discontinuous Galerkin methods applied to the shock-entropy problem, high resolution]
{\label{fig:dg-euler-shockentropy-m3-N256} The shock-entropy interaction problem,
solve using Discontinuous Galerkin methods with moment limiting, with $m=3$ and
$N=256$. The results are similar to Figure~\ref{fig:dg-euler-shockentropy-m3-N128}
but there is now sufficient resolution to capture the finer features after the
shock.\\
\hydroexdoit{\href{https://github.com/zingale/hydro_examples/blob/master/compressible/dg_euler.py}{dg\_euler.py}}}
\end{figure}
%

A test that better captures the advantages as well as the disadvantages of these
methods is the shock-entropy interaction test. A right-going shock interacts
with an entropy wave, with the final results showing both smooth features (that
should be captured well by high order schemes) and shocks (which are more
problematic). Results are shown in Figures~\ref{fig:dg-euler-shockentropy-m3-N128}
and \ref{fig:dg-euler-shockentropy-m3-N256}. The smooth features are mostly
extremely well captured even at these low resolutions, \emph{except} immediately
after the shock. Here again varying $m$ has limited impact, and the crucial
thing is to increase $N$ until the features are resolvable.
31 changes: 31 additions & 0 deletions refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -1154,3 +1154,34 @@ @techreport{Shu1997
url = {https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19980007543.pdf},
year = {1997}
}

@book{hesthaven2018numerical,
title={Numerical methods for conservation laws: From analysis to algorithms},
author={Hesthaven, Jan S},
volume={18},
year={2018},
publisher={SIAM},
url={https://books.google.co.uk/books?id=uyZKDwAAQBAJ&lpg=PR2&ots=udFqVc-kcT}
}

@article{burbeau2001problem,
title={{A problem-independent limiter for high-order Runge--Kutta discontinuous Galerkin methods}},
author={Burbeau, Anne and Sagaut, Pierre and Bruneau, Ch-H},
journal={Journal of Computational Physics},
volume={169},
number={1},
pages={111--150},
year={2001},
publisher={Elsevier}
}

@article{biswas1994parallel,
title={Parallel, adaptive finite element methods for conservation laws},
author={Biswas, Rupak and Devine, Karen D and Flaherty, Joseph E},
journal={Applied Numerical Mathematics},
volume={14},
number={1-3},
pages={255--283},
year={1994},
publisher={Elsevier}
}