]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAerodynamics.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGAerodynamics.h
index 817e014531f57f7cc579e8d9cf31976b9aedf413..e6d8ac2fefc1045581555ca173f8ffcc9b0cd8ce 100644 (file)
@@ -54,10 +54,8 @@ INCLUDES
 
 #include "FGModel.h"
 #include "FGConfigFile.h"
-#include "FGState.h"
-#include "FGMassBalance.h"
-#include "FGTranslation.h"
 #include "FGCoefficient.h"
+#include "FGColumnVector3.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -69,9 +67,7 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -81,9 +77,17 @@ CLASS DOCUMENTATION
     This class owns and contains the list of coefficients that define the
     aerodynamic properties of this aircraft. Here also, such unique phenomena
     as ground effect and maximum lift curve tailoff are handled.
-    @author Jon S. Berndt
-    @version $Id$
-    @see -
+    @config
+    <pre>
+    \<AERODYNAMICS>
+       \<AXIS NAME="{LIFT|DRAG|SIDE|ROLL|PITCH|YAW}">
+         {Coefficient definitions}
+       \</AXIS>
+       {Additional axis definitions}
+    \</AERODYNAMICS> </pre>
+    
+    @author Jon S. Berndt, Tony Peden
+    $Id$
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -95,7 +99,7 @@ class FGAerodynamics : public FGModel {
 public:
   /** Constructor
       @param Executive a pointer to the parent executive object */
-  FGAerodynamics(FGFDMExec*);
+  FGAerodynamics(FGFDMExec* Executive);
   /// Destructor
   ~FGAerodynamics();
 
@@ -103,56 +107,93 @@ public:
       @return false if no error */
   bool Run(void);
 
-  /** Loads the Aerodynamics model
+  /** Loads the Aerodynamics model.
+      The Load function for this class expects the configuration file to
+      have found the AERODYNAMICS keyword in the configution file and to
+      have set that line to the current line.
+      @param AC_cfg pointer to the current configuration file.
       @return true if successful */
   bool Load(FGConfigFile* AC_cfg);
 
-  /** Outputs coefficient information.
-      Non-dimensionalizing parameter descriptions are output
-      for each aero coefficient defined.
-      @param multipliers the list of multipliers for this coefficient.*/
-  void DisplayCoeffFactors(vector <eParam> multipliers);
-
   /** Gets the total aerodynamic force vector.
       @return a force vector reference. */
-  FGColumnVector& GetForces(void) {return vForces;}
+  FGColumnVector3& GetForces(void) {return vForces;}
+
+  /** Gets the aerodynamic force for an axis.
+      @param n Axis index. This could be 0, 1, or 2, or one of the 
+               axis enums: eX, eY, eZ.
+      @return the force acting on an axis */
+  double GetForces(int n) const {return vForces(n);}
 
   /** Gets the total aerodynamic moment vector.
       @return a moment vector reference. */
-  FGColumnVector& GetMoments(void) {return vMoments;}
-
-  inline FGColumnVector GetvLastFs(void) { return vLastFs; }
-  inline float GetvLastFs(int axis) { return vLastFs(axis); }
-  inline FGColumnVector GetvFs(void) { return vFs; }
-  inline float GetvFs(int axis) { return vFs(axis); }
-  float GetLoD(void);
-
-    /** Gets the strings for the current set of coefficients.
+  FGColumnVector3& GetMoments(void) {return vMoments;}
+
+  /** Gets the aerodynamic moment for an axis.
+      @return the moment about a single axis (as described also in the
+              similar call to GetForces(int n).*/
+  double GetMoments(int n) const {return vMoments(n);}
+
+  FGColumnVector3& GetvLastFs(void) { return vLastFs; }
+  double GetvLastFs(int axis) const { return vLastFs(axis); }
+  FGColumnVector3& GetvFs(void) { return vFs; }
+  double GetvFs(int axis) const { return vFs(axis); }
+  inline double GetLoD(void) const { return lod; }
+  inline double GetClSquared(void) const { return clsq; } 
+  inline double GetAlphaCLMax(void) const { return alphaclmax; }
+  inline double GetAlphaCLMin(void) const { return alphaclmin; }
+  
+  inline double GetAlphaHystMax(void) const { return alphahystmax; }
+  inline double GetAlphaHystMin(void) const { return alphahystmin; }
+  inline double GetHysteresisParm(void) const { return stall_hyst; }
+  inline double GetStallWarn(void) const { return impending_stall; }
+  double GetAlphaW(void) const { return alphaw; }
+
+  double GetBI2Vel(void) const { return bi2vel; }
+  double GetCI2Vel(void) const { return ci2vel; }
+  
+  inline void SetAlphaCLMax(double tt) { alphaclmax=tt; }
+  inline void SetAlphaCLMin(double tt) { alphaclmin=tt; }
+
+  /** Gets the strings for the current set of coefficients.
+      @param delimeter either a tab or comma string depending on output type
       @return a string containing the descriptive names for all coefficients */
-  string GetCoefficientStrings(void);
+  string GetCoefficientStrings(string delimeter);
 
   /** Gets the coefficient values.
+      @param delimeter either a tab or comma string depending on output type
       @return a string containing the numeric values for the current set of
       coefficients */
-  string GetCoefficientValues(void);
-
-  /// Gets the Normal Load Factor
-  float GetNlf(void);
-
+  string GetCoefficientValues(string delimeter);
+  
+  void bind(void);
+  void bindModel(void);
+  void unbind(void);
+  void convert(void);
+  
 private:
   typedef map<string,int> AxisIndex;
   AxisIndex AxisIdx;
   typedef vector<FGCoefficient*> CoeffArray;
   CoeffArray* Coeff;
-  FGColumnVector vFs;
-  FGColumnVector vForces;
-  FGColumnVector vMoments;
-  FGColumnVector vLastFs;
-  FGColumnVector vDXYZcg;
-
-  void Debug(void);
+  FGColumnVector3 vFs;
+  FGColumnVector3 vForces;
+  FGColumnVector3 vMoments;
+  FGColumnVector3 vLastFs;
+  FGColumnVector3 vDXYZcg;
+  double alphaclmax, alphaclmin;
+  double alphahystmax, alphahystmin;
+  double impending_stall, stall_hyst;
+  double bi2vel, ci2vel,alphaw;
+  double clsq,lod;
+  
+  typedef double (FGAerodynamics::*PMF)(int) const;
+
+  void Debug(int from);
 };
 
+} // namespace JSBSim
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif