1 /**********************************************************************
3 FILENAME: uiuc_coef_drag.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: computes aggregated aerodynamic drag 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
23 ----------------------------------------------------------------------
25 AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
26 Jeff Scott <jscott@mail.com>
28 ----------------------------------------------------------------------
32 ----------------------------------------------------------------------
36 -drag coefficient components
39 ----------------------------------------------------------------------
43 ----------------------------------------------------------------------
45 CALLED BY: uiuc_coefficients.cpp
47 ----------------------------------------------------------------------
49 CALLS TO: uiuc_1Dinterpolation
53 ----------------------------------------------------------------------
55 COPYRIGHT: (C) 2000 by Michael Selig
57 This program is free software; you can redistribute it and/or
58 modify it under the terms of the GNU General Public License
59 as published by the Free Software Foundation.
61 This program is distributed in the hope that it will be useful,
62 but WITHOUT ANY WARRANTY; without even the implied warranty of
63 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
64 GNU General Public License for more details.
66 You should have received a copy of the GNU General Public License
67 along with this program; if not, write to the Free Software
68 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
69 USA or view http://www.gnu.org/copyleft/gpl.html.
71 **********************************************************************/
73 #include "uiuc_coef_drag.h"
82 command_list = aeroDragParts -> getCommands();
84 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
86 linetoken1 = aeroDragParts -> getToken(*command_line, 1);
87 linetoken2 = aeroDragParts -> getToken(*command_line, 2);
89 switch (CD_map[linetoken2])
95 CDo = uiuc_ice_filter(CDo_clean,kCDo);
104 CDK = uiuc_ice_filter(CDK_clean,kCDK);
113 CD_a = uiuc_ice_filter(CD_a_clean,kCD_a);
122 CD_adot = uiuc_ice_filter(CD_adot_clean,kCD_adot);
124 /* CD_adot must be mulitplied by cbar/2U
125 (see Roskam Control book, Part 1, pg. 147) */
126 CD += CD_adot * Alpha_dot * cbar_2U;
133 CD_q = uiuc_ice_filter(CD_q_clean,kCD_q);
135 /* CD_q must be mulitplied by cbar/2U
136 (see Roskam Control book, Part 1, pg. 147) */
137 /* why multiply by Theta_dot instead of Q_body?
138 see note in coef_lift.cpp */
139 CD += CD_q * Theta_dot * cbar_2U;
151 CD_de = uiuc_ice_filter(CD_de_clean,kCD_de);
153 CD += CD_de * elevator;
158 CDfaI = uiuc_1Dinterpolation(CDfa_aArray,
167 CDfCLI = uiuc_1Dinterpolation(CDfCL_CLArray,
176 CDfdfI = uiuc_1Dinterpolation(CDfdf_dfArray,
185 CDfadeI = uiuc_2Dinterpolation(CDfade_aArray,
197 CDfadfI = uiuc_2Dinterpolation(CDfadf_aArray,
211 CXo = uiuc_ice_filter(CXo_clean,kCXo);
214 CXclean_wing += CXo_clean;
215 CXclean_tail += CXo_clean;
227 CXK = uiuc_ice_filter(CXK_clean,kCXK);
230 CXclean_wing += CXK_clean * CLclean_wing * CLclean_wing;
231 CXclean_tail += CXK_clean * CLclean_tail * CLclean_tail;
232 CXiced_wing += CXK * CLiced_wing * CLiced_wing;
233 CXiced_tail += CXK * CLiced_tail * CLiced_tail;
243 CX_a = uiuc_ice_filter(CX_a_clean,kCX_a);
246 CXclean_wing += CX_a_clean * Alpha;
247 CXclean_tail += CX_a_clean * Alpha;
248 CXiced_wing += CX_a * Alpha;
249 CXiced_tail += CX_a * Alpha;
259 CX_a2 = uiuc_ice_filter(CX_a2_clean,kCX_a2);
262 CXclean_wing += CX_a2_clean * Alpha * Alpha;
263 CXclean_tail += CX_a2_clean * Alpha * Alpha;
264 CXiced_wing += CX_a2 * Alpha * Alpha;
265 CXiced_tail += CX_a2 * Alpha * Alpha;
268 CX += CX_a2 * Alpha * Alpha;
275 CX_a3 = uiuc_ice_filter(CX_a3_clean,kCX_a3);
278 CXclean_wing += CX_a3_clean * Alpha * Alpha * Alpha;
279 CXclean_tail += CX_a3_clean * Alpha * Alpha * Alpha;
280 CXiced_wing += CX_a3 * Alpha * Alpha * Alpha;
281 CXiced_tail += CX_a3 * Alpha * Alpha * Alpha;
284 CX += CX_a3 * Alpha * Alpha * Alpha;
291 CX_adot = uiuc_ice_filter(CX_adot_clean,kCX_adot);
294 CXclean_wing += CX_adot_clean * Alpha_dot * cbar_2U;
295 CXclean_tail += CX_adot_clean * Alpha_dot * ch_2U;
296 CXiced_wing += CX * Alpha_dot * cbar_2U;
297 CXiced_tail += CX * Alpha_dot * ch_2U;
300 /* CX_adot must be mulitplied by cbar/2U
301 (see Roskam Control book, Part 1, pg. 147) */
302 CX += CX_adot * Alpha_dot * cbar_2U;
309 CX_q = uiuc_ice_filter(CX_q_clean,kCX_q);
312 CXclean_wing += CX_q_clean * Q_body * cbar_2U;
313 CXclean_tail += CX_q_clean * Q_body * ch_2U;
314 CXiced_wing += CX_q * Q_body * cbar_2U;
315 CXiced_tail += CX_q * Q_body * ch_2U;
318 /* CX_q must be mulitplied by cbar/2U
319 (see Roskam Control book, Part 1, pg. 147) */
320 CX += CX_q * Q_body * cbar_2U;
327 CX_de = uiuc_ice_filter(CX_de_clean,kCX_de);
330 CXclean_wing += CX_de_clean * elevator;
331 CXclean_tail += CX_de_clean * elevator;
332 CXiced_wing += CX_de * elevator;
333 CXiced_tail += CX_de * elevator;
336 CX += CX_de * elevator;
343 CX_dr = uiuc_ice_filter(CX_dr_clean,kCX_dr);
346 CXclean_wing += CX_dr_clean * rudder;
347 CXclean_tail += CX_dr_clean * rudder;
348 CXiced_wing += CX_dr * rudder;
349 CXiced_tail += CX_dr * rudder;
352 CX += CX_dr * rudder;
359 CX_df = uiuc_ice_filter(CX_df_clean,kCX_df);
362 CXclean_wing += CX_df_clean * flap;
363 CXclean_tail += CX_df_clean * flap;
364 CXiced_wing += CX * flap;
365 CXiced_tail += CX * flap;
375 CX_adf = uiuc_ice_filter(CX_adf_clean,kCX_adf);
378 CXclean_wing += CX_adf_clean * Alpha * flap;
379 CXclean_tail += CX_adf_clean * Alpha * flap;
380 CXiced_wing += CX_adf * Alpha * flap;
381 CXiced_tail += CX_adf * Alpha * flap;
384 CX += CX_adf * Alpha * flap;
393 // end uiuc_coef_drag.cpp