350 likes | 606 Views
The Spectral Method. Definition. where (e m ,e n )= δ m,n. e n = basis of a Hilbert space (.,.): scalar product in this space. In L 2 space. where f * : complex conjugate of f. Discretization: limit the sum to a finite number of terms.
E N D
Definition where (em,en)=δm,n en= basis of a Hilbert space (.,.): scalar product in this space In L2 space where f*: complex conjugate of f Discretization: limit the sum to a finite number of terms (consistent if the em’s are appropriately ordered)
The Galerkin procedure H: linear space operator R: discretization error • Linear case • If em’s are eigenfunctions of H: Hem=λmem we assume R to be a function of the omitted em’s only therefore R is orthogonal to em (m ≤ M) (alternatively we minimize ||R||2) || 0 || || δm,n compute once and store analytical solution (no need to discretize in t)
periodic boundary conditions One-dimensional linear advection equation • Analytical solution phase speed: γ=cte (rad/s) • Basis functions: Fourier functions eimλ (eigenfunctions of ∂/∂λ) ω being a real field ==> ω-m(t)= ωm*(t); we need to solve only for 0≤m ≤M • Galerkin procedure this is a system of 2M+1 equations (decoupled) for the (complex) ωn coefficients
nγ/2π ωn(0) One-dimensional linear advection equation (2) • Exact solution - in physical space the same form as the analytical solution no dispersion due to the space discretization because the derivatives are computed analytically
Calculation of the initial conditions • computation of ωm(0) given ω(λ,0) - Direct Fourier transform where Am: normalization factor - Inverse Fourier transform Bm: normalization factors • Discrete Fourier transforms Procedure: Fast Fourier Transform (FFT) algorithm - Direct : - Inverse : Transformations are exact if K2M+1 Products of two functions have no aliassing if K3M+1
The linear grid 3M+1 points in λ ensure no aliassing in computations of quadratic terms (case of Eulerian advection) Quadratic grid Unfitted function Fitted with quadratic grid 2M+1 points in λ ensure exact transforms of linear terms to grid-point and back Linear grid Fitted with linear grid
Stability analysis no need to discretize in time if we do not have other terms in the equation • Leapfrog scheme Substituting and dividing by W(n-1) conditionally stable and neutral U0=Rγ M~N/2 Δx=2πR/N - Comparison with finite differences if using the quadratic grid M~N/3 ---->
Non-linear advection equation = there are more wavenumbers on the r.h.s. than in the original function Galerkin procedure k=0 …. M therefore Fm m>M are not used but no aliassing produced because of misrepresentation
Non-linear advection equation (cont) Calculation of Fk • Interaction coefficients Ijnk ---> interaction coeff. matrix I is not a sparse matrix • Transform method f(λl); l=1, … L I. FFT g(λl); l=1, … L I. FFT F(λl) = - f(λl)•g(λl) D. FFT can be shown to have no aliassing if L 3M+1
One-dimensional gravity-wave equations • Galerkin procedure no need to discretize in time
One-dimensional gravity-wave equations (cont) • Explicit time stepping (leapfrog) no need to transform to grid-point space • Stability and dispersion (von Neumann method) assume substituting: smaller than with finite differences dispersion due solely to the time discretization
One-dimensional gravity-wave equations (cont) • Implicit time stepping substituting Decoupled set of equations because the basis functions eimλare eigenfunctions of the space operator ∂/ ∂λ with eigenvalues im • Stability and dispersion using von Neumann we get stable dispersion larger than in leapfrog scheme
Shallow water equations Linearize about a basic state U0, V0, Φ0 and assume f=cte=f0 (f-plane approx) substitute and neglect products of perturbations
Stability according to von Neumann Leapfrog (explicit) time scheme and substitute assume
Leapfrog (explicit) time scheme stability (cont) or, calling where
Leapfrog (explicit) time scheme stability (cont) calling this system has non-trivial solutions if for α to have a real solution which gives The most restrictive case is when
Semi-implicit time scheme stability Following the same steps as in the explicit scheme we arrive at: therefore if
Spherical harmonics Orthogonal basis for spherical geometry m: zonal wavenumber n: total wavenumber λ= longitude μ= sin(θ) θ: latitude Pnm: Associated Legendre functions of the first kind
Spectral representation n-|m|: effective meridional wavenumber spectral transform Since X is a real field, Xn-m=(Xnm)* • Fourier coefficients direct Fourier transform or inverse Legendre transform
Spherical harmonics (cont) • Properties of the spherical harmonics eigenfunctions of the operator ∂/ ∂λ eigenfunctions of the laplacian operator semi-implicit method leads to a decoupled set of equations latitudinal derivatives easy to compute although the spherical harmonics are not eigenfunctions of the latitudinal derivative operator
Spherical harmonics (cont.) • Usual truncations N=min(|m|+J, K) pentagonal truncation M=J=K triangular K=J+M rhomboidal K=J>M trapezoidal n n K=J=M K J M m m pentagonal triangular M n K n K=J J M M m m rhomboidal trapezoidal
Gaussian grid Use of the transform method for non-linear terms • Integrals with respect to λ ---> 3M+1 points equally spaced in λ • Integrals with respect to μ computed exactly by means of Gaussian quadrature using the values at the points where Gaussian latitudes In triangular truncation NG (3N+1)/2 Gaussian latitudes are approximately equally spaced same spacing as for λ
The reduced Gaussian grid • Triangular truncation is isotropic • Associated Legendre functions are very small when m is large and |μ| near 1 Full grid Reduced grid
Two resolutions using the same Gaussian grid T213 orography TL319 orography
Diffusion very simple to apply •Stability - Leapfrog physical solution 0≤λ≤1 stable computational solution λ≤-1 unstable - Forward - Backward (implicit) decoupled system of equations 0≤λ≤1 Stable