CUDA Stencil Benchmark

High-performance CUDA kernel generation and benchmarking framework

View the Project on GitHub jasonlarkin/cuda-stencil-benchmark

Modified Wavenumber Analysis

Overview

This document presents the modified wavenumber analysis of the 4th-order finite difference scheme used in the FDTD implementation. The analysis follows Moin’s Numerical Analysis (Section 5.3) to assess the accuracy and dispersion characteristics of the numerical scheme in wavenumber space.

Theoretical Background

Modified Wavenumber Concept

For a finite difference approximation of the second derivative, the exact wavenumber $k$ is replaced by a modified wavenumber $k_{mod}$ that depends on the grid spacing $h$ and the specific finite difference stencil used.

For the 4th-order central difference scheme: \(\frac{\partial^2 u}{\partial x^2} \approx \frac{-u_{i-2} + 16u_{i-1} - 30u_i + 16u_{i+1} - u_{i+2}}{12h^2}\)

The modified wavenumber is given by: \(k_{mod}^2 = \frac{30 - 32\cos(kh) + 2\cos(2kh)}{12h^2}\)

Phase and Group Velocity

The phase velocity error is: \(\frac{c_{phase,mod}}{c_{phase,exact}} = \frac{k_{mod}}{k}\)

The group velocity is the derivative of the modified wavenumber: \(\frac{dk_{mod}}{dk} = \frac{1}{2k_{mod}} \frac{d(k_{mod}^2)}{dk}\)

Analysis Results

Grid Spacing Dependence

The analysis was performed for different grid spacings. Example plots are provided:

Fine grid (h = 0.01) Fine grid (h = 0.01)

Medium grid (h = 0.05) Medium grid (h = 0.05)

Key Findings

1. Phase Velocity Error

The phase velocity error shows consistent behavior across all grid spacings:

2. Group Velocity Error

The group velocity error reaches 100% at high wavenumbers, indicating significant dispersion effects for short wavelengths.

3. Resolution Requirements

The analysis reveals the following resolution requirements for different accuracy levels:

Error Level Points per Wavelength
1% error 5.27
5% error 3.39
10% error 2.76

Physical Interpretation

1. Dispersion Characteristics

The modified wavenumber analysis reveals that the 4th-order scheme exhibits:

2. Accuracy Assessment

3. Practical Implications

For practical FDTD simulations:

Comparison with Theoretical Expectations

4th-Order Scheme Properties

The analysis confirms the expected behavior of a 4th-order finite difference scheme:

Validation Against Literature

The results are consistent with established finite difference theory:

Conclusions

1. Scheme Accuracy

The 4th-order finite difference scheme provides:

2. Resolution Guidelines

For practical applications:

3. Numerical Dispersion

The scheme exhibits significant numerical dispersion at high wavenumbers, which is characteristic of finite difference methods. This dispersion must be considered when interpreting results for short-wavelength phenomena.

References

  1. Moin, P. “Fundamentals of Engineering Numerical Analysis” - Section 5.3
  2. LeVeque, R.J. “Finite Difference Methods for Ordinary and Partial Differential Equations”
  3. Trefethen, L.N. “Spectral Methods in MATLAB”