X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGAtmosphere.h;h=3dd6fa322b333b81417825d68f4905fd3151f9ad;hb=4a817a63079733469d76905902509a40af019535;hp=84d3f072a33857c063152dc63f0315eddad232b9;hpb=10366f4f1b91bfb037060a3f02d5c4056edac6c5;p=flightgear.git
diff --git a/src/FDM/JSBSim/models/FGAtmosphere.h b/src/FDM/JSBSim/models/FGAtmosphere.h
index 84d3f072a..3dd6fa322 100644
--- a/src/FDM/JSBSim/models/FGAtmosphere.h
+++ b/src/FDM/JSBSim/models/FGAtmosphere.h
@@ -35,8 +35,8 @@ HISTORY
SENTRY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#ifndef FGAtmosphere_H
-#define FGAtmosphere_H
+#ifndef FGATMOSPHERE_H
+#define FGATMOSPHERE_H
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
INCLUDES
@@ -44,12 +44,13 @@ INCLUDES
#include "FGModel.h"
#include "math/FGColumnVector3.h"
+#include "math/FGTable.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_ATMOSPHERE "$Id: FGAtmosphere.h,v 1.22 2009/10/02 10:30:09 jberndt Exp $"
+#define ID_ATMOSPHERE "$Id: FGAtmosphere.h,v 1.24 2010/11/18 12:38:06 jberndt Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@@ -63,9 +64,60 @@ CLASS DOCUMENTATION
/** Models the 1976 Standard Atmosphere.
@author Tony Peden, Jon Berndt
- @version $Id: FGAtmosphere.h,v 1.22 2009/10/02 10:30:09 jberndt Exp $
+ @version $Id: FGAtmosphere.h,v 1.24 2010/11/18 12:38:06 jberndt Exp $
@see Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
1989, ISBN 0-07-001641-0
+
+ Additionally, various turbulence models are available. They are specified
+ via the property atmosphere/turb-type. The following models are
+ available:
+ - 0: ttNone (turbulence disabled)
+ - 1: ttStandard
+ - 2: ttBerndt
+ - 3: ttCulp
+ - 4: ttMilspec (Dryden spectrum)
+ - 5: ttTustin (Dryden spectrum)
+
+ The Milspec and Tustin models are described in the Yeager report cited below.
+ They both use a Dryden spectrum model whose parameters (scale lengths and intensities)
+ are modelled according to MIL-F-8785C. Parameters are modelled differently
+ for altitudes below 1000ft and above 2000ft, for altitudes in between they
+ are interpolated linearly.
+
+ The two models differ in the implementation of the transfer functions
+ described in the milspec.
+
+ To use one of these two models, set atmosphere/turb-type to 4 resp. 5,
+ and specify values for atmosphere/turbulence/milspec/windspeed_at_20ft_AGL-fps
+ and atmosphere/turbulence/milspec/severity (the latter corresponds to
+ the probability of exceedence curves from Fig. 7 of the milspec, allowable
+ range is 0 (disabled) to 7). atmosphere/psiw-rad is respected as well;
+ note that you have to specify a positive wind magnitude to prevent psiw from
+ being reset to zero.
+
+ Reference values (cf. figures 7 and 9 from the milspec):
+
+
Intensity
+
windspeed_at_20ft_AGL-fps
+
severity
+
light
+
25 (15 knots)
+
3
+
moderate
+
50 (30 knots)
+
4
+
severe
+
75 (45 knots)
+
6
+
+
+ @see Yeager, Jessie C.: "Implementation and Testing of Turbulence Models for
+ the F18-HARV" (
+ pdf), NASA CR-1998-206937, 1998
+
+ @see MIL-F-8785C: Military Specification: Flying Qualities of Piloted Aircraft
+
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -83,7 +135,7 @@ public:
@return false if no error */
bool Run(void);
bool InitModel(void);
- enum tType {ttNone, ttStandard, ttBerndt, ttCulp} turbType;
+ enum tType {ttNone, ttStandard, ttBerndt, ttCulp, ttMilspec, ttTustin} turbType;
/// Returns the temperature in degrees Rankine.
double GetTemperature(void) const {return *temperature;}
@@ -153,7 +205,7 @@ public:
// TOTAL WIND access functions (wind + gust + turbulence)
/// Retrieves the total wind components in NED frame.
- FGColumnVector3& GetTotalWindNED(void) { return vTotalWindNED; }
+ const FGColumnVector3& GetTotalWindNED(void) const { return vTotalWindNED; }
/// Retrieves a total wind component in NED frame.
double GetTotalWindNED(int idx) const {return vTotalWindNED(idx);}
@@ -209,7 +261,7 @@ public:
/// Retrieves the gust components in NED frame.
FGColumnVector3& GetGustNED(void) {return vGustNED;}
- /** Turbulence models available: ttNone, ttStandard, ttBerndt, ttCulp */
+ /** Turbulence models available: ttNone, ttStandard, ttBerndt, ttCulp, ttMilspec, ttTustin */
void SetTurbType(tType tt) {turbType = tt;}
tType GetTurbType() const {return turbType;}
@@ -224,8 +276,15 @@ public:
double GetTurbPQR(int idx) const {return vTurbPQR(idx);}
double GetTurbMagnitude(void) const {return Magnitude;}
- FGColumnVector3& GetTurbDirection(void) {return vDirection;}
- FGColumnVector3& GetTurbPQR(void) {return vTurbPQR;}
+ const FGColumnVector3& GetTurbDirection(void) const {return vDirection;}
+ const FGColumnVector3& GetTurbPQR(void) const {return vTurbPQR;}
+
+ void SetWindspeed20ft(double ws) { windspeed_at_20ft = ws;}
+ double GetWindspeed20ft() const { return windspeed_at_20ft;}
+
+ /// allowable range: 0-7, 3=light, 4=moderate, 6=severe turbulence
+ void SetProbabilityOfExceedence( int idx) {probability_of_exceedence_index = idx;}
+ int GetProbabilityOfExceedence() const { return probability_of_exceedence_index;}
protected:
double rho;
@@ -261,6 +320,11 @@ protected:
FGColumnVector3 vBodyTurbGrad;
FGColumnVector3 vTurbPQR;
+ // Dryden turbulence model
+ double windspeed_at_20ft; ///< in ft/s
+ int probability_of_exceedence_index; ///< this is bound as the severity property
+ FGTable *POE_Table; ///< probability of exceedence table
+
double psiw;
FGColumnVector3 vTotalWindNED;
FGColumnVector3 vWindNED;