wecopttool.waves

Provide the wave definition structure and provide functions for creating different common types of waves.

This module provides the (empty) data structure for waves in wecopttool. It also provides functions for creating common types of waves such as regular waves and irregular waves. The data structure is a 2D complex xarray.DataArray containing the complex amplitude. The 2D coordinates are: wave angular frequency omega (rad/s) and direction wave_direction (rad).

This module uses wave spectrum data in the wavespectra.SpecArray format, but does not require that you use wavespectra.SpecArray objects.

Functions

elevation_fd

Construct the complex wave elevation xarray.DataArray.

regular_wave

Create the dataset for a regular wave.

long_crested_wave

Create a complex frequency-domain wave elevation from an omnidirectional spectrum.

irregular_wave

Create a complex frequency-domain wave elevation from a spectrum.

random_phase

Generate random phases in range [-π, π) radians.

omnidirectional_spectrum

Create the xarray.DataArray for an omnidirectional wave spectrum in the wavespectra.SpecArray format.

spectrum

Create the xarray.DataArray for an irregular wave in the wavespectra.SpecArray format.

pierson_moskowitz_spectrum

Calculate the Pierson-Moskowitz omni-directional wave spectrum for the specified frequencies and parameters.

jonswap_spectrum

Calculate the Joint North Sea Wave Project (JONSWAP) omni-directional wave spectrum for the specified frequencies and parameters.

spread_cos2s

Calculate the Cosine-2s spreading function for the specified frequencies and wave directions.

general_spectrum

Create a spectrum function.

pierson_moskowitz_params

Return the two PM parameters for the general spectrum formulation.