1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/aero/aerodc81.h,v 1.25 2017/01/12 14:45:58 masarati Exp $ */ 2 /* 3 * MBDyn (C) is a multibody analysis code. 4 * http://www.mbdyn.org 5 * 6 * Copyright (C) 1996-2017 7 * 8 * Pierangelo Masarati <masarati@aero.polimi.it> 9 * Paolo Mantegazza <mantegazza@aero.polimi.it> 10 * 11 * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano 12 * via La Masa, 34 - 20156 Milano, Italy 13 * http://www.aero.polimi.it 14 * 15 * Changing this copyright notice is forbidden. 16 * 17 * This program is free software; you can redistribute it and/or modify 18 * it under the terms of the GNU General Public License as published by 19 * the Free Software Foundation (version 2 of the License). 20 * 21 * 22 * This program is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 * GNU General Public License for more details. 26 * 27 * You should have received a copy of the GNU General Public License 28 * along with this program; if not, write to the Free Software 29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 30 */ 31 32 #ifndef AERODC81_H 33 #define AERODC81_H 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif /* __cplusplus */ 38 39 enum { 40 // 0 unused? 41 OUTA_ALPHA = 1, 42 OUTA_GAMMA = 2, 43 OUTA_MACH = 3, 44 OUTA_CL = 4, 45 OUTA_CD = 5, 46 OUTA_CM = 6, 47 // 7 unused? 48 OUTA_CLALPHA = 7, 49 OUTA_ALF1 = 8, 50 OUTA_ALF2 = 9, 51 OUTA_DAN = 10, 52 OUTA_DAM = 11, 53 OUTA_DCN = 12, 54 OUTA_DCM = 13, 55 // 14-19 unused? 56 57 OUTA_LAST = 20 58 }; 59 60 typedef struct outa_t { 61 doublereal outa_00; 62 doublereal alpha; 63 doublereal gamma; 64 doublereal mach; 65 doublereal cl; 66 doublereal cd; 67 doublereal cm; 68 // doublereal outa_07; 69 doublereal clalpha; 70 doublereal alf1; 71 doublereal alf2; 72 doublereal dan; 73 doublereal dam; 74 doublereal dcn; 75 doublereal dcm; 76 doublereal outa_14; 77 doublereal outa_15; 78 doublereal outa_16; 79 doublereal outa_17; 80 doublereal outa_18; 81 doublereal outa_19; 82 } outa_t; 83 84 extern const outa_t outa_Zero; 85 86 /* 87 C DEFINIZIONI VETTORE VAM 88 C 89 C VAM(1): densita' dell'aria 90 C VAM(2): celerita' del suono 91 C VAM(3): corda 92 C VAM(4): 1/4 corda 93 C VAM(5): 3/4 corda 94 C VAM(6): svergolamento 95 */ 96 enum { 97 VAM_DENSITY = 0, 98 VAM_SOUND_CELERITY, 99 VAM_CHORD, 100 VAM_FORCE_POSITION, 101 VAM_BC_POSITION, 102 VAM_TWIST, 103 104 VAM_LAST 105 }; 106 107 typedef struct vam_t { 108 doublereal density; 109 doublereal sound_celerity; 110 doublereal chord; 111 doublereal force_position; 112 doublereal bc_position; 113 doublereal twist; 114 } vam_t; 115 116 /* 117 * dati in formato c81; 118 * le array mX contengono gli NMX numeri di mach; 119 * le array aX contengono gli NMX*NAX coefficienti, 120 * preceduti dall'angolo di incidenza e row-oriented. 121 * 122 * Quindi, il numero di Mach j-esimo (a base 0) e' 123 * 124 * mX[j] 125 * 126 * l'angolo di incidenza i-esimo (a base 0) e' 127 * 128 * aX[i] 129 * 130 * e per avere il coefficiente relativo all'angolo 131 * di incidenza i-esimo, al numero di mach j-esimo 132 * 133 * aX[NAX*(j+1)+i] 134 * 135 * MODIFICA 2000/10/02: 136 * angolo di stallo o fine linearita' per correzione flusso trasverso 137 * 138 * Ora si aggiunge: 139 * - un vettore di angoli ai quali si perde linearita' (+) 140 * - un vettore di angoli ai quali si perde linearita' (-) 141 * - un vettore con il Cp/alpha 142 */ 143 typedef struct c81_data { 144 char header[31]; 145 146 int NML; 147 int NAL; 148 doublereal *ml; 149 doublereal *al; 150 151 /* 152 * matrice dei dati di stallo: 153 * 0 -> NAL-1 : angoli di stallo positivi 154 * NAL -> 2*NAL-1 : angoli di stallo negativi 155 * 2*NAL -> 3*NAL-1 : Cp/alpha 156 */ 157 doublereal *stall; 158 doublereal *mstall; 159 160 int NMD; 161 int NAD; 162 doublereal *md; 163 doublereal *ad; 164 165 int NMM; 166 int NAM; 167 doublereal *mm; 168 doublereal *am; 169 } c81_data; 170 171 extern int 172 c81_aerod2(doublereal* W, const vam_t *VAM, doublereal* TNG, outa_t* OUTA, c81_data* data); 173 174 extern int 175 c81_aerod2_u(doublereal* W, const vam_t *VAM, doublereal* TNG, outa_t* OUTA, 176 c81_data* data, long unsteadyflag); 177 178 #ifdef __cplusplus 179 } 180 #endif /* __cplusplus */ 181 182 #endif /* AERODC81_H */ 183 184