41 #include "models/FGModel.h" 42 #include "math/FGColumnVector3.h" 43 #include "math/FGMatrix33.h" 44 #include "math/FGTable.h" 50 #define ID_WINDS "$Id: FGWinds.h,v 1.11 2015/02/27 20:36:47 bcoconni Exp $" 133 bool Run(
bool Holding);
134 bool InitModel(
void);
135 enum tType {ttNone, ttStandard, ttCulp, ttMilspec, ttTustin} turbType;
148 virtual void SetWindNED(
double wN,
double wE,
double wD) { vWindNED(1)=wN; vWindNED(2)=wE; vWindNED(3)=wD;}
151 virtual void SetWindNED(
int idx,
double wind) { vWindNED(idx)=wind;}
160 virtual double GetWindNED(
int idx)
const {
return vWindNED(idx);}
175 virtual void SetWindspeed(
double speed);
177 virtual double GetWindspeed(
void)
const;
182 virtual void SetGustNED(
int idx,
double gust) { vGustNED(idx)=gust;}
185 virtual void SetTurbNED(
int idx,
double turb) { vTurbulenceNED(idx)=turb;}
188 virtual void SetGustNED(
double gN,
double gE,
double gD) { vGustNED(eNorth)=gN; vGustNED(eEast)=gE; vGustNED(eDown)=gD;}
191 virtual double GetGustNED(
int idx)
const {
return vGustNED(idx);}
194 virtual double GetTurbNED(
int idx)
const {
return vTurbulenceNED(idx);}
201 virtual tType GetTurbType()
const {
return turbType;}
203 virtual void SetTurbGain(
double tg) {TurbGain = tg;}
204 virtual double GetTurbGain()
const {
return TurbGain;}
206 virtual void SetTurbRate(
double tr) {TurbRate = tr;}
207 virtual double GetTurbRate()
const {
return TurbRate;}
209 virtual void SetRhythmicity(
double r) {Rhythmicity=r;}
210 virtual double GetRhythmicity()
const {
return Rhythmicity;}
212 virtual double GetTurbPQR(
int idx)
const {
return vTurbPQR(idx);}
213 virtual double GetTurbMagnitude(
void)
const {
return vTurbulenceNED.
Magnitude();}
214 virtual double GetTurbDirection(
void)
const {
return TurbDirection;}
215 virtual const FGColumnVector3& GetTurbPQR(
void)
const {
return vTurbPQR;}
217 virtual void SetWindspeed20ft(
double ws) { windspeed_at_20ft = ws;}
218 virtual double GetWindspeed20ft()
const {
return windspeed_at_20ft;}
222 virtual int GetProbabilityOfExceedence()
const {
return probability_of_exceedence_index;}
242 enum eGustFrame {gfNone=0, gfBody, gfWind, gfLocal};
253 vWind.InitMatrix(0.0);
269 ringLatitude = ringLongitude = 0.0;
270 ringAltitude = 1000.0;
272 ringCoreRadius = 100.0;
273 circulation = 100000.0;
279 virtual void StartGust(
bool running) {oneMinusCosineGust.gustProfile.Running = running;}
285 virtual void EndGustDuration(
double dur) {oneMinusCosineGust.gustProfile.endDuration = dur;}
287 virtual void GustMagnitude(
double mag) {oneMinusCosineGust.magnitude = mag;}
295 virtual void GustFrame(eGustFrame gFrame) {oneMinusCosineGust.gustFrame = gFrame;}
304 void NumberOfUpDownburstCells(
int num);
321 double MagnitudedAccelDt, MagnitudeAccel, Magnitude, TurbDirection;
326 double wind_from_clockwise;
327 double spike, target_time, strength;
333 std::vector <struct UpDownBurst*> UpDownBurstCells;
336 double windspeed_at_20ft;
337 int probability_of_exceedence_index;
348 void Turbulence(
double h);
352 double CosineGustProfile(
double startDuration,
double steadyDuration,
354 double DistanceFromRingCenter(
double lat,
double lon);
356 virtual void bind(
void);
357 void Debug(
int from);
FGWinds(FGFDMExec *)
Constructor.
virtual void SteadyGustDuration(double dur)
Specifies the length of time that the gust is at a steady, full strength.
virtual void SetWindPsi(double dir)
Sets the direction that the wind is coming from.
virtual void StartGust(bool running)
Initiates the execution of the gust.
virtual void SetGustNED(int idx, double gust)
Sets a gust component in NED frame.
virtual void StartupGustDuration(double dur)
Specifies the duration of the startup portion of the gust.
virtual const FGColumnVector3 & GetTotalWindNED(void) const
Retrieves the total wind components in NED frame.
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 SetTurbNED(int idx, double turb)
Sets a turbulence component in NED frame.
virtual void EndGustDuration(double dur)
Specifies the length of time it takes for the gust to return to zero velocity.
virtual void SetWindNED(int idx, double wind)
Sets a wind component in NED frame.
virtual void GustYComponent(double y)
Specifies the Y component of velocity in the specified gust frame (ft/sec).
FGColumnVector3 vWindTransformed
virtual double GetGustNED(int idx) const
Retrieves a gust component in NED frame.
Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc.
virtual void SetGustNED(double gN, double gE, double gD)
Sets the gust components in NED frame.
virtual const FGColumnVector3 & GetGustNED(void) const
Retrieves the gust components in NED frame.
Stores information about a specified Up- or Down-burst.
Stores the information about a single one minus cosine gust instance.
virtual double GetTurbNED(int idx) const
Retrieves a turbulence component in NED frame.
virtual double GetWindPsi(void) const
Retrieves the direction that the wind is coming from.
Base class for all scheduled JSBSim models.
virtual void GustMagnitude(double mag)
Specifies the magnitude of the gust in feet/second.
virtual void SetTurbType(tType tt)
Turbulence models available: ttNone, ttStandard, ttBerndt, ttCulp, ttMilspec, ttTustin.
virtual void SetWindNED(const FGColumnVector3 &wind)
Sets the wind components in NED frame.
This class implements a 3 element column vector.
virtual const FGColumnVector3 & GetWindNED(void) const
Retrieves the wind components in NED frame.
virtual void GustFrame(eGustFrame gFrame)
Specifies the frame that the gust direction vector components are specified in.
virtual void GustXComponent(double x)
Specifies the X component of velocity in the specified gust frame (ft/sec).
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
Handles matrix math operations.
double Magnitude(void) const
Length of the vector.
virtual double GetWindNED(int idx) const
Retrieves a wind component in NED frame.
Encapsulates the JSBSim simulation executive.
bool Run(bool Holding)
Runs the winds model; called by the Executive Can pass in a value indicating if the executive is dire...