Visualize full-field Turbsim data and anemometer equivalent wind speed

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

Thomas.Enevoldsen
Posts: 10
Joined: Fri Mar 15, 2019 7:51 am
Organization: Technical University of Denmark
Location: Denmark

Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Thomas.Enevoldsen » Wed Mar 20, 2019 9:07 am

Hi all,

Thank you very much for developing and maintaining the available software tools. In relation to my thesis I'm doing some simulations using the 5MW reference turbine, where I'm doing some condition monitoring. I have a few questions regarding Turbsim and InflowWind, since the various wind phenomena are important to my work.

When simulating the reference turbine, the file named "NRELOffshrBsline5MW_InflowWind_12mps" contains the outputs Wind1VelX", "Wind1VelY" and "Wind1VelZ" by default. I'm unable to find anything in the documentation regarding what these velocities are equivalent to (Where they a physically measured). Are these computed on the nacelle, where Wind1Velx is equal to what an anemometer would measure? If not, how do obtain something equivalent? Edit: On further thought, the wind speed measured by an anemometer could be intrepreted as sqrt(Wind1Velx^2 + Wind1Vely^2 +Wind1Velz^2 ).

I'm able to successfully generate different full-field wind data sets and run various simulations using these. Due to my inexperience with wind turbines and wind in general, I'm trying to figure out a best way to visualize the generated data. Also, since it seems that Turbsim uses various random events, see the figure below, which drastically changes the behaviour of the generated power.

Image

I'm hoping that the wind data can be visualized as some sort of 3D plot, any suggestions on how to achieve a visualization of the full-field wind data that makes sense? And is there a way to receive/output a summary of which randoms events occur at the different time steps?

Any sort of help is appreciated. I'm sorry if the answers to my questions are very obvious, please forgive me if I have overlooked something simple.

Best regards,

Thomas Enevoldsen

Jason.Jonkman
Posts: 4962
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Jason.Jonkman » Wed Mar 20, 2019 5:01 pm

Dear Thomas,

Regarding InflowWind outputs Wind1VelX, Wind1VelY, and Wind1VelZ, these are the ambient wind speeds (i.e. without the influence of the wind turbine induction / wake) at the 1st output point defined in the Inflow primary input file, i.e. the location defined in the WindVxiList, WindVyiList, and WindVziList lists. See the InflowWind documentation for more information: https://wind.nrel.gov/nwtc/docs/InflowWind_Manual.pdf.

TurbSim uses random phases of the various frequency components (the random phases are established via the seed specified in the TurbSim input file), which determine (randomly) where gusts and other events occur in the turbulent time series. You can visualize the turbulence field by reading the wind data in the TurbSim-generated file into MATLAB via the MATLAB script named readfile_BTS provided in the MATLAB Toolbox: https://github.com/OpenFAST/matlab-toolbox.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Thomas.Enevoldsen
Posts: 10
Joined: Fri Mar 15, 2019 7:51 am
Organization: Technical University of Denmark
Location: Denmark

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Thomas.Enevoldsen » Wed Mar 20, 2019 5:54 pm

Dear Jason,

Thanks for the reply.

I have completely overlooked the locations defined by the WindVxiList, WindVyiList, and WindVziLists in the "NRELOffshrBsline5MW_InflowWind_12mps.dat" file. Sorry about that.
Also thank you for the clarification regarding the random events which occur when generating the wind data using Turbsim.

Regarding the readfile_BTS script, I encountered a similar script which was included with the installation of Turbsim. Though, I'm not quite sure what the best approach is to visualizing resulting data, which is in the form of an 4-D array. Ideally I would like some sort of 3-D plot, where it is possible to visually see at what times the gusts and other events appears.

I really appreciate your response, once again thank you.

Best regards,

Thomas Enevoldsen

Jason.Jonkman
Posts: 4962
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Jason.Jonkman » Wed Mar 20, 2019 9:43 pm

Dear Thomas,

I asked Bonnie Jonkman of Envision Energy about this, and she created a simple MATLAB function that creates separate 3D color plots (time, Y, Z) for each velocity component (u,v, w; the u-component is likely most influential to the turbine response). She has shared the MATLAB function here: https://github.com/bjonkman/matlab-tool ... d_figure.m.

I hope that helps.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Thomas.Enevoldsen
Posts: 10
Joined: Fri Mar 15, 2019 7:51 am
Organization: Technical University of Denmark
Location: Denmark

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Thomas.Enevoldsen » Thu Mar 21, 2019 1:07 am

Hi Jason,

Thank you and Bonnie for this, this will definitely be helpful. I really appreciate the help.

Best regards,

Thomas Enevoldsen

Joseph.Arkley
Posts: 3
Joined: Fri Jul 12, 2019 8:36 am
Organization: Liverpool John Moores University
Location: Liverpool

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Joseph.Arkley » Thu Aug 22, 2019 7:55 am

Hi Thomas,

Did you manage to get Bonnies linked function to work?

I am having difficulty in getting the function to read from my .bts file.

Regards,

Bonnie.Jonkman
Posts: 566
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Bonnie.Jonkman » Fri Sep 06, 2019 11:28 am

Joseph,

My script assumes you have installed the OpenFAST matlab-toolbox.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Babak.Gavgani
Posts: 29
Joined: Sat Mar 14, 2020 12:03 pm
Organization: ---
Location: Belgium

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Babak.Gavgani » Sun Apr 26, 2020 5:08 pm

Dear Bonnie,

I have obtained the wind file in (.bts) format from Turbsim. How I can plot it in 3D and/or 4D format? like the ones in the manual (Fig.1). I tried using readfile_BTS MATLAB script but there is an error.
I would be appreciated to help with this matter.

Kind regards,
Babak
Attachments
winds.JPG
winds.JPG (37.43 KiB) Viewed 659 times

Jason.Jonkman
Posts: 4962
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Jason.Jonkman » Mon Apr 27, 2020 8:03 am

Dear Babak,

What error are you getting?

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Babak.Gavgani
Posts: 29
Joined: Sat Mar 14, 2020 12:03 pm
Organization: ---
Location: Belgium

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Babak.Gavgani » Mon Apr 27, 2020 10:44 am

Dear Jason,

Thanks for your reply.
The error is ''Not enough input arguments''.
In the Matlab script, I have changed the FileName to the wind file from turbsim in bts format.

regards
Babak

Jason.Jonkman
Posts: 4962
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Jason.Jonkman » Mon Apr 27, 2020 11:00 am

Dear Babak,

Can you show how you are calling the script from MATLAB? Did you change the source code in some way; if so, how?

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Babak.Gavgani
Posts: 29
Joined: Sat Mar 14, 2020 12:03 pm
Organization: ---
Location: Belgium

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Babak.Gavgani » Mon Apr 27, 2020 11:40 am

Dear Jason,

This is the ''readfile_BTS.m'' script:

Code: Select all

function [velocity, twrVelocity, y, z, zTwr, nz, ny, dz, dy, dt, zHub, z1,mffws] = readfile_BTS([b]FileName[/b],fileFmt)
%[velocity, twrVelocity, y, z, zTwr, nz, ny, dz, dy, dt, zHub, z1,mffws] = readfile_BTS(FileName,fileFmt)
% Author: Bonnie Jonkman, National Renewable Energy Laboratory
%
% Input:
%  FileName      - string: contains file name (.bts extension) to open
%  fileFmt       - string: optional, contains format of grid points.
%
% Output:
%  velocity      - 4-D array: time, velocity component (1=U, 2=V, 3=W), iy, iz
%  twrVelocity   - 3-D array: time, velocity component, iz
%  y             - 1-D array: horizontal locations y(iy)
%  z             - 1-D array: vertical locations z(iz)
%  zTwr          - 1-D array: vertical locations of tower points zTwr(iz)
%  nz, ny        - scalars: number of points in the vertical and horizontal
%                  directions of the grid
%  dz, dy, dt    - scalars: distance between two points in the vertical
%                  [m], horizontal [m], and time [s] dimensions
% zHub           - scalar: hub height [m]
% z1             - scalar: vertical location of bottom of grid [m above ground level]
% mffws          - scalar: mean hub-height wind speed

if ( nargin < 2 )
    fileFmt = 'int16';
end
nffc = 3;

fid  = fopen( FileName );

if fid > 0
    %----------------------------       
    % get the header information
    %----------------------------
   
    tmp   = fread( fid, 1, 'int16');        % TurbSim format identifier (should = 7 or 8 if periodic), INT(2)

    nz    = fread( fid, 1, 'int32');        % the number of grid points vertically, INT(4)
    ny    = fread( fid, 1, 'int32');        % the number of grid points laterally, INT(4)
    ntwr  = fread( fid, 1, 'int32');        % the number of tower points, INT(4)
    nt    = fread( fid, 1, 'int32');        % the number of time steps, INT(4)

    dz    = fread( fid, 1, 'float32');      % grid spacing in vertical direction, REAL(4), in m
    dy    = fread( fid, 1, 'float32');      % grid spacing in lateral direction, REAL(4), in m
    dt    = fread( fid, 1, 'float32');      % grid spacing in delta time, REAL(4), in m/s
    mffws = fread( fid, 1, 'float32');      % the mean wind speed at hub height, REAL(4), in m/s
    zHub  = fread( fid, 1, 'float32');      % height of the hub, REAL(4), in m
    z1    = fread( fid, 1, 'float32');      % height of the bottom of the grid, REAL(4), in m

    Vslope(1)  = fread( fid, 1, 'float32'); % the U-component slope for scaling, REAL(4)
    Voffset(1) = fread( fid, 1, 'float32'); % the U-component offset for scaling, REAL(4)
    Vslope(2)  = fread( fid, 1, 'float32'); % the V-component slope for scaling, REAL(4)
    Voffset(2) = fread( fid, 1, 'float32'); % the V-component offset for scaling, REAL(4)
    Vslope(3)  = fread( fid, 1, 'float32'); % the W-component slope for scaling, REAL(4)
    Voffset(3) = fread( fid, 1, 'float32'); % the W-component offset for scaling, REAL(4)

        % Read the description string: "Generated by TurbSim (vx.xx, dd-mmm-yyyy) on dd-mmm-yyyy at hh:mm:ss."

    nchar    = fread( fid, 1, 'int32');     % the number of characters in the description string, max 200, INT(4)
    asciiINT = fread( fid, nchar, 'int8' ); % the ASCII integer representation of the character string
    asciiSTR = char( asciiINT' );

    disp( ['Reading from the file ' FileName ' with heading: ' ] );
    disp( ['   "' asciiSTR '".' ] ) ;

    %-------------------------       
    % get the grid information
    %-------------------------

    nPts        = ny*nz;
    nv          = nffc*nPts;               % the size of one time step
    nvTwr       = nffc*ntwr;
%   velocity    = zeros(nt,nffc,nPts);
    velocity    = zeros(nt,nffc,ny,nz);
    twrVelocity = zeros(nt,nffc,ntwr);       
   
    if strcmpi(fileFmt,'float32')
        Voffset = 0.0*Voffset;
        Vslope  = ones(size(Vslope));
    end
   
   
    for it = 1:nt
        %--------------------
        %get the grid points
        %--------------------

       
       [v, cnt] = fread( fid, nv, fileFmt ); % read the velocity components for one time step
       if ( cnt < nv )
           disp([ it nt ny nz nffc nv cnt])
           fclose(fid);
           error(['Could not read entire file: at grid record ' num2str( (it-1)*(nv+nvTwr)+cnt ) ' of ' num2str(nt*(nv+nvTwr))]);
       end

        ip = 1;
        for iz = 1:nz
            for iy = 1:ny
                for k=1:nffc
                    velocity(it,k,iy,iz) = ( v(ip) - Voffset(k))/Vslope(k) ;
                    ip = ip + 1;
                end %k
            end %iy
        end % iz

        %---------------------
        %get the tower points
        %---------------------
        if nvTwr > 0
       
            [v, cnt] = fread( fid, nvTwr, fileFmt ); % read the velocity components for the tower
            if ( cnt < nvTwr )
                error(['Could not read entire file: at tower record ' num2str( (it-1)*(nv+nvTwr)+nv+cnt ) ' of ' num2str(nt*(nv+nvTwr))]);
            end

            for k=1:nffc      % scale the data
                twrVelocity(it,k,:) = (v(k:3:nvTwr) - Voffset(k))/Vslope(k);
            end   
           
        end

    end %it

    fclose(fid);
else
    error(['Could not open the wind file: ' FileName]) ;
end


y = [0:ny-1]*dy - dy*(ny-1)/2;
z = [0:nz-1]*dz + z1;
zTwr = z1 - [0:ntwr-1]*dz;

return;

it is in MATLAB script code so I just call it from MATALB and as as far as I know,I only need to change the FileName to my wind file in .bts format, right?

Jason.Jonkman
Posts: 4962
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Jason.Jonkman » Mon Apr 27, 2020 12:40 pm

Dear Babak,

Correct. Here is a sample:

Code: Select all

[velocity, twrVelocity, y, z, zTwr, nz, ny, dz, dy, dt, zHub, z1,mffws] = readfile_BTS('90m_12mps_twr.bts');

Is that how you are calling readfile_BTS.m?

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Babak.Gavgani
Posts: 29
Joined: Sat Mar 14, 2020 12:03 pm
Organization: ---
Location: Belgium

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Babak.Gavgani » Mon Apr 27, 2020 3:11 pm

Dear Jason,

Thanks for your reply.
The problem was about entering file name. It needs to be entered as 'FileName' not just FileName.
Now I have a 4D velocity. Could you please tell me how can I plot it to obtain figures like in my previous post?

Kind regards,
Babak

Jason.Jonkman
Posts: 4962
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Visualize full-field Turbsim data and anemometer equivalent wind speed

Postby Jason.Jonkman » Mon Apr 27, 2020 3:18 pm

Dear Babak,

That is what Bonnie Jonkman's script named FFwind_figure.m is for. See the link to FFwind_figure.m in my forum post dated Mar 20, 2019 above.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest