Code covered by the BSD License

### Highlights from 3D Turbulent Wind Field Simulation by means of Sandia Method for wind energy applications

3.5
3.5 | 2 ratings Rate this file 38 Downloads (last 30 days) File Size: 3.54 KB File ID: #35867

# 3D Turbulent Wind Field Simulation by means of Sandia Method for wind energy applications

### Francesco Perrone (view profile)

27 Mar 2012 (Updated )

3D turbulent wind field generator with Kaimal model

File Information
Description

This code is meant for all those people interested or actively involved within the wind energy business.

It tries to couple the best features of already existing tools, such as TurbSim and Bladed.

The code has been quite tested and reviewed since the previous version, in order to overcome issues dealing with the Coherence function as well as the Gaussian statistics.

Easy to use and free-source.

Inputs:

1) Hub Height [m]
2) Grid Width [m]
3) Grid Height[m]
4) Number of points along Y
5) Number of points along Z
6) Number of FFT points (2^12 recommended)
7) Analysis Time (generally 600s)
8) Hub Average Wind Speed [m/s]
9) Coherence Model (TurbSim or Bladed)

Outputs:

1) U: Turbulent time series for v-component [m/s]
2) V: Turbulent time series for v-component [m/s]
3) W: Turbulent time series for v-component [m/s]

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 8.0 (R2012b)
09 May 2013 kai

### kai (view profile)

Thank you for your sharing code. I wonder that if you use FFT to transform frequency matrix to time series correlty. The code you written is as follows:
for ii = 1:N
tmp_u = (fft((H_u(ii,:)))); % FFT
tmp_v = (fft((H_v(ii,:))));
tmp_w = (fft((H_w(ii,:))));

% Up to this point only the one-sided spectrum has been considered to
% lighten the computational effort, since the double-sided spectrum is
% an even function about the frequency axis.
% Therefore, we can now merge real and imaginary part of the fft to get
% the ultimate time series.

U(ii,:) = [real(tmp_u) imag(tmp_u)];
V(ii,:) = [real(tmp_v) imag(tmp_v)];
W(ii,:) = [real(tmp_w) imag(tmp_w)];
end

I think ifft should be used here.

Comment only
21 Nov 2012 Jean

### Jean (view profile)

Thank you for this script.
I think there is a mistake in the IEC 61400-1 implementation, the power spectrum for Kaimal should be with a 5/3 power and not a 5/6:

PSD(i,IVec)=SigmaLU(IVec)/(1.0 + LU(IVec)*Freq(i))^Exp3

with Exp3=5/3
Moreover the calculated time series is artifically scaled to the desired mean & standard deviation, but the calculation output seems to be very far from the desired value. I therefore suspect an error in the code.
A lot of lines could be vectorized.

19 Oct 2012 Hamid Sarlak

### Hamid Sarlak (view profile)

05 May 2012 Francesco Perrone

### Francesco Perrone (view profile)

http://www.mathworks.com/matlabcentral/fileexchange/16777

as said within "Other Requirements!

Comment only
05 May 2012 Allan

### Allan (view profile)

Thank you for your sharing work.
I met the following problem. It seems that function lapack can't be found.
Is this subroutine needs additional toolbox?

Undefined function 'lapack' for input arguments of type 'char'.

Error in Sandia_3D_method (line 287)
U = lapack('SPPTRF','L',Ntot,H,0);

Comment only