1 /**********************************************************************
3 FILENAME: uiuc_coefficients.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: computes aggregated aerodynamic coefficients
9 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
17 ----------------------------------------------------------------------
19 HISTORY: 01/29/2000 initial release
20 02/01/2000 (JS) changed map name from aeroData to
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
32 ----------------------------------------------------------------------
34 AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
35 Jeff Scott <jscott@mail.com>
37 ----------------------------------------------------------------------
41 ----------------------------------------------------------------------
43 INPUTS: -V_rel_wind (or U_body)
48 ----------------------------------------------------------------------
57 ----------------------------------------------------------------------
59 CALLED BY: uiuc_wrapper
61 ----------------------------------------------------------------------
63 CALLS TO: uiuc_coef_lift
71 ----------------------------------------------------------------------
73 COPYRIGHT: (C) 2000 by Michael Selig
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.
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.
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.
89 **********************************************************************/
91 #include "uiuc_coefficients.h"
94 void uiuc_coefficients()
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
100 if (V_rel_wind > dyn_on_speed)
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);
113 else // use U_body which is probably more correct
115 if (U_body > dyn_on_speed)
117 cbar_2U = cbar / (2.0 * U_body);
118 b_2U = bw / (2.0 * U_body);
119 ch_2U = ch / (2.0 * U_body);
129 // check to see if icing model engaged
135 // check to see if phugoid mode engaged
136 if (elevator_step || elevator_singlet || elevator_doublet || elevator_input)
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;
149 uiuc_coef_sideforce();
156 // end uiuc_coefficients.cpp