Writing .bts file

Dear @Jason.Jonkman,

Hope you are doing well.

I want to ask you whether there is a MATLAB (or Python) function that writes a .bts file ?

Thank you in advance.

Best Regards,

Riad

1 Like

Dear @Riad.Elhamoud

Dear Abhay,

Python script turbsim_file.py in the openFAST-Toolbox reads and writes binary formatted TurbSim (.bts) files: openfast_toolbox/openfast_toolbox/io/turbsim_file.py at main Ā· OpenFAST/openfast_toolbox Ā· GitHub.

From the matlab-toolbox, there is a script readfile_BTS.m that will read a TurbSim binary file into the MATLAB workspace: matlab-toolbox/Utilities at main Ā· OpenFAST/matlab-toolbox Ā· GitHub. Iā€™m not aware that an equivalent MATLAB-based script to write a TurbSim binary file has been developed, but Iā€™m sure that would be possible using readfile_BTS.m as a starting point.

Best regards,

1 Like

Python codes are also available, see here WEIS/weis/aeroelasticse/turbsim_util.py at develop Ā· WISDEM/WEIS Ā· GitHub

1 Like

Iā€™m attempting to generate a BTS file using a user-defined time series file. However, Iā€™ve noticed that in the resulting wind file, both the v and w components are zero. Iā€™m unsure how to proceed.

When I try to use the ā€œIECKAIā€ TurbModel, it appears that I canā€™t utilize the time series file. This seems to contradict the comments in the INP file. However, upon reviewing the user manual, I found that time series can only be used with the TIMESR turbulence model.

Iā€™ve attached the relevant files for reference. Here is key information:


This summary file was generated by TurbSim on 13-Aug-2024 at 17:35:04.


Runtime Options:

    123456  Random seed #1
    RANLUX  Type of random number generator
         F  Output binary HH turbulence parameters?
         F  Output formatted turbulence parameters?
         F  Output AeroDyn HH files?
         T  Output AeroDyn FF files?
         F  Output BLADED FF files?
         F  Output tower data?
         F  Output formatted FF files?
         F  Output coherent turbulence time step file?
         T  Clockwise rotation when looking downwind?
 0 -  NONE  IEC turbulence models scaled to exact specified standard deviation


Turbine/Model Specifications:

        45  Vertical grid-point matrix dimension
        61  Horizontal grid-point matrix dimension
     0.500  Time step [seconds]
  5000.000  Analysis time [seconds]
  5000.000  Usable output time [seconds]
   115.000  Hub height [m]
   220.000  Grid height [m]
   300.000  Grid width [m]
     0.000  Vertical flow angle [degrees]
     0.000  Horizontal flow angle [degrees]


Meteorological Boundary Conditions:

    TIMESR  User-input time series spectral model
       N/A  IEC standard
       N/A  IEC turbulence characteristic
       N/A  IEC turbulence type
       N/A  IEC Extreme Turbulence Model (ETM) "c" parameter [m/s]
       PL   Wind profile type
    90.000  Reference height [m]
    10.000  Reference wind speed [m/s]
       N/A  Jet height [m]
     0.130  Power law exponent
     0.030  Surface roughness length [m]


Non-IEC Meteorological Boundary Conditions:

    45.000  Site latitude [degrees]
     0.050  Gradient Richardson number
     0.480  Friction or shear velocity [m/s]
       N/A  Mixing layer depth [m]
       N/A  Mean hub u'w' Reynolds stress
       N/A  Mean hub u'v' Reynolds stress
       N/A  Mean hub v'w' Reynolds stress


Spatial Coherence Models:

       IEC  u-component coherence model
       IEC  v-component coherence model
       IEC  w-component coherence model
(   12.000, 0.659E-03)  u-component coherence parameters
(   12.000, 0.659E-03)  v-component coherence parameters
(   12.000, 0.659E-03)  w-component coherence parameters
       N/A  Coherence exponent


Profiles from User-Defined Time-Series Input:

  Height   Wind Speed   Horizontal Angle   Vertical Angle
   (m)        (m/s)          (deg)              (deg)    
  ------   ----------   ----------------   --------------
  105.00      12.20          15.00                7.25
  105.00      12.14          15.00                7.25
   75.00      10.97          15.00                7.25
   75.00      10.77          15.00                7.25


You have requested that the following file(s) be generated:

   leice.bts (AeroDyn/TurbSim full-field wind file)


Turbulence Simulation Scaling Parameter Summary:

   Turbulence model used                            =  User-input time series
   Gradient Richardson number                       =    0.050
   Monin-Obukhov (M-O) z/L parameter                =    0.067
   Monin-Obukhov (M-O) length scale                 = 1725.000 m
   Mean wind speed at hub height                    =   10.324 m/s

   Wind profile type                                =  Power law
   Power law exponent                               =    0.130
   Mean shear across rotor disk                     =    0.020 (m/s)/m
   Assumed rotor diameter                           =  220.000 m
   Surface roughness length                         =    0.030 m

   Nyquist frequency of turbulent wind field        =    1.000 Hz

   Number of time steps in the FFT                  =    10000
   Number of time steps output                      =    10000
   Number of points simulated                       =     2747


Mean Flow Angles:

   Vertical   =   0.0 degrees
   Horizontal =   0.0 degrees

Mean Wind Speed Profile:

   Height    Wind Speed   Horizontal Angle  Vertical Angle  U-comp (X)   V-comp (Y)   W-comp (Z)
     (m)        (m/s)         (degrees)       (degrees)       (m/s)        (m/s)        (m/s)   
   ------    ----------   ----------------  --------------  ----------   ----------   ----------
    225.0       11.27            0.00            0.00         11.27         0.00         0.00
    220.0       11.23            0.00            0.00         11.23         0.00         0.00
    215.0       11.20            0.00            0.00         11.20         0.00         0.00
    210.0       11.16            0.00            0.00         11.16         0.00         0.00
    205.0       11.13            0.00            0.00         11.13         0.00         0.00
    200.0       11.09            0.00            0.00         11.09         0.00         0.00
    195.0       11.06            0.00            0.00         11.06         0.00         0.00
    190.0       11.02            0.00            0.00         11.02         0.00         0.00
    185.0       10.98            0.00            0.00         10.98         0.00         0.00
    180.0       10.94            0.00            0.00         10.94         0.00         0.00
    175.0       10.90            0.00            0.00         10.90         0.00         0.00
    170.0       10.86            0.00            0.00         10.86         0.00         0.00
    165.0       10.82            0.00            0.00         10.82         0.00         0.00
    160.0       10.78            0.00            0.00         10.78         0.00         0.00
    155.0       10.73            0.00            0.00         10.73         0.00         0.00
    150.0       10.69            0.00            0.00         10.69         0.00         0.00
    145.0       10.64            0.00            0.00         10.64         0.00         0.00
    140.0       10.59            0.00            0.00         10.59         0.00         0.00
    135.0       10.54            0.00            0.00         10.54         0.00         0.00
    130.0       10.49            0.00            0.00         10.49         0.00         0.00
    125.0       10.44            0.00            0.00         10.44         0.00         0.00
    120.0       10.38            0.00            0.00         10.38         0.00         0.00
    115.0       10.32            0.00            0.00         10.32         0.00         0.00
    110.0       10.26            0.00            0.00         10.26         0.00         0.00
    105.0       10.20            0.00            0.00         10.20         0.00         0.00
    100.0       10.14            0.00            0.00         10.14         0.00         0.00
     95.0       10.07            0.00            0.00         10.07         0.00         0.00
     90.0       10.00            0.00            0.00         10.00         0.00         0.00
     85.0        9.93            0.00            0.00          9.93         0.00         0.00
     80.0        9.85            0.00            0.00          9.85         0.00         0.00
     75.0        9.77            0.00            0.00          9.77         0.00         0.00
     70.0        9.68            0.00            0.00          9.68         0.00         0.00
     65.0        9.59            0.00            0.00          9.59         0.00         0.00
     60.0        9.49            0.00            0.00          9.49         0.00         0.00
     55.0        9.38            0.00            0.00          9.38         0.00         0.00
     50.0        9.26            0.00            0.00          9.26         0.00         0.00
     45.0        9.14            0.00            0.00          9.14         0.00         0.00
     40.0        9.00            0.00            0.00          9.00         0.00         0.00
     35.0        8.84            0.00            0.00          8.84         0.00         0.00
     30.0        8.67            0.00            0.00          8.67         0.00         0.00
     25.0        8.47            0.00            0.00          8.47         0.00         0.00
     20.0        8.22            0.00            0.00          8.22         0.00         0.00
     15.0        7.92            0.00            0.00          7.92         0.00         0.00
     10.0        7.52            0.00            0.00          7.52         0.00         0.00
      5.0        6.87            0.00            0.00          6.87         0.00         0.00


Harvested Random Seeds after Generation of the Random Numbers:

    382863125 K 1
            0 K 2


Hub-Height Simulated Turbulence Statistical Summary:

   Type of Wind        Min (m/s)   Mean (m/s)    Max (m/s)  Sigma (m/s)       TI (%)
   ----------------    ---------   ----------    ---------  -----------       ------
   Longitudinal (u)         8.46        10.32        12.12        0.524        5.072
   Lateral (v)             -0.00         0.00         0.00        0.000        0.000
   Vertical (w)            -0.00        -0.00         0.00        0.000        0.000
   U component              8.46        10.32        12.12        0.524        5.072
   V component             -0.00         0.00         0.00        0.000        0.000
   W component             -0.00        -0.00         0.00        0.000        0.000
   Horizontal (U&V)         8.46        10.32        12.12        0.524        5.072
   Total                    8.46        10.32        12.12        0.524        5.072

                       Min Reynolds     Mean Reynolds    Max Reynolds    Correlation
   Product             Stress (m/s)^2   Stress (m/s)^2   Stress (m/s)^2  Coefficient
   ----------------    --------------   --------------   --------------  -----------
   u'w'                     -0.000            -0.000             0.000        -0.004
   u'v'                     -0.000             0.000             0.000         0.002
   v'w'                     -0.000             0.000             0.000         0.028


   Friction Velocity (Ustar)  =      0.000 m/s
   Maximum Instantaneous TKE  =      1.740 (m/s)^2
   Maximum Instantaneous CTKE =      0.000 (m/s)^2

Any insights or suggestions would be greatly appreciated.

Has anyone else experienced similar issues or know of a workaround? Thank you in advance for your help!
usr-turbsim

Best Regrads,
Junius

Dear @Jundong.Wang,

Iā€™m not sure why the v and w components are showing up as zeros when you specified nonzero values, but I found a couple oddities in your inputs:

  • The user-specified points youā€™ve set are far to one side of the grid and the reference point (RefPtID) is outside the grid altogether
  • Your user-specified v and w components seem to have a nonzero mean, even though your profile and wind direction are zero.

I would first suggest using one user-specified point, placing this point within the domain, and ensuring that the v and w components have zero mean.

Also, which version of TurbSim are you running?

Best regards,

Dear @Jason.Jonkman ,

Thank you for your reply. I misunderstood the definition of pointyi, thinking it referred to the global coordinate system, but Iā€™ve made the necessary adjustments.
BTW, Turbsim version information:

 **************************************************************************************************
 TurbSim

 Copyright (C) 2021 National Renewable Energy Laboratory
 Copyright (C) 2021 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

 TurbSim-v2.5.0-648-g2221ba53
 Compile Info:
  - Compiler: GCC version 9.3.0
  - Architecture: 64 bit
  - Precision: single
  - Date: Apr  6 2021
  - Time: 21:20:00
 Execution Info:
  - Date: 08/15/2024
  - Time: 11:21:42+0800

Following your suggestions, I tested three scenarios: single-point data, data from two points at the same height, and data from two points at different heights on the same side. Unfortunately, the velocity components v and w both have zero results.

Iā€™ve uploaded the relevant files to OneDrive for your review. Iā€™m also examining the source code, and Iā€™ll share any updates here.

usr-turbsim-test

Dear @Jundong.Wang,

I would first focus on the singe-point test (leice-test1.inp). I still see that the mean value of your user-specified v and w components have a sizeable nonzero mean. Do the results make more sense if you remove this mean?

Also, does upgrading to the newest version of TurbSim provided with OpenFAST resolve the issue: https://github.com/OpenFAST/openfast/releases/download/v3.5.3/TurbSim_x64.exe.

Best regards,

@Jason.Jonkman ,
Thank you so much for your suggestion. Iā€™ve been using the latest version of TurbSim for the simulation. I apologize for only just noticing the issue you mentioned about the non-zero mean of the v and w velocity components. I suspect the reason the simulation results were zero is that the wind speed data I provided has significant values in both the horizontal and vertical directions, whereas I intended for the data to generate as zero. However, it seems there are also quite a bit of fluctuations in the reference documents provided by TurbSim. Iā€™m unsure how the average inflow angle is set.

Once I removed the time average from the v and w components, the program ran properly. You can check it out from the following link:
3 items
Thanks to your kind reminder.

I may need to further confirm if I should adjust the average inflow angle at different height layers by modifying the source code to better match the data.

Best Regards,
Junius

Dear @Jundong.Wang,

Iā€™m glad that solved the problem. TurbSim generally works by superimposing turbulent fluctuations with zero mean with a mean wind profile. The mean wind profile can include a change of wind speed with height (shear) as well as a change in wind direction with height (veer), depending on what profile youā€™ve selected.

Best regards,