Reworked dew point, heat index and wind chill calculations

This commit is contained in:
ulteq 2015-05-16 12:39:52 +02:00
parent ea68e91ef9
commit 03b478aeee
4 changed files with 21 additions and 14 deletions

View File

@ -21,6 +21,7 @@
PARAMS_2(_t,_rh);
// Source: https://en.wikipedia.org/wiki/Dew_point
private ["_gamma"];
_gamma = ln(_rh) + (__b * _t) / (__c + _t);

View File

@ -15,19 +15,20 @@
*/
#include "script_component.hpp"
#define __C1 -8.784695
#define __C2 1.61139411
#define __C3 2.338549
#define __C4 -0.14611605
#define __C5 -0.012308094
#define __C6 -0.016424828
#define __C7 0.002211732
#define __C8 0.00072546
#define __C9 -0.000003582
#define __C1 0.363445176
#define __C2 0.988622465
#define __C3 4.777114035
#define __C4 -0.114037667
#define __C5 -0.000850208
#define __C6 -0.020716198
#define __C7 0.000687678
#define __C8 0.000274954
PARAMS_2(_t,_rh);
// Source: https://en.wikipedia.org/wiki/Heat_index
_t = FAHRENHEIT(_t);
_rh = _rh * 100; // relative humidity in %
// Source: https://en.wikipedia.org/wiki/Heat_index
(__C1 + __C2 * _t + __C3 * _rh + __C4 * _t * _rh + __C5 * _t^2 + __C6 * _rh^2 + __C7 * _t^2 * _rh + __C8 * _t * _rh^2 + __C9 * _t^2 * _rh^2)
CELSIUS(__C1 + __C2 * _t + __C3 * _rh + __C4 * _t * _rh + __C5 * _t^2 + __C6 * _rh^2 + __C7 * _t^2 * _rh + __C8 * _t * _rh^2)

View File

@ -16,7 +16,10 @@
PARAMS_2(_t,_v);
_v = _v * 3,6; // wind speed in km/h
// Source: https://en.wikipedia.org/wiki/Wind_chill
(13.12 + 0.06215 * _t - 11.37 * _v ^ 0.16 + 0.3965 * _t * _v^0.16)
if (_t > 10) exitWith { _t };
if (_v < 1.39) exitWith { _t };
_v = _v * 3,6; // wind speed in km/h
(13.12 + 0.6215 * _t - 11.37 * _v ^ 0.16 + 0.3965 * _t * _v ^ 0.16)

View File

@ -18,3 +18,5 @@
#define WATER_VAPOR_MOLAR_MASS 0.018016
#define DRY_AIR_MOLAR_MASS 0.028964
#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058
#define CELSIUS(t) ((t - 32) / 1.8)
#define FAHRENHEIT(t) (t * 1.8 + 32)