]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_coef_sideforce.cpp
Sep 1 2000 updates from the UIUC team.
[flightgear.git] / src / FDM / UIUCModel / uiuc_coef_sideforce.cpp
1 /**********************************************************************
2
3  FILENAME:     uiuc_coef_sideforce.cpp
4
5 ----------------------------------------------------------------------
6
7  DESCRIPTION:  computes aggregated aerodynamic sideforce 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                -sideforce coefficient components
38                -icing parameters
39                -b_2U multiplier
40
41 ----------------------------------------------------------------------
42
43  OUTPUTS:      -CY
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_sideforce.h"
76
77
78 void uiuc_coef_sideforce()
79 {
80   string linetoken1;
81   string linetoken2;
82   stack command_list;
83   
84   command_list = aeroSideforceParts -> getCommands();
85   
86   for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
87     {
88       linetoken1 = aeroSideforceParts -> getToken(*command_line, 1);
89       linetoken2 = aeroSideforceParts -> getToken(*command_line, 2);
90
91       switch(CY_map[linetoken2])
92         {
93         case CYo_flag:
94           {
95             if (ice_on)
96               {
97                 CYo = uiuc_ice_filter(CYo_clean,kCYo);
98               }
99             CY += CYo;
100             break;
101           }
102         case CY_beta_flag:
103           {
104             if (ice_on)
105               {
106                 CY_beta = uiuc_ice_filter(CY_beta_clean,kCY_beta);
107               }
108             CY += CY_beta * Beta;
109             break;
110           }
111         case CY_p_flag:
112           {
113             if (ice_on)
114               {
115                 CY_p = uiuc_ice_filter(CY_p_clean,kCY_p);
116               }
117             /* CY_p must be mulitplied by b/2U 
118                (see Roskam Control book, Part 1, pg. 147) */
119             CY += CY_p * P_body * b_2U;
120             break;
121           }
122         case CY_r_flag:
123           {
124             if (ice_on)
125               {
126                 CY_r = uiuc_ice_filter(CY_r_clean,kCY_r);
127               }
128             /* CY_r must be mulitplied by b/2U 
129                (see Roskam Control book, Part 1, pg. 147) */
130             CY += CY_r * R_body * b_2U;
131             break;
132           }
133         case CY_da_flag:
134           {
135             if (ice_on)
136               {
137                 CY_da = uiuc_ice_filter(CY_da_clean,kCY_da);
138               }
139             CY += CY_da * aileron;
140             break;
141           }
142         case CY_dr_flag:
143           {
144             if (ice_on)
145               {
146                 CY_dr = uiuc_ice_filter(CY_dr_clean,kCY_dr);
147               }
148             CY += CY_dr * rudder;
149             break;
150           }
151         case CY_dra_flag:
152           {
153             if (ice_on)
154               {
155                 CY_dra = uiuc_ice_filter(CY_dra_clean,kCY_dra);
156               }
157             CY += CY_dra * rudder * Alpha;
158             break;
159           }
160         case CY_bdot_flag:
161           {
162             if (ice_on)
163               {
164                 CY_bdot = uiuc_ice_filter(CY_bdot_clean,kCY_bdot);
165               }
166             CY += CY_bdot * Beta_dot * b_2U;
167             break;
168           }
169         case CYfada_flag:
170           {
171             CYfadaI = uiuc_2Dinterpolation(CYfada_aArray,
172                                            CYfada_daArray,
173                                            CYfada_CYArray,
174                                            CYfada_nAlphaArray,
175                                            CYfada_nda,
176                                            Alpha,
177                                            aileron);
178             CY += CYfadaI;
179             break;
180           }
181         case CYfbetadr_flag:
182           {
183             CYfbetadrI = uiuc_2Dinterpolation(CYfbetadr_betaArray,
184                                               CYfbetadr_drArray,
185                                               CYfbetadr_CYArray,
186                                               CYfbetadr_nBetaArray,
187                                               CYfbetadr_ndr,
188                                               Beta,
189                                               rudder);
190             CY += CYfbetadrI;
191             break;
192           }
193         };
194     } // end CY map
195   
196   return;
197 }
198
199 // end uiuc_coef_sideforce.cpp