CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Spectral methods efficiency (https://www.cfd-online.com/Forums/main/4170-spectral-methods-efficiency.html)

Radu Bondar December 3, 2001 15:45

Spectral methods efficiency
 
why spectral methods are so efficient(you need only a few points to find out the right solution) on some cases?

Patrick Godon December 4, 2001 13:25

Re: Spectral methods efficiency
 
Hi Radu,

Spectral method a high order methods, which means that they evaluate the numerical derivative of the variables (density, velocity, pressure, energy, whatever..) using all the points of the function on the grid. An example will help you to understand best:

a simple finite difference method use the Taylor series in order to numerically evaluate the derivatie:

du/dx = (u(j+1)-u(j-1))/(2*delta x)

or also du/dx = (u(j+1)-u(j))/delta x etc....

It uses only 2 points on the grid (j+1, j-1) to evaluate the derivative.

The spectral methods use basis functions (solutions of the Strum Liouville problem) to expand the function as a series of polynomials, then the derivative of this function is obtained by taking the derivative of the polynomial and making a new series:

ex: Fourier Series:

f(x) = sum exp(-ikx) a(k) , k=-n/2+1, -1, 0, 1, ..n/2.

df(x)/dx = sum -ik exp(-ikx) a(k)

since a(k) is itself obtained from the inverse Fourier Transform and numerically the transform is discrete, a(k) is actually a function of f(x_j) where j is the index of the grid points (x_j are the grid points). Consequently, df(x)/dx is numerically evaluated using all the points on the grid and not just 2!

Now in addition, only a few polynomials are needed to represent a smooth function, and therefore high accuracy can be obtained with only a few points when the function is smooth.

When the function is discontinue, then the spectral methods are actually not good at all, and are very oscillatory (Gibbs phenomenon), which is due to the fact than when the function is not continue, the series does not converge and you actually need an infinite number of terms to represent the function. The same will happend if you try to use a Fourier series to represent a non-periodic function (for example f(x)=x cannot be represented by a Fourier series).

Patrick


All times are GMT -4. The time now is 19:42.