]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGAtmosphere.h
Updates from Jon.
[flightgear.git] / src / FDM / JSBSim / FGAtmosphere.h
1 /*******************************************************************************
2
3  Header:       FGAtmosphere.h
4  Author:       Jon Berndt
5                Implementation of 1959 Standard Atmosphere added by Tony Peden
6  Date started: 11/24/98
7
8  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
9
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
13  version.
14
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
18  details.
19
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.
23
24  Further information about the GNU General Public License can also be found on
25  the world wide web at http://www.gnu.org.
26
27 HISTORY
28 --------------------------------------------------------------------------------
29 11/24/98   JSB   Created
30 07/23/99   TP   Added implementation of 1959 Standard Atmosphere
31            Moved calculation of Mach number to FGTranslation
32
33
34 ********************************************************************************
35 SENTRY
36 *******************************************************************************/
37
38 #ifndef FGAtmosphere_H
39 #define FGAtmosphere_H
40
41 /*******************************************************************************
42 INCLUDES
43 *******************************************************************************/
44
45 #include "FGModel.h"
46
47 /*******************************************************************************
48 COMMENTS, REFERENCES,  and NOTES
49 ********************************************************************************
50
51 [1]    Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
52       1989, ISBN 0-07-001641-0
53
54 /*******************************************************************************
55 CLASS DECLARATION
56 *******************************************************************************/
57
58
59 using namespace std;
60
61 class FGAtmosphere : public FGModel
62 {
63 public:
64
65   FGAtmosphere(FGFDMExec*);
66   ~FGAtmosphere(void);
67   bool Run(void);
68
69   inline float Getrho(void) {return rho;}
70   float CalcRho(float altitude);
71
72   inline float GetTemperature(void){return temperature;}
73   inline float GetDensity(void)    {return density;}     // use only after Run() has been called
74   inline float GetPressure(void)   {return pressure;}
75   inline float GetSoundSpeed(void) {return soundspeed;}
76
77   float GetTemperature(float altitude); //Rankine, altitude in feet
78   float GetDensity(float altitude);     //slugs/ft^3
79   float GetPressure(float altitude);    //lbs/ft^2
80   float GetSoundSpeed(float altitude);  //ft/s
81
82 protected:
83
84 private:
85   float rho;
86
87   float h;
88   float temperature;
89   float pressure;
90   float density;
91   float soundspeed;
92   void Calculate(void);
93
94
95 };
96
97 /******************************************************************************/
98 #endif