FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
OceanOptics.h
1#pragma once
2
3#include <cstddef>
4#include <marenv/wave/WaveField.h>
5
16namespace visual::optics
17{
18
20constexpr double kGravity = 9.81;
21
24{
25 double xx = 0.0;
26 double yy = 0.0;
27 double xy = 0.0;
28
30 [[nodiscard]] double MeanSquareSlope() const { return xx + yy; }
31};
32
40SlopeCovariance RotateSlopeCovariance(double along, double across, double angle);
41
44{
45 std::size_t count = 0;
46 double significantHeight = 0.0;
47 double meanDirection = 0.0;
48 double maxWaveNumber = 0.0;
50};
51
57SeaStateStatistics ComputeSeaStateStatistics(const marenv::wave::WaveComponentData& components);
58
66double WindSpeedFromSignificantHeight(double significantHeight);
67
70double RmsCrestAcceleration(const marenv::wave::WaveComponentData& components);
71
74double GaussianTailThreshold(double fraction);
75
84SlopeCovariance CoxMunkSlopeCovariance(double windSpeed, double windDirection);
85
97SlopeCovariance UnresolvedSlopeCovariance(const SlopeCovariance& resolved, double windSpeed, double windDirection, double floorFraction = 0.2);
98
109double GpuAiryElevation(const marenv::wave::WaveComponentData& components, double time, double x, double y);
110
124double GpuGerstnerSurface(const marenv::wave::WaveComponentData& components, double time, double x, double y, double& xOut, double& yOut);
125
126} // namespace visual::optics
Details of a wave component.
Definition WaveField.h:30
Statistics of a set of realised wave components.
Definition OceanOptics.h:44
double meanDirection
Energy-weighted circular mean of the directions [rad]; 0 without energy.
Definition OceanOptics.h:47
double maxWaveNumber
Largest wave number [rad/m].
Definition OceanOptics.h:48
double significantHeight
Hs = 4 sqrt(sum a^2 / 2) [m].
Definition OceanOptics.h:46
std::size_t count
Number of components.
Definition OceanOptics.h:45
SlopeCovariance resolvedSlope
Slope covariance of the components: sum a^2 k k^T / 2.
Definition OceanOptics.h:49
Covariance of the surface slopes (dz/dx, dz/dy) in the horizontal NED frame [-].
Definition OceanOptics.h:24
double yy
Variance of the slope along y (east).
Definition OceanOptics.h:26
double xx
Variance of the slope along x (north).
Definition OceanOptics.h:25
double MeanSquareSlope() const
Definition OceanOptics.h:30
double xy
Covariance.
Definition OceanOptics.h:27