32template <
typename Scalar>
33Scalar
linear(
const Scalar &altitude,
double base_wind,
double base_altitude,
35 return base_wind + shear_rate * (altitude - base_altitude);
51template <
typename Scalar>
54 double base_altitude,
double shear_rate) {
56 double base_speed = std::sqrt(base_wind.
north * base_wind.
north +
61 if (base_speed < 1e-10) {
63 .east = altitude * Scalar(0),
64 .down = altitude * Scalar(0)};
68 Scalar new_speed =
linear(altitude, base_speed, base_altitude, shear_rate);
69 Scalar scale = new_speed / base_speed;
72 .east = scale * base_wind.
east,
73 .down = scale * base_wind.
down};
97template <
typename Scalar>
98Scalar
power_law(
const Scalar &altitude,
double ref_wind,
99 double ref_altitude = 10.0,
double exponent = 1.0 / 7.0) {
102 return ref_wind * janus::pow(altitude / ref_altitude,
exponent);
115template <
typename Scalar>
119 double ref_altitude = 10.0,
double exponent = 1.0 / 7.0) {
121 double base_speed = std::sqrt(base_wind.
north * base_wind.
north +
125 if (base_speed < 1e-10) {
127 .east = altitude * Scalar(0),
128 .down = altitude * Scalar(0)};
132 Scalar scale = janus::pow(altitude / ref_altitude,
exponent);
135 .east = scale * base_wind.
east,
136 .down = scale * base_wind.
down};
161template <
typename Scalar>
162Scalar
logarithmic(
const Scalar &altitude,
double friction_velocity,
163 double roughness_length,
double displacement = 0.0) {
165 Scalar effective_height = altitude - displacement;
167 janus::log(effective_height / roughness_length);
185 double roughness_length,
186 double displacement = 0.0) {
187 double effective_height = ref_altitude - displacement;
189 std::log(effective_height / roughness_length);
212inline constexpr double STABLE = 1.0 / 3.0;
Definition WindShear.hpp:208
constexpr double STABLE
Definition WindShear.hpp:212
constexpr double NEUTRAL
Definition WindShear.hpp:211
constexpr double UNSTABLE
Definition WindShear.hpp:209
Definition WindShear.hpp:196
constexpr double RURAL
Definition WindShear.hpp:199
constexpr double SUBURBAN
Definition WindShear.hpp:200
constexpr double OPEN_TERRAIN
Definition WindShear.hpp:198
constexpr double URBAN
Definition WindShear.hpp:201
constexpr double OPEN_WATER
Definition WindShear.hpp:197
Definition WindShear.hpp:7
Scalar logarithmic(const Scalar &altitude, double friction_velocity, double roughness_length, double displacement=0.0)
Logarithmic wind profile (neutral atmospheric boundary layer).
Definition WindShear.hpp:162
Scalar linear(const Scalar &altitude, double base_wind, double base_altitude, double shear_rate)
Linear wind shear profile.
Definition WindShear.hpp:33
constexpr double VON_KARMAN_CONSTANT
von Kármán constant for atmospheric boundary layer
Definition WindShear.hpp:14
wind::WindVector< Scalar > linear_vector(const Scalar &altitude, const wind::WindVector< double > &base_wind, double base_altitude, double shear_rate)
Linear wind shear returning full wind vector.
Definition WindShear.hpp:53
wind::WindVector< Scalar > power_law_vector(const Scalar &altitude, const wind::WindVector< double > &base_wind, double ref_altitude=10.0, double exponent=1.0/7.0)
Power-law wind profile returning full wind vector.
Definition WindShear.hpp:117
Scalar power_law(const Scalar &altitude, double ref_wind, double ref_altitude=10.0, double exponent=1.0/7.0)
Power-law wind profile (typical for atmospheric boundary layer).
Definition WindShear.hpp:98
double friction_velocity_from_ref(double ref_wind, double ref_altitude, double roughness_length, double displacement=0.0)
Compute friction velocity from reference wind.
Definition WindShear.hpp:184
3D wind velocity in NED frame
Definition WindTypes.hpp:21
Scalar north
North component [m/s].
Definition WindTypes.hpp:22
Scalar east
East component [m/s].
Definition WindTypes.hpp:23
Scalar down
Down component [m/s].
Definition WindTypes.hpp:24