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
110 stars 29 forks source link

Add wave spectrum, elevation and pressure plots #96

Closed srmainwaring closed 1 year ago

srmainwaring commented 1 year ago

This PR adds test programs for plotting the spectrum, elevation and pressure for the different wave simulation types.

The examples depend on the header from gnuplot-iostream (https://github.com/dstahlke/gnuplot-iostream.git) which is provided using cmake FetchContent. Inspiration drawn from the the test programs for the free surface hydrodynamics in buoy_sim.

The examples are run from the workspace directory:

./install/bin/PLOT_WaveSpectrum

Figures: Omni-directional ECKV and Pierson-Moskowitz wave spectra as a function of wavenumber.

PLOT_WaveSpectrum_PM PLOT_WaveSpectrum_ECKV

./install/bin/PLOT_LinearRegularWaves
./install/bin/PLOT_LinearRandomFFTWaves

Figures: Random FFT wave elevation at origin with no horizontal displacement: 1. as a function of time, 2. as function of position. Normalised pressure at varying depths as function of position.

PLOT_LinearRandomFFTWaves_1 PLOT_LinearRandomFFTWaves_2 PLOT_LinearRandomFFTWaves_3