FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
ConstantWind.h
1#pragma once
3
4#include <marenv/wind/WindField.h>
5
6namespace marenv::wind
7{
11enum class WindProfile
12{
13 Uniform,
14 PowerLaw,
15 LogLaw
16};
17
30class ConstantWind : public WindField
31{
32public:
35 {
36 double speed = 0.0;
37 double fromRad = 0.0;
38 double referenceHeight = 10.0;
40 double powerExponent = 0.12;
41 double roughnessLength = 0.0002;
42 double minimumHeight = 1.0;
43 };
44
50 explicit ConstantWind(const Parameters& parameters);
51 ~ConstantWind() override = default;
52
54 Status GetWind(double time, const double position[3], double windVelocity[3]) const override;
55
60 double SpeedAt(double height) const;
61
63 const Parameters& GetParameters() const { return m_parameters; }
64
65private:
66 Parameters m_parameters;
67 double m_towards[2] {};
68};
69} // namespace marenv::wind
Definition ConstantWind.h:31
const Parameters & GetParameters() const
The parameters given to the constructor.
Definition ConstantWind.h:63
ConstantWind(const Parameters &parameters)
double SpeedAt(double height) const
Status GetWind(double time, const double position[3], double windVelocity[3]) const override
Definition WindField.h:19
Status
Definition marenv.h:44
WindProfile
Definition ConstantWind.h:12
@ PowerLaw
U(h) = U_ref (h / h_ref)^alpha (DNV-RP-C205: alpha about 0.12 over open sea).
@ LogLaw
U(h) = U_ref ln(h / z0) / ln(h_ref / z0), z0 the roughness length (open sea about 0....
@ Uniform
The same speed at every height.
The wind's parameters.
Definition ConstantWind.h:35
double speed
Mean wind speed at the reference height [m/s], >= 0.
Definition ConstantWind.h:36
double powerExponent
alpha of WindProfile::PowerLaw, >= 0.
Definition ConstantWind.h:40
double roughnessLength
z0 of WindProfile::LogLaw [m], > 0 and below minimumHeight.
Definition ConstantWind.h:41
WindProfile profile
How the speed varies with the height.
Definition ConstantWind.h:39
double minimumHeight
Heights between the sea level and this [m] get this height's speed, > 0.
Definition ConstantWind.h:42
double fromRad
The direction the wind comes from [rad], true, clockwise from north (meteorological).
Definition ConstantWind.h:37
double referenceHeight
The height of speed above the mean sea level [m], > 0.
Definition ConstantWind.h:38