Marine systems simulation
Loading...
Searching...
No Matches
marenv::wave::WaveEnergySpectrum Class Reference

Represents a wave field.

#include <WaveEnergySpectrum.h>

+ Inheritance diagram for marenv::wave::WaveEnergySpectrum:
+ Collaboration diagram for marenv::wave::WaveEnergySpectrum:

Classes

struct  SpectrumParameters
 The parameters defining a certain wave field. More...
 

Public Types

enum class  DirectionSpectrum { None = 0 , CosineSquared }
 Shape function for the direction spectrum. More...
 
enum class  DirectionBinning { Random , Sequential }
 Methods for realisation of direction spectrum. More...
 
enum class  FrequencyBinning { EqualEnergy , EqualSqrtEnergy }
 Methods for dividing a spectrum in discrete frequencies. More...
 

Public Member Functions

 WaveEnergySpectrum (const SpectrumParameters &spectrumParameters, int numWaves, uint32_t randomSeed)
 
std::shared_ptr< WaveComponentsGetWaveComponents ()
 

Protected Types

using NormalizedProbabilityDistribution = double(WaveEnergySpectrum::*)(const double)
 Defines the type of a normalized probability distribution function.
 

Protected Member Functions

void CalcWaveDirections ()
 Calculates wave directions according to the specified spectrum parameters.
 
void CalcWaveFrequencies ()
 Calculates frequencies of each wave component.
 
double CosPower (double theta) const
 
double SpectralEnergy (double omega) const
 
double JONSWAP (double omega) const
 
double Issc (double omega) const
 

Protected Attributes

SpectrumParameters m_param
 Wave spectrum parameters.
 

Member Enumeration Documentation

◆ DirectionBinning

Enumerator
Random 

Random distribution according to the direction spectrum.

Sequential 

Higher energies in main direction.

◆ DirectionSpectrum

Enumerator
CosineSquared 

The function is of the form cos(theta)^n.

◆ FrequencyBinning

Enumerator
EqualEnergy 

Each wave component has the same energy.

EqualSqrtEnergy 

Each wave component has the same \( \int_{\omega_k}^{\omega_{k+1}} S(\omega)\, d\omega \).

Constructor & Destructor Documentation

◆ WaveEnergySpectrum()

marenv::wave::WaveEnergySpectrum::WaveEnergySpectrum ( const SpectrumParameters spectrumParameters,
int  numWaves,
uint32_t  randomSeed 
)

Constructor.

Parameters
[in]spectrumParametersSpectrum parameters.
[in]numWavesNumber of waves to construct from the spectrum.
[in]randomSeedThe random seed to use.

Member Function Documentation

◆ CosPower()

double marenv::wave::WaveEnergySpectrum::CosPower ( double  theta) const
protected

Computes \( \cos^{\text{cosinePower}}(\theta) \)

Parameters
[in]thetaThe wave direction relative to the main direction.
Returns
The cosine power of theta;

◆ GetWaveComponents()

std::shared_ptr< WaveComponents > marenv::wave::WaveEnergySpectrum::GetWaveComponents ( )

Get all wave components.

Returns
All wave components.

◆ Issc()

double marenv::wave::WaveEnergySpectrum::Issc ( double  omega) const
protected

Calculates the ISSC spectrum energy for a wave frequency.

Parameters
[in]omegaThe wave frequency
Returns
The ISSC spectrum energy for the given wave frequency.

◆ JONSWAP()

double marenv::wave::WaveEnergySpectrum::JONSWAP ( double  omega) const
protected

Calculates the JONSWAP spectrum energy for a wave frequency.

Parameters
[in]omegaThe wave frequency
Returns
The ISSC JONSWAP energy for the given wave frequency.

◆ SpectralEnergy()

double marenv::wave::WaveEnergySpectrum::SpectralEnergy ( double  omega) const
protected

Calculates the spectrum energy for a wave frequency.

Parameters
[in]omegaThe wave frequency
Returns
The spectrum energy for the given wave frequency.

The documentation for this class was generated from the following file: