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,300 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.get_ce = exports.adaptive_en_array = exports.adaptive_en = void 0;
4
+ const t_o_js_1 = require("../psychrometrics/t_o.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * @typedef {object} AdaptiveEnResult - a result set containing the results for {@link #adative_en|adaptive_en}
8
+ * @property {number} tmp_cmf - Comfort temperature at that specific running mean temperature, default in [°C] or in [°F]
9
+ * @property {boolean} acceptability_cat_i - If the indoor conditions comply with comfort category I
10
+ * @property {boolean} acceptability_cat_ii - If the indoor conditions comply with comfort category II
11
+ * @property {boolean} acceptability_cat_iii - If the indoor conditions comply with comfort category III
12
+ * @property {number} tmp_cmf_cat_i_up - Upper acceptable comfort temperature for category I, default in [°C] or in [°F]
13
+ * @property {number} tmp_cmf_cat_ii_up - Upper acceptable comfort temperature for category II, default in [°C] or in [°F]
14
+ * @property {number} tmp_cmf_cat_iii_up - Upper acceptable comfort temperature for category III, default in [°C] or in [°F]
15
+ * @property {number} tmp_cmf_cat_i_low - Lower acceptable comfort temperature for category I, default in [°C] or in [°F]
16
+ * @property {number} tmp_cmf_cat_ii_low - Lower acceptable comfort temperature for category II, default in [°C] or in [°F]
17
+ * @property {number} tmp_cmf_cat_iii_low - Lower acceptable comfort temperature for category III, default in [°C] or in [°F]
18
+ * @public
19
+ */
20
+ /**
21
+ * Determines the adaptive thermal comfort based on EN 16798-1 2019 {@link #ref_3|[3]}
22
+ *
23
+ * Note: You can use this function to calculate if your conditions are within the EN
24
+ * adaptive thermal comfort region. Calculations with comply with the EN 16798-1 2019 {@link #ref_3|[3]}.
25
+ *
26
+ * @see {@link adaptive_en_array} for a version that supports array arguments
27
+ *
28
+ * @public
29
+ * @memberof models
30
+ * @docname Adaptive EN
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} t_running_mean - running mean temperature, default in [°C] in [°C] in [°F] if `units` = 'IP'
35
+ * The running mean temperature can be calculated using the function {@link #running_mean_outdoor_temperature|running_mean_outdoor_temperature}
36
+ *
37
+ * @param {number} v - air speed, default in [m/s] in [fps] if `units` = 'IP'
38
+ *
39
+ * Note: Indoor operative temperature correction is applicable for buildings equipped
40
+ * with fans or personal systems providing building occupants with personal
41
+ * control over air speed at occupant level.
42
+ * For operative temperatures above 25°C the comfort zone upper limit can be
43
+ * increased by 1.2 °C (0.6 < v < 0.9 m/s), 1.8 °C (0.9 < v < 1.2 m/s), 2.2 °C (v > 1.2 m/s)
44
+ *
45
+ * @param {"IP" | "SI"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
46
+ * @param {boolean} [limit_inputs=true] - By default, if the inputs are outsude the standard applicability limits the
47
+ * function returns nan. If False returns pmv and ppd values even if input values are
48
+ * outside the applicability limits of the model.
49
+ *
50
+ * @returns {AdaptiveEnResult} result set
51
+ *
52
+ * @example
53
+ * const results = adaptive_en(25, 25, 20, 0.1);
54
+ * console.log(results); // {tmp_cmf: 25.4, acceptability_cat_i: true, acceptability_cat_ii: true, ... }
55
+ * console.log(results.acceptability_cat_i); // true
56
+ * // The conditions you entered are considered to comply with Category I
57
+ *
58
+ * @example
59
+ * // for users who wants to use the IP system
60
+ * const results = adaptive_en(77, 77, 68, 0.3, 'IP');
61
+ * console.log(results); // {tmp_cmf: 77.7, acceptability_cat_i: true, acceptability_cat_ii: true, ... }
62
+ *
63
+ * @example
64
+ * const results = adaptive_en(25, 25, 9, 0.1);
65
+ * console.log(results); // {tmp_cmf: NaN, acceptability_cat_i: true, acceptability_cat_ii: true, ... }
66
+ * // The adaptive thermal comfort model can only be used
67
+ * // if the running mean temperature is between 10 °C and 30 °C
68
+ */
69
+ function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
70
+ const standard = "ISO";
71
+ if (units.toLowerCase() == "ip") {
72
+ ({
73
+ tdb,
74
+ tr,
75
+ tmp_running_mean: t_running_mean,
76
+ v,
77
+ } = (0, utilities_js_1.units_converter)({ tdb, tr, tmp_running_mean: t_running_mean, v }));
78
+ }
79
+ const to = (0, t_o_js_1.t_o)(tdb, tr, v, standard);
80
+ const ce = get_ce(v, to);
81
+ let t_cmf = 0.33 * t_running_mean + 18.8;
82
+ if (limit_inputs) {
83
+ const trm_valid = t_running_mean >= 10.0 && t_running_mean <= 33.5;
84
+ if (!trm_valid)
85
+ t_cmf = NaN;
86
+ }
87
+ let t_cmf_i_lower = t_cmf - 3.0;
88
+ let t_cmf_ii_lower = t_cmf - 4.0;
89
+ let t_cmf_iii_lower = t_cmf - 5.0;
90
+ let t_cmf_i_upper = t_cmf + 2.0 + ce;
91
+ let t_cmf_ii_upper = t_cmf + 3.0 + ce;
92
+ let t_cmf_iii_upper = t_cmf + 4.0 + ce;
93
+ const acceptability_i = t_cmf_i_lower <= to && to <= t_cmf_i_upper;
94
+ const acceptability_ii = t_cmf_ii_lower <= to && to <= t_cmf_ii_upper;
95
+ const acceptability_iii = t_cmf_iii_lower <= to && to <= t_cmf_iii_upper;
96
+ if (units.toLocaleLowerCase() === "ip") {
97
+ ({
98
+ tmp_cmf: t_cmf,
99
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
100
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
101
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
102
+ } = (0, utilities_js_1.units_converter)({
103
+ tmp_cmf: t_cmf,
104
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
105
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
106
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
107
+ }, "SI"));
108
+ ({
109
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
110
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
111
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
112
+ } = (0, utilities_js_1.units_converter)({
113
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
114
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
115
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
116
+ }, "SI"));
117
+ }
118
+ return {
119
+ tmp_cmf: (0, utilities_js_1.round)(t_cmf, 1),
120
+ acceptability_cat_i: acceptability_i,
121
+ acceptability_cat_ii: acceptability_ii,
122
+ acceptability_cat_iii: acceptability_iii,
123
+ tmp_cmf_cat_i_up: (0, utilities_js_1.round)(t_cmf_i_upper, 1),
124
+ tmp_cmf_cat_ii_up: (0, utilities_js_1.round)(t_cmf_ii_upper, 1),
125
+ tmp_cmf_cat_iii_up: (0, utilities_js_1.round)(t_cmf_iii_upper, 1),
126
+ tmp_cmf_cat_i_low: (0, utilities_js_1.round)(t_cmf_i_lower, 1),
127
+ tmp_cmf_cat_ii_low: (0, utilities_js_1.round)(t_cmf_ii_lower, 1),
128
+ tmp_cmf_cat_iii_low: (0, utilities_js_1.round)(t_cmf_iii_lower, 1),
129
+ };
130
+ }
131
+ exports.adaptive_en = adaptive_en;
132
+ /**
133
+ * @typedef {object} AdaptiveEnArrayResult - a result set containing the results for {@link #adative_en_array|adaptive_en_array}
134
+ * @property {number[]} tmp_cmf - Comfort temperature at that specific running mean temperature, default in [°C] or in [°F]
135
+ * @property {boolean[]} acceptability_cat_i - If the indoor conditions comply with comfort category I
136
+ * @property {boolean[]} acceptability_cat_ii - If the indoor conditions comply with comfort category II
137
+ * @property {boolean[]} acceptability_cat_iii - If the indoor conditions comply with comfort category III
138
+ * @property {number[]} tmp_cmf_cat_i_up - Upper acceptable comfort temperature for category I, default in [°C] or in [°F]
139
+ * @property {number[]} tmp_cmf_cat_ii_up - Upper acceptable comfort temperature for category II, default in [°C] or in [°F]
140
+ * @property {number[]} tmp_cmf_cat_iii_up - Upper acceptable comfort temperature for category III, default in [°C] or in [°F]
141
+ * @property {number[]} tmp_cmf_cat_i_low - Lower acceptable comfort temperature for category I, default in [°C] or in [°F]
142
+ * @property {number[]} tmp_cmf_cat_ii_low - Lower acceptable comfort temperature for category II, default in [°C] or in [°F]
143
+ * @property {number[]} tmp_cmf_cat_iii_low - Lower acceptable comfort temperature for category III, default in [°C] or in [°F]
144
+ * @public
145
+ */
146
+ /**
147
+ * Determines the adaptive thermal comfort based on EN 16798-1 2019 {@link #ref_3|[3]}
148
+ *
149
+ * Note: You can use this function to calculate if your conditions are within the EN
150
+ * adaptive thermal comfort region. Calculations with comply with the EN 16798-1 2019 {@link #ref_3|[3]}.
151
+ *
152
+ * @public
153
+ * @memberof models
154
+ * @docname Adaptive EN (array version)
155
+ *
156
+ * @see {@link adaptive_en} for a version that supports scalar arguments
157
+ *
158
+ * @param {number[]} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
159
+ * @param {number[]} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
160
+ * @param {number[]} t_running_mean - running mean temperature, default in [°C] in [°C] in [°F] if `units` = 'IP'
161
+ * The running mean temperature can be calculated using the function {@link #running_mean_outdoor_temperature|running_mean_outdoor_temperature}
162
+ *
163
+ * @param {number[]} v - air speed, default in [m/s] in [fps] if `units` = 'IP'
164
+ *
165
+ * Note: Indoor operative temperature correction is applicable for buildings equipped
166
+ * with fans or personal systems providing building occupants with personal
167
+ * control over air speed at occupant level.
168
+ * For operative temperatures above 25°C the comfort zone upper limit can be
169
+ * increased by 1.2 °C (0.6 < v < 0.9 m/s), 1.8 °C (0.9 < v < 1.2 m/s), 2.2 °C (v> 1.2 m/s)
170
+ *
171
+ * @param {"IP" | "SI"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
172
+ * @param {boolean} [limit_inputs=true] - By default, if the inputs are outsude the standard applicability limits the
173
+ * function returns nan. If False returns pmv and ppd values even if input values are
174
+ * outside the applicability limits of the model.
175
+ *
176
+ * @returns {AdaptiveEnArrayResult} result set
177
+ *
178
+ * @example
179
+ * const results = adaptive_en([25,25], [25,25], [20,9], [0.1,0.1]);
180
+ * console.log(results); // {tmp_cmf: [25.4, NaN], acceptability_cat_i: [true, true], acceptability_cat_ii: [true, true], ... }
181
+ * console.log(results.acceptability_cat_i); // [true, true]
182
+ * // The conditions you entered are considered to comply with Category I
183
+ * // The adaptive thermal comfort model can only be used
184
+ * // if the running mean temperature is between 10 °C and 30 °C
185
+ */
186
+ function adaptive_en_array(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
187
+ const standard = "ISO";
188
+ if (units.toLowerCase() == "ip") {
189
+ ({
190
+ tdb,
191
+ tr,
192
+ tmp_running_mean: t_running_mean,
193
+ v,
194
+ } = (0, utilities_js_1.units_converter_array)({
195
+ tdb,
196
+ tr,
197
+ tmp_running_mean: t_running_mean,
198
+ v,
199
+ }));
200
+ }
201
+ const to = (0, t_o_js_1.t_o_array)(tdb, tr, v, standard);
202
+ const ce = v.map((_v, index) => get_ce(_v, to[index]));
203
+ let t_cmf = t_running_mean.map((_t_running_mean) => 0.33 * _t_running_mean + 18.8);
204
+ if (limit_inputs) {
205
+ const trm_valid = (0, utilities_js_1.valid_range)(t_running_mean, [10.0, 33.5]);
206
+ trm_valid.forEach((_trm_valid, index) => {
207
+ if (isNaN(_trm_valid))
208
+ t_cmf[index] = NaN;
209
+ });
210
+ }
211
+ let t_cmf_i_lower = t_cmf.map((_t) => _t - 3.0);
212
+ let t_cmf_ii_lower = t_cmf.map((_t) => _t - 4.0);
213
+ let t_cmf_iii_lower = t_cmf.map((_t) => _t - 5.0);
214
+ let t_cmf_i_upper = t_cmf.map((_t, index) => _t + 2.0 + ce[index]);
215
+ let t_cmf_ii_upper = t_cmf.map((_t, index) => _t + 3.0 + ce[index]);
216
+ let t_cmf_iii_upper = t_cmf.map((_t, index) => _t + 4.0 + ce[index]);
217
+ const acceptability_i = to.map((_to, index) => t_cmf_i_lower[index] <= _to && _to <= t_cmf_i_upper[index]);
218
+ const acceptability_ii = to.map((_to, index) => t_cmf_ii_lower[index] <= _to && _to <= t_cmf_ii_upper[index]);
219
+ const acceptability_iii = to.map((_to, index) => t_cmf_iii_lower[index] <= _to && _to <= t_cmf_iii_upper[index]);
220
+ if (units.toLocaleLowerCase() === "ip") {
221
+ ({
222
+ tmp_cmf: t_cmf,
223
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
224
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
225
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
226
+ } = (0, utilities_js_1.units_converter_array)({
227
+ tmp_cmf: t_cmf,
228
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
229
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
230
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
231
+ }, "SI"));
232
+ ({
233
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
234
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
235
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
236
+ } = (0, utilities_js_1.units_converter_array)({
237
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
238
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
239
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
240
+ }, "SI"));
241
+ }
242
+ // NOTE: even all these arrays are the same length and this could be done in one loop
243
+ // doing it in seperate loops means that it is much more cache friendly which makes it faster
244
+ for (let i = 0; i < t_cmf.length; ++i) {
245
+ t_cmf[i] = (0, utilities_js_1.round)(t_cmf[i], 1);
246
+ }
247
+ for (let i = 0; i < t_cmf_i_lower.length; ++i) {
248
+ t_cmf_i_lower[i] = (0, utilities_js_1.round)(t_cmf_i_lower[i], 1);
249
+ }
250
+ for (let i = 0; i < t_cmf_ii_lower.length; ++i) {
251
+ t_cmf_ii_lower[i] = (0, utilities_js_1.round)(t_cmf_ii_lower[i], 1);
252
+ }
253
+ for (let i = 0; i < t_cmf_iii_lower.length; ++i) {
254
+ t_cmf_iii_lower[i] = (0, utilities_js_1.round)(t_cmf_iii_lower[i], 1);
255
+ }
256
+ for (let i = 0; i < t_cmf_i_upper.length; ++i) {
257
+ t_cmf_i_upper[i] = (0, utilities_js_1.round)(t_cmf_i_upper[i], 1);
258
+ }
259
+ for (let i = 0; i < t_cmf_ii_upper.length; ++i) {
260
+ t_cmf_ii_upper[i] = (0, utilities_js_1.round)(t_cmf_ii_upper[i], 1);
261
+ }
262
+ for (let i = 0; i < t_cmf_iii_upper.length; ++i) {
263
+ t_cmf_iii_upper[i] = (0, utilities_js_1.round)(t_cmf_iii_upper[i], 1);
264
+ }
265
+ return {
266
+ tmp_cmf: t_cmf,
267
+ acceptability_cat_i: acceptability_i,
268
+ acceptability_cat_ii: acceptability_ii,
269
+ acceptability_cat_iii: acceptability_iii,
270
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
271
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
272
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
273
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
274
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
275
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
276
+ };
277
+ }
278
+ exports.adaptive_en_array = adaptive_en_array;
279
+ /**
280
+ *
281
+ * @param {number} v
282
+ * @param {number} to
283
+ * @returns {number}
284
+ */
285
+ function get_ce(v, to) {
286
+ let ce = 0;
287
+ if (v >= 0.6 && to >= 25.0) {
288
+ if (v < 0.9) {
289
+ ce = 1.2;
290
+ }
291
+ else if (v < 1.2) {
292
+ ce = 1.8;
293
+ }
294
+ else {
295
+ ce = 2.2;
296
+ }
297
+ }
298
+ return ce;
299
+ }
300
+ exports.get_ce = get_ce;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ankle_draft = void 0;
4
+ const pmv_js_1 = require("./pmv.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * @public
8
+ * @typedef {Object} AnkleDraftRet
9
+ * @property {number} PPD_ad - redicted Percentage of Dissatisfied occupants with ankle draft, [%]
10
+ * @property {boolean} Acceptability - The ASHRAE 55 2020 standard defines that the value of air speed at the ankle level is acceptable if PPD_ad is lower or equal than 20%
11
+ */
12
+ /**
13
+ * Calculates the percentage of thermally dissatisfied people with the ankle draft (0.1 m) above floor level {@link #ref_23|[23]}.
14
+ This equation is only applicable for vr < 0.2 m/s (40 fps).
15
+ * @public
16
+ * @memberof models
17
+ * @docname Ankle draft
18
+ *
19
+ * @param {number} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
20
+ *
21
+ Note: The air temperature is the average value over two heights: 0.6 m (24 in.)
22
+ and 1.1 m (43 in.) for seated occupants
23
+ and 1.1 m (43 in.) and 1.7 m (67 in.) for standing occupants.
24
+
25
+ * @param {number} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
26
+ * @param {number} vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
27
+
28
+ Note: vr is the relative air speed caused by body movement and not the air
29
+ speed measured by the air speed sensor. The relative air speed is the sum of the
30
+ average air speed measured by the sensor plus the activity-generated air speed
31
+ (Vag). Where Vag is the activity-generated air speed caused by motion of
32
+ individual body parts. vr can be calculated using the function v_relative in utilities.js.
33
+
34
+ * @param {number} rh - relative humidity, [%]
35
+ * @param {number} met - metabolic rate, [met]
36
+ * @param {number} clo - clothing insulation, [clo]
37
+
38
+ Note: The activity as well as the air speed modify the insulation characteristics
39
+ of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
40
+ the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
41
+ for the effect of the body movement for met equal or higher than 1.2 met using
42
+ the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
43
+ can be calculated using the function clo_dynamic in utilities.js.
44
+ * @param {number} v_ankle - air speed at the 0.1 m (4 in.) above the floor, default in [m/s] in [fps] if
45
+ `units` = 'IP'
46
+ * @param {"IP"|"SI"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
47
+ * @returns {AnkleDraftRet} - Returns {"PPD_ad": ppd_val, "Acceptability": acceptability}
48
+ *
49
+ * @example
50
+ * results = ankle_draft(25, 25, 0.2, 50, 1.2, 0.5, 0.3, "SI")
51
+ * console.log(results) // expected result is {PPD_ad: 18.5, Acceptability: true}
52
+ *
53
+ */
54
+ function ankle_draft(tdb, tr, vr, rh, met, clo, v_ankle, units = "SI") {
55
+ let kwargs = {};
56
+ let ret = 0;
57
+ if (units.toLowerCase() == "ip") {
58
+ kwargs = {
59
+ tdb: tdb,
60
+ tr: tr,
61
+ v: vr,
62
+ vel: v_ankle,
63
+ };
64
+ ret = (0, utilities_js_1.units_converter)(kwargs);
65
+ tdb = ret["tdb"];
66
+ tr = ret["tr"];
67
+ vr = ret["v"];
68
+ v_ankle = ret["vel"];
69
+ }
70
+ kwargs = { tdb: tdb, tr: tr, v_limited: vr, rh: rh, met: met, clo: clo };
71
+ const warns = (0, utilities_js_1.check_standard_compliance)("ASHRAE", kwargs);
72
+ for (const warn of warns) {
73
+ console.warn("Warning:", warn);
74
+ }
75
+ const tsv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
76
+ const ppd_val = (0, utilities_js_1.round)((Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv) /
77
+ (1 + Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv))) *
78
+ 100, 1);
79
+ const acceptability = ppd_val <= 20;
80
+ return { PPD_ad: ppd_val, Acceptability: acceptability };
81
+ }
82
+ exports.ankle_draft = ankle_draft;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.at = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ const psy_ta_rh_js_1 = require("../psychrometrics/psy_ta_rh.js");
6
+ /**
7
+ * Calculates the Apparent Temperature (AT). The AT is defined as the temperature at the reference
8
+ * humidity level producing the same amount of discomfort as that experienced under the current ambient
9
+ * temperature, humidity, and solar radiation {@link #ref_17|[17]}. In other words, the AT is an adjustment to the dry
10
+ * bulb temperature based on the relative humidity value. Absolute humidity with a dew point of 14°C
11
+ * is chosen as a reference.
12
+ *
13
+ * {@link #ref_16|[16]}. It includes the chilling effect of the wind at lower temperatures.
14
+ *
15
+ * Two formulas for AT are in use by the Australian Bureau of Meteorology: one includes solar
16
+ * radiation and the other one does not ({@link http://www.bom.gov.au/info/thermal_stress/}, 29 Sep 2021).
17
+ * Please specify q if you want to estimate AT with solar load.
18
+ *
19
+ * @public
20
+ * @memberof models
21
+ * @docname Apparent Temperature (AT)
22
+ *
23
+ * @param {number} tdb - dry bulb air temperature, [°C]
24
+ * @param {number} rh - relative humidity, [%]
25
+ * @param {number} v - wind speed 10m above ground level, [m/s]
26
+ * @param {number | undefined} [q] - Net radiation absorbed per unit area of body surface [W/m2]
27
+ * @param {object} [kwargs] - other parameters
28
+ * @param {boolean} [kwargs.round=true] - if True rounds output value, if False it does not round it
29
+ *
30
+ * @returns {number} apparent temperature, [°C]
31
+ *
32
+ * @example
33
+ * const result = at(25, 30, 0.1);
34
+ * console.log(result); // 24.1
35
+ */
36
+ function at(tdb, rh, v, q, kwargs = { round: true }) {
37
+ // dividing it by 100 since the at eq. requires p_vap to be in hPa
38
+ const p_vap = (0, psy_ta_rh_js_1.psy_ta_rh)(tdb, rh).p_vap / 100;
39
+ let t_at;
40
+ if (q !== undefined) {
41
+ // equation sources {@link #ref_16|[16]} and {@link http://www.bom.gov.au/info/thermal_stress/#apparent}
42
+ t_at = tdb + 0.348 * p_vap - 0.7 * v + (0.7 * q) / (v + 10) - 4.25;
43
+ }
44
+ else {
45
+ t_at = tdb + 0.33 * p_vap - 0.7 * v - 4.0;
46
+ }
47
+ if (kwargs.round) {
48
+ t_at = (0, utilities_js_1.round)(t_at, 1);
49
+ }
50
+ return t_at;
51
+ }
52
+ exports.at = at;
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.athb_array = exports.athb = void 0;
4
+ const pmv_ppd_js_1 = require("./pmv_ppd.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * Return the PMV value calculated with the Adaptive Thermal Heat Balance
8
+ * Framework {@link #ref_27|[27]}. The adaptive thermal heat balance (ATHB) framework
9
+ * introduced a method to account for the three adaptive principals, namely
10
+ * physiological, behavioral, and psychological adaptation, individually
11
+ * within existing heat balance models. The objective is a predictive model of
12
+ * thermal sensation applicable during the design stage or in international
13
+ * standards without knowing characteristics of future occupants.
14
+ *
15
+ * This is a version that supports scalar arguments.
16
+ * @see {@link athb_array} for a version that supports arrays.
17
+ *
18
+ * @public
19
+ * @memberof models
20
+ * @docname Adaptive Thermal Heat Balance (athb)
21
+ *
22
+ * @param { number } tdb - dry bulb air temperature, in [°C]
23
+ * @param { number } tr - mean radiant temperature, in [°C]
24
+ * @param { number } vr - relative air speed, in [m/s]
25
+ *
26
+ * Note: vr is the relative air speed caused by body movement and not the air
27
+ * speed measured by the air speed sensor. The relative air speed is the sum of the
28
+ * average air speed measured by the sensor plus the activity-generated air speed
29
+ * (Vag). Where Vag is the activity-generated air speed caused by motion of
30
+ * individual body parts. vr can be calculated using the function jsthermalcomfort.utilities.v_relative.
31
+ *
32
+ * @param { number } rh - relative humidity, [%]
33
+ * @param { number } met - metabolic rate, [met]
34
+ * @param { number } t_running_mean - running mean temperature, in [°C]
35
+ *
36
+ * The running mean temperature can be calculated using the function
37
+ * jsthermalcomfort.utilities.running_mean_outdoor_temperature.
38
+ *
39
+ * @returns { number } athb_pmv - Predicted Mean Vote calculated with the Adaptive Thermal Heat Balance framework
40
+ *
41
+ * @example
42
+ * const tdb = 25;
43
+ * const tr = 25;
44
+ * const vr = 0.1;
45
+ * const rh = 50;
46
+ * const met = 1.1;
47
+ * const t_running_mean = 20;
48
+ *
49
+ * const athb_result = athb(tdb, tr, vr, rh, met, t_running_mean);
50
+ * console.log(athb_result); // Output: 0.2
51
+ */
52
+ function athb(tdb, tr, vr, rh, met, t_running_mean) {
53
+ const met_adapted = met - (0.234 * t_running_mean) / 58.2;
54
+ const clo_adapted = Math.pow(10, -0.17168 -
55
+ 0.000485 * t_running_mean +
56
+ 0.08176 * met_adapted -
57
+ 0.00527 * t_running_mean * met_adapted);
58
+ const pmv_res = (0, pmv_ppd_js_1.pmv_calculation)(tdb, tr, vr, rh, met_adapted, clo_adapted, 0);
59
+ const ts = 0.303 * Math.exp(-0.036 * met_adapted * 58.15) + 0.028;
60
+ const l_adapted = pmv_res / ts;
61
+ return (0, utilities_js_1.round)(1.484 +
62
+ 0.0276 * l_adapted -
63
+ 0.9602 * met_adapted -
64
+ 0.0342 * t_running_mean +
65
+ 0.0002264 * l_adapted * t_running_mean +
66
+ 0.018696 * met_adapted * t_running_mean -
67
+ 0.0002909 * l_adapted * met_adapted * t_running_mean, 3);
68
+ }
69
+ exports.athb = athb;
70
+ /**
71
+ * Return the PMV value calculated with the Adaptive Thermal Heat Balance
72
+ * Framework {@link #ref_27|[27]}. The adaptive thermal heat balance (ATHB) framework
73
+ * introduced a method to account for the three adaptive principals, namely
74
+ * physiological, behavioral, and psychological adaptation, individually
75
+ * within existing heat balance models. The objective is a predictive model of
76
+ * thermal sensation applicable during the design stage or in international
77
+ * standards without knowing characteristics of future occupants.
78
+ *
79
+ * This is a version that supports arrays.
80
+ * @see {@link athb} for a version that supports scalar arguments.
81
+ *
82
+ * @public
83
+ * @memberof models
84
+ * @docname Adaptive Thermal Heat Balance (athb) (array version)
85
+ *
86
+ * @param { number[] } tdb - dry bulb air temperature, in [°C]
87
+ * @param { number[] } tr - mean radiant temperature, in [°C]
88
+ * @param { number[] } vr - relative air speed, in [m/s]
89
+ *
90
+ * Note: vr is the relative air speed caused by body movement and not the air
91
+ * speed measured by the air speed sensor. The relative air speed is the sum of the
92
+ * average air speed measured by the sensor plus the activity-generated air speed
93
+ * (Vag). Where Vag is the activity-generated air speed caused by motion of
94
+ * individual body parts. vr can be calculated using the function
95
+ * jsthermalcomfort.utilities.v_relative.
96
+ *
97
+ * @param { number[] } rh - relative humidity, [%]
98
+ * @param { number[] } met - metabolic rate, [met]
99
+ * @param { number[] } t_running_mean - running mean temperature, in [°C]
100
+ *
101
+ * The running mean temperature can be calculated using the function
102
+ * jsthermalcomfort.utilities.running_mean_outdoor_temperature.
103
+ *
104
+ * @returns { number[] } athb_pmv - Predicted Mean Vote calculated with the Adaptive Thermal Heat Balance framework
105
+ *
106
+ * @example
107
+ * const tdb = [25, 27];
108
+ * const tr = [25, 25];
109
+ * const vr = [0.1, 0.1];
110
+ * const rh = [50, 50];
111
+ * const met = [1.1, 1.1];
112
+ * const t_running_mean = [20, 20];
113
+ *
114
+ * const athb_array_result = athb_array(tdb, tr, vr, rh, met, t_running_mean);
115
+ * console.log(athb_array_result); // Output: [0.2, 0.209]
116
+ */
117
+ function athb_array(tdb, tr, vr, rh, met, t_running_mean) {
118
+ //assume all parameters have same length, and it should have same length when use this API
119
+ const met_adapted = met.map((metValue, index) => metValue - (0.234 * t_running_mean[index]) / 58.2);
120
+ const clo_adapted = met_adapted.map((metValue, index) => Math.pow(10, -0.17168 -
121
+ 0.000485 * t_running_mean[index] +
122
+ 0.08176 * metValue -
123
+ 0.00527 * t_running_mean[index] * metValue));
124
+ const pmv_res = tdb.map((tdbValue, i) => (0, pmv_ppd_js_1.pmv_calculation)(tdbValue, tr[i], vr[i], rh[i], met_adapted[i], clo_adapted[i], 0));
125
+ const ts = met_adapted.map((metValue) => 0.303 * Math.exp(-0.036 * metValue * 58.15) + 0.028);
126
+ const l_adapted = pmv_res.map((pmv_res_Value, i) => pmv_res_Value / ts[i]);
127
+ return l_adapted.map((lValue, i) => (0, utilities_js_1.round)(1.484 +
128
+ 0.0276 * lValue -
129
+ 0.9602 * met_adapted[i] -
130
+ 0.0342 * t_running_mean[i] +
131
+ 0.0002264 * lValue * t_running_mean[i] +
132
+ 0.018696 * met_adapted[i] * t_running_mean[i] -
133
+ 0.0002909 * lValue * met_adapted[i] * t_running_mean[i], 3));
134
+ }
135
+ exports.athb_array = athb_array;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clo_tout_array = exports.clo_tout = void 0;
4
+ const utilities_1 = require("../utilities/utilities");
5
+ /**
6
+ * Representative clothing insulation Icl as a function of outdoor air
7
+ * temperature at 06:00 a.m {@link #ref_4|[4]}.
8
+ *
9
+ * Note: The ASHRAE 55 2020 states that it is acceptable to determine the
10
+ * clothing insulation Icl using this equation in mechanically conditioned
11
+ * buildings {@link #ref_1|[1]}.
12
+ *
13
+ * @public
14
+ * @memberof models
15
+ * @docname Clothing prediction
16
+ *
17
+ * @see {@link clo_tout_array} for a version that supports arrays
18
+ *
19
+ * @param {number} tout - outdoor air temperature at 06:00 a.m., default in
20
+ * [°C] in [°F] if `units` = 'IP'
21
+ * @param {("IP" | "SI")} units - select the SI (International System of Units)
22
+ * or the IP (Imperial Units) system.
23
+ *
24
+ * @returns {number} Representative clothing insulation Icl, [clo]
25
+ */
26
+ function clo_tout(tout, units = "SI") {
27
+ const t = units === "IP" ? (0, utilities_1.units_converter)({ tmp: tout }).tmp : tout;
28
+ let clo = t < 26 ? Math.pow(10, (-0.1635 - 0.0066 * t)) : 0.46;
29
+ clo = t < 5 ? 0.818 - 0.0364 * t : clo;
30
+ clo = t < -5 ? 1 : clo;
31
+ return (0, utilities_1.round)(clo, 2);
32
+ }
33
+ exports.clo_tout = clo_tout;
34
+ /**
35
+ * Representative clothing insulation Icl as a function of outdoor air
36
+ * temperature at 06:00 a.m {@link #ref_4|[4]}.
37
+ *
38
+ * Note: The ASHRAE 55 2020 states that it is acceptable to determine the
39
+ * clothing insulation Icl using this equation in mechanically conditioned
40
+ * buildings {@link #ref_1|[1]}.
41
+ *
42
+ * @public
43
+ * @memberof models
44
+ * @docname Clothing prediction (array version)
45
+ *
46
+ * @see {@link clo_tout} for a version that supports scalar arguments
47
+ *
48
+ * @param {number[]} tout - outdoor air temperatures at 06:00 a.m., default in
49
+ * [°C] in [°F] if `units` = 'IP'
50
+ * @param {("IP" | "SI")} units - select the SI (International System of Units)
51
+ * or the IP (Imperial Units) system.
52
+ *
53
+ * @returns {number[]} Representative clothing insulation Icl, [clo]
54
+ */
55
+ function clo_tout_array(tout, units = "SI") {
56
+ return tout.map((t) => clo_tout(t, units));
57
+ }
58
+ exports.clo_tout_array = clo_tout_array;