]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_coef_yaw.cpp
Updated Cameron's entry.
[flightgear.git] / src / FDM / UIUCModel / uiuc_coef_yaw.cpp
1 /**********************************************************************
2
3  FILENAME:     uiuc_coef_yaw.cpp
4
5 ----------------------------------------------------------------------
6
7  DESCRIPTION:  computes aggregated aerodynamic yaw 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                -yaw coefficient components
38                -icing parameters
39                -b_2U multiplier
40
41 ----------------------------------------------------------------------
42
43  OUTPUTS:      -Cn
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_yaw.h"
76
77
78 void uiuc_coef_yaw()
79 {
80   string linetoken1;
81   string linetoken2;
82   stack command_list;
83   
84   command_list = aeroYawParts -> getCommands();
85   
86   for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
87     {
88       linetoken1 = aeroYawParts -> getToken(*command_line, 1);
89       linetoken2 = aeroYawParts -> getToken(*command_line, 2);
90
91       switch(Cn_map[linetoken2])
92         {
93         case Cno_flag:
94           {
95             if (ice_on)
96               {
97                 Cno = uiuc_ice_filter(Cno_clean,kCno);
98               }
99             Cn += Cno;
100             break;
101           }
102         case Cn_beta_flag:
103           {
104             if (ice_on)
105               {
106                 Cn_beta = uiuc_ice_filter(Cn_beta_clean,kCn_beta);
107               }
108             Cn += Cn_beta * Beta;
109             break;
110           }
111         case Cn_p_flag:
112           {
113             if (ice_on)
114               {
115                 Cn_p = uiuc_ice_filter(Cn_p_clean,kCn_p);
116               }
117             /* Cn_p must be mulitplied by b/2U 
118                (see Roskam Control book, Part 1, pg. 147) */
119             Cn += Cn_p * P_body * b_2U;
120             break;
121           }
122         case Cn_r_flag:
123           {
124             if (ice_on)
125               {
126                 Cn_r = uiuc_ice_filter(Cn_r_clean,kCn_r);
127               }
128             /* Cn_r must be mulitplied by b/2U 
129                (see Roskam Control book, Part 1, pg. 147) */
130             Cn += Cn_r * R_body * b_2U;
131             break;
132           }
133         case Cn_da_flag:
134           {
135             if (ice_on)
136               {
137                 Cn_da = uiuc_ice_filter(Cn_da_clean,kCn_da);
138               }
139             Cn += Cn_da * aileron;
140             break;
141           }
142         case Cn_dr_flag:
143           {
144             if (ice_on)
145               {
146                 Cn_dr = uiuc_ice_filter(Cn_dr_clean,kCn_dr);
147               }
148             Cn += Cn_dr * rudder;
149             break;
150           }
151         case Cn_q_flag:
152           {
153             if (ice_on)
154               {
155                 Cn_q = uiuc_ice_filter(Cn_q_clean,kCn_q);
156               }
157             Cn += Cn_q * Q_body * cbar_2U;
158             break;
159           }
160         case Cn_b3_flag:
161           {
162             if (ice_on)
163               {
164                 Cn_b3 = uiuc_ice_filter(Cn_b3_clean,kCn_b3);
165               }
166             Cn += Cn_b3 * Beta * Beta * Beta;
167             break;
168           }
169         case Cnfada_flag:
170           {
171             CnfadaI = uiuc_2Dinterpolation(Cnfada_aArray,
172                                            Cnfada_daArray,
173                                            Cnfada_CnArray,
174                                            Cnfada_nAlphaArray,
175                                            Cnfada_nda,
176                                            Alpha,
177                                            aileron);
178             Cn += CnfadaI;
179             break;
180           }
181         case Cnfbetadr_flag:
182           {
183             CnfbetadrI = uiuc_2Dinterpolation(Cnfbetadr_betaArray,
184                                               Cnfbetadr_drArray,
185                                               Cnfbetadr_CnArray,
186                                               Cnfbetadr_nBetaArray,
187                                               Cnfbetadr_ndr,
188                                               Beta,
189                                               rudder);
190             Cn += CnfbetadrI;
191             break;
192           }
193         };
194     } // end Cn map
195
196   return;
197 }
198
199 // end uiuc_coef_yaw.cpp