FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
marenv::wind::ConstantWind Class Reference

#include <ConstantWind.h>

+ Inheritance diagram for marenv::wind::ConstantWind:
+ Collaboration diagram for marenv::wind::ConstantWind:

Classes

struct  Parameters
 The wind's parameters. More...
 

Public Member Functions

 ConstantWind (const Parameters &parameters)
 
Status GetWind (double time, const double position[3], double windVelocity[3]) const override
 
double SpeedAt (double height) const
 
const Parameters & GetParameters () const
 The parameters given to the constructor.
 
- Public Member Functions inherited from marenv::wind::WindField
virtual ~WindField ()=default
 Virtual destructor.
 

Additional Inherited Members

- Protected Member Functions inherited from marenv::wind::WindField
 WindField ()=default
 The constructor is protected: WindField is an interface.
 

Detailed Description

A steady, horizontal wind, the same everywhere in the horizontal plane, its speed varying with the height by a profile (WindProfile).

Example usage:

p.speed = 9.0; // [m/s] at 10 m
p.fromRad = 225.0 * M_PI / 180.0; // from the south-west
facade.AddWindField("mean", std::make_shared<marenv::wind::ConstantWind>(p));
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 fromRad
The direction the wind comes from [rad], true, clockwise from north (meteorological).
Definition ConstantWind.h:37

Constructor & Destructor Documentation

◆ ConstantWind()

marenv::wind::ConstantWind::ConstantWind ( const Parameters &  parameters)
explicit

Constructor.

Parameters
[in]parametersThe wind's parameters.
Exceptions
std::invalid_argumentfor a parameter out of its range.

Member Function Documentation

◆ GetWind()

Status marenv::wind::ConstantWind::GetWind ( double  time,
const double  position[3],
double  windVelocity[3] 
) const
overridevirtual

Return the wind velocity in a given position and time.

Parameters
[in]timeTime stamp in simulation time [s].
[in]positionThe position to query for, NED [m].
[out]windVelocityThe velocity of the air in the given time and position, NED [m/s].
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Threading contract, as for current::CurrentField::GetCurrent(): GetWind() may be called from several threads at once and must not change the field's state; registration happens during setup.

Implements marenv::wind::WindField.

◆ SpeedAt()

double marenv::wind::ConstantWind::SpeedAt ( double  height) const

The mean wind speed at the height height above the mean sea level [m/s] (0 at and below the sea level).

Parameters
[in]heightHeight above the mean sea level [m].

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