1 /**********************************************************************
3 FILENAME: uiuc_getwind.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: sets V_airmass_north, _east, _down for use in LaRCsim
9 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
17 ----------------------------------------------------------------------
19 HISTORY: 03/26/2003 initial release
21 ----------------------------------------------------------------------
23 AUTHOR(S): Glen Dimock <dimock@uiuc.edu>
24 Michael Selig <m-selig@uiuc.edu>
26 ----------------------------------------------------------------------
30 ----------------------------------------------------------------------
34 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
40 CALLED BY: uiuc_wrapper
42 ----------------------------------------------------------------------
46 ----------------------------------------------------------------------
48 COPYRIGHT: (C) 2003 by Michael Selig
50 This program is free software; you can redistribute it and/or
51 modify it under the terms of the GNU General Public License
52 as published by the Free Software Foundation.
54 This program is distributed in the hope that it will be useful,
55 but WITHOUT ANY WARRANTY; without even the implied warranty of
56 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 GNU General Public License for more details.
59 You should have received a copy of the GNU General Public License
60 along with this program; if not, write to the Free Software
61 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
63 **********************************************************************/
67 UIUC wind gradient test code v0.1
69 Returns wind vector as a function of altitude for a simple
70 parabolic gradient profile
76 #include "uiuc_getwind.h"
77 #include "uiuc_aircraft.h"
82 double zref = 300.; //Reference height (ft)
83 double uref = 0; //Horizontal wind velocity at ref. height (ft/sec)
84 // double uref = 11; //Horizontal wind velocity at ref. height (ft/sec)
85 // double uref = 13; //Horizontal wind velocity at ref. height (ft/sec)
86 // double uref = 20; //Horizontal wind velocity at ref. height (ft/sec), 13.63 mph
87 // double uref = 22.5; //Horizontal wind velocity at ref. height (ft/sec), 15 mph
88 // double uref = 60.; //Horizontal wind velocity at ref. height (ft/sec), 40 mph
89 double ordref =-64.; //Horizontal wind ordinal from north (degrees)
90 double zoff = 300.; //Z offset (ft) - wind is zero at and below this point
91 double zcomp = 0.; //Vertical component (down is positive)
93 /* double zref = 300.; //Reference height (ft) */
94 /* double uref = 0.; //Horizontal wind velocity at ref. height (ft/sec) */
95 /* double ordref = 0.; //Horizontal wind ordinal from north (degrees) */
96 /* double zoff = 15.; //Z offset (ft) - wind is zero at and below this point */
97 /* double zcomp = 0.; //Vertical component (down is positive) */
100 /* Get wind vector */
101 double windmag = 0; //Wind magnitude
102 double a = 0; //Parabola: Altitude = a*windmag^2 + zoff
103 double x = pow(uref,2.);
108 if ((Altitude >= zoff) && (a > 0))
109 windmag = sqrt(Altitude/a);
113 V_north_airmass = windmag * cos(ordref*3.14159/180.); //North component
114 V_east_airmass = windmag * sin(ordref*3.14159/180.); //East component
115 V_down_airmass = zcomp;