]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_coef_roll.cpp
Updated Cameron's entry.
[flightgear.git] / src / FDM / UIUCModel / uiuc_coef_roll.cpp
1 /**********************************************************************
2
3  FILENAME:     uiuc_coef_roll.cpp
4
5 ----------------------------------------------------------------------
6
7  DESCRIPTION:  computes aggregated aerodynamic roll coefficient
8
9 ----------------------------------------------------------------------
10
11  STATUS:       alpha version
12
13 ----------------------------------------------------------------------
14
15  REFERENCES:   Roskam, Jan.  Airplane Flight Dynamics and Automatic
16                Flight Controls, Part I.  Lawrence, KS: DARcorporation,
17                1995.
18
19 ----------------------------------------------------------------------
20
21  HISTORY:      04/15/2000   initial release
22
23 ----------------------------------------------------------------------
24
25  AUTHOR(S):    Bipin Sehgal       <bsehgal@uiuc.edu>
26                Jeff Scott         <jscott@mail.com>
27
28 ----------------------------------------------------------------------
29
30  VARIABLES:
31
32 ----------------------------------------------------------------------
33
34  INPUTS:       -Alpha
35                -aileron
36                -rudder
37                -roll coefficient components
38                -icing parameters
39                -b_2U multiplier
40
41 ----------------------------------------------------------------------
42
43  OUTPUTS:      -Cl
44
45 ----------------------------------------------------------------------
46
47  CALLED BY:    uiuc_coefficients.cpp
48
49 ----------------------------------------------------------------------
50
51  CALLS TO:     uiuc_1Dinterpolation
52                uiuc_2Dinterpolation
53                uiuc_ice_filter
54
55 ----------------------------------------------------------------------
56
57  COPYRIGHT:    (C) 2000 by Michael Selig
58
59  This program is free software; you can redistribute it and/or
60  modify it under the terms of the GNU General Public License
61  as published by the Free Software Foundation.
62
63  This program is distributed in the hope that it will be useful,
64  but WITHOUT ANY WARRANTY; without even the implied warranty of
65  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
66  GNU General Public License for more details.
67
68  You should have received a copy of the GNU General Public License
69  along with this program; if not, write to the Free Software
70  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
71  USA or view http://www.gnu.org/copyleft/gpl.html.
72
73 **********************************************************************/
74
75 #include "uiuc_coef_roll.h"
76
77
78 void uiuc_coef_roll()
79 {
80   string linetoken1;
81   string linetoken2;
82   stack command_list;
83   
84   command_list = aeroRollParts -> getCommands();
85   
86   for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
87     {
88       linetoken1 = aeroRollParts -> getToken(*command_line, 1);
89       linetoken2 = aeroRollParts -> getToken(*command_line, 2);
90
91       switch(Cl_map[linetoken2])
92         {
93         case Clo_flag:
94           {
95             if (ice_on)
96               {
97                 Clo = uiuc_ice_filter(Clo_clean,kClo);
98               }
99             Cl += Clo;
100             break;
101           }
102         case Cl_beta_flag:
103           {
104             if (ice_on)
105               {
106                 Cl_beta = uiuc_ice_filter(Cl_beta_clean,kCl_beta);
107               }
108             Cl += Cl_beta * Beta;
109             break;
110           }
111         case Cl_p_flag:
112           {
113             if (ice_on)
114               {
115                 Cl_p = uiuc_ice_filter(Cl_p_clean,kCl_p);
116               }
117             /* Cl_p must be mulitplied by b/2U 
118                (see Roskam Control book, Part 1, pg. 147) */
119             Cl += Cl_p * P_body * b_2U;
120             break;
121           }
122         case Cl_r_flag:
123           {
124             if (ice_on)
125               {
126                 Cl_r = uiuc_ice_filter(Cl_r_clean,kCl_r);
127               }
128             /* Cl_r must be mulitplied by b/2U 
129                (see Roskam Control book, Part 1, pg. 147) */
130             Cl += Cl_r * R_body * b_2U;
131             break;
132           }
133         case Cl_da_flag:
134           {
135             if (ice_on)
136               {
137                 Cl_da = uiuc_ice_filter(Cl_da_clean,kCl_da);
138               }
139             Cl += Cl_da * aileron;
140             break;
141           }
142         case Cl_dr_flag:
143           {
144             if (ice_on)
145               {
146                 Cl_dr = uiuc_ice_filter(Cl_dr_clean,kCl_dr);
147               }
148             Cl += Cl_dr * rudder;
149             break;
150           }
151         case Cl_daa_flag:
152           {
153             if (ice_on)
154               {
155                 Cl_daa = uiuc_ice_filter(Cl_daa_clean,kCl_daa);
156               }
157             Cl += Cl_daa * aileron * Alpha;
158             break;
159           }
160         case Clfada_flag:
161           {
162             ClfadaI = uiuc_2Dinterpolation(Clfada_aArray,
163                                            Clfada_daArray,
164                                            Clfada_ClArray,
165                                            Clfada_nAlphaArray,
166                                            Clfada_nda,
167                                            Alpha,
168                                            aileron);
169             Cl += ClfadaI;
170             break;
171           }
172         case Clfbetadr_flag:
173           {
174             ClfbetadrI = uiuc_2Dinterpolation(Clfbetadr_betaArray,
175                                               Clfbetadr_drArray,
176                                               Clfbetadr_ClArray,
177                                               Clfbetadr_nBetaArray,
178                                               Clfbetadr_ndr,
179                                               Beta,
180                                               rudder);
181             Cl += ClfbetadrI;
182             break;
183           }
184         };
185     } // end Cl map
186
187   return;
188 }
189
190 // end uiuc_coef_roll.cpp