Waves

Wave spectra and wave loads functionality can be found in the mclsimpy.waves subpackage.

Wave Spectra

The mclsimpy.waves.wave_spectra module containts basic wave spectra functionality.

class mclsimpy.waves.wave_spectra.BaseSpectrum(freq, freq_hz=False)

Base class for 1-D Wave Spectra.

Parameters:
  • freq (1-D array) – Frequencies of wave spectrum

  • freq_hz (bool) – Boolean to define spectrum in either rad/s (false) or Hz (true)

__init__(freq, freq_hz=False)
moment(n, *args, **kwargs)

Calculate n-th spectral moment.

realization(time, *args, **kwargs)

Generate a wave realization from wave spectrum at a fixed position.

Parameters:
  • time (1D-array) – Array of time points used in realization

  • *args (tuple) – Additional arguments should be passed as keyword arguments

  • **kwargs (dict) – Wave spectrum parameters like hs and tp, include gamma for JONSWAP wave spectrum.

Returns:

timeseries – Array of wave elevation at different time instances for a fixed point (x=0).

Return type:

1D-array

Modified Pierson Moskowitz

class mclsimpy.waves.wave_spectra.ModifiedPiersonMoskowitz(freq, freq_hz=False)
__call__(hs, tp, freq_hz=None)

Generate a Modified Pierson-Moskowitz wave spectrum.

Parameters:
  • hs (float) – Significant wave height

  • tp (float) – Peak period of wave spectrum

  • freq_hz (bool) – Wave spectrum and frequencies in Hz or rad/s.

Returns:

  • freq (1D-array) – Array of frequencies in wave spectrum

  • spectrum (1D-array) – 1D Modified Pierson-Moskowitz wave spectrum

JONSWAP

class mclsimpy.waves.wave_spectra.JONSWAP(freq, freq_hz=False)
__call__(hs, tp, gamma=1, freq_hz=None)

Generate a JONSWAP wave spectrum.

Parameters:
  • hs (float) – Significant wave heihgt

  • tp (float) – Peak period of wave spectrum

  • gamma (float) – Steapness factor

  • freq_hz (bool, default=False) – Frequency in Hz or rad/s

Returns:

  • freq (1D-array) – Frequencies of wave spectrum

  • spectrum (1D-array) – 1D JONSWAP wave spectrum

Wave Loads

class mclsimpy.waves.wave_loads.WaveLoad(wave_amps, freqs, eps, angles, config_file, rho=1025, g=9.81, dof=6, depth=100, deep_water=True, qtf_method='Newman', qtf_interp_angles=True, interpolate=True)

Class for computation of wave loads on floating structure. Both 1st and 2nd order wave loads are considered.

_N

Number of wave components.

Type:

int

_amp

Wave amplitudes.

Type:

1D-array

_freqs

Wave frequencies.

Type:

1D-array

_eps

Random wave phases.

Type:

1D-array

_angles

Wave directional angles.

Type:

1D-array

_qtf_angles

Array of angles used in computation of QTFs in Veres.

Type:

1D-array

_params

Vessel parameters with 1nd and 2nd order transfer functions.

Type:

dict

_g

Gravitational acceleration constant.

Type:

float

_k

Wave number for each wave component found by linear deep-water dispersion relation.

Type:

1D-array

_rho

Water density.

Type:

float

_W

2D array of difference frequencies for each wave pair.

Type:

N x N - array

_P

2D array of phase difference for each wave pair.

Type:

N x N - array

_Q

Array of full QTFs for each DOF, for M relative wave angles and N wave components.

Type:

6 x M x N x N - array

_forceRAOamp

Vessel force RAO amplitude for the given wave frequencies _freq.

Type:

array_like

_forceRAOphase

Vessel force RAO phase for the given wave frequencies _freq.

Type:

array_like

__call__(time, eta)

Calculate first- and second-order wave loads.

__init__(wave_amps, freqs, eps, angles, config_file, rho=1025, g=9.81, dof=6, depth=100, deep_water=True, qtf_method='Newman', qtf_interp_angles=True, interpolate=True)

Initialize a WaveLoad object for a sea state.

Parameters:
  • wave_amps (array_like) – 1D array of wave amplitudes

  • freqs (array_like) – 1D array of frequencies [rad/s]

  • eps (array_like) – 1D array of random phase [rad/s]

  • angles (array_like) – 1D array of wave angles (defined as going to).

  • config_file (path_like) – File path to vessel configuration file. This can be obtained directly from a Vessel object using Vessel._config_file.

  • rho (float (default = 1025)) – Water density

  • g (float (default 9.81)) – Gravitational acceleration

  • depth (float (default = 1000)) – Water depth. Only used when deep water is False. Used to compute the dispersion relation.

  • deep_water (bool (default = True)) – Boolean to specify if infinite deep water assumption.

  • qtf_method (string (default = "Newman")) – QTF approximation method. Can be either “Newman” or “geo-mean” as specified in the WaveLoad.QTF_METHODS.

  • qtf_interp_angles (bool (default = True)) – Boolean to specify whether or not to use interpolation over the wave angles when computing the QTF matrices.

  • interpolate (bool (default = True)) – Boolean value to specify whether or not to use 1D interpolation over the frequencies when computing the first-order force RAO matrices and QTF matrices.

_full_qtf_6dof(qtf_headings, qtf_freqs, qtfs, method=None, interpolate=None, qtf_interp_angles=None)

Generate the full QTF matrix for all DOF, all headings with calculated QTF and for all wave frequency components.

ShipX only calculates the mean drift force for surge, sway, and yaw. Hence, the QTFs are only calculated for these DOFs.

The off-diagonal terms of the QTFs are calculated using Newmanns approximation [3]. The user can specify whether to interpolate over frequencies and angles, or to use the closest value. It is recommended to at least use interpolation over the frequencies. The default QTF approximation use the arithmetic mean. An alternative method for computing the off-diagonal terms is the geometric mean [4]. The geometric mean results in lower QTF values for the far-from off-diagonal terms.

Parameters:
  • qtf_headings (1D-array) – Headings used for calculations of QTFs in diffraction program (ShipX etc)

  • qtf_freqs (1D-array) – Frequencies used in calculations of QTS in diffraction program (Shipx etc)

  • qtfs (6 x n x m - array) – QTFs calculated for 6 DOF for n frequencies and m headings.

  • method (string (default="Newman")) – Method to be used for approximating off-diagonal terms. Newman approximation is the default method, geometric mean (as used in OrcaFlex) is the other.

  • interpolate (bool (default=True)) – 1D Interpolation if the mean drift components w.r.t frequency.

  • qtf_interp_angles (bool (default=True)) – Interpolate the QTFs w.r.t relative incident wave angle.

Returns:

Q – Approximated full QTF for 6 DOF, M headings and N wave frequencies.

Return type:

6 x M x N x N array

See also

WaveLoad.get_methods, WaveLoad.QTF_METHODS

References

_set_force_raos(interpolate=None)

Function to set the force RAOs to be used in calculation of 1st order wave loads. Selected for the wave frequencies of the sea-state by closest index or interpolated over frequencies.

first_order_loads(t, eta)

Calculate first order wave-loads by super position of wave load from each individual wave component.

Parameters:
  • self (Vessel object) –

  • t (float) – Time instance

  • rel_angle (array_like) – Relative wave incident angle for each wave component

  • eta (array_like) – Pose of vessel

Returns:

tau_wf – First order wave-frequency load for each DOF.

Return type:

6x1 array

second_order_loads(t, heading)

Calcualation of second order drift loads.

Estimate 2nd order drift loads using either Newman [1] or formulation from Standing, Brendling and Wilson [2] (as used by OrcaFlex).

Parameters:
  • t (float) – Time.

  • heading (float) – Vessel heading in NED-frame.

Returns:

tau_sv – Array of slowly-vayring load components for each DOF.

Return type:

6x1 - array

References