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 *******************************************************************************/
48 #define ID_ATMOSPHERE "$Header$"
50 /*******************************************************************************
51 COMMENTS, REFERENCES, and NOTES
52 ********************************************************************************
54 [1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
55 1989, ISBN 0-07-001641-0
57 *******************************************************************************
59 *******************************************************************************/
61 class FGAtmosphere : public FGModel {
64 FGAtmosphere(FGFDMExec*);
68 inline float GetTemperature(void) {return temperature;}
69 inline float GetDensity(void) {return density;} // use only after Run() has been called
70 inline float GetPressure(void) {return pressure;}
71 inline float GetSoundSpeed(void) {return soundspeed;}
73 inline float GetTemperatureSL(void) { return SLtemperature; } //Rankine, altitude in feet
74 inline float GetDensitySL(void) { return SLdensity; } //slugs/ft^3
75 inline float GetPressureSL(void) { return SLpressure; } //lbs/ft^2
76 inline float GetSoundSpeedSL(void) { return SLsoundspeed; } //ft/s
78 inline float GetTemperatureRatio(void) { return temperature/SLtemperature; }
79 inline float GetDensityRatio(void) { return density/SLdensity; }
80 inline float GetPressureRatio(void) { return pressure/SLpressure; }
81 inline float GetSoundSpeedRatio(void) { return soundspeed/SLsoundspeed; }
83 inline void UseExternal(void) { useExternal=true; }
84 inline void UseInternal(void) { useExternal=false; } //this is the default
86 inline void SetExTemperature(float t) { exTemperature=t; }
87 inline void SetExDensity(float d) { exDensity=d; }
88 inline void SetExPressure(float p) { exPressure=p; }
90 inline void SetWindNED(float wN, float wE, float wD) { vWindNED(1)=wN; vWindNED(2)=wE; vWindNED(3)=wD;}
92 inline float GetWindN(void) { return vWindNED(1); }
93 inline float GetWindE(void) { return vWindNED(2); }
94 inline float GetWindD(void) { return vWindNED(3); }
96 inline FGColumnVector GetWindUVW(void) { return vWindUVW; }
104 float SLtemperature,SLdensity,SLpressure,SLsoundspeed;
105 float temperature,density,pressure,soundspeed;
107 float exTemperature,exDensity,exPressure;
108 FGColumnVector vWindNED,vWindUVW;
110 void Calculate(float altitude);
116 /******************************************************************************/