spectrum2d
algorithm
- calculates Energy spectrum of a 2D velocity field
- plots Energy spectrum over wave number
- plots Energy spectrum over eddy size
- calculates turbulent kinetic energy
- calculates Integral length scale
- calculates rms values of velocity

syntax
[ENVP1,S1,S,k,L11,RMS]=spectrum2d(x_velocity,y_velocity,L,nx,ny)
example for input
[ENVP1,S1,S,k,L11,RMS]=spectrum2d(x_velocity,y_velocity,0.005,151,151);
input arguments
| Name | description |
|---|---|
| x_velocity, y_velocity, |
square matrices, x- and y- components of velocity |
| L | length of domain |
| nx,ny | number of points of domain |
output arguments
| Name | description |
|---|---|
| ENVP1 | vector, values of energy spectrum |
| k | vector, wavenumbers |
| S1 | turbulent kinetic energy |
| S | normalized turbulent kinetic energy |
| L11 | Integral length scale |
| RMS | standard deviation of velocity values |
| plots | energy cascade along wave number energy cascade along eddy size |
matlab tools required
- fft2, fftshift