User defined spectrum from routine UserWaveSpctrm in HydroDYn

Hello!!!
I am now modeling floating offshore wind turbine with semi-submersible platform by using FAST v.8. I have a question about the HydroDyn module. Since I have measured frequency wave spectrum, I am thinking about using “user-defined spectrum from routine UserWaveSpctrm option” in WaveMod input of HydroDyn. However, as far as I understand there is no clear instruction on how to use this and no example as well. So, could you please give me some suggestions?
Thank you
Danupon Subanapong

Dear Danupon,

Hopefully the UserWaveSpctrm routine in HydroDyn is self-explanatory. This routine is called once per frequency at model initialization and receives the frequency (in rad/s) and direction (in degrees) of the wave component as input and returns the one-sided power-spectral density (PSD) (in m^2/(rad/s)) of the wave component as output. Its up to you how to calculate the one-sided PSD.

Best regards,

Thank you so much for your reply. As you said

, it means that there is an input for frequency and direction of the wave companent. Am I correct?
If correct, the problem is that I cannot find an example of that input in any example of HydroDyn files.
Thank you so much

Dear Danupon,

The sample UserWaveSpctrm routine is included in the Waves.f90 source file of HydroDyn. The Omega and WaveDir arguments of the routine are the inputs.

Best regards,

Thank you so much for your kind response. It is very clear and helpful.
Best Regards,
Danupon Subanapong

Sir,

I need to plot the Power spectral density of the responses I got using FAST for a spar model. I could not get any code or mathematical background for the same. Please guide me where I can find the mathematical expressions or a code.

Thank you

Dear Sai,

The MATLAB-based MCrunch post-processing tool can calculate and plot Power Spectral Densities (PSDs). I’ve also developed a simple MATLAB-based function that calculates PSDs directly via FFT without windowing that I’ve attached for your use.

Best regards,

Jason_PSD.m.txt (2.73 KB)

Dear sir,

Thank you for the code.

I have time series data i.e. in seconds and response in meters. I have gone through the code and being new to MATLAB, as far as I understood, we have to input time series data as ‘Data’ and should convert it in separately into frequency and input as ‘df’.

If it’s correct, under what parameter in the code, we should input the response which I have in meter in order to get it on the y-axis as m2/Hz.

Help me in this regard.

Thanks alot
Response.txt (4.69 KB)
timeseriesdata.txt (2.82 KB)

Dear Sai,

The Data array should be set to the time-series data (what you attached as Response.txt). The df scalar should be set equal to 1/tmax i.e. one divided by the total simulation length in seconds. From your timeseriesdata.txt file, it looks like you have 600 time steps with a time step size of 1 s, so, df = 1/(600 s).

Best regards,

Dear Jason,
Sorry to bother you.
I just tried to use the code you gived:Jason_PSD.m.But I cannot understand the parameter of Jason_PSD( Data, df, N, CreatePlot, BinLen ) in your code.
I guess CreatePlot maybe the CreatePlotInOrigin.m(by the way,I found this from Origin installation manual).Unfortunately I still cannot think out about what BinLen means.Could you please help me?
I will be very grateful for your prompt reply.
CreatePlotInOrigin.txt (2.96 KB)

Dear Jundong.Wang,

There is documentation at the top of the Jason_PSD.m script. CreatePlot is not a reference to the code you are referring to; instead, CreatePlot is a flag for enabling/disabling plotting of the PSD. BinLen is the number of frequency steps to bin the fft by.

Best regards,

Dear Jason,
Thank you for your previous guidance and help. :stuck_out_tongue:
I recently used Mod_AmbWind=1 in FAST.Farm to simulate 3 wind turbines. Then, I used this code(Jason_PSD.m) to analyze the power spectrum of the wind speeds of the 3 wind turbines in the simulation results, and got 3 different graphs. I would like to ask, are the wind speed power spectra of the second and third wind turbines correct? I think there are three explanations: 1. There is a problem with the use of my code and the parameter settings are incorrect; 2. The theory of FAST.Farm is flawed and cannot be analyzed for wind speed; 3. There is no problem with the code and FAST.Farm, this It is a manifestation of the unstable vortex caused by wake interference. The input file of FAST.Farm is shown below, and the three different pictures are shown below. The code used is Jason_PSD.m(The input command is:[ f1, Sf1, f1_Bin, Sf1_Bin ] = Jason_PSD(Data, 1/(96000*0.00625), 96000, 1, 10)).
I would be very grateful if you can provide guidance.
picture 1-3 is the input file(TSinflowA003.ftsf) for FAST.Farm. Sorry I cannot upload this file(TSinflowA003.ftsf).



windPSD-WT1、windPSD-WT2、windPSD-WT3



Dear Jundong.Wang,

It looks you are using Mod_AmbWind = 2 (not 1), using an “InflowWind.dat” input file to specify the inflow wind data via the InflowWind module. What type of wind have you specified in InflowWind.dat?

And what outputs from FAST.Farm or OpenFAST are you actually plotting with Jason_PSD, i.e., what is “Data” in Jason_PSD?

Best regards,

Dear Jason,
First of all, I apologize for misplaced the screenshot, I did use Mod_AmbWind=1.The “Data” is the wind in the out file output by FAST.Farm.as the picture shows.I also tried to change to a PSD code(instead of Jason_PSD), and the result was similar to the analysis result using the code,as the picture shows.
By the way,I did use Mod_AmbWind=2 with BTS file generated by TurbSimas simulation,answer the question you said.“type of wind have you specified in InflowWind.dat”.But I found the similar windPSD results.
Best regards.



Dear Jundong.Wang,

Just to be clear, “WindVel1X” is an output from the OpenFAST model that is driven by FAST.Farm, not a direct output of FAST.Farm. The WindVel1X output from the InflowWind module of OpenFAST represents the wind inflow to a given wind turbine (including wake effects for the downstream wind turbines.

I guess that you are concerned with the peaks in the PSDs every 0.45 Hz (or so), which appears to correspond to a three-per revolution (3P) harmonics of the rotor speed (at 9 rpm). I can’t fully explain why these are present in your model, but I’m also not sure that they have any physical influence on your results. To see the effect that is physically influential, I recommend plotting the PSDs on a linear-linear scale (perhaps letting the value at zero frequency, corresponding to the mean value of the time series, run off the scale). What do the PSDs look like then?

Best regards,