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 non-FFT based linear random wave model #97

Closed srmainwaring closed 1 year ago

srmainwaring commented 1 year ago

This PR adds a non-FFT variant of a linear random wave model for comparison and benchmarking.

Simulations for wave energy devices usually have some variant of a wave model comprised of a sum over linear waves with randomised phases. The sums are typically computed by simple loops over the components and the amplitudes are drawn from a suitable wave spectrum. While not efficient for simulating a wave field where samples must be taken at many points, the models is practical for simulating linear wave body interactions where the field is evaluated at the origin at each time step.

Details

Other

Usage

A limited set of parameters may be configured for the model and visual plugins.

<plugin
    filename="gz-waves1-waves-model-system"
    name="gz::sim::systems::WavesModel">
  <static>0</static>
  <update_rate>30</update_rate>
  <wave>
    <algorithm>linear_random</algorithm>
    <tile_size>256</tile_size>
    <cell_count>128</cell_count>
    <wind_speed>5.0</wind_speed>
    <wind_angle_deg>135</wind_angle_deg>
  </wave>
</plugin>
<plugin
    filename="gz-waves1-waves-visual-system"
    name="gz::sim::systems::WavesVisual">
  <static>0</static>
  <mesh_deformation_method>DYNAMIC_GEOMETRY</mesh_deformation_method>
  <tiles_x>-0 0</tiles_x>
  <tiles_y>-0 0</tiles_y>
  <wave>
    <algorithm>linear_random</algorithm>
    <tile_size>256</tile_size>
    <cell_count>128</cell_count>
    <wind_speed>5.0</wind_speed>
    <wind_angle_deg>135</wind_angle_deg>
  </wave>
</plugin>

Future work