1 /*******************************************************************************
5 Implementation of 1959 Standard Atmosphere added by Tony Peden
8 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
10 This program is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free Software
12 Foundation; either version 2 of the License, or (at your option) any later
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 You should have received a copy of the GNU General Public License along with
21 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22 Place - Suite 330, Boston, MA 02111-1307, USA.
24 Further information about the GNU General Public License can also be found on
25 the world wide web at http://www.gnu.org.
28 --------------------------------------------------------------------------------
30 07/23/99 TP Added implementation of 1959 Standard Atmosphere
31 Moved calculation of Mach number to FGTranslation
34 ********************************************************************************
36 *******************************************************************************/
38 #ifndef FGAtmosphere_H
39 #define FGAtmosphere_H
41 /*******************************************************************************
43 *******************************************************************************/
47 /*******************************************************************************
48 COMMENTS, REFERENCES, and NOTES
49 ********************************************************************************
51 [1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
52 1989, ISBN 0-07-001641-0
54 *******************************************************************************
56 *******************************************************************************/
58 class FGAtmosphere : public FGModel {
61 FGAtmosphere(FGFDMExec*);
65 inline float GetTemperature(void) {return temperature;}
66 inline float GetDensity(void) {return density;} // use only after Run() has been called
67 inline float GetPressure(void) {return pressure;}
68 inline float GetSoundSpeed(void) {return soundspeed;}
70 inline float GetTemperatureSL(void) { return SLtemperature; } //Rankine, altitude in feet
71 inline float GetDensitySL(void) { return SLdensity; } //slugs/ft^3
72 inline float GetPressureSL(void) { return SLpressure; } //lbs/ft^2
73 inline float GetSoundSpeedSL(void) { return SLsoundspeed; } //ft/s
75 inline float GetTemperatureRatio(void) { return temperature/SLtemperature; }
76 inline float GetDensityRatio(void) { return density/SLdensity; }
77 inline float GetPressureRatio(void) { return pressure/SLpressure; }
78 inline float GetSoundSpeedRatio(void) { return soundspeed/SLsoundspeed; }
80 inline void UseExternal(void) { useExternal=true; }
81 inline void UseInternal(void) { useExternal=false; } //this is the default
83 inline void SetExTemperature(float t) { exTemperature=t; }
84 inline void SetExDensity(float d) { exDensity=d; }
85 inline void SetExPressure(float p) { exPressure=p; }
87 inline void SetWindNED(float wN, float wE, float wD) { vWindNED(1)=wN; vWindNED(2)=wE; vWindNED(3)=wD;}
89 inline float GetWindN(void) { return vWindNED(1); }
90 inline float GetWindE(void) { return vWindNED(2); }
91 inline float GetWindD(void) { return vWindNED(3); }
93 inline FGColumnVector GetWindUVW(void) { return vWindUVW; }
101 float SLtemperature,SLdensity,SLpressure,SLsoundspeed;
102 float temperature,density,pressure,soundspeed;
104 float exTemperature,exDensity,exPressure;
105 FGColumnVector vWindNED,vWindUVW;
107 void Calculate(float altitude);
113 /******************************************************************************/