]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAtmosphere.h
Updates to help work the kinks out of JSBsim.
[flightgear.git] / src / FDM / JSBSim / FGAtmosphere.h
index 25afde57ba33a42862898bdfedb0073690206a99..2ee4d3cc9be1d3e4dcedd6fa68616176c505d716 100644 (file)
@@ -2,6 +2,7 @@
 
  Header:       FGAtmosphere.h
  Author:       Jon Berndt
+               Implementation of 1959 Standard Atmosphere added by Tony Peden
  Date started: 11/24/98
 
  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
 HISTORY
 --------------------------------------------------------------------------------
 11/24/98   JSB   Created
+07/23/99   TP   Added implementation of 1959 Standard Atmosphere
+           Moved calculation of Mach number to FGTranslation
+
 
 ********************************************************************************
 SENTRY
 *******************************************************************************/
 
-#ifndef FGATMOSPHERE_H
-#define FGATMOSPHERE_H
+#ifndef FGAtmosphere_H
+#define FGAtmosphere_H
 
 /*******************************************************************************
 INCLUDES
@@ -42,47 +46,52 @@ INCLUDES
 
 /*******************************************************************************
 COMMENTS, REFERENCES,  and NOTES
-*******************************************************************************/
-/**
-The equation used in this model was determined by a third order curve fit using
-Excel. The data is from the ICAO atmosphere model.
-@memo Models the atmosphere.
-@author Jon S. Berndt
-*/
-/*******************************************************************************
+********************************************************************************
+
+[1]    Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
+      1989, ISBN 0-07-001641-0
+
+*******************************************************************************
 CLASS DECLARATION
 *******************************************************************************/
 
+
 using namespace std;
 
 class FGAtmosphere : public FGModel
 {
 public:
-  // ***************************************************************************
-  /** @memo Constructor
-      @param FGFDMExec* - a pointer to the "owning" FDM Executive
-  */
-  FGAtmosphere(FGFDMExec*);
 
-  // ***************************************************************************
-  /** @memo Destructor
-  */
+  FGAtmosphere(FGFDMExec*);
   ~FGAtmosphere(void);
-
-  // ***************************************************************************
-  /** This must be called for each dt to execute the model algorithm */
   bool Run(void);
 
-  // ***************************************************************************
-  /** @memo Returns the air density
-      @return float air density in slugs/cubic foot
-  */
   inline float Getrho(void) {return rho;}
+  float CalcRho(float altitude);
+
+  inline float GetTemperature(void){return temperature;}
+  inline float GetDensity(void)    {return density;}     // use only after Run() has been called
+  inline float GetPressure(void)   {return pressure;}
+  inline float GetSoundSpeed(void) {return soundspeed;}
+
+  float GetTemperature(float altitude); //Rankine, altitude in feet
+  float GetDensity(float altitude);     //slugs/ft^3
+  float GetPressure(float altitude);    //lbs/ft^2
+  float GetSoundSpeed(float altitude);  //ft/s
 
 protected:
 
 private:
   float rho;
+
+  float h;
+  float temperature;
+  float pressure;
+  float density;
+  float soundspeed;
+  void Calculate(void);
+
+
 };
 
 /******************************************************************************/