1 /**********************************************************************
3 FILENAME: uiuc_coef_lift.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: computes aggregated aerodynamic lift coefficient
9 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
15 REFERENCES: Roskam, Jan. Airplane Flight Dynamics and Automatic
16 Flight Controls, Part I. Lawrence, KS: DARcorporation,
19 ----------------------------------------------------------------------
21 HISTORY: 04/15/2000 initial release
22 06/18/2001 (RD) Added CZfa
24 ----------------------------------------------------------------------
26 AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
27 Jeff Scott <jscott@mail.com>
28 Robert Deters <rdeters@uiuc.edu>
30 ----------------------------------------------------------------------
34 ----------------------------------------------------------------------
38 -lift coefficient components
42 ----------------------------------------------------------------------
46 ----------------------------------------------------------------------
48 CALLED BY: uiuc_coefficients.cpp
50 ----------------------------------------------------------------------
52 CALLS TO: uiuc_1Dinterpolation
56 ----------------------------------------------------------------------
58 COPYRIGHT: (C) 2000 by Michael Selig
60 This program is free software; you can redistribute it and/or
61 modify it under the terms of the GNU General Public License
62 as published by the Free Software Foundation.
64 This program is distributed in the hope that it will be useful,
65 but WITHOUT ANY WARRANTY; without even the implied warranty of
66 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 GNU General Public License for more details.
69 You should have received a copy of the GNU General Public License
70 along with this program; if not, write to the Free Software
71 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
72 USA or view http://www.gnu.org/copyleft/gpl.html.
74 **********************************************************************/
76 #include "uiuc_coef_lift.h"
85 command_list = aeroLiftParts -> getCommands();
87 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
89 linetoken1 = aeroLiftParts -> getToken(*command_line, 1);
90 linetoken2 = aeroLiftParts -> getToken(*command_line, 2);
92 switch (CL_map[linetoken2])
98 CLo = uiuc_ice_filter(CLo_clean,kCLo);
101 CLclean_wing += CLo_clean;
102 CLclean_tail += CLo_clean;
114 CL_a = uiuc_ice_filter(CL_a_clean,kCL_a);
117 CLclean_wing += CL_a_clean * Alpha;
118 CLclean_tail += CL_a_clean * Alpha;
119 CLiced_wing += CL_a * Alpha;
120 CLiced_tail += CL_a * Alpha;
130 CL_adot = uiuc_ice_filter(CL_adot_clean,kCL_adot);
133 CLclean_wing += CL_adot_clean * Alpha_dot * cbar_2U;
134 CLclean_tail += CL_adot_clean * Alpha_dot * ch_2U;
135 CLiced_wing += CL_adot * Alpha_dot * cbar_2U;
136 CLiced_tail += CL_adot * Alpha_dot * ch_2U;
139 /* CL_adot must be mulitplied by cbar/2U
140 (see Roskam Control book, Part 1, pg. 147) */
141 CL += CL_adot * Alpha_dot * cbar_2U;
148 CL_q = uiuc_ice_filter(CL_q_clean,kCL_q);
151 CLclean_wing += CL_q_clean * Theta_dot * cbar_2U;
152 CLclean_tail += CL_q_clean * Theta_dot * ch_2U;
153 CLiced_wing += CL_q * Theta_dot * cbar_2U;
154 CLiced_tail += CL_q * Theta_dot * ch_2U;
157 /* CL_q must be mulitplied by cbar/2U
158 (see Roskam Control book, Part 1, pg. 147) */
159 /* why multiply by Theta_dot instead of Q_body?
160 that is what is done in c172_aero.c; assume it
161 has something to do with axes systems */
162 CL += CL_q * Theta_dot * cbar_2U;
174 CL_de = uiuc_ice_filter(CL_de_clean,kCL_de);
177 CLclean_wing += CL_de_clean * elevator;
178 CLclean_tail += CL_de_clean * elevator;
179 CLiced_wing += CL_de * elevator;
180 CLiced_tail += CL_de * elevator;
183 CL += CL_de * elevator;
188 CLfaI = uiuc_1Dinterpolation(CLfa_aArray,
197 CLfadeI = uiuc_2Dinterpolation(CLfade_aArray,
209 CLfdfI = uiuc_1Dinterpolation(CLfdf_dfArray,
218 CLfadfI = uiuc_2Dinterpolation(CLfadf_aArray,
232 CZo = uiuc_ice_filter(CZo_clean,kCZo);
235 CZclean_wing += CZo_clean;
236 CZclean_tail += CZo_clean;
248 CZ_a = uiuc_ice_filter(CZ_a_clean,kCZ_a);
251 CZclean_wing += CZ_a_clean * Alpha;
252 CZclean_tail += CZ_a_clean * Alpha;
253 CZiced_wing += CZ_a * Alpha;
254 CZiced_tail += CZ_a * Alpha;
264 CZ_a2 = uiuc_ice_filter(CZ_a2_clean,kCZ_a2);
267 CZclean_wing += CZ_a2_clean * Alpha * Alpha;
268 CZclean_tail += CZ_a2_clean * Alpha * Alpha;
269 CZiced_wing += CZ_a2 * Alpha * Alpha;
270 CZiced_tail += CZ_a2 * Alpha * Alpha;
273 CZ += CZ_a2 * Alpha * Alpha;
280 CZ_a3 = uiuc_ice_filter(CZ_a3_clean,kCZ_a3);
283 CZclean_wing += CZ_a3_clean * Alpha * Alpha * Alpha;
284 CZclean_tail += CZ_a3_clean * Alpha * Alpha * Alpha;
285 CZiced_wing += CZ_a3 * Alpha * Alpha * Alpha;
286 CZiced_tail += CZ_a3 * Alpha * Alpha * Alpha;
289 CZ += CZ_a3 * Alpha * Alpha * Alpha;
296 CZ_adot = uiuc_ice_filter(CZ_adot_clean,kCZ_adot);
299 CZclean_wing += CZ_adot_clean * Alpha_dot * cbar_2U;
300 CZclean_tail += CZ_adot_clean * Alpha_dot * ch_2U;
301 CZiced_wing += CZ_adot * Alpha_dot * cbar_2U;
302 CZiced_tail += CZ_adot * Alpha_dot * ch_2U;
305 /* CZ_adot must be mulitplied by cbar/2U
306 (see Roskam Control book, Part 1, pg. 147) */
307 CZ += CZ_adot * Alpha_dot * cbar_2U;
314 CZ_q = uiuc_ice_filter(CZ_q_clean,kCZ_q);
317 CZclean_wing += CZ_q_clean * Q_body * cbar_2U;
318 CZclean_tail += CZ_q_clean * Q_body * ch_2U;
319 CZiced_wing += CZ_q * Q_body * cbar_2U;
320 CZiced_tail += CZ_q * Q_body * ch_2U;
323 /* CZ_q must be mulitplied by cbar/2U
324 (see Roskam Control book, Part 1, pg. 147) */
325 CZ += CZ_q * Q_body * cbar_2U;
332 CZ_de = uiuc_ice_filter(CZ_de_clean,kCZ_de);
335 CZclean_wing += CZ_de_clean * elevator;
336 CZclean_tail += CZ_de_clean * elevator;
337 CZiced_wing += CZ_de * elevator;
338 CZiced_tail += CZ_de * elevator;
341 CZ += CZ_de * elevator;
348 CZ_deb2 = uiuc_ice_filter(CZ_deb2_clean,kCZ_deb2);
351 CZclean_wing += CZ_deb2_clean * elevator * Beta * Beta;
352 CZclean_tail += CZ_deb2_clean * elevator * Beta * Beta;
353 CZiced_wing += CZ_deb2 * elevator * Beta * Beta;
354 CZiced_tail += CZ_deb2 * elevator * Beta * Beta;
357 CZ += CZ_deb2 * elevator * Beta * Beta;
364 CZ_df = uiuc_ice_filter(CZ_df_clean,kCZ_df);
367 CZclean_wing += CZ_df_clean * flap;
368 CZclean_tail += CZ_df_clean * flap;
369 CZiced_wing += CZ_df * flap;
370 CZiced_tail += CZ_df * flap;
380 CZ_adf = uiuc_ice_filter(CZ_adf_clean,kCZ_adf);
383 CZclean_wing += CZ_adf_clean * Alpha * flap;
384 CZclean_tail += CZ_adf_clean * Alpha * flap;
385 CZiced_wing += CZ_adf * Alpha * flap;
386 CZiced_tail += CZ_adf * Alpha * flap;
389 CZ += CZ_adf * Alpha * flap;
394 CZfaI = uiuc_1Dinterpolation(CZfa_aArray,
407 // end uiuc_coef_lift.cpp