NumMeth-22: Conservative Methoden
This commit is contained in:
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 |
@@ -3407,7 +3407,211 @@ There are examples, however, when the CFL condition is not sufficient for stabil
|
||||
|
||||
\subsection{Upwind methods}
|
||||
|
||||
For scalar advetion equations with $a>0$, the one-sided method
|
||||
\begin{align}
|
||||
U_j^{n+1} = U_j^n - \frac{k}{h} a (U_{j+1}^n -U_j^n)
|
||||
\end{align}
|
||||
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\grqqq 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 approximatio 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] \nobumber
|
||||
\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}
|
||||
|
||||
|
||||
%- Finite Differenzen
|
||||
|
||||
Reference in New Issue
Block a user