]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGAerodynamics.h
Added recent ground effect modeling changes.
[flightgear.git] / src / FDM / JSBSim / FGAerodynamics.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGAerodynamics.h
4  Author:       Jon S. Berndt
5  Date started: 09/13/00
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 09/13/00   JSB   Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGAERODYNAMICS_H
35 #define FGAERODYNAMICS_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #ifdef FGFS
42 #  include <simgear/compiler.h>
43 #  ifdef SG_HAVE_STD_INCLUDES
44 #    include <vector>
45 #    include <map>
46 #  else
47 #    include <vector.h>
48 #    include <map.h>
49 #  endif
50 #else
51 #  include <vector>
52 #  include <map>
53 #endif
54
55 #include "FGModel.h"
56 #include "FGConfigFile.h"
57 #include "FGState.h"
58 #include "FGMassBalance.h"
59 #include "FGTranslation.h"
60 #include "FGCoefficient.h"
61 #include "FGFactorGroup.h"
62
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 DEFINITIONS
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
66
67 #define ID_AERODYNAMICS "$Id$"
68
69
70 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 FORWARD DECLARATIONS
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
73
74 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
77
78 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79 CLASS DOCUMENTATION
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
81
82 /** Encapsulates the aerodynamic calculations.
83     This class owns and contains the list of coefficients that define the
84     aerodynamic properties of this aircraft. Here also, such unique phenomena
85     as ground effect and maximum lift curve tailoff are handled.
86     @author Jon S. Berndt
87     @version $Id$
88     @see -
89 */
90
91 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92 CLASS DECLARATION
93 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
94
95 class FGAerodynamics : public FGModel {
96
97 public:
98   /** Constructor
99       @param Executive a pointer to the parent executive object */
100   FGAerodynamics(FGFDMExec*);
101   /// Destructor
102   ~FGAerodynamics();
103
104   /** Runs the Aerodynamics model; called by the Executive
105       @return false if no error */
106   bool Run(void);
107
108   /** Loads the Aerodynamics model
109       @return true if successful */
110   bool Load(FGConfigFile* AC_cfg);
111
112   /** Gets the total aerodynamic force vector.
113       @return a force vector reference. */
114   FGColumnVector& GetForces(void) {return vForces;}
115
116   /** Gets the total aerodynamic moment vector.
117       @return a moment vector reference. */
118   FGColumnVector& GetMoments(void) {return vMoments;}
119
120   inline FGColumnVector GetvLastFs(void) { return vLastFs; }
121   inline float GetvLastFs(int axis) { return vLastFs(axis); }
122   inline FGColumnVector GetvFs(void) { return vFs; }
123   inline float GetvFs(int axis) { return vFs(axis); }
124   float GetLoD(void);
125
126     /** Gets the strings for the current set of coefficients.
127       @return a string containing the descriptive names for all coefficients */
128   string GetCoefficientStrings(void);
129
130   /** Gets the coefficient values.
131       @return a string containing the numeric values for the current set of
132       coefficients */
133   string GetCoefficientValues(void);
134
135   /// Gets the Normal Load Factor
136   float GetNlf(void);
137
138 private:
139   typedef map<string,int> AxisIndex;
140   AxisIndex AxisIdx;
141   typedef vector<FGCoefficient*> CoeffArray;
142   CoeffArray* Coeff;
143   FGColumnVector vFs;
144   FGColumnVector vForces;
145   FGColumnVector vMoments;
146   FGColumnVector vLastFs;
147   FGColumnVector vDXYZcg;
148
149   void Debug(void);
150 };
151
152 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
153 #endif
154