The Spectral Method

Author
biancalevine 
Category
Documents

view
43 
download
1
Embed Size (px)
description
Transcript of The Spectral Method

The Spectral Method

Definition where (em,en)=m,n en= basis of a Hilbert space(.,.): scalar product in this spaceIn L2 space where f*: complex conjugate of fDiscretization: limit the sum to a finite number of terms (consistent if the ems are appropriately ordered)

The Galerkin procedureLinear case
If ems are eigenfunctions of H: Hem=mem
H: linear space operatorR: discretization errorwe assume R to be a function of the omitted ems onlytherefore R is orthogonal to em (m M) (alternatively we minimize R2) m,n0 analytical solution (no need to discretize in t) compute once and store

Onedimensional 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 0m M Galerkin procedure this is a system of 2M+1 equations (decoupled) for the(complex) n coefficients

Onedimensional linear advection equation (2) Exact solution in physical spacethe same form as the analytical solutionno dispersion due to the space discretizationbecause 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 transformBm: normalization factors Discrete Fourier transforms Direct : Inverse :Transformations are exact if K2M+1Procedure: Fast Fourier Transform (FFT) algorithmProducts of two functions have no aliassing if K3M+1

The linear gridUnfitted functionFitted withquadraticgridFitted withlineargrid3M+1 points in ensure noaliassing in computations ofquadratic terms (case ofEulerian advection) Quadratic grid2M+1 points in ensureexact transforms of linearterms to gridpoint and backLinear grid

Stability analysis Leapfrog schemeno need to discretizein time if we do nothave other terms in theequationSubstituting and dividing by W(n1) conditionally stable and neutral Comparison with finite differencesU0=RM~N/2x=2R/N if using the quadratic grid M~N/3 >

Graphical representation

Nonlinear advection equation= there are more wavenumbers on the r.h.s. than in the original functionGalerkin procedurek=0 . Mtherefore Fm m>M are not usedbut no aliassing produced because of misrepresentation

Nonlinear advection equation (cont)Calculation of Fk Interaction coefficientsIjnk > interaction coeff. matrixI is not a sparse matrix Transform methodI. FFTf(l); l=1, Lg(l); l=1, LI. FFTF(l) =  f(l)g(l)D. FFT can be shown to have no aliassing if L 3M+1

Onedimensional gravitywave equations Galerkin procedure no need to discretize in time

Onedimensional gravitywave equations (cont) Explicit time stepping (leapfrog)no need to transformto gridpoint space Stability and dispersion (von Neumann method)assume substituting:smaller thanwith finitedifferencesdispersion due solelyto the time discretization

Onedimensional gravitywave equations (cont) Implicit time stepping substitutingDecoupled set of equations because the basis functions eim are eigenfunctions of the space operator / with eigenvalues im Stability and dispersion using von Neumann we getstabledispersion larger thanin leapfrog scheme

Shallow water equationsLinearize about a basic state U0, V0, 0 and assume f=cte=f0 (fplane approx)substitute and neglect productsof perturbations

Leapfrog (explicit) time schemeStability according to von Neumann assume and substitute

Leapfrog (explicit) time scheme stability (cont) or, calling where

Leapfrog (explicit) time scheme stability (cont) calling this system has nontrivial solutions if for to have a real solutionThe most restrictive case is when which gives

Semiimplicit time scheme stabilityFollowing the same steps as in the explicit scheme we arrive at:thereforeif

Spherical harmonicsOrthogonal basis for spherical geometry m: zonal wavenumber n: total wavenumber= longitude= sin() : latitudePnm: Associated Legendre functions of the first kind

Spectral representation nm: effective meridional wavenumberspectral transformSince X is a real field, Xnm=(Xnm)* Fourier coefficients direct Fourier transform orinverse Legendretransform

Some spherical harmonics (n=5)

Spherical harmonics (cont) Properties of the spherical harmonics eigenfunctions of the operator / eigenfunctions of the laplacian operatorsemiimplicit method leads to a decoupledset of equations latitudinal derivatives easy to compute although the spherical harmonics are not eigenfunctions of the latitudinal derivative operator

Spherical harmonics (cont.) Usual truncationsN=min(m+J, K) pentagonal truncationM=J=K triangularK=J+M rhomboidalK=J>M trapezoidalmnMmnMmnMmnM pentagonal triangular rhomboidaltrapezoidalK=J=MKKK=JJJ

Gaussian gridUse of the transform method for nonlinear 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 whereGaussian latitudesIn triangular truncation NG (3N+1)/2Gaussian latitudes are approximately equally spacedsame spacing as for

The reduced Gaussian gridFull gridReduced grid Triangular truncation is isotropic Associated Legendre functions are very small when m is large and  near 1

The linear Gaussian grid
Quadratic
grid
Linear
grid
Exact transforms
to g.p. and back
Yes
Yes
Aliasfree
computation of
quadratic terms
Yes
No
Number of
degrees of
freedom
at least
(3N+1)2/2
at least
(2N+1)2/2
Ratio of degrees
of freedom
g.p. / spec
4.472
at T213
2.
at TL319
Gibbs
phenomena
Yes
Yes
but to a lesser
extent

Two resolutions using the same Gaussian gridT213 orographyTL319 orography

Diffusion very simple to apply LeapfrogStabilityphysical solution 01 stablecomputational solution 1 unstable Forward Backward (implicit)decoupled systemof equations01 Stable