| 1 |
/********************************************************************** |
| 2 |
|
| 3 |
FILENAME: uiuc_getwind.cpp |
| 4 |
|
| 5 |
---------------------------------------------------------------------- |
| 6 |
|
| 7 |
DESCRIPTION: sets V_airmass_north, _east, _down for use in LaRCsim |
| 8 |
|
| 9 |
---------------------------------------------------------------------- |
| 10 |
|
| 11 |
STATUS: alpha version |
| 12 |
|
| 13 |
---------------------------------------------------------------------- |
| 14 |
|
| 15 |
REFERENCES: |
| 16 |
|
| 17 |
---------------------------------------------------------------------- |
| 18 |
|
| 19 |
HISTORY: 03/26/2003 initial release |
| 20 |
|
| 21 |
---------------------------------------------------------------------- |
| 22 |
|
| 23 |
AUTHOR(S): Glen Dimock <[email protected]> |
| 24 |
Michael Selig <[email protected]> |
| 25 |
|
| 26 |
---------------------------------------------------------------------- |
| 27 |
|
| 28 |
VARIABLES: |
| 29 |
|
| 30 |
---------------------------------------------------------------------- |
| 31 |
|
| 32 |
INPUTS: |
| 33 |
|
| 34 |
---------------------------------------------------------------------- |
| 35 |
|
| 36 |
OUTPUTS: |
| 37 |
|
| 38 |
---------------------------------------------------------------------- |
| 39 |
|
| 40 |
CALLED BY: uiuc_wrapper |
| 41 |
|
| 42 |
---------------------------------------------------------------------- |
| 43 |
|
| 44 |
CALLS TO: none |
| 45 |
|
| 46 |
---------------------------------------------------------------------- |
| 47 |
|
| 48 |
COPYRIGHT: (C) 2003 by Michael Selig |
| 49 |
|
| 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. |
| 53 |
|
| 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. |
| 58 |
|
| 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. |
| 62 |
|
| 63 |
**********************************************************************/ |
| 64 |
|
| 65 |
|
| 66 |
/* |
| 67 |
UIUC wind gradient test code v0.1 |
| 68 |
|
| 69 |
Returns wind vector as a function of altitude for a simple |
| 70 |
parabolic gradient profile |
| 71 |
|
| 72 |
Glen Dimock |
| 73 |
Last update: 020227 |
| 74 |
*/ |
| 75 |
|
| 76 |
#include "uiuc_getwind.h" |
| 77 |
#include "uiuc_aircraft.h" |
| 78 |
|
| 79 |
void uiuc_getwind() |
| 80 |
{ |
| 81 |
/* Wind parameters */ |
| 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) |
| 92 |
|
| 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) */ |
| 98 |
|
| 99 |
|
| 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.); |
| 104 |
|
| 105 |
if (x) { |
| 106 |
a = zref/x; |
| 107 |
} |
| 108 |
if ((Altitude >= zoff) && (a > 0)) |
| 109 |
windmag = sqrt(Altitude/a); |
| 110 |
else |
| 111 |
windmag = 0.; |
| 112 |
|
| 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; |
| 116 |
|
| 117 |
return; |
| 118 |
} |
| 119 |
|