41#include "models/FGModel.h"
42#include "math/FGMatrix33.h"
181 bool Run(
bool Holding)
override;
182 bool InitModel(
void)
override;
183 enum tType {ttNone, ttStandard, ttCulp, ttMilspec, ttTustin} turbType;
196 virtual void SetWindNED(
double wN,
double wE,
double wD) { vWindNED(1)=wN; vWindNED(2)=wE; vWindNED(3)=wD;}
199 virtual void SetWindNED(
int idx,
double wind) { vWindNED(idx)=wind;}
208 virtual double GetWindNED(
int idx)
const {
return vWindNED(idx);}
224 virtual void SetWindspeed(
double speed);
226 virtual double GetWindspeed(
void)
const;
231 virtual void SetGustNED(
int idx,
double gust) { vGustNED(idx)=gust;}
234 virtual void SetTurbNED(
int idx,
double turb) { vTurbulenceNED(idx)=turb;}
237 virtual void SetGustNED(
double gN,
double gE,
double gD) { vGustNED(eNorth)=gN; vGustNED(eEast)=gE; vGustNED(eDown)=gD;}
240 virtual double GetGustNED(
int idx)
const {
return vGustNED(idx);}
243 virtual double GetTurbNED(
int idx)
const {
return vTurbulenceNED(idx);}
251 virtual tType GetTurbType()
const {
return turbType;}
253 virtual void SetTurbGain(
double tg) {TurbGain = tg;}
254 virtual double GetTurbGain()
const {
return TurbGain;}
256 virtual void SetTurbRate(
double tr) {TurbRate = tr;}
257 virtual double GetTurbRate()
const {
return TurbRate;}
259 virtual void SetRhythmicity(
double r) {Rhythmicity=r;}
260 virtual double GetRhythmicity()
const {
return Rhythmicity;}
262 virtual double GetTurbPQR(
int idx)
const {
return vTurbPQR(idx);}
263 virtual double GetTurbMagnitude(
void)
const {
return vTurbulenceNED.
Magnitude();}
264 virtual double GetTurbDirection(
void)
const {
return TurbDirection;}
265 virtual const FGColumnVector3& GetTurbPQR(
void)
const {
return vTurbPQR;}
267 virtual void SetWindspeed20ft(
double ws) { windspeed_at_20ft = ws;}
268 virtual double GetWindspeed20ft()
const {
return windspeed_at_20ft;}
272 virtual int GetProbabilityOfExceedence()
const {
return probability_of_exceedence_index;}
292 enum eGustFrame {gfNone=0, gfBody, gfWind, gfLocal};
303 vWind.InitMatrix(0.0);
354 void NumberOfUpDownburstCells(
int num);
371 double MagnitudedAccelDt, MagnitudeAccel, Magnitude, TurbDirection;
376 double wind_from_clockwise;
377 double spike, target_time, strength;
383 std::vector <struct UpDownBurst*> UpDownBurstCells;
386 double windspeed_at_20ft;
387 int probability_of_exceedence_index;
392 double xi_u_km1, nu_u_km1;
393 double xi_v_km1, xi_v_km2, nu_v_km1, nu_v_km2;
394 double xi_w_km1, xi_w_km2, nu_w_km1, nu_w_km2;
395 double xi_p_km1, nu_p_km1;
396 double xi_q_km1, xi_r_km1;
406 std::optional<unsigned int> RandomSeed;
407 std::shared_ptr<RandomNumberGenerator> generator;
409 void SetRandomSeed(
int sr);
410 int GetRandomSeed(
void)
const;
412 void Turbulence(
double h);
416 double CosineGustProfile(
double startDuration,
double steadyDuration,
417 double endDuration,
double elapsedTime);
418 double DistanceFromRingCenter(
double lat,
double lon);
420 virtual void bind(
void);
421 void Debug(
int from)
override;
This class implements a 3 element column vector.
double Magnitude(void) const
Length of the vector.
Encapsulates the JSBSim simulation executive.
Handles matrix math operations.
Base class for all scheduled JSBSim models.
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
virtual const FGColumnVector3 & GetWindNED(void) const
Retrieves the wind components in NED frame.
virtual void SetWindNED(const FGColumnVector3 &wind)
Sets the wind components in NED frame.
virtual void GustMagnitude(double mag)
Specifies the magnitude of the gust in feet/second.
virtual const FGColumnVector3 & GetTotalWindNED(void) const
Retrieves the total wind components in NED frame.
virtual void GustXComponent(double x)
Specifies the X component of velocity in the specified gust frame (ft/sec).
virtual void SetWindNED(int idx, double wind)
Sets a wind component in NED frame.
virtual void SetTurbNED(int idx, double turb)
Sets a turbulence component in NED frame.
virtual void SetWindPsi(double dir)
Sets the direction that the wind is coming from.
virtual void StartupGustDuration(double dur)
Specifies the duration of the startup portion of the gust.
bool Run(bool Holding) override
Runs the winds model; called by the Executive Can pass in a value indicating if the executive is dire...
virtual void SetTurbType(tType tt)
Turbulence models available: ttNone, ttStandard, ttBerndt, ttCulp, ttMilspec, ttTustin.
virtual double GetTurbNED(int idx) const
Retrieves a turbulence component in NED frame.
virtual void SteadyGustDuration(double dur)
Specifies the length of time that the gust is at a steady, full strength.
virtual void EndGustDuration(double dur)
Specifies the length of time it takes for the gust to return to zero velocity.
virtual double GetTotalWindNED(int idx) const
Retrieves a total wind component in NED frame.
virtual void SetWindNED(double wN, double wE, double wD)
Sets the wind components in NED frame.
virtual void GustZComponent(double z)
Specifies the Z component of velocity in the specified gust frame (ft/sec).
virtual void SetProbabilityOfExceedence(int idx)
allowable range: 0-7, 3=light, 4=moderate, 6=severe turbulence
virtual double GetWindNED(int idx) const
Retrieves a wind component in NED frame.
virtual void GustFrame(eGustFrame gFrame)
Specifies the frame that the gust direction vector components are specified in.
virtual double GetGustNED(int idx) const
Retrieves a gust component in NED frame.
virtual void GustYComponent(double y)
Specifies the Y component of velocity in the specified gust frame (ft/sec).
virtual void StartGust(bool running)
Initiates the execution of the gust.
virtual const FGColumnVector3 & GetGustNED(void) const
Retrieves the gust components in NED frame.
virtual double GetWindPsi(void) const
Retrieves the direction that the wind is coming from.
virtual void SetGustNED(double gN, double gE, double gD)
Sets the gust components in NED frame.
virtual void SetGustNED(int idx, double gust)
Sets a gust component in NED frame.
Stores the information about a single one minus cosine gust instance.
FGColumnVector3 vWindTransformed
struct OneMinusCosineProfile gustProfile
Stores information about a specified Up- or Down-burst.
struct OneMinusCosineProfile oneMCosineProfile