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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
62 USA or view http://www.gnu.org/copyleft/gpl.html.
64 **********************************************************************/
68 UIUC wind gradient test code v0.1
70 Returns wind vector as a function of altitude for a simple
71 parabolic gradient profile
77 #include "uiuc_getwind.h"
78 #include "uiuc_aircraft.h"
83 double zref = 300.; //Reference height (ft)
84 double uref = 0; //Horizontal wind velocity at ref. height (ft/sec)
85 // double uref = 11; //Horizontal wind velocity at ref. height (ft/sec)
86 // double uref = 13; //Horizontal wind velocity at ref. height (ft/sec)
87 // double uref = 20; //Horizontal wind velocity at ref. height (ft/sec), 13.63 mph
88 // double uref = 22.5; //Horizontal wind velocity at ref. height (ft/sec), 15 mph
89 // double uref = 60.; //Horizontal wind velocity at ref. height (ft/sec), 40 mph
90 double ordref =-64.; //Horizontal wind ordinal from north (degrees)
91 double zoff = 300.; //Z offset (ft) - wind is zero at and below this point
92 double zcomp = 0.; //Vertical component (down is positive)
94 /* double zref = 300.; //Reference height (ft) */
95 /* double uref = 0.; //Horizontal wind velocity at ref. height (ft/sec) */
96 /* double ordref = 0.; //Horizontal wind ordinal from north (degrees) */
97 /* double zoff = 15.; //Z offset (ft) - wind is zero at and below this point */
98 /* double zcomp = 0.; //Vertical component (down is positive) */
101 /* Get wind vector */
102 double windmag = 0; //Wind magnitude
103 double a = 0; //Parabola: Altitude = a*windmag^2 + zoff
105 a = zref/pow(uref,2.);
106 if (Altitude >= zoff)
107 windmag = sqrt(Altitude/a);
111 V_north_airmass = windmag * cos(ordref*3.14159/180.); //North component
112 V_east_airmass = windmag * sin(ordref*3.14159/180.); //East component
113 V_down_airmass = zcomp;