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.adaptive_ashrae_array = exports.adaptive_ashrae = void 0;
4
- const utilities_js_1 = require("../utilities/utilities.js");
3
+ exports.adaptive_ashrae = adaptive_ashrae;
4
+ exports.adaptive_ashrae_array = adaptive_ashrae_array;
5
5
  const t_o_js_1 = require("../psychrometrics/t_o.js");
6
+ const utilities_js_1 = require("../utilities/utilities.js");
6
7
  const adaptive_en_js_1 = require("./adaptive_en.js");
7
8
  /**
8
9
  * @typedef {object} AdaptiveAshraeResult
@@ -80,7 +81,7 @@ const adaptive_en_js_1 = require("./adaptive_en.js");
80
81
  */
81
82
  function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
82
83
  const standard = "ASHRAE";
83
- if (units === "IP") {
84
+ if (units.toUpperCase() === "IP") {
84
85
  ({
85
86
  tdb,
86
87
  tr,
@@ -118,7 +119,7 @@ function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs
118
119
  let tmp_cmf_90_up = t_cmf + 2.5 + ce;
119
120
  const acceptability_80 = tmp_cmf_80_low <= to && to <= tmp_cmf_80_up;
120
121
  const acceptability_90 = tmp_cmf_90_low <= to && to <= tmp_cmf_90_up;
121
- if (units === "IP") {
122
+ if (units.toUpperCase() === "IP") {
122
123
  ({
123
124
  tmp_cmf: t_cmf,
124
125
  tmp_cmf_80_low,
@@ -143,7 +144,6 @@ function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs
143
144
  acceptability_90,
144
145
  };
145
146
  }
146
- exports.adaptive_ashrae = adaptive_ashrae;
147
147
  /**
148
148
  * @typedef {object} AdaptiveAshraeArrayResult
149
149
  * @property {number[]} tmp_cmf - Comfort temperature a that specific running mean temperature, default in [°C] or in [°F]
@@ -287,4 +287,3 @@ function adaptive_ashrae_array(tdb, tr, t_running_mean, v, units = "SI", limit_i
287
287
  acceptability_90,
288
288
  };
289
289
  }
290
- exports.adaptive_ashrae_array = adaptive_ashrae_array;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get_ce = exports.adaptive_en_array = exports.adaptive_en = void 0;
3
+ exports.adaptive_en = adaptive_en;
4
+ exports.adaptive_en_array = adaptive_en_array;
5
+ exports.get_ce = get_ce;
4
6
  const t_o_js_1 = require("../psychrometrics/t_o.js");
5
7
  const utilities_js_1 = require("../utilities/utilities.js");
6
8
  /**
@@ -128,7 +130,6 @@ function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = tr
128
130
  tmp_cmf_cat_iii_low: (0, utilities_js_1.round)(t_cmf_iii_lower, 1),
129
131
  };
130
132
  }
131
- exports.adaptive_en = adaptive_en;
132
133
  /**
133
134
  * @typedef {object} AdaptiveEnArrayResult - a result set containing the results for {@link #adative_en_array|adaptive_en_array}
134
135
  * @property {number[]} tmp_cmf - Comfort temperature at that specific running mean temperature, default in [°C] or in [°F]
@@ -275,7 +276,6 @@ function adaptive_en_array(tdb, tr, t_running_mean, v, units = "SI", limit_input
275
276
  tmp_cmf_cat_iii_low: t_cmf_iii_lower,
276
277
  };
277
278
  }
278
- exports.adaptive_en_array = adaptive_en_array;
279
279
  /**
280
280
  *
281
281
  * @param {number} v
@@ -297,4 +297,3 @@ function get_ce(v, to) {
297
297
  }
298
298
  return ce;
299
299
  }
300
- exports.get_ce = get_ce;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ankle_draft = void 0;
4
- const pmv_js_1 = require("./pmv.js");
3
+ exports.ankle_draft = ankle_draft;
5
4
  const utilities_js_1 = require("../utilities/utilities.js");
5
+ const pmv_js_1 = require("./pmv.js");
6
6
  /**
7
7
  * @public
8
8
  * @typedef {Object} AnkleDraftRet
@@ -77,6 +77,5 @@ function ankle_draft(tdb, tr, vr, rh, met, clo, v_ankle, units = "SI") {
77
77
  (1 + Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv))) *
78
78
  100, 1);
79
79
  const acceptability = ppd_val <= 20;
80
- return { PPD_ad: ppd_val, Acceptability: acceptability };
80
+ return { ppd_ad: ppd_val, acceptability: acceptability };
81
81
  }
82
- exports.ankle_draft = ankle_draft;
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.at = void 0;
4
- const utilities_js_1 = require("../utilities/utilities.js");
3
+ exports.at = at;
5
4
  const psy_ta_rh_js_1 = require("../psychrometrics/psy_ta_rh.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * @typedef {object} AtResult
8
+ * @property {number} at - Apparent Temperature, [°C]
9
+ * @public
10
+ */
6
11
  /**
7
12
  * Calculates the Apparent Temperature (AT). The AT is defined as the temperature at the reference
8
13
  * humidity level producing the same amount of discomfort as that experienced under the current ambient
@@ -27,11 +32,11 @@ const psy_ta_rh_js_1 = require("../psychrometrics/psy_ta_rh.js");
27
32
  * @param {object} [kwargs] - other parameters
28
33
  * @param {boolean} [kwargs.round=true] - if True rounds output value, if False it does not round it
29
34
  *
30
- * @returns {number} apparent temperature, [°C]
35
+ * @returns {AtResult} set containing results for the model
31
36
  *
32
37
  * @example
33
38
  * const result = at(25, 30, 0.1);
34
- * console.log(result); // 24.1
39
+ * console.log(result); // {at: 24.1}
35
40
  */
36
41
  function at(tdb, rh, v, q, kwargs = { round: true }) {
37
42
  // dividing it by 100 since the at eq. requires p_vap to be in hPa
@@ -47,6 +52,5 @@ function at(tdb, rh, v, q, kwargs = { round: true }) {
47
52
  if (kwargs.round) {
48
53
  t_at = (0, utilities_js_1.round)(t_at, 1);
49
54
  }
50
- return t_at;
55
+ return { at: t_at };
51
56
  }
52
- exports.at = at;
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
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");
3
+ exports.athb = athb;
4
+ exports.athb_array = athb_array;
5
5
  const utilities_js_1 = require("../utilities/utilities.js");
6
+ const pmv_ppd_js_1 = require("./pmv_ppd.js");
7
+ /**
8
+ * @typedef {Object} AthbResult
9
+ * @property {number} athb_pmv - Predicted Mean Vote calculated with the Adaptive Thermal Heat Balance framework
10
+ * @public
11
+ */
6
12
  /**
7
13
  * Return the PMV value calculated with the Adaptive Thermal Heat Balance
8
14
  * Framework {@link #ref_27|[27]}. The adaptive thermal heat balance (ATHB) framework
@@ -36,7 +42,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
36
42
  * The running mean temperature can be calculated using the function
37
43
  * jsthermalcomfort.utilities.running_mean_outdoor_temperature.
38
44
  *
39
- * @returns { number } athb_pmv - Predicted Mean Vote calculated with the Adaptive Thermal Heat Balance framework
45
+ * @returns { AthbResult } set containing results for the model
40
46
  *
41
47
  * @example
42
48
  * const tdb = 25;
@@ -47,7 +53,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
47
53
  * const t_running_mean = 20;
48
54
  *
49
55
  * const athb_result = athb(tdb, tr, vr, rh, met, t_running_mean);
50
- * console.log(athb_result); // Output: 0.2
56
+ * console.log(athb_result); // Output: {athb_pmv: 0.2}
51
57
  */
52
58
  function athb(tdb, tr, vr, rh, met, t_running_mean) {
53
59
  const met_adapted = met - (0.234 * t_running_mean) / 58.2;
@@ -58,15 +64,16 @@ function athb(tdb, tr, vr, rh, met, t_running_mean) {
58
64
  const pmv_res = (0, pmv_ppd_js_1.pmv_calculation)(tdb, tr, vr, rh, met_adapted, clo_adapted, 0);
59
65
  const ts = 0.303 * Math.exp(-0.036 * met_adapted * 58.15) + 0.028;
60
66
  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);
67
+ return {
68
+ athb_pmv: (0, utilities_js_1.round)(1.484 +
69
+ 0.0276 * l_adapted -
70
+ 0.9602 * met_adapted -
71
+ 0.0342 * t_running_mean +
72
+ 0.0002264 * l_adapted * t_running_mean +
73
+ 0.018696 * met_adapted * t_running_mean -
74
+ 0.0002909 * l_adapted * met_adapted * t_running_mean, 3),
75
+ };
68
76
  }
69
- exports.athb = athb;
70
77
  /**
71
78
  * Return the PMV value calculated with the Adaptive Thermal Heat Balance
72
79
  * Framework {@link #ref_27|[27]}. The adaptive thermal heat balance (ATHB) framework
@@ -132,4 +139,3 @@ function athb_array(tdb, tr, vr, rh, met, t_running_mean) {
132
139
  0.018696 * met_adapted[i] * t_running_mean[i] -
133
140
  0.0002909 * lValue * met_adapted[i] * t_running_mean[i], 3));
134
141
  }
135
- exports.athb_array = athb_array;
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clo_tout_array = exports.clo_tout = void 0;
3
+ exports.clo_tout = clo_tout;
4
+ exports.clo_tout_array = clo_tout_array;
4
5
  const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * @typedef {object} CloToutResult
8
+ * @property {number} clo - Representative clothing insulation Icl, [clo]
9
+ * @public
10
+ */
5
11
  /**
6
12
  * Representative clothing insulation Icl as a function of outdoor air
7
13
  * temperature at 06:00 a.m {@link #ref_4|[4]}.
@@ -21,16 +27,16 @@ const utilities_js_1 = require("../utilities/utilities.js");
21
27
  * @param {("IP" | "SI")} units - select the SI (International System of Units)
22
28
  * or the IP (Imperial Units) system.
23
29
  *
24
- * @returns {number} Representative clothing insulation Icl, [clo]
30
+ * @returns {CloToutResult} set containing results for the model
25
31
  */
26
32
  function clo_tout(tout, units = "SI") {
27
33
  const t = units === "IP" ? (0, utilities_js_1.units_converter)({ tmp: tout }).tmp : tout;
28
34
  let clo = t < 26 ? Math.pow(10, (-0.1635 - 0.0066 * t)) : 0.46;
29
35
  clo = t < 5 ? 0.818 - 0.0364 * t : clo;
30
36
  clo = t < -5 ? 1 : clo;
31
- return (0, utilities_js_1.round)(clo, 2);
37
+ clo = (0, utilities_js_1.round)(clo, 2);
38
+ return { clo_tout: clo };
32
39
  }
33
- exports.clo_tout = clo_tout;
34
40
  /**
35
41
  * Representative clothing insulation Icl as a function of outdoor air
36
42
  * temperature at 06:00 a.m {@link #ref_4|[4]}.
@@ -55,4 +61,3 @@ exports.clo_tout = clo_tout;
55
61
  function clo_tout_array(tout, units = "SI") {
56
62
  return tout.map((t) => clo_tout(t, units));
57
63
  }
58
- exports.clo_tout_array = clo_tout_array;
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.brent = exports.cooling_effect = void 0;
3
+ exports.cooling_effect = cooling_effect;
4
+ exports.brent = brent;
4
5
  const utilities_js_1 = require("../utilities/utilities.js");
5
6
  const set_tmp_js_1 = require("./set_tmp.js");
7
+ /**
8
+ * @typedef {object} CoolingEffectResult
9
+ * @property {number} ce - Cooling Effect, default in [°C] in [°F] if `units` = 'IP'
10
+ * @public
11
+ */
6
12
  /**
7
13
  * Returns the value of the Cooling Effect ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#Cooling_Effect|CE} )
8
14
  * calculated in compliance with the ASHRAE 55 2020 Standard {@link #ref_1|[1]}.
@@ -39,15 +45,15 @@ const set_tmp_js_1 = require("./set_tmp.js");
39
45
  *
40
46
  * @param {number} [wme=0] - external work
41
47
  * @param {'SI'|'IP'} [units= "SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
42
- * @returns {number} ce - Cooling Effect, default in [°C] in [°F] if `units` = 'IP'
48
+ * @returns {CoolingEffectResult} ce - Cooling Effect, default in [°C] in [°F] if `units` = 'IP'
43
49
  *
44
50
  * @example
45
51
  * const CE = cooling_effect(25, 25, 0.3, 50, 1.2, 0.5);
46
- * console.log(CE); // Output: 1.64
52
+ * console.log(CE); // Output: {ce: 1.64}
47
53
  *
48
54
  * // For users who want to use the IP system
49
55
  * const CE_IP = cooling_effect(77, 77, 1.64, 50, 1, 0.6, "IP");
50
- * console.log(CE_IP); // Output: 3.74
56
+ * console.log(CE_IP); // Output: {ce: 3.74}
51
57
  */
52
58
  function cooling_effect(tdb, tr, vr, rh, met, clo, wme = 0, units = "SI") {
53
59
  if (units.toLowerCase() === "ip") {
@@ -57,18 +63,18 @@ function cooling_effect(tdb, tr, vr, rh, met, clo, wme = 0, units = "SI") {
57
63
  vr = result.vr;
58
64
  }
59
65
  if (vr <= 0.1) {
60
- return 0;
66
+ return { ce: 0 };
61
67
  }
62
68
  const still_air_threshold = 0.1;
63
69
  const initial_set_tmp = (0, set_tmp_js_1.set_tmp)(tdb, tr, vr, rh, met, clo, wme, undefined, undefined, undefined, undefined, false, {
64
70
  round: false,
65
71
  calculate_ce: true,
66
- });
72
+ }).set;
67
73
  function func(x) {
68
74
  return ((0, set_tmp_js_1.set_tmp)(tdb - x, tr - x, still_air_threshold, rh, met, clo, wme, undefined, undefined, undefined, undefined, false, {
69
75
  round: false,
70
76
  calculate_ce: true,
71
- }) - initial_set_tmp);
77
+ }).set - initial_set_tmp);
72
78
  }
73
79
  let ce;
74
80
  try {
@@ -84,9 +90,9 @@ function cooling_effect(tdb, tr, vr, rh, met, clo, wme = 0, units = "SI") {
84
90
  if (units.toLowerCase() === "ip") {
85
91
  ce = (ce / 1.8) * 3.28;
86
92
  }
87
- return (0, utilities_js_1.round)(ce, 2);
93
+ ce = (0, utilities_js_1.round)(ce, 2);
94
+ return { ce: ce };
88
95
  }
89
- exports.cooling_effect = cooling_effect;
90
96
  // https://gist.github.com/ryanspradlin/18c1010b7dd2d875284933d018c5c908
91
97
  // Derived from: https://en.wikipedia.org/wiki/Brent%27s_method#Algorithm
92
98
  // Brent's method is a hybrid root-finding algorithm that combines the
@@ -161,4 +167,3 @@ function brent(f, lowerBound, upperBound, tolerance = 1e-6, maxIterations = 100)
161
167
  // Could not achieve required tolerance within iteration limit.
162
168
  throw new Error("Could not achieve required tolerance within iteration limit.");
163
169
  }
164
- exports.brent = brent;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.discomfort_index_array = exports.discomfort_index = void 0;
3
+ exports.discomfort_index = discomfort_index;
4
+ exports.discomfort_index_array = discomfort_index_array;
4
5
  const utilities_js_1 = require("../utilities/utilities.js");
5
6
  /**
6
7
  * @typedef {Object} DiscomfortIndexReturnType - a result set containing the discomfort index and the classification of the
@@ -41,7 +42,6 @@ function discomfort_index(tdb, rh) {
41
42
  discomfort_condition: condition,
42
43
  };
43
44
  }
44
- exports.discomfort_index = discomfort_index;
45
45
  /**
46
46
  * @typedef {Object} DiscomfortIndexArrayReturnType - a result set containing an array of discomfort index and an array
47
47
  * of classification of the thermal comfort conditions
@@ -79,7 +79,6 @@ function discomfort_index_array(tdb, rh) {
79
79
  discomfort_condition: discomfortCondition,
80
80
  };
81
81
  }
82
- exports.discomfort_index_array = discomfort_index_array;
83
82
  /**
84
83
  *
85
84
  * Determine the discomfort categories based on DI.
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.e_pmv_array = exports.e_pmv = void 0;
4
- const pmv_js_1 = require("./pmv.js");
3
+ exports.e_pmv = e_pmv;
4
+ exports.e_pmv_array = e_pmv_array;
5
5
  const utilities_js_1 = require("../utilities/utilities.js");
6
+ const pmv_js_1 = require("./pmv.js");
7
+ /**
8
+ * @typedef {Object} EPmvResult
9
+ * @property {number} e_pmv - Predicted Mean Vote
10
+ * @public
11
+ */
6
12
  /**
7
13
  * @typedef {Object} E_pmvKwargs
8
14
  * @property {'SI'|'IP'} units - select the SI (International System of Units) or the IP (Imperial Units) system.
@@ -52,7 +58,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
52
58
  * @param {number} [wme=0] - External work
53
59
  * @param {E_pmvKwargs} [kwargs] - additional arguments
54
60
  *
55
- * @returns {number} pmv - Predicted Mean Vote
61
+ * @returns {EPmvResult} set containing results for the model
56
62
  *
57
63
  * @example
58
64
  * const tdb = 28;
@@ -67,7 +73,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
67
73
  * const e_coefficient = 0.6;
68
74
  *
69
75
  * const result = e_pmv(tdb, tr, v_r, rh, met, clo_d, e_coefficient);
70
- * console.log(result) // output 0.51
76
+ * console.log(result) // output {e_pmv: 0.51}
71
77
  */
72
78
  function e_pmv(tdb, tr, vr, rh, met, clo, e_coefficient, wme = 0, kwargs = {}) {
73
79
  const default_kwargs = {
@@ -78,9 +84,9 @@ function e_pmv(tdb, tr, vr, rh, met, clo, e_coefficient, wme = 0, kwargs = {}) {
78
84
  let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
79
85
  met = _pmv > 0 ? met * (1 + _pmv * -0.067) : met;
80
86
  _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
81
- return (0, utilities_js_1.round)(_pmv * e_coefficient, 2);
87
+ _pmv = (0, utilities_js_1.round)(_pmv * e_coefficient, 2);
88
+ return { e_pmv: _pmv };
82
89
  }
83
- exports.e_pmv = e_pmv;
84
90
  /**
85
91
  * Returns Adjusted Predicted Mean Votes with Expectancy Factor (ePMV). This index was developed by
86
92
  * Fanger, P. O. et al. (2002). In non-air-conditioned buildings in warm climates, occupants may sense
@@ -151,4 +157,3 @@ function e_pmv_array(tdb, tr, vr, rh, met, clo, e_coefficient, wme, kwargs = {})
151
157
  return (0, utilities_js_1.round)(value * e_coefficient[i], 2);
152
158
  });
153
159
  }
154
- exports.e_pmv_array = e_pmv_array;
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.heat_index = void 0;
3
+ exports.heat_index = heat_index;
4
4
  const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * @typedef {object} HeatIndexResult
7
+ * @property {number} hi - Heat Index, default in [°C] in [°F] if `units` = 'IP'.
8
+ * @public
9
+ */
5
10
  /**
6
11
  * Calculates the Heat Index (HI). It combines air temperature and relative humidity to determine an apparent temperature.
7
12
  * The HI equation {@link #ref_12|[12]} is derived by multiple regression analysis in temperature and relative humidity from the first version
@@ -17,17 +22,14 @@ const utilities_js_1 = require("../utilities/utilities.js");
17
22
  * @param {boolean} [options.round=true] - If True rounds output value, if False it does not round it.
18
23
  * @param {"SI" | "IP"} [options.units="SI"] - Select the SI (International System of Units) or the IP (Imperial Units) system.
19
24
  *
20
- * @returns {number} Heat Index, default in [°C] in [°F] if `units` = 'IP'.
25
+ * @returns {HeatIndexResult} set containing results for the model
21
26
  *
22
27
  * @example
23
- * const hi = heat_index(25, 50); // returns 25.9
28
+ * const hi = heat_index(25, 50); // returns {hi: 25.9}
24
29
  *
25
30
  * @category Thermophysiological models
26
31
  */
27
32
  function heat_index(tdb, rh, options = { round: true, units: "SI" }) {
28
- /**
29
- * @type {number}
30
- */
31
33
  let hi;
32
34
  let tdb_squared = Math.pow(tdb, 2);
33
35
  let rh_squared = Math.pow(rh, 2);
@@ -55,6 +57,6 @@ function heat_index(tdb, rh, options = { round: true, units: "SI" }) {
55
57
  0.00085282 * tdb * rh_squared -
56
58
  0.00000199 * tdb_squared * rh_squared;
57
59
  }
58
- return options.round === undefined || options.round ? (0, utilities_js_1.round)(hi, 1) : hi;
60
+ hi = options.round === undefined || options.round ? (0, utilities_js_1.round)(hi, 1) : hi;
61
+ return { hi: hi };
59
62
  }
60
- exports.heat_index = heat_index;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.humidex = void 0;
3
+ exports.humidex = humidex;
4
4
  const utilities_js_1 = require("../utilities/utilities.js");
5
5
  /**
6
6
  * @typedef {object} HumidexResult - a result set containing the humidex and
@@ -60,4 +60,3 @@ function humidex(tdb, rh, options = { round: true }) {
60
60
  }
61
61
  return { humidex: hi, discomfort: stress_category };
62
62
  }
63
- exports.humidex = humidex;
@@ -12,6 +12,8 @@ const wc_js_1 = require("./wc.js");
12
12
  const adaptive_en_js_1 = require("./adaptive_en.js");
13
13
  const at_js_1 = require("./at.js");
14
14
  const pmv_ppd_js_1 = require("./pmv_ppd.js");
15
+ const pmv_ppd_ashrae_js_1 = require("./pmv_ppd_ashrae.js");
16
+ const pmv_ppd_iso_js_1 = require("./pmv_ppd_iso.js");
15
17
  const adaptive_ashrae_js_1 = require("./adaptive_ashrae.js");
16
18
  const solar_gain_js_1 = require("./solar_gain.js");
17
19
  const cooling_effect_js_1 = require("./cooling_effect.js");
@@ -56,6 +58,8 @@ exports.default = {
56
58
  pet_steady: pet_steady_js_1.pet_steady,
57
59
  pmv_ppd: pmv_ppd_js_1.pmv_ppd,
58
60
  pmv_ppd_array: pmv_ppd_js_1.pmv_ppd_array,
61
+ pmv_ppd_ashrae: pmv_ppd_ashrae_js_1.pmv_ppd_ashrae,
62
+ pmv_ppd_iso: pmv_ppd_iso_js_1.pmv_ppd_iso,
59
63
  pmv: pmv_js_1.pmv,
60
64
  pmv_array: pmv_js_1.pmv_array,
61
65
  solar_gain: solar_gain_js_1.solar_gain,
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.net = void 0;
3
+ exports.net = net;
4
4
  const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * @typedef {object} NetResult
7
+ * @property {number} net - Normal Effective Temperature, [°C]
8
+ * @public
9
+ */
5
10
  /**
6
11
  * Calculates the Normal Effective Temperature (NET). Missenard (1933)
7
12
  * devised a formula for calculating effective temperature. The index
@@ -31,20 +36,19 @@ const utilities_js_1 = require("../utilities/utilities.js");
31
36
  * @param {boolean} [options.round = true] - If true, rounds output value. If
32
37
  * false, it does not.
33
38
  *
34
- * @returns {number} Normal Effective Temperature, [°C]
39
+ * @returns {NetResult} set containing results for the
35
40
  *
36
41
  * @example
37
42
  * const result = net(37, 100, 0.1);
38
- * console.log(result); // -> 37
43
+ * console.log(result); // -> {net: 37}
39
44
  */
40
45
  function net(tdb, rh, v, options = { round: true }) {
41
46
  const frac = 1.0 / (1.76 + 1.4 * Math.pow(v, 0.75));
42
- const et = 37 -
47
+ let et = 37 -
43
48
  (37 - tdb) / (0.68 - 0.0014 * rh + frac) -
44
49
  0.29 * tdb * (1 - 0.01 * rh);
45
50
  if (options.round) {
46
- return (0, utilities_js_1.round)(et, 1);
51
+ et = (0, utilities_js_1.round)(et, 1);
47
52
  }
48
- return et;
53
+ return { net: et };
49
54
  }
50
- exports.net = net;
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pet_steady = void 0;
4
- const utilities_js_1 = require("../utilities/utilities.js");
3
+ exports.pet_steady = pet_steady;
5
4
  const p_sat_js_1 = require("../psychrometrics/p_sat.js");
6
- const utilities_js_2 = require("../utilities/utilities.js");
5
+ const utilities_js_1 = require("../utilities/utilities.js");
6
+ /**
7
+ * @typedef {object} PetSteadyResult
8
+ * @property {number} pet - Steady-state PET under the given ambient conditions
9
+ * @public
10
+ */
7
11
  /**
8
12
  * The steady physiological equivalent temperature (PET) is calculated using the Munich
9
13
  * Energy-balance Model for Individuals (MEMI), which simulates the human body's thermal
@@ -25,6 +29,9 @@ const utilities_js_2 = require("../utilities/utilities.js");
25
29
  * PET calculation routine, and implementing a state-of-the-art vapour diffusion model.
26
30
  * Walther and Goestchel (2018) model is therefore used to calculate the PET.
27
31
  *
32
+ * **Warning:** Some tests are currently failing for this function. Please refer to the test
33
+ * suite or the project's issue tracker for more details.
34
+ *
28
35
  * @public
29
36
  * @memberof models
30
37
  * @docname Physiological Equivalent Temperature (PET)
@@ -43,11 +50,11 @@ const utilities_js_2 = require("../utilities/utilities.js");
43
50
  * @param {number} [height=1.8] - height, [m]
44
51
  * @param {number} [wme=0] - external work, [W/(m2)]
45
52
  *
46
- * @returns {number} Steady-state PET under the given ambient conditions
53
+ * @returns {PetSteadyResult} set containing results for the model
47
54
  *
48
55
  * @example
49
56
  * const result = pet_steady(20, 20, 50, 0.15, 1.37, 0.5);
50
- * console.log(result); // 18.85
57
+ * console.log(result); // {pet: 18.85}
51
58
  */
52
59
  function pet_steady(tdb, tr, v, rh, met, clo, p_atm = 1013.25, position = 1, age = 23, sex = 1, weight = 75, height = 1.8, wme = 0) {
53
60
  const met_factor = 58.2; // met conversion factor
@@ -56,9 +63,8 @@ function pet_steady(tdb, tr, v, rh, met, clo, p_atm = 1013.25, position = 1, age
56
63
  const t_guess = [36.7, 34, 0.5 * (tdb + tr)];
57
64
  // solve for Tc, Tsk, Tcl temperatures
58
65
  const t_stable = newtonRaphson((tx) => solve_pet(tx, tdb, tr, v, rh, met, clo, true, p_atm, position, age, sex, weight, height, wme), t_guess);
59
- return pet_fc(t_stable);
66
+ return { pet: pet_fc(t_stable) };
60
67
  }
61
- exports.pet_steady = pet_steady;
62
68
  /**
63
69
  * Function to find the solution.
64
70
  *
@@ -72,7 +78,7 @@ function pet_fc(_t_stable) {
72
78
  const result = solve_pet(_t_stable, tx[0], tx[0], undefined, undefined, undefined, undefined, false);
73
79
  return [result];
74
80
  }, [pet_guess]);
75
- return (0, utilities_js_2.round)(result[0], 2);
81
+ return (0, utilities_js_1.round)(result[0], 2);
76
82
  }
77
83
  /**
78
84
  * @typedef {Object} VasomotricitytRet
@@ -122,7 +128,7 @@ function sweat_rate(t_body) {
122
128
  // In this case, Tbody < Tbody_set --> The sweat flow is 0 from Gagge's model
123
129
  sig_body = 0.0;
124
130
  }
125
- let m_rsw = 304.94 * Math.pow(10, -3) * sig_body;
131
+ let m_rsw = 304.94 * sig_body;
126
132
  // 500 g/m^2/h is the upper sweat rate limit
127
133
  if (m_rsw > 500) {
128
134
  m_rsw = 500;
@@ -182,7 +188,7 @@ function solve_pet(t_arr, _tdb, _tr, _v = 0.1, _rh = 50, _met = 80, _clo = 0.9,
182
188
  const i_m = 0.38; // Woodcock ratio for vapour transfer through clothing [-]
183
189
  // Calculation of the Burton surface increase coefficient, k = 0.31 for Hoeppe:
184
190
  const fcl = 1 + 0.31 * _clo; // Increase heat exchange surface depending on clothing level
185
- const f_a_cl = (173.51 * _clo - 2.36 - 100.76 * _clo * _clo + 19.28 * Math.pow(_clo, 3.0)) / 100;
191
+ let f_a_cl = (173.51 * _clo - 2.36 - 100.76 * _clo * _clo + 19.28 * Math.pow(_clo, 3.0)) / 100;
186
192
  const a_clo = a_dubois * f_a_cl + a_dubois * (fcl - 1.0); // clothed body surface area
187
193
  const f_eff = position === 2 ? 0.696 : 0.725; // effective radiation factor
188
194
  const a_r_eff = a_dubois * f_eff; // Effective radiative area depending on the position of the subject
@@ -225,19 +231,22 @@ function solve_pet(t_arr, _tdb, _tr, _v = 0.1, _rh = 50, _met = 80, _clo = 0.9,
225
231
  // Clothed fraction of the body approximation
226
232
  const r_cl = _clo / 6.45; // Conversion in [m2.K/W]
227
233
  let y = 0;
228
- if (f_a_cl > 1.0) {
229
- f_a_cl = 1.0;
230
- }
234
+ f_a_cl = Math.min(f_a_cl, 1.0);
231
235
  if (_clo >= 2.0) {
232
236
  y = 1.0;
233
237
  }
234
- if (0.6 < _clo < 2.0) {
238
+ else if (_clo > 0.6) {
235
239
  y = (height - 0.2) / height;
236
240
  }
237
- if (0.6 >= _clo > 0.3) {
241
+ else if (_clo > 0.3) {
238
242
  y = 0.5;
239
243
  }
240
- if (0.3 >= _clo > 0.0) {
244
+ else if (_clo > 0.0) {
245
+ y = 0.1;
246
+ }
247
+ // Ensure y is non-zero before using it in radius calculations, in particular
248
+ // for _clo <= 0 (nude case), to avoid division by zero.
249
+ if (y === 0) {
241
250
  y = 0.1;
242
251
  }
243
252
  // calculation of the clothing radius depending on the clothing level (6.28 = 2*
@@ -260,7 +269,7 @@ function solve_pet(t_arr, _tdb, _tr, _v = 0.1, _rh = 50, _met = 80, _clo = 0.9,
260
269
  const he_diff = hc * lr; // diffusion coefficient of air layer
261
270
  const fecl = 1 / (1 + 0.92 * hc * r_cl); // Burton efficiency factor
262
271
  let e_max = he_diff * fecl * (p_v_sk - vpa); // maximum diffusion at skin surface
263
- if (e_max < 0.001 && e_max >= 0) {
272
+ if (e_max === 0) {
264
273
  // added this otherwise e_req / e_max cannot be calculated
265
274
  e_max = 0.001;
266
275
  }