Merge branch 'master' of masterduck.fspanier.de:fspanier/teaching
# Conflicts: # nummeth-ws22/skript.tex
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
\documentclass[12pt,a4paper]{uebungen}
|
||||
\usepackage{german}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{epsfig}
|
||||
\usepackage[amssymb]{SIunits}
|
||||
\usepackage{wrapfig}
|
||||
\usepackage{graphics}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{pgf}
|
||||
\usepackage{listings}
|
||||
\lstset{language=[ANSI]C++,basicstyle=\ttfamily,commentstyle=\itshape,
|
||||
keywordstyle=\bfseries,extendedchars=true,backgroundcolor=\color{gray}}
|
||||
|
||||
%------------------------------------------------------------------------------
|
||||
%\graphicspath{{../../../GALLERY/}}
|
||||
%------------------------------------------------------------------------------
|
||||
\setlength{\topmargin}{-2.5cm}
|
||||
\setlength{\textheight}{26.0cm}
|
||||
\setlength{\textwidth}{17cm}
|
||||
\setlength{\oddsidemargin}{-0.5cm}
|
||||
\setlength{\evensidemargin}{-0.5cm}
|
||||
\setlength{\parskip}{0pt}
|
||||
\setlength{\parindent}{0pt}
|
||||
\pagestyle{empty}
|
||||
%------------------------------------------------------------------------------
|
||||
\newcommand{\vt}[1]{\vec{#1}}
|
||||
\newcommand{\mt}[1]{\underline{\underline{#1}}}
|
||||
\newcommand{\dt}[1]{\left\vert\underline{\underline{#1}}\right\vert}
|
||||
\newcommand{\mo}{\!\!\!\!\!-1}
|
||||
%------------------------------------------------------------------------------
|
||||
\def\bbbr{{\rm I\!R}}
|
||||
%------------------------------------------------------------------------------
|
||||
\begin{document}
|
||||
%------------------------------------------------------------------------------
|
||||
\thispagestyle{myheadings}
|
||||
\begin{center}
|
||||
{\bf \underline{\Large Exercises in ``Numerical Methods in Plasma Astrophysics''}}\\
|
||||
%\hfill\\
|
||||
%{\bf \large }\\
|
||||
\hfill\\
|
||||
{\bf \large Winter 2022/23 \hfill Exercise 5}\\
|
||||
\end{center}
|
||||
\noindent
|
||||
%
|
||||
\section*{\large Exercise 5: Sod shock tube}\vspace*{-0.0cm}
|
||||
%
|
||||
|
||||
After we have learned in the last exercise that some methods are better suited to simulate
|
||||
are better suited to simulating shocks than others, let's approach the problem a little more realistically.
|
||||
|
||||
Let us assume a one-dimensional pipe filled with an ideal gas, which is defined by
|
||||
the parameters $\rho$ (density), $P$ (pressure) and $u$ (flow).
|
||||
are described. They behave according to the Euler equation (in
|
||||
conservation form):
|
||||
|
||||
\begin{equation}
|
||||
\frac{\partial}{\partial t}
|
||||
\left( \begin{array}{c} \rho \\ \rho u\\ \frac{1}{2}\rho u^2 \end{array} \right)
|
||||
+ \frac{\partial}{\partial x} \left( \begin{array}{c} \rho u\\ P + \rho u^2 \\ (P+ \frac{1}{2}\rho u^2) u\end{array} \right) = 0
|
||||
\end{equation}
|
||||
|
||||
(Where the adiabatic equation $P = \rho^\gamma$ with $\gamma = \frac{5}{3}$ closes the system of equations).
|
||||
|
||||
\medskip
|
||||
Let fixed values for these parameters be given at the left and right ends of the pipe.
|
||||
|
||||
\begin{equation}
|
||||
\left( \begin{array}{c}\rho_L\\P_L\\u_L\end{array}\right)
|
||||
=
|
||||
\left( \begin{array}{c}1.0\\1.0\\0.0\end{array} \right)
|
||||
, \quad
|
||||
\left( \begin{array}{c}\rho_R\\P_R\\u_R\end{array}\right)
|
||||
=
|
||||
\left( \begin{array}{c}0.125\\0.1\\0.0\end{array}\right)
|
||||
\end{equation}
|
||||
|
||||
At the beginning of the simulation, let the entire left or right half of the tube be
|
||||
is filled with the respective state and separated by a membrane, which is
|
||||
suddenly removed - a shock is formed.
|
||||
|
||||
\bigskip
|
||||
|
||||
\textbf{a)} Linearise the Euler equation so that it has the form
|
||||
|
||||
\begin{equation}
|
||||
\frac{\partial \vec{s}}{\partial t} + \mathbf{A}(s) \frac{\partial \vec{s}}{\partial x} = 0
|
||||
\end{equation}
|
||||
|
||||
with the state vector $\vec{s} = \left( \begin{array}{c} \rho\\ \rho u\\ \frac{1}{2}\rho u^2\end{array} \right)$ assumes.
|
||||
|
||||
\bigskip
|
||||
\textbf{b)} Simulate the Sod Shock Tube scenario with Upwind,
|
||||
Lax-Wendroff and Leapfrog methods. Compare numerical diffusivity
|
||||
and stability.
|
||||
|
||||
\vfill
|
||||
|
||||
No bathing ducks were endangered in the preparation of this exercise sheet. Except
|
||||
the ones that were already in the tube. What are they looking for? For real.
|
||||
|
||||
|
||||
\end{document}
|
||||
%------------------------------------------------------------------------------
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
+247
-20
@@ -3407,29 +3407,256 @@ There are examples, however, when the CFL condition is not sufficient for stabil
|
||||
|
||||
\subsection{Upwind methods}
|
||||
|
||||
For the scalar advection equation with $a > 0$, the one-sided method
|
||||
For scalar advetion equations with $a>0$, the one-sided method
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n - \frac{a k}{h}\left(U_j^n - U_{j-1}^n \right)
|
||||
U_j^{n+1} = U_j^n - \frac{k}{h} a (U_{j+1}^n -U_j^n)
|
||||
\end{align}
|
||||
can be applied and is stable provided the CFL condition is satisfied. This method is usually called the first order upwind method, since the one-sided stencil points in the ``upwind'' or
|
||||
``upstream'' direction, the correct direction from which characteristic information propagates. If we think of the advection equation as modeling the advection of a concentration profile in a
|
||||
fluid stream, then this is literally the upstream direction.
|
||||
Similarly, the method (10.51) is the upwind method for the advection equation with
|
||||
a<0.
|
||||
For a system of equations, we have seen that a one-sided method can only be used if
|
||||
all of the eigenvalues of A have the same sign. This is typically not the case in practice.
|
||||
In the linearized Euler equations, for example, the eigenvalues of f(u) are v, v ± c and
|
||||
these all have the same sign only if jvj > c. In this case the fluid speed is greater than the
|
||||
sound speed and the flow is said to be supersonic. If lvi < c then the flow is subsonic
|
||||
and any one-sided method will he unstable since there are sound waves propagating in
|
||||
both directions and the CFL condition is violated.
|
||||
When computing discontinuous solutions, upwind differencing turns out to be an important tool, even for indefinite systems with eigenvalues of mixed sign. The appropriate
|
||||
application of upwind methods requires some sort of decomposition into characteristic
|
||||
fields. For example, if we change variables and decouple the linear system into (10.47),
|
||||
then each of the resulting scalar problems can be solved with an appropriate upwind
|
||||
method, using the point to the left when .\p > 0 or to the right when Ap < 0.
|
||||
This method can be written in a compact form if we introduce the notation
|
||||
can be applied ans is stable provided the CFl condition is satisfied. This method is usually called the first order upwind method, since the one-sided stencil points in the \emph{upwind} or \emph{upstream} direction, the correct direction from which characteristic information propagates. If we think of the advection equation as modeling hte advection of a concentration profile in a fluid stream, then this is literally the upstream direction.
|
||||
|
||||
Similarly
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n - \frac{k}{h} a (U_{j}^n -U_{j-1}^n)
|
||||
\end{align}
|
||||
is the upwind method for the advection equation with $a<0$.
|
||||
|
||||
For a system of equations, we have seen that a one-sided method can only be used if all of the eigenvalues of A have the same sign. Ths is typically not the case in practice. In the linearized Euler equations, for example, the eigenvalues of $f^\prime(u)$ are $v, v\pm c$ and these all have the same sign only if $|v|>c$. In this case the fluid speed is greater than the sound speed and the flow is said to be supersonic. If $|v|<c$ then the flow is subsonic and any one-sided method will be unstable since there are sound waves propagating in both directions and the CFL condition is violated.
|
||||
|
||||
When computing discontinuous solutions, upwind differencing turns out to be an important tool, even for indefinite systems with eigenvalues of mixed sign. The appropriate application of upwind methods requires some sort of decomposition into characteristic fields. For example, if we change variables and decouple the linear system into
|
||||
\begin{align}
|
||||
\partial_t v - \Lambda \partial_x v = 0
|
||||
\end{align}
|
||||
the each of the resulting scalar problems can be solved with an appropriate upwind method, using the point to the left, when $\lambda_p>0$ or to the right when $\lambda_p <0$.
|
||||
|
||||
\section{Computing Discontinuous Solutions}
|
||||
|
||||
For conservations laws we are naturally interested in the difficulties caused by discontinuities in the solution. In the linear theory presented so far we have assumed smooth solutions, and used this in our discussion of the truncation error and the convergence proof. We now consider what happens when we apply a numerical method to a linear problem with discontinuous initial data, e.g., the Riemann problem for the scalar advection equation
|
||||
\begin{align}
|
||||
\partial_t u + a \partial_x u &= 0\label{eq:leveque11.1}\\
|
||||
u_0(x) &= \begin{cases} 1 & x<0\\ 0 & x>0\end{cases}
|
||||
\end{align}
|
||||
Of course the exact solution is simply $u_0(x-at)$, but we expect our numerical method to have difficulty near the discontinuity. Note for example that a finite difference approximation to $\partial_x u$ applied across the discontinuity in the true solution will blow up as $h\to 0$.
|
||||
\begin{align}
|
||||
\frac{u(a t + h, t) - u (a t -h,t)}{2h} = \frac{0-1}{2 h} \to -\infty \ \text{as} \ h \to 0
|
||||
\end{align}
|
||||
The local truncation error does not vanish as $h\to 0$ and the proof of convergence presented before breaks down. This proof can be rescued by considering approximations $u^\epsilon_0(x)$ to $u_0(x)$ that are smooth and approach $u_0$ as $\epsilon \to 0$. Although convergence can be again be proven for a stable and consistent method, the \emph{rate} of convergence may be considerably less than what is expected from the \glqq order \grqq of the method as defined by its behavior on smooth solutions. Moreover, the numerical solution may look very unsatisfactory on any particular finite grid.
|
||||
|
||||
Figures \ref{fig:leveque_11.1} and \ref{fig:leveque_11.2} show numerical solutions to the Riemann problem \eqref{eq:leveque11.1} computed with some of the standard methods discussed in the previous chapter. In all cases
|
||||
$a = 1, k/h = 0.5$ and the results are plotted at time $t = 0.5$ along with the exact solution.
|
||||
In Figure \ref{fig:leveque_11.1}, $h = 0.01$ while a finer grid with $h = 0.0025$ is used in Figure \ref{fig:leveque_11.2}. Notice that the first order methods (Lax-Friedrichs and upwind) give very smeared solutions
|
||||
while the second order methods (Lax-Wendroff and Beam-Warming) give oscillations.
|
||||
This behavior is typical.
|
||||
|
||||
|
||||
\begin{figure}
|
||||
\begin{center}
|
||||
\pgfimage[width=0.8\textwidth]{fig_chapter5/leveque_11.1.png}
|
||||
\end{center}
|
||||
\caption{Numerical and exact solution to \eqref{eq:leveque11.1} with $h = 0.01$ and the following
|
||||
methods: (a) Lax-Friedrichs, (b) Upwind, (c) Lax-Wendroff, (d) Beam-Warming.}
|
||||
\label{fig:leveque_11.1}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}
|
||||
\begin{center}
|
||||
\pgfimage[width=0.8\textwidth]{fig_chapter5/leveque_11.2.png}
|
||||
\end{center}
|
||||
\caption{Numerical and exact solution to \eqref{eq:leveque11.1} with $h = 0.0025$ and the following
|
||||
methods: (a) Lax-Friedrichs, (b) Upwind, (c) Lax-Wendroff, (d) Beam-Warming.}
|
||||
\label{fig:leveque_11.2}
|
||||
\end{figure}
|
||||
|
||||
If we compute the 1-norm error in these computed solutions we do not see the expected
|
||||
rates of convergence. Instead the \glqq first order\grqq methods converge with an error that is
|
||||
$\mathcal{O}(k^{1/2})$ while the \glqq second order\grqq methods have an error that is $\mathcal{O}(k^{2/3})$ at best. These convergence rates can be proved for very general initial data by a careful analysis using
|
||||
smooth approximations. An indication of why this should be so will be given later in this
|
||||
chapter.
|
||||
|
||||
\subsection{Modified equation}
|
||||
|
||||
useful technique for studying the behavior of solutions to difference equations is to
|
||||
model the difference equation by a differential equation. Of course the difference equation
|
||||
was originally derived by approximating a PDE, and so we can view the original PDE
|
||||
as a model for the difference equation, but there are other differential equations that are
|
||||
better models. In other words, there are other PDEs that the numerical method solves
|
||||
more accurately than the original PDE.
|
||||
|
||||
At first glance it may seem strange to approximate the difference equation by a PDE.
|
||||
The difference equation was introduced in the first place because it is easier to solve
|
||||
than the PDE. This is true if we want to generate numerical approximations, but on
|
||||
the other hand it is often easier to predict the qualitative behavior of a PDE than of
|
||||
a system of difference equations. At the moment it is the qualitative behavior of the
|
||||
numerical methods that we wish to understand.
|
||||
|
||||
The derivation of the modified equation is closely related to the calculation of the
|
||||
local truncation error for a given method. Consider Lax-Friedrichs, for example, where
|
||||
we calculated the local truncation error $L_k(x, t)$. Since $u(x, t)$ is taken to be
|
||||
the exact solution to $\partial_t u+ A\partial x u = 0$, we found that $L_k(x, t) = \mathcal{O}(k)$. However, if we instead take $u(x, t)$ to be the solution of the PDE
|
||||
\begin{align}
|
||||
\partial_t u + A \partial_x u + \frac{1}{2}\left(k\partial_t^2 -\frac{h^2}{k}\partial_x^2 u \right) = 0
|
||||
\end{align}
|
||||
then the truncation error would be $\mathcal{O}(k^3)$. We conclude that the Lax-Friedrichs method
|
||||
produces a second order accurate approximation to the solution of this PDE. This equation is
|
||||
called a modified equation for the Lax-Friedrichs method. (The term "model equation"
|
||||
is also sometimes used.)
|
||||
|
||||
\section{Conservative Methods for Nonlinear Problems}
|
||||
|
||||
When we attempt to solve nonlinear conservation laws numerically we run into additional
|
||||
difficulties not seen in the linear equation. Moreover, the nonlinearity makes everything
|
||||
harder to analyze. In spite of this, a great deal of progress has been made in recent years.
|
||||
|
||||
For smooth solutions to nonlinear problems, the numerical method can often be linearized
|
||||
and results from the theory of linear finite difference methods applied to obtain
|
||||
convergence results for nonlinear problems. We will not pursue this topic here since we are
|
||||
primarily interested in discontinuous solutions, for which very reasonable looking finite
|
||||
difference methods can easily give disasterous results that are obviously (or sometimes,
|
||||
not so obviously) incorrect.
|
||||
|
||||
We have already seen some of the difficulties caused by discontinuous solutions even
|
||||
in the linear case. For nonlinear problems there are additional difficulties that can arise:
|
||||
\begin{itemize}
|
||||
\item The method might be "nonlinearly unstable", i.e., unstable on the nonlinear problem
|
||||
even though linearized versions appear to be stable. Often oscillations will trigger
|
||||
nonlinear instabilities.
|
||||
\item The method might converge to a function that is not a weak solution of our original
|
||||
equation (or that is the wrong weak solution, i.e., does not satisfy the entropy
|
||||
condition).
|
||||
\end{itemize}
|
||||
The fact that we might converge to the wrong weak solution is not so surprising -
|
||||
if there is more than one weak solution why should we necessarily converge to the right
|
||||
one? (We must make sure that the finite difference approximations satisfy some discrete
|
||||
form of the entropy condition, as we will do later.)
|
||||
|
||||
The fact that we might converge to a function that is not a weak solution at all is more
|
||||
puzzling, but goes back to the fact that it is possible to derive a variety of conservation
|
||||
laws that are equivalent for smooth solutions but have different weak solutions. For example the PDEs
|
||||
\begin{align}
|
||||
\partial_t u + \partial_x (1/2 u^2) &= 0 \label{eq:leveque12.1}
|
||||
\end{align}
|
||||
and
|
||||
\begin{align}
|
||||
\partial_t (u^2) + \partial_x (2/3 u^3) &= 0 \label{eq:leveque12.2}
|
||||
\end{align}
|
||||
have exactly the same smooth solutions, but the Rankine-Hugoniot condition gives different
|
||||
shock speeds, and hence different weak solutions.
|
||||
|
||||
Consider a finite difference method that is consistent with one of these equations,
|
||||
say \eqref{eq:leveque12.1}, using the same definition of consistency as for linear problems (expand in
|
||||
Taylor series, etc.). Then the method is also consistent with \eqref{eq:leveque12.2} since the Taylor series
|
||||
expansion (which assumes smoothness) gives the same result in either case. So the method
|
||||
is consistent with both \eqref{eq:leveque12.1} and \eqref{eq:leveque12.2} and while we might then expect the method to
|
||||
converge to a function that is a weak solution of both, that is impossible when the two
|
||||
weak solutions differ.
|
||||
|
||||
Example: If we write the Burgers' equation \eqref{eq:leveque12.1} in the quasilinear form
|
||||
\begin{align}
|
||||
\partial_t u + u \partial_x u
|
||||
\end{align}
|
||||
then a natural finite difference method, obtained by a minor modification of the upwind method for $\partial_t u + a \partial_x u = 0$ (and assuming $U_j^n \geq 0$ for all $j, n$) is
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n - \frac{k}{h}U_j^n(U_j^n - U_{j-1}^n)\label{eq:leveque12.4}
|
||||
\end{align}
|
||||
This method adequate for smooth solutions but will not, in general, converge to
|
||||
a discontinuous weak solution of Burgers' equation \eqref{eq:leveque12.1} as the grid is refined. Consider,
|
||||
for example, the data from
|
||||
\begin{align}
|
||||
U_j^0 = \begin{cases} 1 & j< 0 \\ 0 & j\geq 0\end{cases}
|
||||
\end{align}
|
||||
Then it is easy to verify from \eqref{eq:leveque12.4} that $U_j^1 = U_j^0$ for all $j$. This happens in every
|
||||
successive step as well and so $U_j^n = U_j^0$ for all $j$ and $n$, regardless of the step sizes $k$ and
|
||||
$h$. As the grid is refined, the numerical solution thus converges very nicely to the function
|
||||
u(x, t) = uo(x). This is not a weak solution of \eqref{eq:leveque12.1} (or of \eqref{eq:leveque12.2} either).
|
||||
|
||||
In this example the solution is obviously wrong, but similar behavior is seen with other
|
||||
initial data that may give reasonable looking results that are incorrect. Figure \ref{fig:leveque_12.1} shows
|
||||
the true and computed solutions at time $t = 1$ with Riemann data $u_l = 1.2$ and $u_r = 0.4$.
|
||||
We get a nice looking solution propagating at entirely the wrong speed.
|
||||
|
||||
|
||||
|
||||
\begin{figure}
|
||||
\begin{center}
|
||||
\pgfimage[width=0.8\textwidth]{fig_chapter5/leveque_12.1.png}
|
||||
\end{center}
|
||||
\caption{True and computed solutions to Burgers' equation using a nonconservative
|
||||
method.}
|
||||
\label{fig:leveque_12.1}
|
||||
\end{figure}
|
||||
|
||||
|
||||
\subsection{Conservative Methods}
|
||||
|
||||
Luckily, there turns out to be a very simple and natural requirement we can impose on
|
||||
our numerical methods which will guarantee that we do not converge to non-solutions.
|
||||
This is the requirement that the method be in conservation form, which means it has
|
||||
the form
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n - \frac{k}{h}\left[F(U_{j-p}^n,U_{j-p+1}^n,\dots, U_{j+q}^n) - F(U_{j-p-1}^n,U_{j-p+1}^n,\dots, U_{j+q-1}^n) \right]
|
||||
\label{eq:leveque12.6}
|
||||
\end{align}
|
||||
for some function $F$ of $p+q+1$ arguments. $F$ is called the numerical flux function. In the simplest case, $p=0$ and $q=1$ so that $F$ is a function of only two variables and \eqref{eq:leveque12.6} becomes
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n - \frac{k}{h} \left[ F(U_j^n,U_{j+1}^n) - F(U_{j-1}^n ,U_j^n) \right]
|
||||
\label{eq:leveque12.7}
|
||||
\end{align}
|
||||
This form is very natural if we view $U_j^n$ as an approximation to the cell average $\bar{u}^n_j$. We know that the weak solution $u(x,t)$ satisfies the integral form of the conservation law
|
||||
\begin{align}
|
||||
\int_{x_{j-1/2}}^{x_{j+1/2}} \dd x u(x,t^{n+1}) = \int_{x_{j-1/2}}^{x_{j+1/2}} u(x,t^n) -\\
|
||||
-\left[ \int_{t^n}^{t^{n+1}} \dd t f(u(x_{j+1/2},t) - \int_{t^n}^{t^{n+1}} \dd t f(u(x_{j-1/2},t)\right] \nonumber
|
||||
\end{align}
|
||||
Dividing by $h$ and using the averages defined this yields
|
||||
\begin{align}
|
||||
\bar{u}_j^{n+1} = \bar{u}_j^n - \frac{1}{h} \left[ \int_{t^n}^{t^{n+1}} \dd t f(u(x_{j+1/2},t) - \int_{t^n}^{t^{n+1}} \dd t f(u(x_{j-1/2},t)\right]
|
||||
\end{align}
|
||||
Comparing this to \eqref{eq:leveque12.7} we see that the numerical flux function $F(U_j;U_{j+1})$ plays the role of an average flux through $x_{j+1/2}$ over the time interval $(t^n;t^{n+1})$
|
||||
\begin{align}
|
||||
F(U_j,U_{j+1} \approx \frac{1}{k}int_{t^n}^{t^{n+1}} \dd t f(u(x_{j+1/2},t)
|
||||
\end{align}
|
||||
One way to derive numerical methods in conservation form is to use standard finite difference discretizations but to start with the conservative form of the PDE rather than the
|
||||
quasilinear form. For example, if we generalize the upwind method to Burgers' equation, we obtain
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n-\frac{k}{h}\left[ \frac{1}{2}(U_j^n)^2 - \frac{1}{2}(U_j^{n-1})^2\right]
|
||||
\end{align}
|
||||
This is of the form \eqref{eq:leveque12.7} with
|
||||
\begin{align}
|
||||
F(v,w) = \frac{1}{2}v^2
|
||||
\end{align}
|
||||
Here we again assume that $U^\prime > 0$ for all $j, n$, so that the ``upwind'' direction is
|
||||
always to the left. More generally, for a nonlinear system $\partial_t u + \partial_x f(u)= 0$ for which the Jacobian matrix $f^\prime(U_j^n)$ has non-negative eigenvalues for all $U_j^n$, the upwind method is of the form \eqref{eq:leveque12.7} with
|
||||
\begin{align}
|
||||
F(v,w) = f(v) \label{eq:leveque12.13}
|
||||
\end{align}
|
||||
Of course in general the Jacobian will have eigenvalues of mixed sign and it will not be
|
||||
possible to use a completely one-sided method. Also note that for the nonlinear problem,
|
||||
unlike the linear advection equation, the ``upwind'' direction depends on the data $U_j^n$; and
|
||||
may vary from point to point. Even in the scalar case we need to introduce some way of
|
||||
switching the directional bias based on the data. We will consider various generalizations
|
||||
of \eqref{eq:leveque12.13} to handle this situation later. For now we simply note that if $f\prime(U_j^n)$ has only non-positive eigenvalues for all $U_jn$, then the upwind method always uses the point to the right, and the flux becomes
|
||||
\begin{align}
|
||||
F(v,w) = f(w) \label{eq:leveque12.13}
|
||||
\end{align}
|
||||
|
||||
\textbf{Lax-Friedrichs}. he generalization of the Lax-Friedrichs method to nonlinear systems takes the form
|
||||
\begin{align}
|
||||
U_j^{n+1} = \frac{1}{2} (U_{j-1}^n + U_{j+1}^n) - \frac{k}{2h}(f(U_{j+1}^n) - f(U_{j-1}^n))
|
||||
\end{align}
|
||||
This method can be written in the conservation form \eqref{eq:leveque12.7} by taking
|
||||
\begin{align}
|
||||
F(U_j,U_{j+1}) = \frac{h}{2k} (U_j - U_{j+1}) + \frac{1}{2}(f(U_j) + +f(U_{j+1}))
|
||||
\end{align}
|
||||
|
||||
\section{Godunov's method}
|
||||
|
||||
Recall that one-sided methods cannot be used for systems of equations with eigenvalues
|
||||
of mixed sign. For a linear system of equations we previously obtained a natural generalization of the upwind method by diagonalizing the system. For nonlinear systems the matrix of eigenvectors is not constant, and this same approach does not work directly. In this chapter we will study a generalization in which the local characteristic structure, now obtained by solving a Riemann problem rather than by diagonalizing the Jacobian matrix, is used to define a natural upwind method. This method was first proposed for gas dynamics calculations by Godunov.
|
||||
Since solving a Riemann problem is a nontrivial task, we should first justify the need
|
||||
for upwind methods. An alternative is to use a centered method such as the Lax-Friedrichs
|
||||
method which allows eigenvalues of either sign. In the scalar case, this turns out
|
||||
to be stable provided
|
||||
\begin{align}
|
||||
\left\vert \frac{k}{h} f^\prime(U_j^n)\right\vert \leq 1
|
||||
\end{align}
|
||||
for all $U_j^n$.
|
||||
|
||||
%- Finite Differenzen
|
||||
%- Finite Volumina
|
||||
|
||||
Reference in New Issue
Block a user