1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 Header: FGAerodynamics.h
7 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
34 #ifndef FGAERODYNAMICS_H
35 #define FGAERODYNAMICS_H
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42 # include <simgear/compiler.h>
43 # ifdef SG_HAVE_STD_INCLUDES
56 #include "FGConfigFile.h"
58 #include "FGMassBalance.h"
59 #include "FGTranslation.h"
60 #include "FGCoefficient.h"
62 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
66 #define ID_AERODYNAMICS "$Id$"
68 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
72 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
76 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
80 /** Encapsulates the aerodynamic calculations.
81 This class owns and contains the list of coefficients that define the
82 aerodynamic properties of this aircraft. Here also, such unique phenomena
83 as ground effect and maximum lift curve tailoff are handled.
89 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
93 class FGAerodynamics : public FGModel {
97 @param Executive a pointer to the parent executive object */
98 FGAerodynamics(FGFDMExec*);
102 /** Runs the Aerodynamics model; called by the Executive
103 @return false if no error */
106 /** Loads the Aerodynamics model
107 @return true if successful */
108 bool LoadAerodynamics(FGConfigFile* AC_cfg);
110 /** Outputs coefficient information.
111 Non-dimensionalizing parameter descriptions are output
112 for each aero coefficient defined.
113 @param multipliers the list of multipliers for this coefficient.*/
114 void DisplayCoeffFactors(vector <eParam> multipliers);
116 /** Gets the total aerodynamic force vector.
117 @return a force vector reference. */
118 FGColumnVector& GetForces(void) {return vForces;}
120 /** Gets the total aerodynamic moment vector.
121 @return a moment vector reference. */
122 FGColumnVector& GetMoments(void) {return vMoments;}
124 inline FGColumnVector GetvLastFs(void) { return vLastFs; }
125 inline float GetvLastFs(int axis) { return vLastFs(axis); }
126 inline FGColumnVector GetvFs(void) { return vFs; }
127 inline float GetvFs(int axis) { return vFs(axis); }
130 /** Gets the strings for the current set of coefficients.
131 @return a string containing the descriptive names for all coefficients */
132 string GetCoefficientStrings(void);
134 /** Gets the coefficient values.
135 @return a string containing the numeric values for the current set of
137 string GetCoefficientValues(void);
139 /// Gets the Normal Load Factor
143 typedef map<string,int> AxisIndex;
145 typedef vector<FGCoefficient*> CoeffArray;
148 FGColumnVector vForces;
149 FGColumnVector vMoments;
150 FGColumnVector vLastFs;
151 FGColumnVector vDXYZcg;
156 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%