next up previous contents
Next: Wire Current Up: Testing the Solver Previous: Testing the Solver   Contents

Plane Wave Propagation

The plane wave propagation simulation is used to show that the solvers can resolve a simple plane wave and it is used to measure the accuracy of the solvers.

A plane wave of the form

$\displaystyle \xi\left(x,t\right) = \sin \left(2\pi x + 2\pi t\right)$ (100)

is applied to one of the negative going characteristic waves for
$\displaystyle D_z\left(x,t\right)$ $\displaystyle =$ $\displaystyle \xi\left(x,t\right),$ (101)
$\displaystyle H_y\left(x,t\right)$ $\displaystyle =$ $\displaystyle -\xi\left(x,t\right)$ (102)

where these equations are both the initial conditions when $ t=0$ and the analytic solution.

Figure 4.1: This is the computational domain used for the plane wave propagation simulation, which is a periodic domain. Width of the domain is one with periodic boundary conditions on both sides of the domain.
\begin{figure}\begin{center}\setlength{\unitlength}{1 cm}
\begin{picture}(14,...
...1.5,0.7){$x=1$}
\put(12.5,2.2){$x$\ axis}
\end{picture}\end{center}
\end{figure}

The plane wave is set as the initial solution on a periodic domain (shown in Figure 4.1) and the solver is ran for one light transit time. Except where otherwise noted, the grid is 20 cells in the x-direction and 3 cells in the y-direction. Under these conditions, the wave should propagate, and at one time transit time, the initial solution is the analytic solution. The time step used is a CFL of 0.2 for all three solvers.

Figure 4.2: This shows the plane wave propagating with the rectangular upwind at two different times; all three lines show that the wave is propagating to the left, which is correct.
\includegraphics{runs/pwp-rect-soln.psc}

The propagation of the wave with the rectangular upwind solver is shown in Figure 4.2 and demonstrates that the wave does propagate properly to the left. As can be seen, significant dissipation in the rectangular upwind solver is evident in the drastic decrease in wave amplitude over the single light transit time.

Figure 4.3: This shows the plane wave solution for each of the solvers after one light transit; the analytic solution is shown as the dotted sine wave, with the solutions from the solvers shown by the other lines. From this graph, the triangular WENO solver shows a solution that is the closest to the analytical solution, whereas the triangular upwind and the rectangular upwind show significant decay.
\includegraphics{runs/pwp-soln.psc}

The propagation of the wave for each of the solvers can be compared in Figure 4.3 where the solution is plotted after one light transit, the solutions should be the initial sine wave $ \sin 2\pi x$. As can be seen, the triangular WENO performed the best, however, a bit of super-compression can be seen near the peak. Second best is the triangular upwind which shows itself to be better than the rectangular upwind; however, the triangular upwind solver does have greater fidelity in the usage of four sub-cells per grid cell, therefore, the increase of accuracy over the rectangular upwind solver is not unexpected. In all three cases, the solutions converge to the analytic solution as the grid is refined.

Figure 4.4: This shows the accuracy of solver as the grid is refined. The error is defined as the difference between the solver solution and the analytic solution at one light transit; the 2 norm of this error is plotted on the vertical axis while the $ \Delta x$ of the grid spacing is plotted on the horizontal axis. From the lines, the rectangular upwind solver is the poorest while the triangular WENO solver is the greatest in terms of accuracy.
\includegraphics{runs/pwp-error.psc}

Table 4.1: Accuracy of the solvers with a least squares fit, this is the $ r$ in $ \mathcal{O}\left(h^r\right)$. Asymptotic $ r$ is computed using $ n\geq 750$.
Solver Overall Asymptote
Rectangular Upwind 0.7805 0.9867
Triangular Upwind 0.9444 0.9974
Triangular WENO 2.3850 2.0819


Table 4.2: Speed Comparison for the solvers to run for 2000x3 cell grid (x4 for triangular upwind and WENO). Listed is the time to completion and the norm-2 error in the solution.
Solver Time Error
    Absolute Relative
Rectangular Upwind 0:06:15 $ 1.108\cdot 10^{-2}$ 9,824
Triangular Upwind 0:17:56 $ 2.140\cdot 10^{-3}$ 1,898
Triangular WENO 4:07:35 $ 1.128\cdot 10^{-6}$ 1

The order of accuracy for each of the solvers is determined by refining the grid, repeating the simulation, and measuring the error. The error measure $ \epsilon$ is calculated using the p-norm measure where $ p=1,2,\infty$, as in

$\displaystyle \epsilon_{p=1}$ $\displaystyle =$ $\displaystyle \frac{1}{N} \sum_k^{\mathrm{cells}}
\left\vert {D_z}_k - \sin 2\pi x_k \right\vert,$ (103)
$\displaystyle \epsilon_{p=2}$ $\displaystyle =$ $\displaystyle \sqrt{\frac{\sum_k^{\mathrm{cells}}
\left( {D_z}_k - \sin 2\pi x_k \right)^2}{N}},$ (104)
$\displaystyle \epsilon_{p=\infty}$ $\displaystyle =$ $\displaystyle \mathrm{Max}_k
\left\vert {D_z}_k - \sin 2\pi x_k \right\vert$ (105)

where
 $ p$ is the order of the norm,
 $ k$ is the index to indicate the cell for the rectangular upwind, or the sub-cell for the triangular upwind and WENO solvers,
 $ N$ is the number of cells for the rectangular upwind, or the number of sub-cells for the triangular upwind and WENO solvers.

The grid is refined in increments from 20 cells in the x direction to 2,000 cells in the x-direction. The measured 2-norm errors for all three solvers is shown in the log-log plot of Figure 4.4; the 1-norm and $ \infty$-norm are similar, therefore, they are not shown. As shown, the triangular WENO provides the least errors for a given resolution.

The 2-norm errors are fitted to the form

$\displaystyle \epsilon = A \left(\Delta x\right)^r$ (106)

where
 $ r$ is the order of accuracy.

This form is fitted to each of the error curves for each of the solvers, the accuracy is listed in Table 4.1. Overall accuracy is determined using the entire dataset from all of the grid refinements. Asymptotic accuracy is determined using the error data from the five finest grid refinements (2,000, 1,500, 1,000, 750, and 500 grid cells).

Speed of each solver is measured by listing the time the main for loop in the code starts the time marching and the time the code stops the time marching to the nearest second. This comparison is done using a grid spanning 2,000 cells in the x-direction. The timings are listed in Table 4.2. While the triangular WENO solver takes the longest to compute, it has the highest accuracy. The rectangular upwind solver takes a mere 6 minutes to run the simulation; however, to reach the same error figures as the triangular WENO solver, a grid of nearly twenty million cells would be required, this would take 11.5 centuries on a single 2.0 GHz AthlonXP.


next up previous contents
Next: Wire Current Up: Testing the Solver Previous: Testing the Solver   Contents
Chris Aberle 2004-12-17