Represents a wave field.
#include <WaveEnergySpectrum.h>
|
|
using | NormalizedProbabilityDistribution = double(WaveEnergySpectrum::*)(const double) |
| | Defines the type of a normalized probability distribution function.
|
| |
◆ 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 \).
|
◆ WaveEnergySpectrum()
| marenv::wave::WaveEnergySpectrum::WaveEnergySpectrum |
( |
const SpectrumParameters & |
spectrumParameters, |
|
|
int |
numWaves, |
|
|
uint32_t |
randomSeed |
|
) |
| |
Constructor.
- Parameters
-
| [in] | spectrumParameters | Spectrum parameters. |
| [in] | numWaves | Number of waves to construct from the spectrum. |
| [in] | randomSeed | The random seed to use. |
- Exceptions
-
| std::invalid_argument | for a non-finite or negative Hs, a non-finite or non-positive T1, a non-finite Theta, frequency limits that are not finite with 0 <= lower < upper, and a negative numWaves (0 gives a sea state without components). |
| std::runtime_error | if the spectrum is NaN. Hs = 0 is legal: a calm sea, with the components of the frequency grid and zero amplitude. |
◆ BinFrequency()
| double marenv::wave::WaveEnergySpectrum::BinFrequency |
( |
double |
omegaLow, |
|
|
double |
omegaHigh, |
|
|
double |
step |
|
) |
| const |
|
protected |
Frequency of a bin: the energy-weighted mean \( \int \omega S(\omega)\, d\omega / \int S(\omega)\, d\omega \) over [omegaLow, omegaHigh] (owner ruling D50), both integrals by the same composite Simpson rule as IntegrateSpectrum().
- Parameters
-
| [in] | omegaLow | Lower frequency limit of the bin. |
| [in] | omegaHigh | Upper frequency limit of the bin. |
| [in] | step | The widest panel to use, as for IntegrateSpectrum(). |
- Returns
- The weighted mean frequency. A bin of zero width or zero energy has no weighting: the midpoint is returned.
◆ CalcBinEdges()
| std::vector< double > marenv::wave::WaveEnergySpectrum::CalcBinEdges |
( |
| ) |
const |
|
protected |
The edges of the frequency bins for the binning mode: numWaves + 1 ascending values, the first and the last being the ends of the frequency range. Needs a spectrum with energy (Hs > 0).
◆ CalcWaveDirections()
| void marenv::wave::WaveEnergySpectrum::CalcWaveDirections |
( |
calc::LcgRandom & |
random | ) |
|
|
protected |
Calculates wave directions according to the specified spectrum parameters.
- Parameters
-
| [in,out] | random | The generator of the whole spectrum. Directions and phases are drawn from it in turn, so the two are independent. |
◆ CalcWaveFrequencies()
| void marenv::wave::WaveEnergySpectrum::CalcWaveFrequencies |
( |
| ) |
|
|
protected |
Calculates frequencies of each wave component.
The bins cover the whole cumulative distribution, from probability 0 to 1. The energy of a bin is the integral of the spectrum over the bin, so the energies add up to the spectrum energy \( m_0 \) over the frequency range and \( H_s = 4\sqrt{m_0} \) is realised for any number of components. The frequency of a bin is its energy-weighted mean frequency (BinFrequency()), for both binning modes; the wave number follows from it.
◆ CosPower()
| double marenv::wave::WaveEnergySpectrum::CosPower |
( |
double |
theta | ) |
const |
|
protected |
Computes \( \cos^{\text{cosinePower}}(\theta) \)
- Parameters
-
| [in] | theta | The 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.
◆ IntegrateSpectrum()
| double marenv::wave::WaveEnergySpectrum::IntegrateSpectrum |
( |
double |
omegaLow, |
|
|
double |
omegaHigh, |
|
|
double |
step |
|
) |
| const |
|
protected |
Integral of the spectrum over [omegaLow, omegaHigh] (Simpson's rule).
- Parameters
-
| [in] | omegaLow | Lower frequency limit. |
| [in] | omegaHigh | Upper frequency limit. |
| [in] | step | The widest panel to use. |
- Returns
- The energy of the spectrum in the band, \( \int S(\omega)\, d\omega \).
◆ Issc()
| double marenv::wave::WaveEnergySpectrum::Issc |
( |
double |
omega | ) |
const |
|
protected |
Calculates the ISSC spectrum energy for a wave frequency.
- Parameters
-
| [in] | omega | The 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] | omega | The 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] | omega | The wave frequency |
- Returns
- The spectrum energy for the given wave frequency.
The documentation for this class was generated from the following file: