srmainwaring / asv_wave_sim

This package contains plugins that support the simulation of waves and surface vessels in Gazebo.
GNU General Public License v3.0
126 stars 36 forks source link

Which spectrum is used for FFT waves? #169

Closed ConnorDTaylor closed 4 months ago

ConnorDTaylor commented 4 months ago

Is the P-M spectrum or ECKV spectrum used in the 'fft' wave algorithm?

I am trying to determine which of the wave spectrums are being used, in the source code I am seeing the P-M spectrum and the ECKV spectrum. It is unclear to me which spectrum is actually being used in the simulator though.

I thought it was the P-M spectrum with the cosine-2s spreading function, but I don't know for sure.

Connor

srmainwaring commented 4 months ago

ECKV with ECKV spreading for standing waves or Cos2s for travelling (the default).

https://github.com/srmainwaring/asv_wave_sim/blob/40eed5158fcab37421826ffa3ba33aab94d55e28/gz-waves/src/LinearRandomFFTWaveSimulation.cc#L283-L297

ConnorDTaylor commented 4 months ago

For my understanding: Do both of these spreading functions get used in the simulator simultaneously? Or is there a setting which defines which spreading function is used?

srmainwaring commented 4 months ago

Looks like it's hardcoded to use the travelling wave version:

https://github.com/srmainwaring/asv_wave_sim/blob/40eed5158fcab37421826ffa3ba33aab94d55e28/gz-waves/src/LinearRandomFFTWaveSimulationImpl.hh#L213

So, Cos2s always.