]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGAuxiliary.h
Sync. with JSBSim CVS
[flightgear.git] / src / FDM / JSBSim / models / FGAuxiliary.h
index 297b3a0cc0ea62c9031663900dcbabde3d497702..8d47ce8cc8f6fb595e215cc403177da0f263c53a 100644 (file)
@@ -7,20 +7,20 @@
  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
 
  This program is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free Software
+ the terms of the GNU Lesser General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later
  version.
 
  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
  details.
 
- You should have received a copy of the GNU General Public License along with
+ You should have received a copy of the GNU Lesser General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  Place - Suite 330, Boston, MA  02111-1307, USA.
 
- Further information about the GNU General Public License can also be found on
+ Further information about the GNU Lesser General Public License can also be found on
  the world wide web at http://www.gnu.org.
 
 HISTORY
@@ -116,6 +116,8 @@ public:
   /// Destructor
   ~FGAuxiliary();
 
+  bool InitModel(void);
+
   /** Runs the Auxiliary routines; called by the Executive
       @return false if no error */
   bool Run(void);
@@ -123,14 +125,28 @@ public:
 // GET functions
 
   // Atmospheric parameters GET functions
+  /** Returns Calibrated airspeed in feet/second.*/
   double GetVcalibratedFPS(void) const { return vcas; }
+  /** Returns Calibrated airspeed in knots.*/
   double GetVcalibratedKTS(void) const { return vcas*fpstokts; }
+  /** Returns equivalent airspeed in feet/second. */
   double GetVequivalentFPS(void) const { return veas; }
+  /** Returns equivalent airspeed in knots. */
   double GetVequivalentKTS(void) const { return veas*fpstokts; }
 
-  // total pressure above is freestream total pressure for subsonic only
-  // for supersonic it is the 1D total pressure behind a normal shock
+  /** Returns the total pressure.
+      Total pressure is freestream total pressure for
+      subsonic only. For supersonic it is the 1D total pressure
+      behind a normal shock. */
   double GetTotalPressure(void) const { return pt; }
+
+  /** Returns the total temperature.
+    The total temperature ("tat", isentropic flow) is calculated:
+    @code
+    tat = sat*(1 + 0.2*Mach*Mach)
+    @endcode
+    (where "sat" is standard temperature) */
+
   double GetTotalTemperature(void) const { return tat; }
   double GetTAT_C(void) const { return tatc; }
 
@@ -165,23 +181,24 @@ public:
   double GetMagBeta (int unit) const { if (unit == inDegrees) return fabs(beta)*radtodeg;
                                        else cerr << "Bad units" << endl; return 0.0;}
 
-  double Getqbar    (void) const { return qbar;       }
-  double GetqbarUW  (void) const { return qbarUW;     }
-  double GetqbarUV  (void) const { return qbarUV;     }
-  double GetVt      (void) const { return Vt;         }
-  double GetVground (void) const { return Vground;    }
-  double GetMach    (void) const { return Mach;       }
-  double GetMachU   (void) const { return MachU;      }
+  double Getqbar          (void) const { return qbar;       }
+  double GetqbarUW        (void) const { return qbarUW;     }
+  double GetqbarUV        (void) const { return qbarUV;     }
+  double GetReynoldsNumber(void) const { return Re;         }
+  double GetVt            (void) const { return Vt;         }
+  double GetVground       (void) const { return Vground;    }
+  double GetMach          (void) const { return Mach;       }
+  double GetMachU         (void) const { return MachU;      }
+  double GetNz            (void) const { return Nz;         }
 
   double GetHOverBCG(void) const { return hoverbcg; }
   double GetHOverBMAC(void) const { return hoverbmac; }
 
   double GetGamma(void)              const { return gamma;         }
   double GetGroundTrack(void)        const { return psigt;         }
-  double GetEarthPositionAngle(void) const { return earthPosAngle; }
 
-  double GetHeadWind(void);
-  double GetCrossWind(void);
+  double GetHeadWind(void) const;
+  double GetCrossWind(void) const;
 
 // SET functions
 
@@ -200,7 +217,7 @@ public:
   void SetAB    (double t1, double t2) { alpha=t1; beta=t2; }
   void SetGamma (double tt)            { gamma = tt;        }
 
-// Time routines, SET and GET functions
+// Time routines, SET and GET functions, used by FGMSIS atmosphere
 
   void SetDayOfYear    (int doy)    { day_of_year = doy;    }
   void SetSecondsInDay (double sid) { seconds_in_day = sid; }
@@ -208,8 +225,11 @@ public:
   int    GetDayOfYear    (void) const { return day_of_year;    }
   double GetSecondsInDay (void) const { return seconds_in_day; }
 
-  void bind(void);
-  void unbind(void);
+  double GetLongitudeRelativePosition (void) const { return lon_relative_position; }
+  double GetLatitudeRelativePosition  (void) const { return lat_relative_position; }
+  double GetDistanceRelativePosition  (void) const { return relative_position; }
+
+  void SetAeroPQR(FGColumnVector3 tt) { vAeroPQR = tt; }
 
 private:
   double vcas, veas;
@@ -223,19 +243,30 @@ private:
   FGColumnVector3 vEuler;
   FGColumnVector3 vEulerRates;
   FGColumnVector3 vMachUVW;
+  FGColumnVector3 vAircraftAccel;
   FGLocation vLocationVRP;
 
   double Vt, Vground, Mach, MachU;
   double qbar, qbarUW, qbarUV;
+  double Re; // Reynolds Number = V*c/mu
   double alpha, beta;
   double adot,bdot;
   double psigt, gamma;
+  double Nz;
   double seconds_in_day;  // seconds since current GMT day began
   int    day_of_year;     // GMT day, 1 .. 366
 
-  double earthPosAngle;
   double hoverbcg, hoverbmac;
 
+  // helper data, calculation of distance from initial position
+
+  double lon_relative_position;
+  double lat_relative_position;
+  double relative_position;
+
+  void CalculateRelativePosition(void);
+
+  void bind(void);
   void Debug(int from);
 };