MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
NREL_AeroDyn.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/modules/module-aerodyn/NREL_AeroDyn.h,v 1.8 2017/01/12 14:47:15 masarati Exp $ */
2 /*
3  * Copyright (C) 2003-2017
4  *
5  * Pierangelo Masarati <masarati@aero.polimi.it>
6  * Paolo Mantegazza <mantegazza@aero.polimi.it>
7  *
8  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
9  * via La Masa, 34 - 20156 Milano, Italy
10  * http://www.aero.polimi.it
11  *
12  * Changing this copyright notice is forbidden.
13  *
14  * This header file is free software; you can redistribute it at will,
15  * under the same license conditions of the AeroDyn package.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  */
22 
23 #ifndef AERO_DYN_H
24 #define AERO_DYN_H
25 
26 /*
27  * NOTE to gfortran users:
28  *
29  * - get AeroDyn 12.58
30  * - apply patch aerodyn-12.58-mbdyn.patch
31  * - run
32  gfortran -O -c *.f90
33  ar ru libAeroDyn.a *.o
34  * - place libAeroDyn.a where the linker can find it,
35  * or tweak Makefile.inc as appropriate
36  */
37 
38 /*
39  * NOTE to icc users:
40  *
41  * compile f90 files with
42 
43  ifc -r8
44 
45  * for double precision; defaults to single precision
46  * link C++ executable with
47 
48  g++ -L /opt/intel/ia32/lib/ -lF90 -lCEPCF90 -lintrins
49 
50  */
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif /* __cplusplus */
55 
56 #if defined(USE_SINGLE_PRECISION)
57 typedef float F_REAL;
58 #elif defined(USE_DOUBLE_PRECISION)
59 typedef double F_REAL;
60 #else /* !USE_SINGLE_PRECISION && !USE_DOUBLE_PRECISION */
61 #error "define either USE_SINGLE_PRECISION or USE_DOUBLE_PRECISION"
62 #endif /* !USE_SINGLE_PRECISION && !USE_DOUBLE_PRECISION */
63 typedef long int F_LOGICAL;
64 typedef char F_CHAR;
65 typedef long int F_INTEGER;
66 
67 /*
68  * Info from:
69 
70  USER'S GUIDE
71  to the Wind Turbine Aerodynamics Computer Software
72  AeroDyn
73 
74  David J. Laino
75  A. Craig Hansen
76  Windward Engineering, LC
77  Salt Lake City, UT 84117
78  www.windwardengineering.com
79 
80  Phone: 801-278-7852
81  Fax: 801-272-4132
82  email: dlaino@windwardengineering.com
83  chansen@windwardengineering.com
84 
85  Software date and version
86  AeroDyn 12.43, 26-Apr-2002
87 
88  Prepared for the
89  National Renewable Energy Laboratory
90  under Subcontract No. TCX-9-29209-01
91 
92 */
93 
94 /*
95  * AeroDyn initialization; must be called as early as possible.
96  */
97 extern int
98 __FC_DECL__(ad_inputgate)(F_CHAR *input_file);
99 extern int
100 __FC_DECL__(adinputgate)(void);
101 
102 // ADDED BY JENS VAN SCHELVE TO PROVIDE AERODYN ELEMENT DATA OUTPUT
103 extern int
104 __FC_DECL__(elemout)(void);
105 
106 /*
107  * Returns the force and moment for a given element.
108  */
109 extern int
110 __FC_DECL__(aerofrcintrface)(F_LOGICAL *FirstLoop, F_INTEGER *JElem,
111  F_REAL *DFN, F_REAL *DFT, F_REAL *PMA);
112 
113 /*
114  * Rotor parameters - called once per time step.
115  */
116 extern int
117 __FC_DECL__(getrotorparams)(F_REAL *Omega, F_REAL *gamma, F_REAL *VHUB,
118  F_REAL *tau);
119 
120 /*
121  * Blade parameters - called once for each blade at each time step.
122  */
123 extern int
124 __FC_DECL__(getbladeparams)(F_REAL *psi);
125 
126 /*
127  * Element parameters - called once for each element at each time step.
128  */
129 extern int
130 __FC_DECL__(getelemparams)(F_INTEGER *MulTabLoc, F_REAL *phi,
131  F_REAL *radius,
132  F_REAL *XGRND, F_REAL *YGRND, F_REAL *ZGRND);
133 
134 /*
135  * Compute VT, VN{W,E} based on VX, VY, VZ of the wind.
136  */
137 extern int
138 __FC_DECL__(getvnvt)(F_REAL *VX, F_REAL *VY, F_REAL *VZ,
139  F_REAL *VT, F_REAL *VNW, F_REAL *VNE);
140 
141 /*
142  * Write an error message to the appropriate stream
143  *
144  * FIXME: the "msg" and "level" arrays should be reset by the caller
145  * before writing the message, otherwise they're not '\0' terminated
146  */
147 extern int
148 __FC_DECL__(usrmes)(F_LOGICAL *Logical, F_CHAR msg[],
149  F_INTEGER *code, F_CHAR level[]);
150 
151 /*
152  * self explanatory :)
153  */
154 extern int
155 __FC_DECL__(ad_abort)(void);
156 
157 /*
158  * MBDyn stuff initialization
159  */
160 extern int
161 __FC_DECL__(mbdyn_init)(F_CHAR *Version, F_INTEGER *nblades, F_REAL *rotradius);
162 
163 /*
164  * AeroDyn initialization wrapper
165  */
166 extern int
167 __FC_DECL__(mbdyn_ad_inputgate)(F_CHAR *ifname, F_INTEGER *ifnamelen, F_CHAR *efname, F_INTEGER *efnamelen);
168 
169 /*
170  * MBDyn logical true
171  */
172 extern int
173 __FC_DECL__(mbdyn_true)(F_LOGICAL *val);
174 
175 /*
176  * MBDyn logical false
177  */
178 extern int
179 __FC_DECL__(mbdyn_false)(F_LOGICAL *val);
180 
181 /*
182  * By Fanzhong Meng 21 Feb. 2008
183  * MBDyn-AeroDyn common module defined data
184  */
185 extern int
186 __FC_DECL__(mbdyn_com_data)(F_INTEGER *c_blade, F_INTEGER *c_elem);
187 
188 /*
189  * This subroutine is to pass the current simulation time
190  * from MBDyn to AeroDyn!
191  * c_time: current time
192  * By Fanzhong MENG 19 June 2008
193  */
194 extern int
195 __FC_DECL__(mbdyn_sim_time)(doublereal *c_time);
196 
197 /*
198  * This subroutine is to pass the current simulation time step
199  * from MBDyn to AeroDyn!
200  * dt: time step
201  * By Fanzhong MENG 19 June 2008
202  */
203 extern int
204 __FC_DECL__(mbdyn_time_step)(F_REAL *dt);
205 
206 
207 /*
208  * This Subroutine is to get the Tip loss constants.
209  * RLOCAL: store the position of the blade element.
210  * Cur_elem: store the number of current blade element.
211  * By Fanzhong Meng 14 August 2008
212  */
213 extern int
214 __FC_DECL__(mbdyn_get_tl_const)(F_REAL *RLOCAL, F_INTEGER *Cur_elem);
215 
216 
217 /*
218  * This Subroutine is to get the Hub loss constants.
219  * RLOCAL: store the position of the blade element.
220  * Cur_elem: store the number of current blade element.
221  * RHub: Store the hub radius.
222  * By Fanzhong Meng 14 August 2008
223  */
224 extern int
225 __FC_DECL__(mbdyn_get_hl_const)(F_REAL *RLOCAL, F_INTEGER *Cur_elem, F_REAL *RHub);
226 
227 #ifdef __cplusplus
228 }
229 #endif /* __cplusplus */
230 
231 #endif /* AERO_DYN_H */
232 
int __FC_DECL__() aerofrcintrface(F_LOGICAL *FirstLoop, F_INTEGER *JElem, F_REAL *DFN, F_REAL *DFT, F_REAL *PMA)
int __FC_DECL__() mbdyn_true(F_LOGICAL *val)
int __FC_DECL__() getvnvt(F_REAL *VX, F_REAL *VY, F_REAL *VZ, F_REAL *VT, F_REAL *VNW, F_REAL *VNE)
int __FC_DECL__() mbdyn_init(F_CHAR *Version, F_INTEGER *nblades, F_REAL *rotradius)
int __FC_DECL__() getrotorparams(F_REAL *Omega, F_REAL *gamma, F_REAL *VHUB, F_REAL *tau)
int __FC_DECL__() usrmes(F_LOGICAL *Logical, F_CHAR msg[], F_INTEGER *code, F_CHAR level[])
int __FC_DECL__() mbdyn_false(F_LOGICAL *val)
int __FC_DECL__() getelemparams(F_INTEGER *MulTabLoc, F_REAL *phi, F_REAL *radius, F_REAL *XGRND, F_REAL *YGRND, F_REAL *ZGRND)
int __FC_DECL__() ad_inputgate(F_CHAR *input_file)
int __FC_DECL__() getbladeparams(F_REAL *psi)
int __FC_DECL__() mbdyn_sim_time(doublereal *c_time)
int __FC_DECL__() adinputgate(void)
int __FC_DECL__() ad_abort(void)
int __FC_DECL__() mbdyn_com_data(F_INTEGER *c_blade, F_INTEGER *c_elem)
char F_CHAR
Definition: NREL_AeroDyn.h:64
int __FC_DECL__() mbdyn_get_tl_const(F_REAL *RLOCAL, F_INTEGER *Cur_elem)
int __FC_DECL__() elemout(void)
struct mbrtai_msg_t msg
long int F_INTEGER
Definition: NREL_AeroDyn.h:65
long int F_LOGICAL
Definition: NREL_AeroDyn.h:63
int __FC_DECL__() mbdyn_ad_inputgate(F_CHAR *ifname, F_INTEGER *ifnamelen, F_CHAR *efname, F_INTEGER *efnamelen)
double doublereal
Definition: colamd.c:52
int __FC_DECL__() mbdyn_time_step(F_REAL *dt)
int __FC_DECL__() mbdyn_get_hl_const(F_REAL *RLOCAL, F_INTEGER *Cur_elem, F_REAL *RHub)