jsthermalcomfort 0.0.2 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +196 -6
  2. package/lib/cjs/index.js +7 -434
  3. package/lib/cjs/models/a_pmv.js +140 -0
  4. package/lib/cjs/models/adaptive_ashrae.js +290 -0
  5. package/lib/cjs/models/adaptive_en.js +300 -0
  6. package/lib/cjs/models/ankle_draft.js +82 -0
  7. package/lib/cjs/models/at.js +52 -0
  8. package/lib/cjs/models/athb.js +135 -0
  9. package/lib/cjs/models/clo_tout.js +58 -0
  10. package/lib/cjs/models/cooling_effect.js +164 -0
  11. package/lib/cjs/models/discomfort_index.js +115 -0
  12. package/lib/cjs/models/e_pmv.js +154 -0
  13. package/lib/cjs/models/heat_index.js +60 -0
  14. package/lib/cjs/models/humidex.js +63 -0
  15. package/lib/cjs/models/index.js +71 -0
  16. package/lib/cjs/models/net.js +50 -0
  17. package/lib/cjs/models/pet_steady.js +443 -0
  18. package/lib/cjs/models/phs.js +458 -0
  19. package/lib/cjs/models/pmv.js +200 -0
  20. package/lib/cjs/models/pmv_ppd.js +404 -0
  21. package/lib/cjs/models/set_tmp.js +203 -0
  22. package/lib/cjs/models/solar_gain.js +163 -0
  23. package/lib/cjs/models/two_nodes.js +790 -0
  24. package/lib/cjs/models/use_fans_heatwave.js +203 -0
  25. package/lib/cjs/models/utci.js +609 -0
  26. package/lib/cjs/models/vertical_tmp_grad_ppd.js +95 -0
  27. package/lib/cjs/models/wbgt.js +72 -0
  28. package/lib/cjs/models/wc.js +37 -0
  29. package/lib/cjs/psychrometrics/enthalpy.js +24 -0
  30. package/lib/cjs/psychrometrics/index.js +28 -0
  31. package/lib/cjs/psychrometrics/p_sat.js +46 -0
  32. package/lib/cjs/psychrometrics/p_sat_torr.js +34 -0
  33. package/lib/cjs/psychrometrics/psy_ta_rh.js +51 -0
  34. package/lib/cjs/psychrometrics/t_dp.js +19 -0
  35. package/lib/cjs/psychrometrics/t_mrt.js +117 -0
  36. package/lib/cjs/psychrometrics/t_o.js +82 -0
  37. package/lib/cjs/psychrometrics/t_wb.js +23 -0
  38. package/lib/cjs/types/index.d.ts +7 -79
  39. package/lib/cjs/types/index.d.ts.map +1 -1
  40. package/lib/cjs/types/models/a_pmv.d.ts +133 -0
  41. package/lib/cjs/types/models/a_pmv.d.ts.map +1 -0
  42. package/lib/cjs/types/models/adaptive_ashrae.d.ts +211 -0
  43. package/lib/cjs/types/models/adaptive_ashrae.d.ts.map +1 -0
  44. package/lib/cjs/types/models/adaptive_en.d.ts +217 -0
  45. package/lib/cjs/types/models/adaptive_en.d.ts.map +1 -0
  46. package/lib/cjs/types/models/ankle_draft.d.ts +60 -0
  47. package/lib/cjs/types/models/ankle_draft.d.ts.map +1 -0
  48. package/lib/cjs/types/models/at.d.ts +34 -0
  49. package/lib/cjs/types/models/at.d.ts.map +1 -0
  50. package/lib/cjs/types/models/athb.d.ts +96 -0
  51. package/lib/cjs/types/models/athb.d.ts.map +1 -0
  52. package/lib/cjs/types/models/clo_tout.d.ts +45 -0
  53. package/lib/cjs/types/models/clo_tout.d.ts.map +1 -0
  54. package/lib/cjs/types/models/cooling_effect.d.ts +49 -0
  55. package/lib/cjs/types/models/cooling_effect.d.ts.map +1 -0
  56. package/lib/cjs/types/models/discomfort_index.d.ts +91 -0
  57. package/lib/cjs/types/models/discomfort_index.d.ts.map +1 -0
  58. package/lib/cjs/types/models/e_pmv.d.ts +139 -0
  59. package/lib/cjs/types/models/e_pmv.d.ts.map +1 -0
  60. package/lib/cjs/types/models/heat_index.d.ts +27 -0
  61. package/lib/cjs/types/models/heat_index.d.ts.map +1 -0
  62. package/lib/cjs/types/models/humidex.d.ts +54 -0
  63. package/lib/cjs/types/models/humidex.d.ts.map +1 -0
  64. package/lib/cjs/types/models/index.d.ts +78 -0
  65. package/lib/cjs/types/models/index.d.ts.map +1 -0
  66. package/lib/cjs/types/models/net.d.ts +39 -0
  67. package/lib/cjs/types/models/net.d.ts.map +1 -0
  68. package/lib/cjs/types/models/pet_steady.d.ts +59 -0
  69. package/lib/cjs/types/models/pet_steady.d.ts.map +1 -0
  70. package/lib/cjs/types/models/phs.d.ts +242 -0
  71. package/lib/cjs/types/models/phs.d.ts.map +1 -0
  72. package/lib/cjs/types/models/pmv.d.ts +198 -0
  73. package/lib/cjs/types/models/pmv.d.ts.map +1 -0
  74. package/lib/cjs/types/models/pmv_ppd.d.ts +246 -0
  75. package/lib/cjs/types/models/pmv_ppd.d.ts.map +1 -0
  76. package/lib/cjs/types/models/set_tmp.d.ts +124 -0
  77. package/lib/cjs/types/models/set_tmp.d.ts.map +1 -0
  78. package/lib/cjs/types/models/solar_gain.d.ts +76 -0
  79. package/lib/cjs/types/models/solar_gain.d.ts.map +1 -0
  80. package/lib/cjs/types/models/two_nodes.d.ts +412 -0
  81. package/lib/cjs/types/models/two_nodes.d.ts.map +1 -0
  82. package/lib/cjs/types/models/use_fans_heatwave.d.ts +188 -0
  83. package/lib/cjs/types/models/use_fans_heatwave.d.ts.map +1 -0
  84. package/lib/cjs/types/models/utci.d.ts +79 -0
  85. package/lib/cjs/types/models/utci.d.ts.map +1 -0
  86. package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts +58 -0
  87. package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts.map +1 -0
  88. package/lib/cjs/types/models/wbgt.d.ts +51 -0
  89. package/lib/cjs/types/models/wbgt.d.ts.map +1 -0
  90. package/lib/cjs/types/models/wc.d.ts +29 -0
  91. package/lib/cjs/types/models/wc.d.ts.map +1 -0
  92. package/lib/cjs/types/psychrometrics/enthalpy.d.ts +12 -0
  93. package/lib/cjs/types/psychrometrics/enthalpy.d.ts.map +1 -0
  94. package/lib/cjs/types/psychrometrics/index.d.ts +26 -0
  95. package/lib/cjs/types/psychrometrics/index.d.ts.map +1 -0
  96. package/lib/cjs/types/psychrometrics/p_sat.d.ts +13 -0
  97. package/lib/cjs/types/psychrometrics/p_sat.d.ts.map +1 -0
  98. package/lib/cjs/types/psychrometrics/p_sat_torr.d.ts +26 -0
  99. package/lib/cjs/types/psychrometrics/p_sat_torr.d.ts.map +1 -0
  100. package/lib/cjs/types/psychrometrics/psy_ta_rh.d.ts +51 -0
  101. package/lib/cjs/types/psychrometrics/psy_ta_rh.d.ts.map +1 -0
  102. package/lib/cjs/types/psychrometrics/t_dp.d.ts +9 -0
  103. package/lib/cjs/types/psychrometrics/t_dp.d.ts.map +1 -0
  104. package/lib/cjs/types/psychrometrics/t_mrt.d.ts +43 -0
  105. package/lib/cjs/types/psychrometrics/t_mrt.d.ts.map +1 -0
  106. package/lib/cjs/types/psychrometrics/t_o.d.ts +31 -0
  107. package/lib/cjs/types/psychrometrics/t_o.d.ts.map +1 -0
  108. package/lib/cjs/types/psychrometrics/t_wb.d.ts +12 -0
  109. package/lib/cjs/types/psychrometrics/t_wb.d.ts.map +1 -0
  110. package/lib/cjs/types/utilities/index.d.ts +28 -0
  111. package/lib/cjs/types/utilities/index.d.ts.map +1 -0
  112. package/lib/cjs/types/utilities/utilities.d.ts +377 -0
  113. package/lib/cjs/types/utilities/utilities.d.ts.map +1 -0
  114. package/lib/cjs/utilities/index.js +27 -0
  115. package/lib/cjs/utilities/utilities.js +903 -0
  116. package/lib/esm/index.js +4 -0
  117. package/lib/esm/models/a_pmv.js +135 -0
  118. package/lib/esm/models/adaptive_ashrae.js +285 -0
  119. package/lib/esm/models/adaptive_en.js +294 -0
  120. package/lib/esm/models/ankle_draft.js +78 -0
  121. package/lib/esm/models/at.js +48 -0
  122. package/lib/esm/models/athb.js +130 -0
  123. package/lib/esm/models/clo_tout.js +53 -0
  124. package/lib/esm/models/cooling_effect.js +159 -0
  125. package/lib/esm/models/discomfort_index.js +110 -0
  126. package/lib/esm/models/e_pmv.js +149 -0
  127. package/lib/esm/models/heat_index.js +56 -0
  128. package/lib/esm/models/humidex.js +59 -0
  129. package/lib/esm/models/index.js +69 -0
  130. package/lib/esm/models/net.js +46 -0
  131. package/lib/esm/models/pet_steady.js +439 -0
  132. package/lib/esm/models/phs.js +454 -0
  133. package/lib/esm/models/pmv.js +195 -0
  134. package/lib/esm/models/pmv_ppd.js +398 -0
  135. package/lib/esm/models/set_tmp.js +198 -0
  136. package/lib/esm/models/solar_gain.js +158 -0
  137. package/lib/esm/models/two_nodes.js +784 -0
  138. package/lib/esm/models/use_fans_heatwave.js +199 -0
  139. package/lib/esm/models/utci.js +604 -0
  140. package/lib/esm/models/wbgt.js +68 -0
  141. package/lib/esm/models/wc.js +33 -0
  142. package/lib/esm/psychrometrics/enthalpy.js +20 -0
  143. package/lib/esm/psychrometrics/index.js +26 -0
  144. package/lib/esm/psychrometrics/p_sat.js +42 -0
  145. package/lib/esm/psychrometrics/p_sat_torr.js +29 -0
  146. package/lib/esm/psychrometrics/psy_ta_rh.js +47 -0
  147. package/lib/esm/psychrometrics/t_dp.js +15 -0
  148. package/lib/esm/psychrometrics/t_mrt.js +112 -0
  149. package/lib/esm/psychrometrics/t_o.js +77 -0
  150. package/lib/esm/psychrometrics/t_wb.js +19 -0
  151. package/lib/esm/types/index.d.ts +7 -79
  152. package/lib/esm/types/index.d.ts.map +1 -1
  153. package/lib/esm/types/models/a_pmv.d.ts +133 -0
  154. package/lib/esm/types/models/a_pmv.d.ts.map +1 -0
  155. package/lib/esm/types/models/adaptive_ashrae.d.ts +211 -0
  156. package/lib/esm/types/models/adaptive_ashrae.d.ts.map +1 -0
  157. package/lib/esm/types/models/adaptive_en.d.ts +217 -0
  158. package/lib/esm/types/models/adaptive_en.d.ts.map +1 -0
  159. package/lib/esm/types/models/ankle_draft.d.ts +60 -0
  160. package/lib/esm/types/models/ankle_draft.d.ts.map +1 -0
  161. package/lib/esm/types/models/at.d.ts +34 -0
  162. package/lib/esm/types/models/at.d.ts.map +1 -0
  163. package/lib/esm/types/models/athb.d.ts +96 -0
  164. package/lib/esm/types/models/athb.d.ts.map +1 -0
  165. package/lib/esm/types/models/clo_tout.d.ts +45 -0
  166. package/lib/esm/types/models/clo_tout.d.ts.map +1 -0
  167. package/lib/esm/types/models/cooling_effect.d.ts +49 -0
  168. package/lib/esm/types/models/cooling_effect.d.ts.map +1 -0
  169. package/lib/esm/types/models/discomfort_index.d.ts +91 -0
  170. package/lib/esm/types/models/discomfort_index.d.ts.map +1 -0
  171. package/lib/esm/types/models/e_pmv.d.ts +139 -0
  172. package/lib/esm/types/models/e_pmv.d.ts.map +1 -0
  173. package/lib/esm/types/models/heat_index.d.ts +27 -0
  174. package/lib/esm/types/models/heat_index.d.ts.map +1 -0
  175. package/lib/esm/types/models/humidex.d.ts +54 -0
  176. package/lib/esm/types/models/humidex.d.ts.map +1 -0
  177. package/lib/esm/types/models/index.d.ts +77 -0
  178. package/lib/esm/types/models/index.d.ts.map +1 -0
  179. package/lib/esm/types/models/net.d.ts +39 -0
  180. package/lib/esm/types/models/net.d.ts.map +1 -0
  181. package/lib/esm/types/models/pet_steady.d.ts +59 -0
  182. package/lib/esm/types/models/pet_steady.d.ts.map +1 -0
  183. package/lib/esm/types/models/phs.d.ts +242 -0
  184. package/lib/esm/types/models/phs.d.ts.map +1 -0
  185. package/lib/esm/types/models/pmv.d.ts +198 -0
  186. package/lib/esm/types/models/pmv.d.ts.map +1 -0
  187. package/lib/esm/types/models/pmv_ppd.d.ts +246 -0
  188. package/lib/esm/types/models/pmv_ppd.d.ts.map +1 -0
  189. package/lib/esm/types/models/set_tmp.d.ts +124 -0
  190. package/lib/esm/types/models/set_tmp.d.ts.map +1 -0
  191. package/lib/esm/types/models/solar_gain.d.ts +76 -0
  192. package/lib/esm/types/models/solar_gain.d.ts.map +1 -0
  193. package/lib/esm/types/models/two_nodes.d.ts +412 -0
  194. package/lib/esm/types/models/two_nodes.d.ts.map +1 -0
  195. package/lib/esm/types/models/use_fans_heatwave.d.ts +188 -0
  196. package/lib/esm/types/models/use_fans_heatwave.d.ts.map +1 -0
  197. package/lib/esm/types/models/utci.d.ts +79 -0
  198. package/lib/esm/types/models/utci.d.ts.map +1 -0
  199. package/lib/esm/types/models/wbgt.d.ts +51 -0
  200. package/lib/esm/types/models/wbgt.d.ts.map +1 -0
  201. package/lib/esm/types/models/wc.d.ts +29 -0
  202. package/lib/esm/types/models/wc.d.ts.map +1 -0
  203. package/lib/esm/types/psychrometrics/enthalpy.d.ts +12 -0
  204. package/lib/esm/types/psychrometrics/enthalpy.d.ts.map +1 -0
  205. package/lib/esm/types/psychrometrics/index.d.ts +26 -0
  206. package/lib/esm/types/psychrometrics/index.d.ts.map +1 -0
  207. package/lib/esm/types/psychrometrics/p_sat.d.ts +13 -0
  208. package/lib/esm/types/psychrometrics/p_sat.d.ts.map +1 -0
  209. package/lib/esm/types/psychrometrics/p_sat_torr.d.ts +26 -0
  210. package/lib/esm/types/psychrometrics/p_sat_torr.d.ts.map +1 -0
  211. package/lib/esm/types/psychrometrics/psy_ta_rh.d.ts +51 -0
  212. package/lib/esm/types/psychrometrics/psy_ta_rh.d.ts.map +1 -0
  213. package/lib/esm/types/psychrometrics/t_dp.d.ts +9 -0
  214. package/lib/esm/types/psychrometrics/t_dp.d.ts.map +1 -0
  215. package/lib/esm/types/psychrometrics/t_mrt.d.ts +43 -0
  216. package/lib/esm/types/psychrometrics/t_mrt.d.ts.map +1 -0
  217. package/lib/esm/types/psychrometrics/t_o.d.ts +31 -0
  218. package/lib/esm/types/psychrometrics/t_o.d.ts.map +1 -0
  219. package/lib/esm/types/psychrometrics/t_wb.d.ts +12 -0
  220. package/lib/esm/types/psychrometrics/t_wb.d.ts.map +1 -0
  221. package/lib/esm/types/utilities/index.d.ts +28 -0
  222. package/lib/esm/types/utilities/index.d.ts.map +1 -0
  223. package/lib/esm/types/utilities/utilities.d.ts +377 -0
  224. package/lib/esm/types/utilities/utilities.d.ts.map +1 -0
  225. package/lib/esm/utilities/index.js +25 -0
  226. package/lib/esm/utilities/utilities.js +885 -0
  227. package/package.json +22 -15
  228. package/lib/esm/index.mjs +0 -430
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.brent = exports.cooling_effect = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ const set_tmp_js_1 = require("./set_tmp.js");
6
+ /**
7
+ * Returns the value of the Cooling Effect ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#Cooling_Effect|CE} )
8
+ * calculated in compliance with the ASHRAE 55 2020 Standard {@link #ref_1|[1]}.
9
+ * The {@link https://en.wikipedia.org/wiki/Thermal_comfort#Cooling_Effect|CE} of the elevated air speed
10
+ * is the value that, when subtracted equally from both the average air temperature and the mean radiant temperature,
11
+ * the same {@link https://en.wikipedia.org/wiki/Thermal_comfort#Standard_effective_temperature|SET} under still air
12
+ * as in the first {@link https://en.wikipedia.org/wiki/Thermal_comfort#Standard_effective_temperature|SET} calculation
13
+ * under elevated air speed. The cooling effect is calculated only for air speed higher than 0.1 m/s.
14
+ *
15
+ * @public
16
+ * @memberof models
17
+ * @docname Cooling Effect (CE)
18
+ *
19
+ * @param {number} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
20
+ * @param {number} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
21
+ * @param {number} vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
22
+ *
23
+ * Note: vr is the relative air speed caused by body movement and not the air
24
+ * speed measured by the air speed sensor. The relative air speed is the sum of the
25
+ * average air speed measured by the sensor plus the activity-generated air speed
26
+ * (Vag). Where Vag is the activity-generated air speed caused by motion of individual body parts.
27
+ * vr can be calculated using the function `v_relative` which is in .utilities.js.
28
+ *
29
+ * @param {number} rh - relative humidity, [%]
30
+ * @param {number} met - metabolic rate, [met]
31
+ * @param {number} clo - clothing insulation, [clo]
32
+ *
33
+ * Note: The activity as well as the air speed modify the insulation characteristics
34
+ * of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
35
+ * the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
36
+ * for the effect of the body movement for met equal or higher than 1.2 met using
37
+ * the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
38
+ * can be calculated using the function `clo_dynamic` which is in .utilities.js.
39
+ *
40
+ * @param {number} [wme=0] - external work
41
+ * @param {'SI'|'IP'} [units= "SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
42
+ * @returns {number} ce - Cooling Effect, default in [°C] in [°F] if `units` = 'IP'
43
+ *
44
+ * @example
45
+ * const CE = cooling_effect(25, 25, 0.3, 50, 1.2, 0.5);
46
+ * console.log(CE); // Output: 1.64
47
+ *
48
+ * // For users who want to use the IP system
49
+ * const CE_IP = cooling_effect(77, 77, 1.64, 50, 1, 0.6, "IP");
50
+ * console.log(CE_IP); // Output: 3.74
51
+ */
52
+ function cooling_effect(tdb, tr, vr, rh, met, clo, wme = 0, units = "SI") {
53
+ if (units.toLowerCase() === "ip") {
54
+ const result = (0, utilities_js_1.units_converter)({ tdb, tr, vr }, "IP");
55
+ tdb = result.tdb;
56
+ tr = result.tr;
57
+ vr = result.vr;
58
+ }
59
+ if (vr <= 0.1) {
60
+ return 0;
61
+ }
62
+ const still_air_threshold = 0.1;
63
+ const initial_set_tmp = (0, set_tmp_js_1.set_tmp)(tdb, tr, vr, rh, met, clo, wme, undefined, undefined, undefined, undefined, false, {
64
+ round: false,
65
+ calculate_ce: true,
66
+ });
67
+ function func(x) {
68
+ return ((0, set_tmp_js_1.set_tmp)(tdb - x, tr - x, still_air_threshold, rh, met, clo, wme, undefined, undefined, undefined, undefined, false, {
69
+ round: false,
70
+ calculate_ce: true,
71
+ }) - initial_set_tmp);
72
+ }
73
+ let ce;
74
+ try {
75
+ // Find a root of a function in a bracketing interval
76
+ ce = brent(func, 0, 40);
77
+ }
78
+ catch (error) {
79
+ ce = 0;
80
+ }
81
+ if (ce === 0) {
82
+ console.warn(`Assuming cooling effect = 0 since it could not be calculated for this set of inputs tdb=${tdb}, tr=${tr}, rh=${rh}, vr=${vr}, clo=${clo}, met=${met}`);
83
+ }
84
+ if (units.toLowerCase() === "ip") {
85
+ ce = (ce / 1.8) * 3.28;
86
+ }
87
+ return (0, utilities_js_1.round)(ce, 2);
88
+ }
89
+ exports.cooling_effect = cooling_effect;
90
+ // https://gist.github.com/ryanspradlin/18c1010b7dd2d875284933d018c5c908
91
+ // Derived from: https://en.wikipedia.org/wiki/Brent%27s_method#Algorithm
92
+ // Brent's method is a hybrid root-finding algorithm that combines the
93
+ // faster/less-reliable inverse quadradic interpolation and secant methods with
94
+ // the slower/more-reliable bisection method.
95
+ function brent(f, lowerBound, upperBound, tolerance = 1e-6, maxIterations = 100) {
96
+ let a = lowerBound;
97
+ let b = upperBound;
98
+ let fa = f(a);
99
+ let fb = f(b);
100
+ if (fa * fb > 0) {
101
+ // Root is not bracketed.
102
+ throw new Error(`Root is not bracketed: [${fa}, ${fb}].`);
103
+ }
104
+ if (Math.abs(fa) < Math.abs(fb)) {
105
+ [a, b] = [b, a];
106
+ [fa, fb] = [fb, fa];
107
+ }
108
+ let c = a;
109
+ let fc = fa;
110
+ let s = 0;
111
+ let d = 0;
112
+ let mflag = true;
113
+ for (let i = 0; i < maxIterations; i++) {
114
+ // Check if we have succeeded...
115
+ if (fb === 0 || Math.abs(b - a) <= tolerance) {
116
+ // Root found!
117
+ return b;
118
+ }
119
+ // Try to use fast/less-reliable methods first...
120
+ if (fa !== fc && fb !== fc) {
121
+ // Inverse quadratic interpolation.
122
+ s =
123
+ (a * fb * fc) / ((fa - fb) * (fa - fc)) +
124
+ (b * fa * fc) / ((fb - fa) * (fb - fc)) +
125
+ (c * fa * fb) / ((fc - fa) * (fc - fb));
126
+ }
127
+ else {
128
+ // Secant method.
129
+ s = b - fb * ((b - a) / (fb - fa));
130
+ }
131
+ // If necessary, fallback to slow/more-reliable method...
132
+ if ((s - (3 * a + b) / 4) * (s - b) >= 0 ||
133
+ (mflag && Math.abs(s - b) >= Math.abs(b - c) / 2) ||
134
+ (!mflag && Math.abs(s - b) >= Math.abs(c - d) / 2) ||
135
+ (mflag && Math.abs(b - c) < Math.abs(tolerance)) ||
136
+ (!mflag && Math.abs(c - d) < Math.abs(tolerance))) {
137
+ // Bisection method.
138
+ s = (a + b) / 2;
139
+ mflag = true;
140
+ }
141
+ else {
142
+ mflag = false;
143
+ }
144
+ d = c;
145
+ c = b;
146
+ fc = fb;
147
+ const fs = f(s);
148
+ if (fa * fs < 0) {
149
+ b = s;
150
+ fb = fs;
151
+ }
152
+ else {
153
+ a = s;
154
+ fa = fs;
155
+ }
156
+ if (Math.abs(fa) < Math.abs(fb)) {
157
+ [a, b] = [b, a];
158
+ [fa, fb] = [fb, fa];
159
+ }
160
+ }
161
+ // Could not achieve required tolerance within iteration limit.
162
+ throw new Error("Could not achieve required tolerance within iteration limit.");
163
+ }
164
+ exports.brent = brent;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.discomfort_index_array = exports.discomfort_index = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * @typedef {Object} DiscomfortIndexReturnType - a result set containing the discomfort index and the classification of the
7
+ * thermal comfort conditions
8
+ * @property {number} di – Discomfort Index(DI)
9
+ * @property {string} discomfort_condition Classification of the thermal comfort conditions according to the discomfort index
10
+ * @public
11
+ */
12
+ /**
13
+ * Calculates the Discomfort Index (DI). The index is essentially an effective temperature based on air temperature and humidity.
14
+ * The discomfort index is usuallly divided in 6 dicomfort categories and it only applies to warm environments. {@link #ref_24|[24]}
15
+ *
16
+ * - class 1 - DI < 21 °C - No discomfort
17
+ * - class 2 - 21 <= DI < 24 °C - Less than 50% feels discomfort
18
+ * - class 3 - 24 <= DI < 27 °C - More than 50% feels discomfort
19
+ * - class 4 - 27 <= DI < 29 °C - Most of the population feels discomfort
20
+ * - class 5 - 29 <= DI < 32 °C - Everyone feels severe stress
21
+ * - class 6 - DI >= 32 °C - State of medical emergency
22
+ *
23
+ * @see {@link discomfort_index_array} for a version that supports arrays
24
+ *
25
+ * @public
26
+ * @memberof models
27
+ * @docname Discomfort Index (DI)
28
+ *
29
+ * @param {number} tdb - air temperature [C]
30
+ * @param {number} rh - relative humidity [%]
31
+ *
32
+ * @returns {DiscomfortIndexReturnType} object with results of DI
33
+ * @example
34
+ * const DI = discomfort_index(25, 50); // returns { di: 22.1, discomfort_condition: 'Less than 50% feels discomfort' }
35
+ */
36
+ function discomfort_index(tdb, rh) {
37
+ const di = calculate_di(tdb, rh);
38
+ const condition = check_categories(di);
39
+ return {
40
+ di: (0, utilities_js_1.round)(di, 1),
41
+ discomfort_condition: condition,
42
+ };
43
+ }
44
+ exports.discomfort_index = discomfort_index;
45
+ /**
46
+ * @typedef {Object} DiscomfortIndexArrayReturnType - a result set containing an array of discomfort index and an array
47
+ * of classification of the thermal comfort conditions
48
+ * @property {number[]} di – Discomfort Index(DI) Array
49
+ * @property {string[]} discomfort_condition Classification of the thermal comfort conditions in array
50
+ * @public
51
+ */
52
+ /**
53
+ * Calculates the Discomfort Index (DI). The index is essentially an effective temperature based on air temperature and humidity.
54
+ * The discomfort index is usuallly divided in 6 dicomfort categories and it only applies to warm environments. {@link #ref_24|[24]}
55
+ *
56
+ * - class 1 - DI < 21 °C - No discomfort
57
+ * - class 2 - 21 <= DI < 24 °C - Less than 50% feels discomfort
58
+ * - class 3 - 24 <= DI < 27 °C - More than 50% feels discomfort
59
+ * - class 4 - 27 <= DI < 29 °C - Most of the population feels discomfort
60
+ * - class 5 - 29 <= DI < 32 °C - Everyone feels severe stress
61
+ * - class 6 - DI >= 32 °C - State of medical emergency
62
+ *
63
+ * @see {@link discomfort_index} for a version that supports scalar arguments
64
+ *
65
+ * @public
66
+ * @memberof models
67
+ * @docname Discomfort Index (DI) (array version)
68
+ *
69
+ * @param {number[]} tdb - air temperature [C]
70
+ * @param {number[]} rh - relative humidity [%]
71
+ *
72
+ * @returns {DiscomfortIndexArrayReturnType} object with results of DI
73
+ */
74
+ function discomfort_index_array(tdb, rh) {
75
+ const di = tdb.map((temperature, index) => calculate_di(temperature, rh[index]));
76
+ const discomfortCondition = di.map((value) => check_categories(value));
77
+ return {
78
+ di: di.map((value) => (0, utilities_js_1.round)(value, 1)),
79
+ discomfort_condition: discomfortCondition,
80
+ };
81
+ }
82
+ exports.discomfort_index_array = discomfort_index_array;
83
+ /**
84
+ *
85
+ * Determine the discomfort categories based on DI.
86
+ *
87
+ * @param {number} di - Discomfort Index (DI)
88
+ * @returns {string} Discomfort condition
89
+ */
90
+ function check_categories(di) {
91
+ const threshold = [21, 24, 27, 29, 32, 99];
92
+ const condition = [
93
+ "No discomfort",
94
+ "Less than 50% feels discomfort",
95
+ "More than 50% feels discomfort",
96
+ "Most of the population feels discomfort",
97
+ "Everyone feels severe stress",
98
+ "State of medical emergency",
99
+ ];
100
+ for (let index = 0; index < threshold.length; index++) {
101
+ if (di <= threshold[index]) {
102
+ return condition[index];
103
+ }
104
+ }
105
+ }
106
+ /**
107
+ * Calculate Discomfort Index (DI) based on air temperature and relative humidity.
108
+ *
109
+ * @param {number} tdb - air temperature [C]
110
+ * @param {number} rh - relative humidity [%]
111
+ * @returns {number} Discomfort Index (DI)
112
+ */
113
+ function calculate_di(tdb, rh) {
114
+ return tdb - 0.55 * (1 - 0.01 * rh) * (tdb - 14.5);
115
+ }
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.e_pmv_array = exports.e_pmv = void 0;
4
+ const pmv_js_1 = require("./pmv.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * @typedef {Object} E_pmvKwargs
8
+ * @property {'SI'|'IP'} units - select the SI (International System of Units) or the IP (Imperial Units) system.
9
+ * @property { boolean } limit_inputs - Default is True. By default, if the inputs are outside the standard
10
+ * applicability limits the function returns NaN. If false, returns pmv and ppd values even if input values
11
+ * are outside the applicability limits of the model.
12
+ *
13
+ * The ISO 7730 2005 limits are 10 < tdb [°C] < 30, 10 < tr [°C] < 40,
14
+ * 0 < vr [m/s] < 1, 0.8 < met [met] < 4, 0 < clo [clo] < 2, and -2 < PMV < 2.
15
+ * @public
16
+ */
17
+ /**
18
+ * Returns Adjusted Predicted Mean Votes with Expectancy Factor (ePMV). This index was developed by
19
+ * Fanger, P. O. et al. (2002). In non-air-conditioned buildings in warm climates, occupants may sense
20
+ * the warmth as being less severe than the PMV predicts. The main reason is low expectations, but a
21
+ * metabolic rate that is estimated too high can also contribute to explaining the difference. An extension
22
+ * of the PMV model that includes an expectancy factor is introduced for use in non-air-conditioned buildings
23
+ * in warm climates {@link #ref_26|[26]}.
24
+ *
25
+ * This is a version that supports scalar arguments.
26
+ * @see {@link e_pmv_array} for a version that supports arrays.
27
+ *
28
+ * @public
29
+ * @memberof models
30
+ * @docname Adjusted Predicted Mean Votes with Expectancy Factor (ePMV)
31
+ *
32
+ * @param {number} tdb - Dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
33
+ * @param {number} tr - Mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
34
+ * @param {number} vr - Relative air speed, default in [m/s] in [fps] if `units` = 'IP'
35
+ *
36
+ * Note: vr is the relative air speed caused by body movement and not the air
37
+ * speed measured by the air speed sensor. The relative air speed is the sum of the
38
+ * average air speed measured by the sensor plus the activity-generated air speed
39
+ * (Vag). Where Vag is the activity-generated air speed caused by motion of
40
+ * individual body parts. vr can be calculated using the function v_relative in utilities.js.
41
+ * @param {number} rh - Relative humidity, [%]
42
+ * @param {number} met - Metabolic rate, [met]
43
+ * @param {number} clo - Clothing insulation, [clo]
44
+ *
45
+ * Note: The activity as well as the air speed modify the insulation characteristics
46
+ * of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
47
+ * the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
48
+ * for the effect of the body movement for met equal or higher than 1.2 met using
49
+ * the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
50
+ * can be calculated using the function clo_dynamic in utilities.js.
51
+ * @param {number} e_coefficient - expectancy factor
52
+ * @param {number} [wme=0] - External work
53
+ * @param {E_pmvKwargs} [kwargs] - additional arguments
54
+ *
55
+ * @returns {number} pmv - Predicted Mean Vote
56
+ *
57
+ * @example
58
+ * const tdb = 28;
59
+ * const tr = 28;
60
+ * const v = 0.1;
61
+ * const met = 1.4;
62
+ * const clo = 0.5;
63
+ * // Calculate relative air speed
64
+ * const v_r = v_relative(v, met);
65
+ * // Calculate dynamic clothing
66
+ * const clo_d = clo_dynamic(clo, met);
67
+ * const e_coefficient = 0.6;
68
+ *
69
+ * const result = e_pmv(tdb, tr, v_r, rh, met, clo_d, e_coefficient);
70
+ * console.log(result) // output 0.51
71
+ */
72
+ function e_pmv(tdb, tr, vr, rh, met, clo, e_coefficient, wme = 0, kwargs = {}) {
73
+ const default_kwargs = {
74
+ units: "SI",
75
+ limit_inputs: true,
76
+ };
77
+ kwargs = Object.assign(default_kwargs, kwargs);
78
+ let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
79
+ met = _pmv > 0 ? met * (1 + _pmv * -0.067) : met;
80
+ _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
81
+ return (0, utilities_js_1.round)(_pmv * e_coefficient, 2);
82
+ }
83
+ exports.e_pmv = e_pmv;
84
+ /**
85
+ * Returns Adjusted Predicted Mean Votes with Expectancy Factor (ePMV). This index was developed by
86
+ * Fanger, P. O. et al. (2002). In non-air-conditioned buildings in warm climates, occupants may sense
87
+ * the warmth as being less severe than the PMV predicts. The main reason is low expectations, but a
88
+ * metabolic rate that is estimated too high can also contribute to explaining the difference. An extension
89
+ * of the PMV model that includes an expectancy factor is introduced for use in non-air-conditioned buildings
90
+ * in warm climates {@link #ref_26|[26]}.
91
+ *
92
+ * This is a version that supports arrays.
93
+ * @see {@link a_pmv} for a version that supports scalar arguments.
94
+ *
95
+ * @public
96
+ * @memberof models
97
+ * @docname Adjusted Predicted Mean Votes with Expectancy Factor (ePMV) (array version)
98
+ *
99
+ * @param {number[]} tdb - Dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
100
+ * @param {number[]} tr - Mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
101
+ * @param {number[]} vr - Relative air speed, default in [m/s] in [fps] if `units` = 'IP'
102
+ *
103
+ * Note: vr is the relative air speed caused by body movement and not the air
104
+ * speed measured by the air speed sensor. The relative air speed is the sum of the
105
+ * average air speed measured by the sensor plus the activity-generated air speed
106
+ * (Vag). Where Vag is the activity-generated air speed caused by motion of
107
+ * individual body parts. vr can be calculated using the function v_relative_array in utilities.js.
108
+ * @param {number[]} rh - Relative humidity, [%]
109
+ * @param {number[]} met - Metabolic rate, [met]
110
+ * @param {number[]} clo - Clothing insulation, [clo]
111
+ *
112
+ * Note: The activity as well as the air speed modify the insulation characteristics
113
+ * of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
114
+ * the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
115
+ * for the effect of the body movement for met equal or higher than 1.2 met using
116
+ * the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
117
+ * can be calculated using the function clo_dynamic_array in utilities.js.
118
+ * @param {number[]} e_coefficient - expectancy factor
119
+ * @param {number[]} wme - External work, default is array of 0
120
+ * @param {E_pmvKwargs} [kwargs] - additional arguments
121
+ *
122
+ * @returns {number[]} pmv - Predicted Mean Vote
123
+ *
124
+ * @example
125
+ * const tdb = [24, 30];
126
+ * const tr = [30, 30];
127
+ * const v = [0.22, 0.22];
128
+ * const met = [1.4, 1.4];
129
+ * const clo = [0.5, 0.5];
130
+ * // Calculate relative air speed
131
+ * const v_r = v_relative_array(v, met);
132
+ * // Calculate dynamic clothing
133
+ * const clo_d = clo_dynamic_array(clo, met);
134
+ * const e_coefficient = [0.6, 0.6];
135
+ *
136
+ * const result = e_pmv_array(tdb, tr, v_r, rh, met, clo_d, e_coefficient);
137
+ * console.log(result) // output [0.29, 0.91]
138
+ */
139
+ function e_pmv_array(tdb, tr, vr, rh, met, clo, e_coefficient, wme, kwargs = {}) {
140
+ const default_kwargs = {
141
+ units: "SI",
142
+ limit_inputs: true,
143
+ };
144
+ kwargs = Object.assign(default_kwargs, kwargs);
145
+ let _pmv = (0, pmv_js_1.pmv_array)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
146
+ met = _pmv.map((value, i) => {
147
+ return value > 0 ? met[i] * (1 + value * -0.067) : met[i];
148
+ });
149
+ _pmv = (0, pmv_js_1.pmv_array)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
150
+ return _pmv.map((value, i) => {
151
+ return (0, utilities_js_1.round)(value * e_coefficient[i], 2);
152
+ });
153
+ }
154
+ exports.e_pmv_array = e_pmv_array;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.heat_index = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * Calculates the Heat Index (HI). It combines air temperature and relative humidity to determine an apparent temperature.
7
+ * The HI equation {@link #ref_12|[12]} is derived by multiple regression analysis in temperature and relative humidity from the first version
8
+ * of Steadman’s (1979) apparent temperature (AT) {@link #ref_13|[13]}.
9
+ *
10
+ * @public
11
+ * @memberof models
12
+ * @docname Heat Index
13
+ *
14
+ * @param {number} tdb Dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'.
15
+ * @param {number} rh Relative humidity, [%].
16
+ * @param {Object} [options] (Optional) Other parameters.
17
+ * @param {boolean} [options.round=true] - If True rounds output value, if False it does not round it.
18
+ * @param {"SI" | "IP"} [options.units="SI"] - Select the SI (International System of Units) or the IP (Imperial Units) system.
19
+ *
20
+ * @returns {number} Heat Index, default in [°C] in [°F] if `units` = 'IP'.
21
+ *
22
+ * @example
23
+ * const hi = heat_index(25, 50); // returns 25.9
24
+ *
25
+ * @category Thermophysiological models
26
+ */
27
+ function heat_index(tdb, rh, options = { round: true, units: "SI" }) {
28
+ /**
29
+ * @type {number}
30
+ */
31
+ let hi;
32
+ let tdb_squared = Math.pow(tdb, 2);
33
+ let rh_squared = Math.pow(rh, 2);
34
+ if (options.units === undefined || options.units === "SI") {
35
+ hi =
36
+ -8.784695 +
37
+ 1.61139411 * tdb +
38
+ 2.338549 * rh -
39
+ 0.14611605 * tdb * rh -
40
+ 0.012308094 * tdb_squared -
41
+ 0.016424828 * rh_squared +
42
+ 0.002211732 * tdb_squared * rh +
43
+ 0.00072546 * tdb * rh_squared -
44
+ 0.000003582 * tdb_squared * rh_squared;
45
+ }
46
+ else {
47
+ hi =
48
+ -42.379 +
49
+ 2.04901523 * tdb +
50
+ 10.14333127 * rh -
51
+ 0.22475541 * tdb * rh -
52
+ 0.00683783 * tdb_squared -
53
+ 0.05481717 * rh_squared +
54
+ 0.00122874 * tdb_squared * rh +
55
+ 0.00085282 * tdb * rh_squared -
56
+ 0.00000199 * tdb_squared * rh_squared;
57
+ }
58
+ return options.round === undefined || options.round ? (0, utilities_js_1.round)(hi, 1) : hi;
59
+ }
60
+ exports.heat_index = heat_index;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.humidex = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * @typedef {object} HumidexResult - a result set containing the humidex and
7
+ * discomfort level.
8
+ * @property {number} humidex - the humdidex given the provided dry bulb
9
+ * air temperature and relative humidity.
10
+ * @property {string} discomfort - a human description of how the weather
11
+ * would be felt by the average person.
12
+ * @public
13
+ */
14
+ /**
15
+ * Calculates the humidex (short for "humidity index"). It has been
16
+ * developed by the Canadian Meteorological service. It was introduced in 1965
17
+ * and then it was revised by Masterson and Richardson (1979) {@link #ref_14|[14]}. It aims
18
+ * to describe how hot, humid weather is felt by the average person. The
19
+ * Humidex differs from the heat index in being related to the dew point
20
+ * rather than relative humidity {@link #ref_15|[15]}.
21
+ *
22
+ * @public
23
+ * @memberof models
24
+ * @docname Humidex
25
+ *
26
+ * @param {number} tdb - dry bulb air temperature, [°C]
27
+ * @param {number} rh - relative humidity, [%]
28
+ * @param {object} [options] - configuration options for the function.
29
+ * @param {boolean} [options.round = true] - If true, rounds output value. If
30
+ * false, it does not.
31
+ *
32
+ * @returns {HumidexResult} the result given the provided temperature and
33
+ * relative humidity.
34
+ *
35
+ * @example
36
+ * const result = humidex(25, 50);
37
+ * console.log(result); // -> { humidex: 28.2, discomfort: "Little or no discomfort" }
38
+ */
39
+ function humidex(tdb, rh, options = { round: true }) {
40
+ let hi = tdb +
41
+ (5 / 9) * ((6.112 * Math.pow(10, ((7.5 * tdb) / (237.7 + tdb))) * rh) / 100 - 10);
42
+ if (options.round) {
43
+ hi = (0, utilities_js_1.round)(hi, 1);
44
+ }
45
+ let stress_category = "Heat stroke probable";
46
+ if (hi <= 30) {
47
+ stress_category = "Little or no discomfort";
48
+ }
49
+ else if (hi <= 35) {
50
+ stress_category = "Noticeable discomfort";
51
+ }
52
+ else if (hi <= 40) {
53
+ stress_category = "Evident discomfort";
54
+ }
55
+ else if (hi <= 45) {
56
+ stress_category = "Intense discomfort; avoid exertion";
57
+ }
58
+ else if (hi <= 54) {
59
+ stress_category = "Dangerous discomfort";
60
+ }
61
+ return { humidex: hi, discomfort: stress_category };
62
+ }
63
+ exports.humidex = humidex;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const heat_index_js_1 = require("./heat_index.js");
4
+ const phs_js_1 = require("./phs.js");
5
+ const humidex_js_1 = require("./humidex.js");
6
+ const net_js_1 = require("./net.js");
7
+ const wbgt_js_1 = require("./wbgt.js");
8
+ const discomfort_index_js_1 = require("./discomfort_index.js");
9
+ const two_nodes_js_1 = require("./two_nodes.js");
10
+ const set_tmp_js_1 = require("./set_tmp.js");
11
+ const wc_js_1 = require("./wc.js");
12
+ const adaptive_en_js_1 = require("./adaptive_en.js");
13
+ const at_js_1 = require("./at.js");
14
+ const pmv_ppd_js_1 = require("./pmv_ppd.js");
15
+ const adaptive_ashrae_js_1 = require("./adaptive_ashrae.js");
16
+ const solar_gain_js_1 = require("./solar_gain.js");
17
+ const cooling_effect_js_1 = require("./cooling_effect.js");
18
+ const athb_js_1 = require("./athb.js");
19
+ const pmv_js_1 = require("./pmv.js");
20
+ const a_pmv_js_1 = require("./a_pmv.js");
21
+ const ankle_draft_js_1 = require("./ankle_draft.js");
22
+ const e_pmv_js_1 = require("./e_pmv.js");
23
+ const vertical_tmp_grad_ppd_1 = require("./vertical_tmp_grad_ppd");
24
+ const use_fans_heatwave_js_1 = require("./use_fans_heatwave.js");
25
+ const clo_tout_js_1 = require("./clo_tout.js");
26
+ const utci_js_1 = require("./utci.js");
27
+ const pet_steady_js_1 = require("./pet_steady.js");
28
+ /**
29
+ * @public
30
+ * @name models
31
+ * @docname Comfort Models
32
+ */
33
+ exports.default = {
34
+ heat_index: heat_index_js_1.heat_index,
35
+ phs: phs_js_1.phs,
36
+ humidex: humidex_js_1.humidex,
37
+ net: net_js_1.net,
38
+ wbgt: wbgt_js_1.wbgt,
39
+ clo_tout: clo_tout_js_1.clo_tout,
40
+ clo_tout_array: clo_tout_js_1.clo_tout_array,
41
+ discomfort_index: discomfort_index_js_1.discomfort_index,
42
+ discomfort_index_array: discomfort_index_js_1.discomfort_index_array,
43
+ two_nodes: two_nodes_js_1.two_nodes,
44
+ two_nodes_array: two_nodes_js_1.two_nodes_array,
45
+ wc: wc_js_1.wc,
46
+ adaptive_en: adaptive_en_js_1.adaptive_en,
47
+ adaptive_en_array: adaptive_en_js_1.adaptive_en_array,
48
+ at: at_js_1.at,
49
+ vertical_tmp_grad_ppd: vertical_tmp_grad_ppd_1.vertical_tmp_grad_ppd,
50
+ set_tmp: set_tmp_js_1.set_tmp,
51
+ set_tmp_array: set_tmp_js_1.set_tmp_array,
52
+ adaptive_ashrae: adaptive_ashrae_js_1.adaptive_ashrae,
53
+ adaptive_ashrae_array: adaptive_ashrae_js_1.adaptive_ashrae_array,
54
+ solar_gain: solar_gain_js_1.solar_gain,
55
+ cooling_effect: cooling_effect_js_1.cooling_effect,
56
+ pmv_ppd: pmv_ppd_js_1.pmv_ppd,
57
+ pmv_ppd_array: pmv_ppd_js_1.pmv_ppd_array,
58
+ pmv: pmv_js_1.pmv,
59
+ pmv_array: pmv_js_1.pmv_array,
60
+ athb: athb_js_1.athb,
61
+ athb_array: athb_js_1.athb_array,
62
+ a_pmv: a_pmv_js_1.a_pmv,
63
+ a_pmv_array: a_pmv_js_1.a_pmv_array,
64
+ ankle_draft: ankle_draft_js_1.ankle_draft,
65
+ e_pmv: e_pmv_js_1.e_pmv,
66
+ e_pmv_array: e_pmv_js_1.e_pmv_array,
67
+ use_fans_heatwaves: use_fans_heatwave_js_1.use_fans_heatwaves,
68
+ utci: utci_js_1.utci,
69
+ utci_array: utci_js_1.utci_array,
70
+ pet_steady: pet_steady_js_1.pet_steady,
71
+ };
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.net = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * Calculates the Normal Effective Temperature (NET). Missenard (1933)
7
+ * devised a formula for calculating effective temperature. The index
8
+ * establishes a link between the same condition of the organism's
9
+ * thermoregulatory capability (warm and cold perception) and the surrounding
10
+ * environment's temperature and humidity. The index is calculated as a
11
+ * function of three meteorological factors: air temperature, relative
12
+ * humidity of air, and wind speed. This index allows to calculate the
13
+ * effective temperature felt by a person. Missenard original equation was
14
+ * then used to calculate the Normal Effective Temperature (NET), by
15
+ * considering normal atmospheric pressure and a normal human body temperature
16
+ * (37°C). The NET is still in use in Germany, where medical check-ups for
17
+ * subjects working in the heat are decided on by prevailing levels of ET,
18
+ * depending on metabolic rates. The NET is also constantly monitored by the
19
+ * Hong Kong Observatory {@link #ref_16|[16]}. In central Europe the following thresholds are
20
+ * in use: <1°C = very cold; 1–9 = cold; 9–17 = cool; 17–21 = fresh;
21
+ * 21–23 = comfortable; 23–27 = warm; >27°C = hot [1].
22
+ *
23
+ * @public
24
+ * @memberof models
25
+ * @docname Normal Effective Temperature (NET)
26
+ *
27
+ * @param {number} tdb - dry bulb air temperature, [°C]
28
+ * @param {number} rh - relative humidity, [%]
29
+ * @param {number} v - wind speed [m/s] at 1.2 m above the ground
30
+ * @param {object} [options] - configuration options for the function.
31
+ * @param {boolean} [options.round = true] - If true, rounds output value. If
32
+ * false, it does not.
33
+ *
34
+ * @returns {number} Normal Effective Temperature, [°C]
35
+ *
36
+ * @example
37
+ * const result = net(37, 100, 0.1);
38
+ * console.log(result); // -> 37
39
+ */
40
+ function net(tdb, rh, v, options = { round: true }) {
41
+ const frac = 1.0 / (1.76 + 1.4 * Math.pow(v, 0.75));
42
+ const et = 37 -
43
+ (37 - tdb) / (0.68 - 0.0014 * rh + frac) -
44
+ 0.29 * tdb * (1 - 0.01 * rh);
45
+ if (options.round) {
46
+ return (0, utilities_js_1.round)(et, 1);
47
+ }
48
+ return et;
49
+ }
50
+ exports.net = net;