jsthermalcomfort 0.2.0 → 1.0.4

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 +15 -14
  2. package/lib/cjs/jos3_functions/JOS3Defaults.js +18 -18
  3. package/lib/cjs/jos3_functions/bfb_rate.js +18 -9
  4. package/lib/cjs/jos3_functions/bsa_rate.js +1 -2
  5. package/lib/cjs/jos3_functions/capacity.js +1 -2
  6. package/lib/cjs/jos3_functions/conductance.js +18 -9
  7. package/lib/cjs/jos3_functions/local_bsa.js +18 -9
  8. package/lib/cjs/jos3_functions/matrix.js +21 -11
  9. package/lib/cjs/jos3_functions/thermoregulation/ava_blood_flow.js +18 -9
  10. package/lib/cjs/jos3_functions/thermoregulation/basal_met.js +1 -2
  11. package/lib/cjs/jos3_functions/thermoregulation/clo_area_factor.js +1 -2
  12. package/lib/cjs/jos3_functions/thermoregulation/conv_coef.js +18 -9
  13. package/lib/cjs/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js +18 -9
  14. package/lib/cjs/jos3_functions/thermoregulation/dry_r.js +18 -9
  15. package/lib/cjs/jos3_functions/thermoregulation/error_signals.js +18 -9
  16. package/lib/cjs/jos3_functions/thermoregulation/evaporation.js +19 -9
  17. package/lib/cjs/jos3_functions/thermoregulation/fixed_hc.js +18 -9
  18. package/lib/cjs/jos3_functions/thermoregulation/fixed_hr.js +18 -9
  19. package/lib/cjs/jos3_functions/thermoregulation/local_mbase.js +18 -9
  20. package/lib/cjs/jos3_functions/thermoregulation/local_q_work.js +18 -9
  21. package/lib/cjs/jos3_functions/thermoregulation/nonshivering.js +18 -9
  22. package/lib/cjs/jos3_functions/thermoregulation/operative_temp.js +18 -9
  23. package/lib/cjs/jos3_functions/thermoregulation/rad_coef.js +18 -9
  24. package/lib/cjs/jos3_functions/thermoregulation/resp_heat_loss.js +1 -2
  25. package/lib/cjs/jos3_functions/thermoregulation/shivering.js +20 -10
  26. package/lib/cjs/jos3_functions/thermoregulation/skin_blood_flow.js +18 -9
  27. package/lib/cjs/jos3_functions/thermoregulation/sum_bf.js +18 -9
  28. package/lib/cjs/jos3_functions/thermoregulation/sum_m.js +18 -9
  29. package/lib/cjs/jos3_functions/thermoregulation/wet_r.js +18 -9
  30. package/lib/cjs/jos3_functions/validate_body_parameters.js +1 -2
  31. package/lib/cjs/jos3_functions/weight_rate.js +1 -2
  32. package/lib/cjs/models/JOS3.js +17 -7
  33. package/lib/cjs/models/a_pmv.js +13 -8
  34. package/lib/cjs/models/adaptive_ashrae.js +5 -6
  35. package/lib/cjs/models/adaptive_en.js +3 -4
  36. package/lib/cjs/models/ankle_draft.js +3 -4
  37. package/lib/cjs/models/at.js +10 -6
  38. package/lib/cjs/models/athb.js +19 -13
  39. package/lib/cjs/models/clo_tout.js +10 -5
  40. package/lib/cjs/models/cooling_effect.js +15 -10
  41. package/lib/cjs/models/discomfort_index.js +2 -3
  42. package/lib/cjs/models/e_pmv.js +12 -7
  43. package/lib/cjs/models/heat_index.js +10 -8
  44. package/lib/cjs/models/humidex.js +1 -2
  45. package/lib/cjs/models/index.js +4 -0
  46. package/lib/cjs/models/net.js +11 -7
  47. package/lib/cjs/models/pet_steady.js +26 -17
  48. package/lib/cjs/models/phs.js +119 -56
  49. package/lib/cjs/models/pmv.js +2 -3
  50. package/lib/cjs/models/pmv_ppd.js +6 -6
  51. package/lib/cjs/models/pmv_ppd_ashrae.js +50 -0
  52. package/lib/cjs/models/pmv_ppd_iso.js +51 -0
  53. package/lib/cjs/models/set_tmp.js +12 -8
  54. package/lib/cjs/models/solar_gain.js +11 -13
  55. package/lib/cjs/models/two_nodes.js +7 -5
  56. package/lib/cjs/models/use_fans_heatwave.js +1 -2
  57. package/lib/cjs/models/utci.js +3 -4
  58. package/lib/cjs/models/vertical_tmp_grad_ppd.js +7 -8
  59. package/lib/cjs/models/wbgt.js +10 -6
  60. package/lib/cjs/models/wc.js +1 -2
  61. package/lib/cjs/psychrometrics/enthalpy.js +1 -2
  62. package/lib/cjs/psychrometrics/p_sat.js +1 -2
  63. package/lib/cjs/psychrometrics/p_sat_torr.js +2 -3
  64. package/lib/cjs/psychrometrics/psy_ta_rh.js +1 -2
  65. package/lib/cjs/psychrometrics/t_dp.js +1 -2
  66. package/lib/cjs/psychrometrics/t_mrt.js +2 -3
  67. package/lib/cjs/psychrometrics/t_o.js +2 -3
  68. package/lib/cjs/psychrometrics/t_wb.js +1 -2
  69. package/lib/cjs/supa.js +9 -10
  70. package/lib/cjs/types/jos3_functions/conductance.d.ts.map +1 -1
  71. package/lib/cjs/types/jos3_functions/local_bsa.d.ts.map +1 -1
  72. package/lib/cjs/types/jos3_functions/matrix.d.ts.map +1 -1
  73. package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +1 -1
  74. package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +1 -1
  75. package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +1 -1
  76. package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +1 -1
  77. package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts.map +1 -1
  78. package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts.map +1 -1
  79. package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts.map +1 -1
  80. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +1 -1
  81. package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +1 -1
  82. package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +1 -1
  83. package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +1 -1
  84. package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +1 -1
  85. package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +1 -1
  86. package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts.map +1 -1
  87. package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +1 -1
  88. package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +1 -1
  89. package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts.map +1 -1
  90. package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts.map +1 -1
  91. package/lib/cjs/types/models/JOS3.d.ts +11 -11
  92. package/lib/cjs/types/models/JOS3.d.ts.map +1 -1
  93. package/lib/cjs/types/models/a_pmv.d.ts +15 -4
  94. package/lib/cjs/types/models/a_pmv.d.ts.map +1 -1
  95. package/lib/cjs/types/models/at.d.ts +14 -3
  96. package/lib/cjs/types/models/at.d.ts.map +1 -1
  97. package/lib/cjs/types/models/athb.d.ts +14 -3
  98. package/lib/cjs/types/models/athb.d.ts.map +1 -1
  99. package/lib/cjs/types/models/clo_tout.d.ts +13 -2
  100. package/lib/cjs/types/models/clo_tout.d.ts.map +1 -1
  101. package/lib/cjs/types/models/cooling_effect.d.ts +15 -4
  102. package/lib/cjs/types/models/cooling_effect.d.ts.map +1 -1
  103. package/lib/cjs/types/models/e_pmv.d.ts +15 -4
  104. package/lib/cjs/types/models/e_pmv.d.ts.map +1 -1
  105. package/lib/cjs/types/models/heat_index.d.ts +14 -3
  106. package/lib/cjs/types/models/heat_index.d.ts.map +1 -1
  107. package/lib/cjs/types/models/humidex.d.ts.map +1 -1
  108. package/lib/cjs/types/models/index.d.ts +4 -0
  109. package/lib/cjs/types/models/index.d.ts.map +1 -1
  110. package/lib/cjs/types/models/net.d.ts +14 -3
  111. package/lib/cjs/types/models/net.d.ts.map +1 -1
  112. package/lib/cjs/types/models/pet_steady.d.ts +17 -3
  113. package/lib/cjs/types/models/pet_steady.d.ts.map +1 -1
  114. package/lib/cjs/types/models/phs.d.ts +34 -21
  115. package/lib/cjs/types/models/phs.d.ts.map +1 -1
  116. package/lib/cjs/types/models/pmv.d.ts +1 -1
  117. package/lib/cjs/types/models/pmv_ppd.d.ts +1 -1
  118. package/lib/cjs/types/models/pmv_ppd.d.ts.map +1 -1
  119. package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts +59 -0
  120. package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts.map +1 -0
  121. package/lib/cjs/types/models/pmv_ppd_iso.d.ts +59 -0
  122. package/lib/cjs/types/models/pmv_ppd_iso.d.ts.map +1 -0
  123. package/lib/cjs/types/models/set_tmp.d.ts +14 -3
  124. package/lib/cjs/types/models/set_tmp.d.ts.map +1 -1
  125. package/lib/cjs/types/models/solar_gain.d.ts +3 -3
  126. package/lib/cjs/types/models/solar_gain.d.ts.map +1 -1
  127. package/lib/cjs/types/models/two_nodes.d.ts +3 -0
  128. package/lib/cjs/types/models/two_nodes.d.ts.map +1 -1
  129. package/lib/cjs/types/models/utci.d.ts +4 -1
  130. package/lib/cjs/types/models/utci.d.ts.map +1 -1
  131. package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts +5 -5
  132. package/lib/cjs/types/models/wbgt.d.ts +15 -4
  133. package/lib/cjs/types/models/wbgt.d.ts.map +1 -1
  134. package/lib/cjs/types/models/wc.d.ts.map +1 -1
  135. package/lib/cjs/types/supa.d.ts.map +1 -1
  136. package/lib/cjs/types/utilities/utilities.d.ts.map +1 -1
  137. package/lib/cjs/utilities/utilities.js +16 -16
  138. package/lib/esm/jos3_functions/JOS3Defaults.js +18 -18
  139. package/lib/esm/models/a_pmv.js +11 -5
  140. package/lib/esm/models/adaptive_ashrae.js +3 -3
  141. package/lib/esm/models/ankle_draft.js +2 -2
  142. package/lib/esm/models/at.js +9 -4
  143. package/lib/esm/models/athb.js +17 -10
  144. package/lib/esm/models/clo_tout.js +9 -3
  145. package/lib/esm/models/cooling_effect.js +14 -8
  146. package/lib/esm/models/e_pmv.js +10 -4
  147. package/lib/esm/models/heat_index.js +9 -6
  148. package/lib/esm/models/index.js +4 -0
  149. package/lib/esm/models/net.js +10 -5
  150. package/lib/esm/models/pet_steady.js +24 -14
  151. package/lib/esm/models/phs.js +118 -54
  152. package/lib/esm/models/pmv_ppd.js +3 -2
  153. package/lib/esm/models/pmv_ppd_ashrae.js +47 -0
  154. package/lib/esm/models/pmv_ppd_iso.js +48 -0
  155. package/lib/esm/models/set_tmp.js +11 -6
  156. package/lib/esm/models/solar_gain.js +9 -10
  157. package/lib/esm/models/two_nodes.js +4 -1
  158. package/lib/esm/models/utci.js +2 -2
  159. package/lib/esm/models/vertical_tmp_grad_ppd.js +6 -6
  160. package/lib/esm/models/wbgt.js +9 -4
  161. package/lib/esm/types/jos3_functions/conductance.d.ts.map +1 -1
  162. package/lib/esm/types/jos3_functions/local_bsa.d.ts.map +1 -1
  163. package/lib/esm/types/jos3_functions/matrix.d.ts.map +1 -1
  164. package/lib/esm/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +1 -1
  165. package/lib/esm/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +1 -1
  166. package/lib/esm/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +1 -1
  167. package/lib/esm/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +1 -1
  168. package/lib/esm/types/jos3_functions/thermoregulation/dry_r.d.ts.map +1 -1
  169. package/lib/esm/types/jos3_functions/thermoregulation/error_signals.d.ts.map +1 -1
  170. package/lib/esm/types/jos3_functions/thermoregulation/evaporation.d.ts.map +1 -1
  171. package/lib/esm/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +1 -1
  172. package/lib/esm/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +1 -1
  173. package/lib/esm/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +1 -1
  174. package/lib/esm/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +1 -1
  175. package/lib/esm/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +1 -1
  176. package/lib/esm/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +1 -1
  177. package/lib/esm/types/jos3_functions/thermoregulation/shivering.d.ts.map +1 -1
  178. package/lib/esm/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +1 -1
  179. package/lib/esm/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +1 -1
  180. package/lib/esm/types/jos3_functions/thermoregulation/sum_m.d.ts.map +1 -1
  181. package/lib/esm/types/jos3_functions/thermoregulation/wet_r.d.ts.map +1 -1
  182. package/lib/esm/types/models/JOS3.d.ts +11 -11
  183. package/lib/esm/types/models/JOS3.d.ts.map +1 -1
  184. package/lib/esm/types/models/a_pmv.d.ts +15 -4
  185. package/lib/esm/types/models/a_pmv.d.ts.map +1 -1
  186. package/lib/esm/types/models/at.d.ts +14 -3
  187. package/lib/esm/types/models/at.d.ts.map +1 -1
  188. package/lib/esm/types/models/athb.d.ts +14 -3
  189. package/lib/esm/types/models/athb.d.ts.map +1 -1
  190. package/lib/esm/types/models/clo_tout.d.ts +13 -2
  191. package/lib/esm/types/models/clo_tout.d.ts.map +1 -1
  192. package/lib/esm/types/models/cooling_effect.d.ts +15 -4
  193. package/lib/esm/types/models/cooling_effect.d.ts.map +1 -1
  194. package/lib/esm/types/models/e_pmv.d.ts +15 -4
  195. package/lib/esm/types/models/e_pmv.d.ts.map +1 -1
  196. package/lib/esm/types/models/heat_index.d.ts +14 -3
  197. package/lib/esm/types/models/heat_index.d.ts.map +1 -1
  198. package/lib/esm/types/models/humidex.d.ts.map +1 -1
  199. package/lib/esm/types/models/index.d.ts +4 -0
  200. package/lib/esm/types/models/index.d.ts.map +1 -1
  201. package/lib/esm/types/models/net.d.ts +14 -3
  202. package/lib/esm/types/models/net.d.ts.map +1 -1
  203. package/lib/esm/types/models/pet_steady.d.ts +17 -3
  204. package/lib/esm/types/models/pet_steady.d.ts.map +1 -1
  205. package/lib/esm/types/models/phs.d.ts +34 -21
  206. package/lib/esm/types/models/phs.d.ts.map +1 -1
  207. package/lib/esm/types/models/pmv.d.ts +1 -1
  208. package/lib/esm/types/models/pmv_ppd.d.ts +1 -1
  209. package/lib/esm/types/models/pmv_ppd.d.ts.map +1 -1
  210. package/lib/esm/types/models/pmv_ppd_ashrae.d.ts +59 -0
  211. package/lib/esm/types/models/pmv_ppd_ashrae.d.ts.map +1 -0
  212. package/lib/esm/types/models/pmv_ppd_iso.d.ts +59 -0
  213. package/lib/esm/types/models/pmv_ppd_iso.d.ts.map +1 -0
  214. package/lib/esm/types/models/set_tmp.d.ts +14 -3
  215. package/lib/esm/types/models/set_tmp.d.ts.map +1 -1
  216. package/lib/esm/types/models/solar_gain.d.ts +3 -3
  217. package/lib/esm/types/models/solar_gain.d.ts.map +1 -1
  218. package/lib/esm/types/models/two_nodes.d.ts +3 -0
  219. package/lib/esm/types/models/two_nodes.d.ts.map +1 -1
  220. package/lib/esm/types/models/utci.d.ts +4 -1
  221. package/lib/esm/types/models/utci.d.ts.map +1 -1
  222. package/lib/esm/types/models/vertical_tmp_grad_ppd.d.ts +5 -5
  223. package/lib/esm/types/models/wbgt.d.ts +15 -4
  224. package/lib/esm/types/models/wbgt.d.ts.map +1 -1
  225. package/lib/esm/types/models/wc.d.ts.map +1 -1
  226. package/lib/esm/types/supa.d.ts.map +1 -1
  227. package/lib/esm/types/utilities/utilities.d.ts.map +1 -1
  228. package/package.json +21 -13
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.phs = void 0;
4
- const utilities_js_1 = require("../utilities/utilities.js");
3
+ exports.phs = phs;
5
4
  const p_sat_js_1 = require("../psychrometrics/p_sat.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ const MET_WATT_PER_MET = 58.15;
6
7
  /**
7
8
  * @typedef {Object} PhsReturnType
8
9
  * @property {number} t_re - rectal temperature, [°C]
@@ -13,8 +14,9 @@ const p_sat_js_1 = require("../psychrometrics/p_sat.js");
13
14
  * @property {number} d_lim_loss_50 - maximum allowable exposure time for water loss, mean subject, [minutes]
14
15
  * @property {number} d_lim_loss_95 - maximum allowable exposure time for water loss, 95% of the working population, [minutes]
15
16
  * @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]
17
+ * @property {number} sweat_rate_watt - instantaneous regulatory sweat rate at skin, [W·m⁻²]
18
+ * @property {number} sweat_loss_g - maximum water loss, [g]
19
+ * @property {number} evap_load_wm2_min - accumulated evaporative load per area
18
20
  * @public
19
21
  */
20
22
  /**
@@ -28,7 +30,7 @@ const p_sat_js_1 = require("../psychrometrics/p_sat.js");
28
30
  * @property {number} [theta=0] - angle between walking direction and wind direction [degrees]
29
31
  * @property {number} [acclimatized=100] - 100 if acclimatized subject, 0 otherwise
30
32
  * @property {number} [duration=480] - duration of the work sequence, [minutes]
31
- * @property {number} [f_r=0.97] - emissivity of the reflective clothing, [dimensionless]
33
+ * @property {number} [f_r] - emissivity of the reflective clothing, [dimensionless]. Default 0.97 (2004) or 0.42 (2023).
32
34
  * @property {number} [t_sk=34.1] - mean skin temperature when worker starts working, [°C]
33
35
  * @property {number} [t_cr=36.8] - mean core temperature when worker starts working, [°C]
34
36
  * @property {number} [t_re] - mean rectal temperature when worker starts working, [°C]
@@ -53,16 +55,19 @@ const p_sat_js_1 = require("../psychrometrics/p_sat.js");
53
55
  * @property {number} t_cr
54
56
  * @property {number} t_re
55
57
  * @property {number} t_cr_eq
56
- * @property {number} sweat_rate
58
+ * @property {number} t_sk_t_cr_wg
59
+ * @property {number} sweat_rate_watt
60
+ * @property {number} evap_load_wm2_min
57
61
  * @property {boolean} round
62
+ * @property {string} model
58
63
  */
59
64
  /**
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.
65
+ * Calculates the Predicted Heat Strain (PHS) index based in compliance with
66
+ * the ISO 7933:2004 Standard {@link #ref_8|[8]} or the ISO 7933:2023 Standard.
67
+ * The ISO 7933 provides a method for the analytical evaluation and interpretation
68
+ * of the thermal stress experienced by a subject in a hot environment.
69
+ * It describes a method for predicting the sweat rate and the internal core
70
+ * temperature that the human body will develop in response to the working conditions.
66
71
  *
67
72
  * The PHS model can be used to predict the: heat by respiratory convection, heat flow
68
73
  * by respiratory evaporation, steady state mean skin temperature, instantaneous value
@@ -78,20 +83,21 @@ const p_sat_js_1 = require("../psychrometrics/p_sat.js");
78
83
  * @param {number} tr - mean radiant temperature, default in [°C]
79
84
  * @param {number} v - air speed, default in [m/s]
80
85
  * @param {number} rh - relative humidity, [%]
81
- * @param {number} met - metabolic rate, [W/(m2)]
86
+ * @param {number} met - metabolic rate, [met]
82
87
  * @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
88
+ * @param {number | "sitting" | "standing" | "crouching"} posture - a numeric or string value presenting posture of person [sitting=1, standing=2, crouching=3]
89
+ * @param {number} [wme=0] - external work, [met] default 0
90
+ * @param {string} [model="7933-2023"] - PHS model version ["7933-2004", "7933-2023"]
85
91
  * @param {PhsKwargs} [kwargs] - additional arguments
86
92
  *
87
93
  * @returns {PhsReturnType} object with results of phs
88
94
  *
89
95
  * @example
90
96
  * 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}
97
+ * const results = phs(40, 40, 0.3, 33.85, 2.5, 0.5, "standing");
98
+ * console.log(results); // {t_re: 37.5, d_lim_loss_50: 480, d_lim_loss_95: 480, d_lim_t_re: 480, sweat_loss_g: 5847.0, sweat_rate_watt: 252.1, ...}
93
99
  */
94
- function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, kwargs = {}) {
100
+ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-2023", kwargs = {}) {
95
101
  const defaults_kwargs = {
96
102
  i_mst: 0.38,
97
103
  a_p: 0.54,
@@ -102,29 +108,49 @@ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, kwargs = {}) {
102
108
  theta: 0,
103
109
  acclimatized: 100,
104
110
  duration: 480,
105
- f_r: 0.97,
111
+ f_r: model === "7933-2023" ? 0.42 : 0.97,
106
112
  t_sk: 34.1,
107
113
  t_cr: 36.8,
108
- t_re: undefined,
109
- t_cr_eq: undefined,
110
- sweat_rate: 0,
114
+ t_re: model === "7933-2023" ? 36.8 : undefined,
115
+ t_cr_eq: model === "7933-2023" ? 36.8 : undefined,
116
+ t_sk_t_cr_wg: 0.3,
117
+ sweat_rate_watt: 0,
118
+ evap_load_wm2_min: 0,
111
119
  round: true,
112
120
  };
113
121
  let joint_kwargs = Object.assign(defaults_kwargs, kwargs);
114
122
  joint_kwargs.t_re = joint_kwargs.t_re || joint_kwargs.t_cr;
115
123
  joint_kwargs.t_cr_eq = joint_kwargs.t_cr_eq || joint_kwargs.t_cr;
124
+ joint_kwargs.model = model;
125
+ if (typeof posture === "string") {
126
+ const p = posture.toLowerCase();
127
+ if (p === "sitting")
128
+ posture = 1;
129
+ else if (p === "standing")
130
+ posture = 2;
131
+ else if (p === "crouching")
132
+ posture = 3;
133
+ }
134
+ const met_watt = met * MET_WATT_PER_MET;
135
+ const wme_watt = wme * MET_WATT_PER_MET;
116
136
  const warnings = (0, utilities_js_1.check_standard_compliance)("ISO7933", {
117
137
  tdb,
118
138
  tr,
119
139
  v,
120
140
  rh,
121
- met: met * (0, utilities_js_1.body_surface_area)(joint_kwargs.weight, joint_kwargs.height),
141
+ met: met_watt * (0, utilities_js_1.body_surface_area)(joint_kwargs.weight, joint_kwargs.height),
122
142
  clo,
123
143
  });
124
144
  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);
145
+ let p_a;
146
+ if (model === "7933-2023") {
147
+ p_a = 0.6105 * Math.exp((17.27 * tdb) / (tdb + 237.3)) * (rh / 100);
148
+ }
149
+ else {
150
+ p_a = (((0, p_sat_js_1.p_sat)(tdb) / 1000) * rh) / 100;
151
+ }
152
+ const variables_for_loop = _calculate_variables_for_loop(v, met_watt, posture, clo, tdb, p_a, joint_kwargs);
153
+ const result = _phs_loop(tdb, tr, v, met_watt, clo, wme_watt, p_a, joint_kwargs, variables_for_loop);
128
154
  if (joint_kwargs.round) {
129
155
  return {
130
156
  t_re: (0, utilities_js_1.round)(result.t_re, 1),
@@ -135,13 +161,13 @@ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, kwargs = {}) {
135
161
  d_lim_loss_50: (0, utilities_js_1.round)(result.d_lim_loss_50, 1),
136
162
  d_lim_loss_95: (0, utilities_js_1.round)(result.d_lim_loss_95, 1),
137
163
  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),
164
+ sweat_rate_watt: (0, utilities_js_1.round)(result.sweat_rate_watt, 1),
165
+ sweat_loss_g: (0, utilities_js_1.round)(result.sweat_loss_g, 1),
166
+ evap_load_wm2_min: (0, utilities_js_1.round)(result.evap_load_wm2_min, 1),
140
167
  };
141
168
  }
142
169
  return result;
143
170
  }
144
- exports.phs = phs;
145
171
  /**
146
172
  * @param {1 | 2 | 3} posture
147
173
  */
@@ -152,8 +178,12 @@ function _radiating_area_dubois(posture) {
152
178
  * @param {number} met
153
179
  * @param {number} a_dubois
154
180
  * @param {number} acclimatized
181
+ * @param {string} model
155
182
  */
156
- function _max_sweat_rate(met, a_dubois, acclimatized) {
183
+ function _max_sweat_rate(met, a_dubois, acclimatized, model) {
184
+ if (model === "7933-2023") {
185
+ return acclimatized === 0 ? 400 : 500;
186
+ }
157
187
  let sw_max = (met - 32) * a_dubois;
158
188
  sw_max = Math.min(sw_max, 400);
159
189
  sw_max = Math.max(sw_max, 250);
@@ -194,6 +224,7 @@ function _calculate_speeds(walk_speed, theta, v, met) {
194
224
  * @property {number} c_res
195
225
  * @property {number} e_res
196
226
  * @property {number} hc_dyn
227
+ * @property {number} z
197
228
  * @property {number} aux_r
198
229
  * @property {number} f_cl_r
199
230
  * @property {number} a_dubois
@@ -221,12 +252,20 @@ function _calculate_speeds(walk_speed, theta, v, met) {
221
252
  function _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, kwargs) {
222
253
  let walk_sp = kwargs.walk_sp;
223
254
  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;
255
+ const sp_heat = (MET_WATT_PER_MET * kwargs.weight) / a_dubois;
225
256
  const d_lim_t_re = 0;
226
257
  const d_lim_loss_50 = 0;
227
258
  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;
259
+ let d_max_50, d_max_95;
260
+ if (kwargs.model === "7933-2023") {
261
+ const d_max = (kwargs.drink === 0 ? 0.03 : 0.05) * kwargs.weight * 1000;
262
+ d_max_50 = d_max;
263
+ d_max_95 = d_max;
264
+ }
265
+ else {
266
+ d_max_50 = 0.075 * kwargs.weight * 1000;
267
+ d_max_95 = 0.05 * kwargs.weight * 1000;
268
+ }
230
269
  const const_t_eq = Math.exp(-1 / 10);
231
270
  const const_t_sk = Math.exp(-1 / 3);
232
271
  const const_sw = Math.exp(-1 / 10);
@@ -242,7 +281,7 @@ function _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, kwargs) {
242
281
  let corr_ia = Math.exp((0.047 * v_r - 0.472) * v_r + (0.117 * w_a_ux - 0.342) * w_a_ux);
243
282
  corr_ia = Math.min(1, corr_ia);
244
283
  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;
284
+ const fcl = kwargs.model === "7933-2023" ? 1 + 0.28 * clo : 1 + 0.3 * clo;
246
285
  const i_a_st = 0.111;
247
286
  const i_tot_st = clo * 0.155 + i_a_st / fcl;
248
287
  const i_tot_dyn = i_tot_st * corr_tot;
@@ -255,13 +294,29 @@ function _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, kwargs) {
255
294
  const c_res = 0.001516 * met * (t_exp - tdb);
256
295
  const e_res = 0.00127 * met * (59.34 + 0.53 * tdb - 11.63 * p_a);
257
296
  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);
297
+ let hc_dyn;
298
+ if (kwargs.model === "7933-2023") {
299
+ // In 2023, hc_dyn uses clothing temperature. Since t_cl is solved in loop,
300
+ // we use an initial placeholder or handle it inside the loop.
301
+ // Python code calculates it using t_cl = tr + 0.1 initially.
302
+ const t_cl_init = tdb + 0.1; // or tr + 0.1
303
+ hc_dyn = 2.38 * Math.pow(Math.abs(t_cl_init - tdb), 0.25);
304
+ }
305
+ else {
306
+ hc_dyn = 2.38 * Math.pow(Math.abs(kwargs.t_sk - tdb), 0.25);
307
+ }
259
308
  if (z > hc_dyn) {
260
309
  hc_dyn = z;
261
310
  }
262
311
  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);
312
+ let f_cl_r;
313
+ if (kwargs.model === "7933-2023") {
314
+ f_cl_r = (1 - kwargs.a_p) * 0.97 + kwargs.a_p * (1 - kwargs.f_r);
315
+ }
316
+ else {
317
+ f_cl_r = (1 - kwargs.a_p) * 0.97 + kwargs.a_p * kwargs.f_r;
318
+ }
319
+ const sw_max = _max_sweat_rate(met, a_dubois, kwargs.acclimatized, kwargs.model);
265
320
  return {
266
321
  sw_max,
267
322
  w_max,
@@ -271,6 +326,7 @@ function _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, kwargs) {
271
326
  c_res,
272
327
  e_res,
273
328
  hc_dyn,
329
+ z,
274
330
  aux_r,
275
331
  f_cl_r,
276
332
  a_dubois,
@@ -299,10 +355,9 @@ function _calculate_variables_for_loop(v, met, posture, clo, tdb, p_a, kwargs) {
299
355
  * @returns {PhsReturnType}
300
356
  */
301
357
  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;
358
+ let { sw_max, w_max, fcl, i_cl_dyn, r_t_dyn, c_res, e_res, hc_dyn: hc_dyn_init, z, 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;
359
+ let hc_dyn = hc_dyn_init;
360
+ let { duration, t_sk, t_re, t_cr, t_cr_eq, sweat_rate_watt, t_sk_t_cr_wg, evap_load_wm2_min, drink, model, } = kwargs;
306
361
  let sw_tot_g = 0.0;
307
362
  for (let time = 1; time <= duration; time++) {
308
363
  let t_sk0 = t_sk;
@@ -339,6 +394,9 @@ function _phs_loop(tdb, tr, v, met, clo, wme, p_a, kwargs, variables) {
339
394
  let t_cl = tr + 0.1; // clothing surface temperature
340
395
  let h_r;
341
396
  while (true) {
397
+ if (model === "7933-2023") {
398
+ hc_dyn = Math.max(2.38 * Math.pow(Math.abs(t_cl - tdb), 0.25), z);
399
+ }
342
400
  // radiative heat transfer coefficient
343
401
  h_r =
344
402
  (f_cl_r * aux_r * (Math.pow((t_cl + 273), 4) - Math.pow((tr + 273), 4))) / (t_cl - tr);
@@ -353,6 +411,9 @@ function _phs_loop(tdb, tr, v, met, clo, wme, p_a, kwargs, variables) {
353
411
  let radiation = fcl * h_r * (t_cl - tr);
354
412
  // maximum evaporative heat flow at the skin surface [W/m2]
355
413
  let e_max = (p_sk - p_a) / r_t_dyn;
414
+ if (e_max === 0) {
415
+ e_max = 0.001;
416
+ }
356
417
  // required evaporative heat flow [W/m2]
357
418
  let e_req = met - d_stored_eq - wme - c_res - e_res - convection - radiation;
358
419
  // required skin wettedness
@@ -374,19 +435,20 @@ function _phs_loop(tdb, tr, v, met, clo, wme, p_a, kwargs, variables) {
374
435
  if (w_req > 1) {
375
436
  e_v_eff = Math.pow((2 - w_req), 2) / 2;
376
437
  }
438
+ e_v_eff = Math.max(0.05, e_v_eff);
377
439
  sw_req = e_req / e_v_eff;
378
440
  if (sw_req > sw_max) {
379
441
  sw_req = sw_max;
380
442
  }
381
443
  }
382
- sweat_rate = sweat_rate * const_sw + sw_req * (1 - const_sw);
444
+ sweat_rate_watt = sweat_rate_watt * const_sw + sw_req * (1 - const_sw);
383
445
  let e_p;
384
- if (sweat_rate <= 0) {
446
+ if (sweat_rate_watt <= 0) {
385
447
  e_p = 0; // predicted evaporative heat flow [W/m2]
386
- sweat_rate = 0;
448
+ sweat_rate_watt = 0;
387
449
  }
388
450
  else {
389
- let k = e_max / sweat_rate;
451
+ let k = e_max / Math.max(sweat_rate_watt, 1e-6);
390
452
  let wp = 1;
391
453
  if (k >= 0.5) {
392
454
  wp = -k + Math.sqrt(k * k + 2);
@@ -418,21 +480,21 @@ function _phs_loop(tdb, tr, v, met, clo, wme, p_a, kwargs, variables) {
418
480
  t_cr_new = (t_cr_new + t_cr) / 2;
419
481
  }
420
482
  t_re = t_re0 + (2 * t_cr - 1.962 * t_re0 - 1.31) / 9;
421
- if (d_lim_t_re == 0 && t_re >= 38) {
483
+ if (d_lim_t_re === 0 && t_re >= 38) {
422
484
  d_lim_t_re = time;
423
485
  }
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) {
486
+ evap_load_wm2_min = evap_load_wm2_min + sweat_rate_watt + e_res;
487
+ sw_tot_g = (evap_load_wm2_min * 2.67 * a_dubois) / 1.8 / 60;
488
+ if (d_lim_loss_50 === 0 && sw_tot_g >= d_max_50) {
427
489
  d_lim_loss_50 = time;
428
490
  }
429
- if (d_lim_loss_95 == 0 && sw_tot_g >= d_max_95) {
491
+ if (d_lim_loss_95 === 0 && sw_tot_g >= d_max_95) {
430
492
  d_lim_loss_95 = time;
431
493
  }
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
- }
494
+ }
495
+ if (drink === 0) {
496
+ d_lim_loss_95 = d_lim_loss_95 * 0.6;
497
+ d_lim_loss_50 = d_lim_loss_95;
436
498
  }
437
499
  if (d_lim_loss_50 === 0) {
438
500
  d_lim_loss_50 = duration;
@@ -452,7 +514,8 @@ function _phs_loop(tdb, tr, v, met, clo, wme, p_a, kwargs, variables) {
452
514
  d_lim_loss_50,
453
515
  d_lim_loss_95,
454
516
  d_lim_t_re,
455
- water_loss_watt: sweat_rate,
456
- water_loss: sw_tot_g,
517
+ sweat_rate_watt,
518
+ sweat_loss_g: sw_tot_g,
519
+ evap_load_wm2_min,
457
520
  };
458
521
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pmv_array = exports.pmv = void 0;
3
+ exports.pmv = pmv;
4
+ exports.pmv_array = pmv_array;
4
5
  const pmv_ppd_js_1 = require("./pmv_ppd.js");
5
6
  /**
6
7
  * @typedef {Object} PmvKwargs
@@ -109,7 +110,6 @@ function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {})
109
110
  }
110
111
  return pmv_ppdValue.pmv;
111
112
  }
112
- exports.pmv = pmv;
113
113
  /**
114
114
  * Returns Predicted Mean Vote ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} ) calculated
115
115
  * in accordance with main thermal comfort Standards.
@@ -197,4 +197,3 @@ function pmv_array(tdb, tr, vr, rh, met, clo, wme, standard = "ISO", kwargs = {}
197
197
  }
198
198
  return pmv_ppd_arrayValue.pmv;
199
199
  }
200
- exports.pmv_array = pmv_array;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pmv_calculation = exports.pmv_ppd_array = exports.pmv_ppd = void 0;
3
+ exports.pmv_ppd = pmv_ppd;
4
+ exports.pmv_ppd_array = pmv_ppd_array;
5
+ exports.pmv_calculation = pmv_calculation;
4
6
  const utilities_js_1 = require("../utilities/utilities.js");
5
7
  const cooling_effect_js_1 = require("./cooling_effect.js");
6
8
  /**
@@ -112,7 +114,7 @@ function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs =
112
114
  airspeed_control: true,
113
115
  };
114
116
  kwargs = Object.assign(default_kwargs, kwargs);
115
- if (kwargs.units && kwargs.units === "IP") {
117
+ if (kwargs.units && kwargs.units.toUpperCase() === "IP") {
116
118
  // Conversion from IP to SI units
117
119
  ({ tdb, tr, vr } = (0, utilities_js_1.units_converter)({ tdb, tr, vr }, "IP"));
118
120
  }
@@ -130,7 +132,7 @@ function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs =
130
132
  let ce = 0;
131
133
  if (standard === "ASHRAE") {
132
134
  //if v_r is higher than 0.1 follow methodology ASHRAE Appendix H, H3
133
- ce = vr > 0.1 ? (0, cooling_effect_js_1.cooling_effect)(tdb, tr, vr, rh, met, clo, wme) : 0;
135
+ ce = vr > 0.1 ? (0, cooling_effect_js_1.cooling_effect)(tdb, tr, vr, rh, met, clo, wme).ce : 0;
134
136
  }
135
137
  tdb = tdb - ce;
136
138
  tr = tr - ce;
@@ -160,7 +162,6 @@ function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs =
160
162
  ppd: (0, utilities_js_1.round)(ppd, 1),
161
163
  };
162
164
  }
163
- exports.pmv_ppd = pmv_ppd;
164
165
  /**
165
166
  * @typedef {Object} Pmv_ppd_arrayReturns
166
167
  * @property { number[] } pmv - Predicted Mean Vote
@@ -275,6 +276,7 @@ function pmv_ppd_array(tdb, tr, vr, rh, met, clo, wme, standard = "ISO", kwargs
275
276
  //if v_r is higher than 0.1 follow methodology ASHRAE Appendix H, H3
276
277
  return vrValue > 0.1
277
278
  ? (0, cooling_effect_js_1.cooling_effect)(tdb[i], tr[i], vrValue, rh[i], met[i], clo[i], wme[i])
279
+ .ce
278
280
  : 0;
279
281
  });
280
282
  }
@@ -323,7 +325,6 @@ function pmv_ppd_array(tdb, tr, vr, rh, met, clo, wme, standard = "ISO", kwargs
323
325
  ppd: ppd_array,
324
326
  };
325
327
  }
326
- exports.pmv_ppd_array = pmv_ppd_array;
327
328
  /**
328
329
  * @param {number} tdb
329
330
  * @param {number} tr
@@ -401,4 +402,3 @@ function pmv_calculation(tdb, tr, vr, rh, met, clo, wme) {
401
402
  const ts = 0.303 * Math.exp(-0.036 * m) + 0.028;
402
403
  return ts * (mw - hl1 - hl2 - hl3 - hl4 - hl5 - hl6);
403
404
  }
404
- exports.pmv_calculation = pmv_calculation;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pmv_ppd_ashrae = pmv_ppd_ashrae;
4
+ const pmv_ppd_js_1 = require("./pmv_ppd.js");
5
+ /**
6
+ * @typedef {Object} PmvPpdAshrae
7
+ * @property {number} pmv - Predicted Mean Vote on the ASHRAE 55 scale [-3, +3]
8
+ * @property {number} ppd - Predicted Percentage of Dissatisfied [%]
9
+ * @public
10
+ */
11
+ /**
12
+ * Calculate PMV and PPD in accordance with ASHRAE 55.
13
+ *
14
+ * Delegates to {@link pmv_ppd} with the standard fixed to `'ASHRAE'`.
15
+ * The ASHRAE equation applies a cooling effect (via SET) before computing
16
+ * PMV — this lowers the result compared to the raw ISO equation when
17
+ * elevated air speed is present.
18
+ *
19
+ * Valid ASHRAE 55 input ranges (when `limit_inputs` is true):
20
+ * - 10 < tdb [°C] < 40
21
+ * - 10 < tr [°C] < 40
22
+ * - 0 < vr [m/s] < 2
23
+ * - 1 < met [met] < 4
24
+ * - 0 < clo [clo] < 1.5
25
+ *
26
+ * @param {number} tdb - Dry-bulb air temperature [°C] (or [°F] if units = 'IP')
27
+ * @param {number} tr - Mean radiant temperature [°C] (or [°F] if units = 'IP')
28
+ * @param {number} vr - Relative air speed [m/s] (or [fps] if units = 'IP')
29
+ * @param {number} rh - Relative humidity [%]
30
+ * @param {number} met - Metabolic rate [met]
31
+ * @param {number} clo - Clothing insulation [clo]
32
+ * @param {number} [wme=0] - External work [met]
33
+ * @param {Object} [kwargs={}] - Optional overrides
34
+ * @param {'SI'|'IP'} [kwargs.units='SI'] - Unit system
35
+ * @param {boolean} [kwargs.limit_inputs=true] - Return NaN for out-of-range inputs
36
+ * @param {boolean} [kwargs.airspeed_control=true] - Occupant controls airspeed
37
+ * @returns {PmvPpdAshrae} PMV and PPD values
38
+ *
39
+ * @example
40
+ * const r = pmv_ppd_ashrae(25, 25, 0.1, 50, 1.2, 0.5);
41
+ * console.log(r.pmv); // 0.08
42
+ * console.log(r.ppd); // 5.1
43
+ *
44
+ * @public
45
+ * @memberof models
46
+ * @docname PMV/PPD (ASHRAE 55)
47
+ */
48
+ function pmv_ppd_ashrae(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
49
+ return (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, "ASHRAE", kwargs);
50
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pmv_ppd_iso = pmv_ppd_iso;
4
+ const pmv_ppd_js_1 = require("./pmv_ppd.js");
5
+ /**
6
+ * @typedef {Object} PmvPpdIso
7
+ * @property {number} pmv - Predicted Mean Vote on the ISO 7730 scale [-3, +3]
8
+ * @property {number} ppd - Predicted Percentage of Dissatisfied [%]
9
+ * @public
10
+ */
11
+ /**
12
+ * Calculate PMV and PPD in accordance with ISO 7730.
13
+ *
14
+ * Delegates to {@link pmv_ppd} with the standard fixed to `'ISO'`.
15
+ * The ISO equation uses Fanger's original PMV formulation without the
16
+ * ASHRAE cooling-effect adjustment.
17
+ *
18
+ * ISO 7730 applies stricter input limits than ASHRAE 55. When
19
+ * `limit_inputs` is true (the default), inputs outside the following
20
+ * ranges cause the function to return NaN:
21
+ * - 10 < tdb [°C] < 30
22
+ * - 10 < tr [°C] < 40
23
+ * - 0 < vr [m/s] < 1
24
+ * - 0.8 < met [met] < 4
25
+ * - 0 < clo [clo] < 2
26
+ * - -2 < PMV < 2 (result is clamped to NaN outside this range)
27
+ *
28
+ * @param {number} tdb - Dry-bulb air temperature [°C] (or [°F] if units = 'IP')
29
+ * @param {number} tr - Mean radiant temperature [°C] (or [°F] if units = 'IP')
30
+ * @param {number} vr - Relative air speed [m/s] (or [fps] if units = 'IP')
31
+ * @param {number} rh - Relative humidity [%]
32
+ * @param {number} met - Metabolic rate [met]
33
+ * @param {number} clo - Clothing insulation [clo]
34
+ * @param {number} [wme=0] - External work [met]
35
+ * @param {Object} [kwargs={}] - Optional overrides
36
+ * @param {'SI'|'IP'} [kwargs.units='SI'] - Unit system
37
+ * @param {boolean} [kwargs.limit_inputs=true] - Return NaN for out-of-range inputs
38
+ * @returns {PmvPpdIso} PMV and PPD values
39
+ *
40
+ * @example
41
+ * const r = pmv_ppd_iso(25, 25, 0.1, 50, 1.2, 0.5);
42
+ * console.log(r.pmv); // 0.08
43
+ * console.log(r.ppd); // 5.1
44
+ *
45
+ * @public
46
+ * @memberof models
47
+ * @docname PMV/PPD (ISO 7730)
48
+ */
49
+ function pmv_ppd_iso(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
50
+ return (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
51
+ }
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.set_tmp_array = exports.set_tmp = void 0;
4
- const utilities_js_1 = require("../utilities/utilities.js");
3
+ exports.set_tmp = set_tmp;
4
+ exports.set_tmp_array = set_tmp_array;
5
5
  const two_nodes_js_1 = require("../models/two_nodes.js");
6
+ const utilities_js_1 = require("../utilities/utilities.js");
7
+ /**
8
+ * @typedef {Object} SetTmpResult
9
+ * @property {number} set - Standard effective temperature in array, [°C]
10
+ * @public
11
+ */
6
12
  /**
7
13
  * @typedef {Object} SetTmpKwargs - a keywords argument set containing the additional arguments for Standard Effective Temperature calculation
8
14
  * @property {boolean} [round=true] - round the result of the SET
@@ -41,10 +47,10 @@ const two_nodes_js_1 = require("../models/two_nodes.js");
41
47
  * @param {"SI" | "IP"} [units="SI"] Select the SI (International System of Units) or the IP (Imperial Units) system.
42
48
  * @param {boolean} [limit_inputs=true] By default, if the inputs are outsude the following limits the function returns nan. If False returns values regardless of the input values.
43
49
  * @param {SetTmpKwargs} [kwargs]
44
- * @returns {number} SET – Standard effective temperature in array, [°C]
50
+ * @returns {SetTmpResult} set containing results for the model
45
51
  *
46
52
  * @example
47
- * const set = set_tmp(25, 25, 0.1, 50, 1.2, 0.5); // returns 24.3
53
+ * const set = set_tmp(25, 25, 0.1, 50, 1.2, 0.5); // returns {set: 24.3}
48
54
  */
49
55
  function set_tmp(tdb, tr, v, rh, met, clo, wme = 0, body_surface_area, p_atm, body_position = "standing", units = "SI", limit_inputs = true, kwargs = {}) {
50
56
  const defaults_kwargs = {
@@ -91,11 +97,10 @@ function set_tmp(tdb, tr, v, rh, met, clo, wme = 0, body_surface_area, p_atm, bo
91
97
  }
92
98
  }
93
99
  if (joint_kwargs.round) {
94
- return (0, utilities_js_1.round)(set_tmp, 1);
100
+ set_tmp = (0, utilities_js_1.round)(set_tmp, 1);
95
101
  }
96
- return set_tmp;
102
+ return { set: set_tmp };
97
103
  }
98
- exports.set_tmp = set_tmp;
99
104
  /**
100
105
  * @typedef {Object} SetTmpArrayKwargs - a keywords argument set containing the additional arguments for SET array calculation
101
106
  * @property {boolean} [round=true] - round the result of the SET
@@ -200,4 +205,3 @@ function set_tmp_array(tdbArray, trArray, vArray, rhArray, metArray, cloArray, w
200
205
  }
201
206
  return setArray;
202
207
  }
203
- exports.set_tmp_array = set_tmp_array;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.find_span = exports.solar_gain = void 0;
3
+ exports.solar_gain = solar_gain;
4
+ exports.find_span = find_span;
4
5
  const utilities_js_1 = require("../utilities/utilities.js");
5
- const utilities_js_2 = require("../utilities/utilities.js");
6
6
  // avoid reallocating these arrays accross function calls
7
7
  const _alt_range = [0, 15, 30, 45, 60, 75, 90];
8
8
  const _az_range = [0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180];
9
9
  // avoid reallocating these table across function calls
10
- const _fp_table_seated = [
10
+ const _fp_table_sitting = [
11
11
  [0.29, 0.324, 0.305, 0.303, 0.262, 0.224, 0.177],
12
12
  [0.292, 0.328, 0.294, 0.288, 0.268, 0.227, 0.177],
13
13
  [0.288, 0.332, 0.298, 0.29, 0.264, 0.222, 0.177],
@@ -82,27 +82,27 @@ const _fp_table = [
82
82
  * clothing or skin color of the occupants is available.
83
83
  * Note: Short-wave absorptivity typically ranges from 0.57 to 0.84, depending
84
84
  * on skin and clothing color. More information is available in Blum (1945).
85
- * @param {"standing" | "supine" | "seated"} [posture="seated"] - Default 'seated' list of available options 'standing', 'supine' or 'seated'
85
+ * @param {"standing" | "supine" | "sitting"} [posture="sitting"] - Default 'sitting' list of available options 'standing', 'supine' or 'sitting'
86
86
  * @param {number} [floor_reflectance=0.7] - Floor refectance. It is assumed to be constant and equal to 0.6.
87
87
  *
88
88
  * @returns {SolarGainReturnType}
89
89
  *
90
90
  * @example
91
91
  * import {solar_gain} from "jsthermalcomfort/models";
92
- * const results = solar_gain(0, 120, 800, 0.5, 0.7, "seated");
92
+ * const results = solar_gain(0, 120, 800, 0.5, 0.7, "sitting");
93
93
  * console.log(results); // {erf: 42.9, delta_mrt: 10.3}
94
94
  */
95
- function solar_gain(sol_altitude, sharp, sol_radiation_dir, sol_transmittance, f_svv, f_bes, asw = 0.7, posture = "seated", floor_reflectance = 0.6) {
95
+ function solar_gain(sol_altitude, sharp, sol_radiation_dir, sol_transmittance, f_svv, f_bes, asw = 0.7, posture = "sitting", floor_reflectance = 0.6) {
96
96
  posture = posture.toLowerCase();
97
- if (posture !== "standing" && posture !== "supine" && posture !== "seated")
98
- throw new Error("Posture has to be either standing, supine or seated");
97
+ if (posture !== "standing" && posture !== "supine" && posture !== "sitting")
98
+ throw new Error("Posture has to be either standing, supine or sitting");
99
99
  const deg_to_rad = 0.0174532925;
100
100
  const hr = 6;
101
101
  const i_diff = 0.2 * sol_radiation_dir;
102
102
  // fp is the projected area factor
103
- const fp_table = posture === "seated" ? _fp_table_seated : _fp_table;
103
+ const fp_table = posture === "sitting" ? _fp_table_sitting : _fp_table;
104
104
  if (posture === "supine") {
105
- [sharp, sol_altitude] = (0, utilities_js_2.transpose_sharp_altitude)(sharp, sol_altitude);
105
+ [sharp, sol_altitude] = (0, utilities_js_1.transpose_sharp_altitude)(sharp, sol_altitude);
106
106
  }
107
107
  const alt_i = find_span(_alt_range, sol_altitude);
108
108
  const az_i = find_span(_az_range, sharp);
@@ -119,7 +119,7 @@ function solar_gain(sol_altitude, sharp, sol_radiation_dir, sol_transmittance, f
119
119
  fp += fp12 * (az2 - sharp) * (sol_altitude - alt1);
120
120
  fp += fp22 * (sharp - az1) * (sol_altitude - alt1);
121
121
  fp /= (az2 - az1) * (alt2 - alt1);
122
- const f_eff = posture === "seated" ? 0.696 : 0.725; // fraction of the body surface exposed to environmental radiation
122
+ const f_eff = posture === "sitting" ? 0.696 : 0.725; // fraction of the body surface exposed to environmental radiation
123
123
  const sw_abs = asw;
124
124
  const lw_abs = 0.95;
125
125
  const e_diff = f_eff * f_svv * 0.5 * sol_transmittance * i_diff;
@@ -135,7 +135,6 @@ function solar_gain(sol_altitude, sharp, sol_radiation_dir, sol_transmittance, f
135
135
  const d_mrt = erf / (hr * f_eff);
136
136
  return { erf: (0, utilities_js_1.round)(erf, 1), delta_mrt: (0, utilities_js_1.round)(d_mrt, 1) };
137
137
  }
138
- exports.solar_gain = solar_gain;
139
138
  /**
140
139
  *
141
140
  * @param {number[]} arr
@@ -160,4 +159,3 @@ function find_span(arr, x) {
160
159
  }
161
160
  return x === arr[0] ? 0 : -1;
162
161
  }
163
- exports.find_span = find_span;