]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_coefficients.cpp
Sep 1 2000 updates from the UIUC team.
[flightgear.git] / src / FDM / UIUCModel / uiuc_coefficients.cpp
1 /**********************************************************************
2
3  FILENAME:     uiuc_coefficients.cpp
4
5 ----------------------------------------------------------------------
6
7  DESCRIPTION:  computes aggregated aerodynamic coefficients
8
9 ----------------------------------------------------------------------
10
11  STATUS:       alpha version
12
13 ----------------------------------------------------------------------
14
15  REFERENCES:   
16
17 ----------------------------------------------------------------------
18
19  HISTORY:      01/29/2000   initial release
20                02/01/2000   (JS) changed map name from aeroData to 
21                             aeroPart
22                02/18/2000   (JS) added calls to 1Dinterpolation 
23                             function from CLfa and CDfa switches
24                02/24/2000   added icing model functions
25                02/29/2000   (JS) added calls to 2Dinterpolation 
26                             function from CLfade, CDfade, Cmfade, 
27                             CYfada, CYfbetadr, Clfada, Clfbetadr, 
28                             Cnfada, and Cnfbetadr switches
29                04/15/2000   (JS) broke up into multiple 
30                             uiuc_coef_xxx functions
31
32 ----------------------------------------------------------------------
33
34  AUTHOR(S):    Bipin Sehgal       <bsehgal@uiuc.edu>
35                Jeff Scott         <jscott@mail.com>
36
37 ----------------------------------------------------------------------
38
39  VARIABLES:
40
41 ----------------------------------------------------------------------
42
43  INPUTS:       -V_rel_wind (or U_body)
44                -dyn_on_speed
45                -ice on/off
46                -phugoid on/off
47
48 ----------------------------------------------------------------------
49
50  OUTPUTS:      -CL
51                -CD
52                -Cm
53                -CY
54                -Cl
55                -Cn
56
57 ----------------------------------------------------------------------
58
59  CALLED BY:    uiuc_wrapper
60
61 ----------------------------------------------------------------------
62
63  CALLS TO:     uiuc_coef_lift
64                uiuc_coef_drag
65                uiuc_coef_pitch
66                uiuc_coef_sideforce
67                uiuc_coef_roll
68                uiuc_coef_yaw
69                uiuc_controlInput
70
71 ----------------------------------------------------------------------
72
73  COPYRIGHT:    (C) 2000 by Michael Selig
74
75  This program is free software; you can redistribute it and/or
76  modify it under the terms of the GNU General Public License
77  as published by the Free Software Foundation.
78
79  This program is distributed in the hope that it will be useful,
80  but WITHOUT ANY WARRANTY; without even the implied warranty of
81  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
82  GNU General Public License for more details.
83
84  You should have received a copy of the GNU General Public License
85  along with this program; if not, write to the Free Software
86  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
87  USA or view http://www.gnu.org/copyleft/gpl.html.
88
89 **********************************************************************/
90
91 #include "uiuc_coefficients.h"
92
93
94 void uiuc_coefficients()
95 {
96   // calculate rate derivative nondimensionalization factors
97   // check if speed is sufficient to compute dynamic pressure terms
98   if (nondim_rate_V_rel_wind)         // c172_aero uses V_rel_wind
99     {
100       if (V_rel_wind > dyn_on_speed)
101         {
102           cbar_2U = cbar / (2.0 * V_rel_wind);
103           b_2U = bw / (2.0 * V_rel_wind);
104           ch_2U = ch / (2.0 * V_rel_wind);
105         }
106       else
107         {
108           cbar_2U = 0.0;
109           b_2U = 0.0;
110           ch_2U = 0.0;
111         }
112     }
113   else      // use U_body which is probably more correct
114     {
115       if (U_body > dyn_on_speed)
116         {
117           cbar_2U = cbar / (2.0 * U_body);
118           b_2U = bw / (2.0 * U_body);
119           ch_2U = ch / (2.0 * U_body);
120         }
121       else
122         {
123           cbar_2U = 0.0;
124           b_2U = 0.0;
125           ch_2U = 0.0;
126         }
127     }
128
129   // check to see if icing model engaged
130   if (ice_model)
131     {
132       uiuc_ice_eta();
133     }
134
135   // check to see if phugoid mode engaged
136   if (elevator_step || elevator_singlet || elevator_doublet || elevator_input)
137     {
138       uiuc_controlInput();
139     }
140
141   CD = CX = CL = CZ = Cm = CY = Cl = Cn = 0.0;
142   CLclean_wing = CLiced_wing = CLclean_tail = CLiced_tail = 0.0;
143   CZclean_wing = CZiced_wing = CZclean_tail = CZiced_tail = 0.0;
144   CXclean_wing = CXiced_wing = CXclean_tail = CXiced_tail = 0.0;
145
146   uiuc_coef_lift();
147   uiuc_coef_drag();
148   uiuc_coef_pitch();
149   uiuc_coef_sideforce();
150   uiuc_coef_roll();
151   uiuc_coef_yaw();
152
153   return;
154 }
155
156 // end uiuc_coefficients.cpp