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,458 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.phs = void 0;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ const p_sat_js_1 = require("../psychrometrics/p_sat.js");
6
+ /**
7
+ * @typedef {Object} PhsReturnType
8
+ * @property {number} t_re - rectal temperature, [°C]
9
+ * @property {number} t_sk - skin temperature, [°C]
10
+ * @property {number} t_cr - core temperature, [°C]
11
+ * @property {number} t_cr_eq - core temperature as a function of the metabolic rate, [°C]
12
+ * @property {number} t_sk_t_cr_wg - fraction of the body mass at the skin temperature
13
+ * @property {number} d_lim_loss_50 - maximum allowable exposure time for water loss, mean subject, [minutes]
14
+ * @property {number} d_lim_loss_95 - maximum allowable exposure time for water loss, 95% of the working population, [minutes]
15
+ * @property {number} d_lim_t_re - maximum allowable exposure time for heat storage, [minutes]
16
+ * @property {number} water_loss_watt - maximum water loss in watts, [W]
17
+ * @property {number} water_loss - maximum water loss, [g]
18
+ * @public
19
+ */
20
+ /**
21
+ * @typedef {Object} PhsKwargs
22
+ * @property {number} [i_mst=0.38] - static moisture permeability index, [dimensionless]
23
+ * @property {number} [a_p=0.54] - fraction of the body surface covered by the reflective clothing, [dimensionless]
24
+ * @property {0 | 1} [drink=1] - 1 if workers can drink freely, 0 otherwise
25
+ * @property {number} [weight=75] - body weight, [kg]
26
+ * @property {number} [height=1.8] - height, [m]
27
+ * @property {number} [walk_sp=0] - walking speed, [m/s]
28
+ * @property {number} [theta=0] - angle between walking direction and wind direction [degrees]
29
+ * @property {number} [acclimatized=100] - 100 if acclimatized subject, 0 otherwise
30
+ * @property {number} [duration=480] - duration of the work sequence, [minutes]
31
+ * @property {number} [f_r=0.97] - emissivity of the reflective clothing, [dimensionless]
32
+ * @property {number} [t_sk=34.1] - mean skin temperature when worker starts working, [°C]
33
+ * @property {number} [t_cr=36.8] - mean core temperature when worker starts working, [°C]
34
+ * @property {number} [t_re] - mean rectal temperature when worker starts working, [°C]
35
+ * @property {number} [t_cr_eq] - mean core temperature as a function of met when worker starts working, [°C]
36
+ * @property {number} [sweat_rate=0] - sweat rate
37
+ * @property {boolean} [round=true] - round the result of the PHS model
38
+ * @public
39
+ */
40
+ /**
41
+ * @typedef {Object} PhsKwargsRequired
42
+ * @property {number} i_mst
43
+ * @property {number} a_p
44
+ * @property {0 | 1} drink
45
+ * @property {number} weight
46
+ * @property {number} height
47
+ * @property {number} walk_sp
48
+ * @property {number} theta
49
+ * @property {number} acclimatized
50
+ * @property {number} duration
51
+ * @property {number} f_r
52
+ * @property {number} t_sk
53
+ * @property {number} t_cr
54
+ * @property {number} t_re
55
+ * @property {number} t_cr_eq
56
+ * @property {number} sweat_rate
57
+ * @property {boolean} round
58
+ */
59
+ /**
60
+ * Calculates the Predicted Heat Strain (PHS) index based in compliace with
61
+ * the ISO 7933:2004 Standard {@link #ref_8|[8]}. The ISO 7933 provides a method for the
62
+ * analytical evaluation and interpretation of the thermal stress experienced
63
+ * by a subject in a hot environment. It describes a method for predicting the
64
+ * sweat rate and the internal core temperature that the human body will
65
+ * develop in response to the working conditions.
66
+ *
67
+ * The PHS model can be used to predict the: heat by respiratory convection, heat flow
68
+ * by respiratory evaporation, steady state mean skin temperature, instantaneous value
69
+ * of skin temperature, heat accumulation associated with the metabolic rate, maximum
70
+ * evaporative heat flow at the skin surface, predicted sweat rate, predicted evaporative
71
+ * heat flow, and rectal temperature.
72
+ *
73
+ * @public
74
+ * @memberof models
75
+ * @docname Predicted Heat Strain (PHS) Index
76
+ *
77
+ * @param {number} tdb - dry bulb air temperature, default in [°C]
78
+ * @param {number} tr - mean radiant temperature, default in [°C]
79
+ * @param {number} v - air speed, default in [m/s]
80
+ * @param {number} rh - relative humidity, [%]
81
+ * @param {number} met - metabolic rate, [W/(m2)]
82
+ * @param {number} clo - clothing insulation, [clo]
83
+ * @param {1 | 2 | 3} posture - a numeric value presenting posture of person [sitting=1, standing=2, crouching=3]
84
+ * @param {number} [wme=0] - external work, [W/(m2)] default 0
85
+ * @param {PhsKwargs} [kwargs] - additional arguments
86
+ *
87
+ * @returns {PhsReturnType} object with results of phs
88
+ *
89
+ * @example
90
+ * import { phs } from "jsthermalcomfort";
91
+ * const results = phs(40, 40, 33.85, 0.3, 150, 0.5, 2);
92
+ * console.log(results); // {t_re: 37.5, d_lim_loss_50: 440, d_lim_loss_95: 298, d_lim_t_re: 480, water_loss: 6166.0}
93
+ */
94
+ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, kwargs = {}) {
95
+ const defaults_kwargs = {
96
+ i_mst: 0.38,
97
+ a_p: 0.54,
98
+ drink: 1,
99
+ weight: 75,
100
+ height: 1.8,
101
+ walk_sp: 0,
102
+ theta: 0,
103
+ acclimatized: 100,
104
+ duration: 480,
105
+ f_r: 0.97,
106
+ t_sk: 34.1,
107
+ t_cr: 36.8,
108
+ t_re: undefined,
109
+ t_cr_eq: undefined,
110
+ sweat_rate: 0,
111
+ round: true,
112
+ };
113
+ let joint_kwargs = Object.assign(defaults_kwargs, kwargs);
114
+ joint_kwargs.t_re = joint_kwargs.t_re || joint_kwargs.t_cr;
115
+ joint_kwargs.t_cr_eq = joint_kwargs.t_cr_eq || joint_kwargs.t_cr;
116
+ const warnings = (0, utilities_js_1.check_standard_compliance)("ISO7933", {
117
+ tdb,
118
+ tr,
119
+ v,
120
+ rh,
121
+ met: met * (0, utilities_js_1.body_surface_area)(joint_kwargs.weight, joint_kwargs.height),
122
+ clo,
123
+ });
124
+ warnings.forEach((warning) => console.warn(warning));
125
+ const p_a = (((0, p_sat_js_1.p_sat)(tdb) / 1000) * rh) / 100;
126
+ const variables_for_loop = _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, joint_kwargs);
127
+ const result = _phs_loop(tdb, tr, v, met, clo, wme, p_a, joint_kwargs, variables_for_loop);
128
+ if (joint_kwargs.round) {
129
+ return {
130
+ t_re: (0, utilities_js_1.round)(result.t_re, 1),
131
+ t_sk: (0, utilities_js_1.round)(result.t_sk, 1),
132
+ t_cr: (0, utilities_js_1.round)(result.t_cr, 1),
133
+ t_cr_eq: (0, utilities_js_1.round)(result.t_cr_eq, 1),
134
+ t_sk_t_cr_wg: (0, utilities_js_1.round)(result.t_sk_t_cr_wg, 2),
135
+ d_lim_loss_50: (0, utilities_js_1.round)(result.d_lim_loss_50, 1),
136
+ d_lim_loss_95: (0, utilities_js_1.round)(result.d_lim_loss_95, 1),
137
+ d_lim_t_re: (0, utilities_js_1.round)(result.d_lim_t_re, 1),
138
+ water_loss_watt: (0, utilities_js_1.round)(result.water_loss_watt, 1),
139
+ water_loss: (0, utilities_js_1.round)(result.water_loss, 1),
140
+ };
141
+ }
142
+ return result;
143
+ }
144
+ exports.phs = phs;
145
+ /**
146
+ * @param {1 | 2 | 3} posture
147
+ */
148
+ function _radiating_area_dubois(posture) {
149
+ return posture === 1 ? 0.7 : posture === 2 ? 0.77 : 0.67;
150
+ }
151
+ /**
152
+ * @param {number} met
153
+ * @param {number} a_dubois
154
+ * @param {number} acclimatized
155
+ */
156
+ function _max_sweat_rate(met, a_dubois, acclimatized) {
157
+ let sw_max = (met - 32) * a_dubois;
158
+ sw_max = Math.min(sw_max, 400);
159
+ sw_max = Math.max(sw_max, 250);
160
+ return acclimatized >= 50 ? sw_max * 1.25 : sw_max;
161
+ }
162
+ /**
163
+ * @typedef {Object} Speeds
164
+ * @property {number} v
165
+ * @property {number} walk_speed
166
+ */
167
+ /**
168
+ * @param {number} walk_speed
169
+ * @param {number} theta
170
+ * @param {number} v
171
+ * @param {number} met
172
+ *
173
+ * @returns {Speeds}
174
+ */
175
+ function _calculate_speeds(walk_speed, theta, v, met) {
176
+ if (walk_speed <= 0) {
177
+ walk_speed = 0.0052 * (met - 58);
178
+ walk_speed = Math.min(walk_speed, 0.7);
179
+ return { walk_speed, v };
180
+ }
181
+ if (theta !== 0)
182
+ v = Math.abs(v - walk_speed * Math.cos((3.14159 * theta) / 180));
183
+ else
184
+ v = Math.max(v, walk_speed);
185
+ return { v, walk_speed };
186
+ }
187
+ /**
188
+ * @typedef {Object} VariablesForLoop
189
+ * @property {number} sw_max
190
+ * @property {number} w_max
191
+ * @property {number} fcl
192
+ * @property {number} i_cl_dyn
193
+ * @property {number} r_t_dyn
194
+ * @property {number} c_res
195
+ * @property {number} e_res
196
+ * @property {number} hc_dyn
197
+ * @property {number} aux_r
198
+ * @property {number} f_cl_r
199
+ * @property {number} a_dubois
200
+ * @property {number} sp_heat
201
+ * @property {number} d_lim_t_re
202
+ * @property {number} d_lim_loss_50
203
+ * @property {number} d_lim_loss_95
204
+ * @property {number} d_max_50
205
+ * @property {number} d_max_95
206
+ * @property {number} const_t_eq
207
+ * @property {number} const_t_sk
208
+ * @property {number} const_sw
209
+ */
210
+ /**
211
+ * @param {number} v
212
+ * @param {number} met
213
+ * @param {number} posture
214
+ * @param {number} clo
215
+ * @param {number} tdb
216
+ * @param {number} p_a
217
+ * @param {PhsKwargsRequired} kwargs
218
+ *
219
+ * @returns {VariablesForLoop} Variables used in the phs calculation loop
220
+ */
221
+ function _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, kwargs) {
222
+ let walk_sp = kwargs.walk_sp;
223
+ const a_dubois = 0.202 * Math.pow(kwargs.weight, 0.425) * Math.pow(kwargs.height, 0.725);
224
+ const sp_heat = (57.83 * kwargs.weight) / a_dubois;
225
+ const d_lim_t_re = 0;
226
+ const d_lim_loss_50 = 0;
227
+ const d_lim_loss_95 = 0;
228
+ const d_max_50 = 0.075 * kwargs.weight * 1000;
229
+ const d_max_95 = 0.05 * kwargs.weight * 1000;
230
+ const const_t_eq = Math.exp(-1 / 10);
231
+ const const_t_sk = Math.exp(-1 / 3);
232
+ const const_sw = Math.exp(-1 / 10);
233
+ const w_max = kwargs.acclimatized < 50 ? 0.85 : 1;
234
+ const speeds = _calculate_speeds(walk_sp, kwargs.theta, v, met);
235
+ const v_r = speeds.v;
236
+ walk_sp = speeds.walk_speed;
237
+ const v_ux = Math.min(3, v_r);
238
+ const w_a_ux = Math.min(1.5, walk_sp);
239
+ let corr_cl = 1.044 *
240
+ Math.exp((0.066 * v_ux - 0.398) * v_ux + (0.094 * w_a_ux - 0.378) * w_a_ux);
241
+ corr_cl = Math.min(1, corr_cl);
242
+ let corr_ia = Math.exp((0.047 * v_r - 0.472) * v_r + (0.117 * w_a_ux - 0.342) * w_a_ux);
243
+ corr_ia = Math.min(1, corr_ia);
244
+ const corr_tot = clo <= 0.6 ? ((0.6 - clo) * corr_ia + clo * corr_cl) / 0.6 : corr_cl;
245
+ const fcl = 1 + 0.3 * clo;
246
+ const i_a_st = 0.111;
247
+ const i_tot_st = clo * 0.155 + i_a_st / fcl;
248
+ const i_tot_dyn = i_tot_st * corr_tot;
249
+ const i_a_dyn = corr_ia * i_a_st;
250
+ const i_cl_dyn = i_tot_dyn - i_a_dyn / fcl;
251
+ const corr_e = (2.6 * corr_tot - 6.5) * corr_tot + 4.9;
252
+ const im_dyn = Math.min(kwargs.i_mst * corr_e, 0.9);
253
+ const r_t_dyn = i_tot_dyn / im_dyn / 16.7;
254
+ const t_exp = 28.56 + 0.115 * tdb + 0.641 * p_a;
255
+ const c_res = 0.001516 * met * (t_exp - tdb);
256
+ const e_res = 0.00127 * met * (59.34 + 0.53 * tdb - 11.63 * p_a);
257
+ const z = v_r > 1 ? 8.7 * Math.pow(v_r, 0.6) : 3.5 + 5.2 * v_r;
258
+ let hc_dyn = 2.38 * Math.pow(Math.abs(kwargs.t_sk - tdb), 0.25);
259
+ if (z > hc_dyn) {
260
+ hc_dyn = z;
261
+ }
262
+ const aux_r = 5.67e-8 * _radiating_area_dubois(posture);
263
+ const f_cl_r = (1 - kwargs.a_p) * 0.97 + kwargs.a_p * kwargs.f_r;
264
+ const sw_max = _max_sweat_rate(met, a_dubois, kwargs.acclimatized);
265
+ return {
266
+ sw_max,
267
+ w_max,
268
+ fcl,
269
+ i_cl_dyn,
270
+ r_t_dyn,
271
+ c_res,
272
+ e_res,
273
+ hc_dyn,
274
+ aux_r,
275
+ f_cl_r,
276
+ a_dubois,
277
+ sp_heat,
278
+ d_lim_t_re,
279
+ d_lim_loss_50,
280
+ d_lim_loss_95,
281
+ d_max_50,
282
+ d_max_95,
283
+ const_t_eq,
284
+ const_t_sk,
285
+ const_sw,
286
+ };
287
+ }
288
+ /**
289
+ * @param {number} tdb
290
+ * @param {number} tr
291
+ * @param {number} v
292
+ * @param {number} met
293
+ * @param {number} clo
294
+ * @param {number} wme
295
+ * @param {number} p_a
296
+ * @param {PhsKwargsRequired} kwargs
297
+ * @param {VariablesForLoop} variables
298
+ *
299
+ * @returns {PhsReturnType}
300
+ */
301
+ function _phs_loop(tdb, tr, v, met, clo, wme, p_a, kwargs, variables) {
302
+ let { sw_max, w_max, fcl, i_cl_dyn, r_t_dyn, c_res, e_res, hc_dyn, aux_r, f_cl_r, a_dubois, sp_heat, d_lim_t_re, d_lim_loss_50, d_lim_loss_95, d_max_50, d_max_95, const_t_eq, const_t_sk, const_sw, } = variables;
303
+ let { duration, t_sk, t_re, t_cr, t_cr_eq, sweat_rate, drink } = kwargs;
304
+ let sw_tot = sweat_rate;
305
+ let t_sk_t_cr_wg = 0.3;
306
+ let sw_tot_g = 0.0;
307
+ for (let time = 1; time <= duration; time++) {
308
+ let t_sk0 = t_sk;
309
+ let t_re0 = t_re;
310
+ let t_cr0 = t_cr;
311
+ let t_cr_eq0 = t_cr_eq;
312
+ let t_sk_t_cr_wg0 = t_sk_t_cr_wg;
313
+ // equilibrium core temperature associated to the metabolic rate
314
+ let t_cr_eq_m = 0.0036 * met + 36.6;
315
+ // Core temperature at this minute, by exponential averaging
316
+ t_cr_eq = t_cr_eq0 * const_t_eq + t_cr_eq_m * (1 - const_t_eq);
317
+ // Heat storage associated with this core temperature increase during the last minute
318
+ let d_stored_eq = sp_heat * (t_cr_eq - t_cr_eq0) * (1 - t_sk_t_cr_wg0);
319
+ // skin temperature prediction -- clothed model
320
+ let t_sk_eq_cl = 12.165 + 0.02017 * tdb + 0.04361 * tr + 0.19354 * p_a - 0.25315 * v;
321
+ t_sk_eq_cl = t_sk_eq_cl + 0.005346 * met + 0.51274 * t_re;
322
+ // nude model
323
+ let t_sk_eq_nu = 7.191 + 0.064 * tdb + 0.061 * tr + 0.198 * p_a - 0.348 * v;
324
+ t_sk_eq_nu = t_sk_eq_nu + 0.616 * t_re;
325
+ let t_sk_eq;
326
+ if (clo >= 0.6) {
327
+ t_sk_eq = t_sk_eq_cl;
328
+ }
329
+ else if (clo <= 0.2) {
330
+ t_sk_eq = t_sk_eq_nu;
331
+ }
332
+ else {
333
+ t_sk_eq = t_sk_eq_nu + 2.5 * (t_sk_eq_cl - t_sk_eq_nu) * (clo - 0.2);
334
+ }
335
+ // skin temperature [C]
336
+ t_sk = t_sk0 * const_t_sk + t_sk_eq * (1 - const_t_sk);
337
+ // Saturated water vapour pressure at the surface of the skin
338
+ let p_sk = 0.6105 * Math.exp((17.27 * t_sk) / (t_sk + 237.3));
339
+ let t_cl = tr + 0.1; // clothing surface temperature
340
+ let h_r;
341
+ while (true) {
342
+ // radiative heat transfer coefficient
343
+ h_r =
344
+ (f_cl_r * aux_r * (Math.pow((t_cl + 273), 4) - Math.pow((tr + 273), 4))) / (t_cl - tr);
345
+ let t_cl_new = (fcl * (hc_dyn * tdb + h_r * tr) + t_sk / i_cl_dyn) /
346
+ (fcl * (hc_dyn + h_r) + 1 / i_cl_dyn);
347
+ if (Math.abs(t_cl - t_cl_new) <= 0.001) {
348
+ break;
349
+ }
350
+ t_cl = (t_cl + t_cl_new) / 2;
351
+ }
352
+ let convection = fcl * hc_dyn * (t_cl - tdb);
353
+ let radiation = fcl * h_r * (t_cl - tr);
354
+ // maximum evaporative heat flow at the skin surface [W/m2]
355
+ let e_max = (p_sk - p_a) / r_t_dyn;
356
+ // required evaporative heat flow [W/m2]
357
+ let e_req = met - d_stored_eq - wme - c_res - e_res - convection - radiation;
358
+ // required skin wettedness
359
+ let w_req = e_req / e_max;
360
+ let sw_req;
361
+ if (e_req <= 0) {
362
+ e_req = 0;
363
+ sw_req = 0; // required sweat rate [W/m2]
364
+ }
365
+ else if (e_max <= 0) {
366
+ e_max = 0;
367
+ sw_req = sw_max;
368
+ }
369
+ else if (w_req >= 1.7) {
370
+ sw_req = sw_max;
371
+ }
372
+ else {
373
+ let e_v_eff = 1 - Math.pow(w_req, 2) / 2;
374
+ if (w_req > 1) {
375
+ e_v_eff = Math.pow((2 - w_req), 2) / 2;
376
+ }
377
+ sw_req = e_req / e_v_eff;
378
+ if (sw_req > sw_max) {
379
+ sw_req = sw_max;
380
+ }
381
+ }
382
+ sweat_rate = sweat_rate * const_sw + sw_req * (1 - const_sw);
383
+ let e_p;
384
+ if (sweat_rate <= 0) {
385
+ e_p = 0; // predicted evaporative heat flow [W/m2]
386
+ sweat_rate = 0;
387
+ }
388
+ else {
389
+ let k = e_max / sweat_rate;
390
+ let wp = 1;
391
+ if (k >= 0.5) {
392
+ wp = -k + Math.sqrt(k * k + 2);
393
+ }
394
+ if (wp > w_max) {
395
+ wp = w_max;
396
+ }
397
+ e_p = wp * e_max;
398
+ }
399
+ // body heat storage rate [W/m2]
400
+ let d_storage = e_req - e_p + d_stored_eq;
401
+ let t_cr_new = t_cr0;
402
+ while (true) {
403
+ t_sk_t_cr_wg = 0.3 - 0.09 * (t_cr_new - 36.8);
404
+ if (t_sk_t_cr_wg > 0.3) {
405
+ t_sk_t_cr_wg = 0.3;
406
+ }
407
+ if (t_sk_t_cr_wg < 0.1) {
408
+ t_sk_t_cr_wg = 0.1;
409
+ }
410
+ t_cr =
411
+ d_storage / sp_heat +
412
+ (t_sk0 * t_sk_t_cr_wg0) / 2 -
413
+ (t_sk * t_sk_t_cr_wg) / 2;
414
+ t_cr = (t_cr + t_cr0 * (1 - t_sk_t_cr_wg0 / 2)) / (1 - t_sk_t_cr_wg / 2);
415
+ if (Math.abs(t_cr - t_cr_new) <= 0.001) {
416
+ break;
417
+ }
418
+ t_cr_new = (t_cr_new + t_cr) / 2;
419
+ }
420
+ t_re = t_re0 + (2 * t_cr - 1.962 * t_re0 - 1.31) / 9;
421
+ if (d_lim_t_re == 0 && t_re >= 38) {
422
+ d_lim_t_re = time;
423
+ }
424
+ sw_tot = sw_tot + sweat_rate + e_res;
425
+ sw_tot_g = (sw_tot * 2.67 * a_dubois) / 1.8 / 60;
426
+ if (d_lim_loss_50 == 0 && sw_tot_g >= d_max_50) {
427
+ d_lim_loss_50 = time;
428
+ }
429
+ if (d_lim_loss_95 == 0 && sw_tot_g >= d_max_95) {
430
+ d_lim_loss_95 = time;
431
+ }
432
+ if (drink == 0) {
433
+ d_lim_loss_95 = d_lim_loss_95 * 0.6;
434
+ d_lim_loss_50 = d_lim_loss_95;
435
+ }
436
+ }
437
+ if (d_lim_loss_50 === 0) {
438
+ d_lim_loss_50 = duration;
439
+ }
440
+ if (d_lim_loss_95 === 0) {
441
+ d_lim_loss_95 = duration;
442
+ }
443
+ if (d_lim_t_re === 0) {
444
+ d_lim_t_re = duration;
445
+ }
446
+ return {
447
+ t_re,
448
+ t_sk,
449
+ t_cr,
450
+ t_cr_eq,
451
+ t_sk_t_cr_wg,
452
+ d_lim_loss_50,
453
+ d_lim_loss_95,
454
+ d_lim_t_re,
455
+ water_loss_watt: sweat_rate,
456
+ water_loss: sw_tot_g,
457
+ };
458
+ }
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pmv_array = exports.pmv = void 0;
4
+ const pmv_ppd_js_1 = require("./pmv_ppd.js");
5
+ /**
6
+ * @typedef {Object} PmvKwargs
7
+ * @property {'SI'|'IP'} units - select the SI (International System of Units) or the IP (Imperial Units) system.
8
+ * @property {boolean} limit_inputs - Default is True. By default, if the inputs are outside the standard applicability
9
+ * limits the function returns NaN. If false, returns pmv and ppd values even if input values are outside
10
+ * the applicability limits of the model.
11
+ *
12
+ * The ASHRAE 55 2020 limits are 10 < tdb [°C] < 40, 10 < tr [°C] < 40,
13
+ * 0 < vr [m/s] < 2, 1 < met [met] < 4, and 0 < clo [clo] < 1.5.
14
+ * The ISO 7730 2005 limits are 10 < tdb [°C] < 30, 10 < tr [°C] < 40,
15
+ * 0 < vr [m/s] < 1, 0.8 < met [met] < 4, 0 < clo [clo] < 2, and -2 < PMV < 2.
16
+ * @property {boolean} airspeed_control - This only applies if standard = "ASHRAE".
17
+ *
18
+ * Default is True. By default, it is assumed that the occupant has control over the airspeed.
19
+ * In this case, the ASHRAE 55 Standard does not impose any airspeed limits.
20
+ * On the other hand, if the occupant has no control over the airspeed,
21
+ * the ASHRAE 55 imposes an upper limit for v which varies as a function of
22
+ * the operative temperature, for more information please consult the Standard.
23
+ * @public
24
+ */
25
+ /**
26
+ * Returns Predicted Mean Vote ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} ) calculated
27
+ * in accordance with main thermal comfort Standards.
28
+ *
29
+ * The {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} is an index that predicts the
30
+ * mean value of the thermal sensation votes (self-reported perceptions) of a large group of people on a sensation
31
+ * scale expressed from –3 to +3 corresponding to the categories: cold, cool, slightly cool, neutral, slightly warm,
32
+ * warm, and hot. {@link #ref_1|[1]}
33
+ *
34
+ * While the PMV equation is the same for both the ISO and ASHRAE standards, in the ASHRAE 55 PMV equation, the SET is
35
+ * used to calculate the cooling effect first, this is then subtracted from both the air and mean radiant temperatures,
36
+ * and the differences are used as input to the PMV model, while the airspeed is set to 0.1m/s. Please read more in the
37
+ * Note below.
38
+ *
39
+ * Notes:
40
+ *
41
+ * You can use this function to calculate the {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV}
42
+ * {@link #ref_1|[1]} {@link #ref_2|[2]}
43
+ *
44
+ * This is a version that supports scalar arguments.
45
+ * @see {@link pmv_array} for a version that supports arrays.
46
+ *
47
+ * @public
48
+ * @memberof models
49
+ * @docname Predicted Mean Vote (PMV)
50
+ *
51
+ * @param {number} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
52
+ * @param {number} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
53
+ * @param {number} vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
54
+ *
55
+ * Note: vr is the relative air speed caused by body movement and not the air speed measured by the air speed sensor.
56
+ * The relative air speed is the sum of the average air speed measured by the sensor plus the activity-generated air
57
+ * speed (Vag). Where Vag is the activity-generated air speed caused by motion of individual body parts. vr can be
58
+ * calculated using the function 'v_relative' in utilities.
59
+ * @param {number} rh - relative humidity, [%]
60
+ * @param {number} met - metabolic rate
61
+ *
62
+ * Note: The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent
63
+ * air layer. Consequently, the ISO 7730 states that the clothing insulation shall be corrected [2]. The ASHRAE 55
64
+ * Standard corrects for the effect of the body movement for met equal or higher than 1.2 met using the equation
65
+ * clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo, can be calculated using the function 'clo_dynamic'
66
+ * in utilities.
67
+ * @param {number} clo - clothing insulation
68
+ * @param {number} [wme=0] - external work
69
+ * @param {"ISO"|"ASHRAE"} [standard="ISO"] - comfort standard used for calculation
70
+ *
71
+ * · If "ISO", then the ISO Equation is used
72
+ *
73
+ * · If "ASHRAE", then the ASHRAE Equation is used
74
+ *
75
+ * Note: While the PMV equation is the same for both the ISO and ASHRAE standards, the ASHRAE Standard Use of the
76
+ * PMV model is limited to air speeds below 0.10m/s (20 fpm). When air speeds exceed 0.10 m/s (20 fpm), the comfort zone
77
+ * boundaries are adjusted based on the SET model. This change was introduced by the
78
+ * {@link https://www.ashrae.org/file%20library/technical%20resources/standards%20and%20guidelines/standards%20addenda/55_2020_c_20210430.pdf|Addendum_C to Standard 55-2020}
79
+ * @param {PmvKwargs} kwargs - additional arguments
80
+ *
81
+ * @returns {number} pmv - Predicted Mean Vote
82
+ *
83
+ * @example
84
+ * const tdb = 25;
85
+ * const tr = 25;
86
+ * const rh = 50;
87
+ * const v = 0.1;
88
+ * const met = 1.4;
89
+ * const clo = 0.5;
90
+ *
91
+ * // calculate relative air speed
92
+ * const v_r = v_relative(v, met);
93
+ * // calculate dynamic clothing
94
+ * const clo_d = clo_dynamic(clo, met);
95
+ *
96
+ * const results = pmv(tdb, tr, v_r, rh, met, clo_d);
97
+ * console.log(results); // 0.06
98
+ */
99
+ function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
100
+ const default_kwargs = {
101
+ units: "SI",
102
+ limit_inputs: true,
103
+ airspeed_control: true,
104
+ };
105
+ kwargs = Object.assign(default_kwargs, kwargs);
106
+ const pmv_ppdValue = (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, standard, kwargs);
107
+ if (!pmv_ppdValue.hasOwnProperty("pmv")) {
108
+ throw new Error("pmv property not found in pmv_ppdValue");
109
+ }
110
+ return pmv_ppdValue.pmv;
111
+ }
112
+ exports.pmv = pmv;
113
+ /**
114
+ * Returns Predicted Mean Vote ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} ) calculated
115
+ * in accordance with main thermal comfort Standards.
116
+ *
117
+ * The {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} is an index that predicts the
118
+ * mean value of the thermal sensation votes (self-reported perceptions) of a large group of people on a sensation
119
+ * scale expressed from –3 to +3 corresponding to the categories: cold, cool, slightly cool, neutral, slightly warm,
120
+ * warm, and hot. {@link #ref_1|[1]}
121
+ *
122
+ * While the PMV equation is the same for both the ISO and ASHRAE standards, in the ASHRAE 55 PMV equation, the SET is
123
+ * used to calculate the cooling effect first, this is then subtracted from both the air and mean radiant temperatures,
124
+ * and the differences are used as input to the PMV model, while the airspeed is set to 0.1m/s. Please read more in the
125
+ * Note below.
126
+ *
127
+ * Notes:
128
+ *
129
+ * You can use this function to calculate the {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV}
130
+ * {@link #ref_1|[1]} {@link #ref_2|[2]}
131
+ *
132
+ * This is a version that supports arrays.
133
+ * @see {@link pmv} for a version that supports scalar arguments.
134
+ *
135
+ * @public
136
+ * @memberof models
137
+ * @docname Predicted Mean Vote (PMV) (array version)
138
+ *
139
+ * @param {number[]} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
140
+ * @param {number[]} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
141
+ * @param {number[]} vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
142
+ *
143
+ * Note: vr is the relative air speed caused by body movement and not the air speed measured by the air speed sensor.
144
+ * The relative air speed is the sum of the average air speed measured by the sensor plus the activity-generated air
145
+ * speed (Vag). Where Vag is the activity-generated air speed caused by motion of individual body parts. vr can be
146
+ * calculated using the function 'v_relative_array' in utilities.
147
+ * @param {number[]} rh - relative humidity, [%]
148
+ * @param {number[]} met - metabolic rate, [met]
149
+ * @param {number[]} clo - clothing insulation, [clo]
150
+ *
151
+ * Note: The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent
152
+ * air layer. Consequently, the ISO 7730 states that the clothing insulation shall be corrected [2]. The ASHRAE 55
153
+ * Standard corrects for the effect of the body movement for met equal or higher than 1.2 met using the equation
154
+ * clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo, can be calculated using the function 'clo_dynamic_array'
155
+ * in utilities.
156
+ * @param {number[]} wme - external work, default is array of 0
157
+ * @param {"ISO"|"ASHRAE"} [standard="ISO"] - comfort standard used for calculation
158
+ *
159
+ * · If "ISO", then the ISO Equation is used
160
+ *
161
+ * · If "ASHRAE", then the ASHRAE Equation is used
162
+ *
163
+ * Note: While the PMV equation is the same for both the ISO and ASHRAE standards, the ASHRAE Standard Use of the
164
+ * PMV model is limited to air speeds below 0.10m/s (20 fpm). When air speeds exceed 0.10 m/s (20 fpm), the comfort zone
165
+ * boundaries are adjusted based on the SET model. This change was introduced by the
166
+ * {@link https://www.ashrae.org/file%20library/technical%20resources/standards%20and%20guidelines/standards%20addenda/55_2020_c_20210430.pdf|Addendum_C to Standard 55-2020}
167
+ * @param {PmvKwargs} kwargs - additional arguments
168
+ *
169
+ * @returns {number[]} pmv - Predicted Mean Vote
170
+ *
171
+ * @example
172
+ * const tdb = [22, 25];
173
+ * const tr = [25, 25];
174
+ * const rh = [50, 50];
175
+ * const v = [0.1, 0.1];
176
+ * const met = [1.4, 1.4];
177
+ * const clo = [0.5, 0.5];
178
+ *
179
+ * // calculate relative air speed
180
+ * const v_r = v_relative_array(v, met);
181
+ * // calculate dynamic clothing
182
+ * const clo_d = clo_dynamic_array(clo, met);
183
+ *
184
+ * const results = pmv_array(tdb, tr, v_r, rh, met, clo_d);
185
+ * console.log(results); // [-0.47, 0.06]
186
+ */
187
+ function pmv_array(tdb, tr, vr, rh, met, clo, wme, standard = "ISO", kwargs = {}) {
188
+ const default_kwargs = {
189
+ units: "SI",
190
+ limit_inputs: true,
191
+ airspeed_control: true,
192
+ };
193
+ kwargs = Object.assign(default_kwargs, kwargs);
194
+ const pmv_ppd_arrayValue = (0, pmv_ppd_js_1.pmv_ppd_array)(tdb, tr, vr, rh, met, clo, wme, standard, kwargs);
195
+ if (!pmv_ppd_arrayValue.hasOwnProperty("pmv")) {
196
+ throw new Error("pmv property not found in pmv_ppd_arrayValue");
197
+ }
198
+ return pmv_ppd_arrayValue.pmv;
199
+ }
200
+ exports.pmv_array = pmv_array;