jsthermalcomfort 1.3.1 → 1.4.0

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 (39) hide show
  1. package/lib/cjs/models/adaptive_ashrae.js +15 -3
  2. package/lib/cjs/models/adaptive_en.js +28 -9
  3. package/lib/cjs/models/index.js +4 -1
  4. package/lib/cjs/models/phs.js +9 -9
  5. package/lib/cjs/models/wind_chill_temperature.js +42 -0
  6. package/lib/cjs/types/models/adaptive_ashrae.d.ts +1 -1
  7. package/lib/cjs/types/models/adaptive_ashrae.d.ts.map +1 -1
  8. package/lib/cjs/types/models/adaptive_en.d.ts +1 -1
  9. package/lib/cjs/types/models/adaptive_en.d.ts.map +1 -1
  10. package/lib/cjs/types/models/index.d.ts +3 -1
  11. package/lib/cjs/types/models/index.d.ts.map +1 -1
  12. package/lib/cjs/types/models/wind_chill_temperature.d.ts +4 -0
  13. package/lib/cjs/types/models/wind_chill_temperature.d.ts.map +1 -0
  14. package/lib/cjs/types/utilities/index.d.ts +3 -1
  15. package/lib/cjs/types/utilities/index.d.ts.map +1 -1
  16. package/lib/cjs/types/utilities/utilities.d.ts +25 -14
  17. package/lib/cjs/types/utilities/utilities.d.ts.map +1 -1
  18. package/lib/cjs/utilities/index.js +3 -1
  19. package/lib/cjs/utilities/utilities.js +52 -14
  20. package/lib/esm/models/adaptive_ashrae.js +15 -3
  21. package/lib/esm/models/adaptive_en.js +28 -9
  22. package/lib/esm/models/index.js +3 -1
  23. package/lib/esm/models/phs.js +9 -9
  24. package/lib/esm/models/wind_chill_temperature.js +39 -0
  25. package/lib/esm/types/models/adaptive_ashrae.d.ts +1 -1
  26. package/lib/esm/types/models/adaptive_ashrae.d.ts.map +1 -1
  27. package/lib/esm/types/models/adaptive_en.d.ts +1 -1
  28. package/lib/esm/types/models/adaptive_en.d.ts.map +1 -1
  29. package/lib/esm/types/models/index.d.ts +3 -1
  30. package/lib/esm/types/models/index.d.ts.map +1 -1
  31. package/lib/esm/types/models/wind_chill_temperature.d.ts +4 -0
  32. package/lib/esm/types/models/wind_chill_temperature.d.ts.map +1 -0
  33. package/lib/esm/types/utilities/index.d.ts +3 -1
  34. package/lib/esm/types/utilities/index.d.ts.map +1 -1
  35. package/lib/esm/types/utilities/utilities.d.ts +25 -14
  36. package/lib/esm/types/utilities/utilities.d.ts.map +1 -1
  37. package/lib/esm/utilities/index.js +3 -2
  38. package/lib/esm/utilities/utilities.js +51 -13
  39. package/package.json +1 -1
@@ -41,6 +41,7 @@ const adaptive_en_js_1 = require("./adaptive_en.js");
41
41
  * @param {boolean} limit_inputs - By default, if the inputs are outsude the standard applicability limits the
42
42
  * function returns nan. If False returns pmv and ppd values even if input values are
43
43
  * outside the applicability limits of the model.
44
+ * @param {boolean} [round_output=true] - if true, rounds `t_cmf` to one decimal place in SI before bounds are derived; if false, returns the unrounded values. Under `units = 'IP'` the rounded SI value is then converted to °F, so IP outputs carry the additional decimals from the °C-to-°F conversion.
44
45
  *
45
46
  * @returns {AdaptiveAshraeResult} set containing results for the model
46
47
  *
@@ -84,9 +85,18 @@ const ADAPTIVE_ASHRAE_SCHEMA = {
84
85
  v: { type: "number" },
85
86
  units: { enum: ["SI", "IP"] },
86
87
  limit_inputs: { type: "boolean" },
88
+ round_output: { type: "boolean", required: false },
87
89
  };
88
- function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
89
- (0, utilities_js_1.validateInputs)({ tdb, tr, t_running_mean, v, units: units.toUpperCase(), limit_inputs }, ADAPTIVE_ASHRAE_SCHEMA);
90
+ function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true, round_output = true) {
91
+ (0, utilities_js_1.validateInputs)({
92
+ tdb,
93
+ tr,
94
+ t_running_mean,
95
+ v,
96
+ units: units.toUpperCase(),
97
+ limit_inputs,
98
+ round_output,
99
+ }, ADAPTIVE_ASHRAE_SCHEMA);
90
100
  const standard = "ASHRAE";
91
101
  if (units.toUpperCase() === "IP") {
92
102
  ({
@@ -112,7 +122,9 @@ function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs
112
122
  if (warnings.length > 0 || !trm_valid)
113
123
  t_cmf = NaN;
114
124
  }
115
- t_cmf = (0, utilities_js_1.round)(t_cmf, 1);
125
+ if (round_output) {
126
+ t_cmf = (0, utilities_js_1.round)(t_cmf, 1);
127
+ }
116
128
  let tmp_cmf_80_low = t_cmf - 3.5;
117
129
  let tmp_cmf_90_low = t_cmf - 2.5;
118
130
  let tmp_cmf_80_up = t_cmf + 3.5 + ce;
@@ -46,6 +46,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
46
46
  * @param {boolean} [limit_inputs=true] - By default, if the inputs are outsude the standard applicability limits the
47
47
  * function returns nan. If False returns pmv and ppd values even if input values are
48
48
  * outside the applicability limits of the model.
49
+ * @param {boolean} [round_output=true] - if true, rounds the returned comfort temperature and bounds to one decimal place in the output unit (rounding is applied after any IP unit conversion); if false, returns the unrounded values.
49
50
  *
50
51
  * @returns {AdaptiveEnResult} result set
51
52
  *
@@ -73,9 +74,18 @@ const ADAPTIVE_EN_SCHEMA = {
73
74
  v: { type: "number" },
74
75
  units: { enum: ["SI", "IP"] },
75
76
  limit_inputs: { type: "boolean" },
77
+ round_output: { type: "boolean", required: false },
76
78
  };
77
- function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
78
- (0, utilities_js_1.validateInputs)({ tdb, tr, t_running_mean, v, units: units.toUpperCase(), limit_inputs }, ADAPTIVE_EN_SCHEMA);
79
+ function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true, round_output = true) {
80
+ (0, utilities_js_1.validateInputs)({
81
+ tdb,
82
+ tr,
83
+ t_running_mean,
84
+ v,
85
+ units: units.toUpperCase(),
86
+ limit_inputs,
87
+ round_output,
88
+ }, ADAPTIVE_EN_SCHEMA);
79
89
  const standard = "ISO";
80
90
  if (units.toLowerCase() == "ip") {
81
91
  ({
@@ -124,17 +134,26 @@ function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = tr
124
134
  tmp_cmf_cat_iii_low: t_cmf_iii_lower,
125
135
  }, "SI"));
126
136
  }
137
+ if (round_output) {
138
+ t_cmf = (0, utilities_js_1.round)(t_cmf, 1);
139
+ t_cmf_i_lower = (0, utilities_js_1.round)(t_cmf_i_lower, 1);
140
+ t_cmf_ii_lower = (0, utilities_js_1.round)(t_cmf_ii_lower, 1);
141
+ t_cmf_iii_lower = (0, utilities_js_1.round)(t_cmf_iii_lower, 1);
142
+ t_cmf_i_upper = (0, utilities_js_1.round)(t_cmf_i_upper, 1);
143
+ t_cmf_ii_upper = (0, utilities_js_1.round)(t_cmf_ii_upper, 1);
144
+ t_cmf_iii_upper = (0, utilities_js_1.round)(t_cmf_iii_upper, 1);
145
+ }
127
146
  return {
128
- tmp_cmf: (0, utilities_js_1.round)(t_cmf, 1),
147
+ tmp_cmf: t_cmf,
129
148
  acceptability_cat_i: acceptability_i,
130
149
  acceptability_cat_ii: acceptability_ii,
131
150
  acceptability_cat_iii: acceptability_iii,
132
- tmp_cmf_cat_i_up: (0, utilities_js_1.round)(t_cmf_i_upper, 1),
133
- tmp_cmf_cat_ii_up: (0, utilities_js_1.round)(t_cmf_ii_upper, 1),
134
- tmp_cmf_cat_iii_up: (0, utilities_js_1.round)(t_cmf_iii_upper, 1),
135
- tmp_cmf_cat_i_low: (0, utilities_js_1.round)(t_cmf_i_lower, 1),
136
- tmp_cmf_cat_ii_low: (0, utilities_js_1.round)(t_cmf_ii_lower, 1),
137
- tmp_cmf_cat_iii_low: (0, utilities_js_1.round)(t_cmf_iii_lower, 1),
151
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
152
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
153
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
154
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
155
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
156
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
138
157
  };
139
158
  }
140
159
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wc = exports.wbgt = exports.vertical_tmp_grad_ppd = exports.use_fans_heatwaves = exports.utci = exports.two_nodes = exports.set_tmp = exports.solar_gain = exports.pmv = exports.pmv_ppd_iso = exports.pmv_ppd_ashrae = exports.pmv_ppd = exports.pet_steady = exports.phs = exports.net = exports.humidex = exports.heat_index = exports.discomfort_index = exports.cooling_effect = exports.clo_tout = exports.ankle_draft = exports.at = exports.e_pmv = exports.athb = exports.a_pmv = exports.adaptive_en = exports.adaptive_ashrae = void 0;
3
+ exports.wind_chill_temperature = exports.wc = exports.wbgt = exports.vertical_tmp_grad_ppd = exports.use_fans_heatwaves = exports.utci = exports.two_nodes = exports.set_tmp = exports.solar_gain = exports.pmv = exports.pmv_ppd_iso = exports.pmv_ppd_ashrae = exports.pmv_ppd = exports.pet_steady = exports.phs = exports.net = exports.humidex = exports.heat_index = exports.discomfort_index = exports.cooling_effect = exports.clo_tout = exports.ankle_draft = exports.at = exports.e_pmv = exports.athb = exports.a_pmv = exports.adaptive_en = exports.adaptive_ashrae = void 0;
4
4
  const heat_index_js_1 = require("./heat_index.js");
5
5
  Object.defineProperty(exports, "heat_index", { enumerable: true, get: function () { return heat_index_js_1.heat_index; } });
6
6
  const phs_js_1 = require("./phs.js");
@@ -19,6 +19,8 @@ const set_tmp_js_1 = require("./set_tmp.js");
19
19
  Object.defineProperty(exports, "set_tmp", { enumerable: true, get: function () { return set_tmp_js_1.set_tmp; } });
20
20
  const wc_js_1 = require("./wc.js");
21
21
  Object.defineProperty(exports, "wc", { enumerable: true, get: function () { return wc_js_1.wc; } });
22
+ const wind_chill_temperature_js_1 = require("./wind_chill_temperature.js");
23
+ Object.defineProperty(exports, "wind_chill_temperature", { enumerable: true, get: function () { return wind_chill_temperature_js_1.wind_chill_temperature; } });
22
24
  const adaptive_en_js_1 = require("./adaptive_en.js");
23
25
  Object.defineProperty(exports, "adaptive_en", { enumerable: true, get: function () { return adaptive_en_js_1.adaptive_en; } });
24
26
  const at_js_1 = require("./at.js");
@@ -84,5 +86,6 @@ exports.default = {
84
86
  vertical_tmp_grad_ppd: vertical_tmp_grad_ppd_js_1.vertical_tmp_grad_ppd,
85
87
  wbgt: wbgt_js_1.wbgt,
86
88
  wc: wc_js_1.wc,
89
+ wind_chill_temperature: wind_chill_temperature_js_1.wind_chill_temperature,
87
90
  JOS3: JOS3_js_1.JOS3,
88
91
  };
@@ -194,11 +194,18 @@ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-2023", kw
194
194
  }, PHS_SCHEMA);
195
195
  const met_watt = met * MET_WATT_PER_MET;
196
196
  const wme_watt = wme * MET_WATT_PER_MET;
197
- const warnings = (0, utilities_js_1.check_standard_compliance)("ISO7933", {
197
+ let p_a;
198
+ if (model === "7933-2023") {
199
+ p_a = 0.6105 * Math.exp((17.27 * tdb) / (tdb + 237.3)) * (rh / 100);
200
+ }
201
+ else {
202
+ p_a = (((0, p_sat_js_1.p_sat)(tdb) / 1000) * rh) / 100;
203
+ }
204
+ const warnings = (0, utilities_js_1.check_standard_compliance)(model, {
198
205
  tdb,
199
206
  tr,
200
207
  v,
201
- rh,
208
+ p_a,
202
209
  met: met_watt * (0, utilities_js_1.body_surface_area)(joint_kwargs.weight, joint_kwargs.height),
203
210
  clo,
204
211
  });
@@ -218,13 +225,6 @@ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-2023", kw
218
225
  evap_load_wm2_min: NaN,
219
226
  };
220
227
  }
221
- let p_a;
222
- if (model === "7933-2023") {
223
- p_a = 0.6105 * Math.exp((17.27 * tdb) / (tdb + 237.3)) * (rh / 100);
224
- }
225
- else {
226
- p_a = (((0, p_sat_js_1.p_sat)(tdb) / 1000) * rh) / 100;
227
- }
228
228
  const variables_for_loop = _calculate_variables_for_loop(v, met_watt, posture, clo, tdb, p_a, joint_kwargs);
229
229
  const result = _phs_loop(tdb, tr, v, met_watt, clo, wme_watt, p_a, joint_kwargs, variables_for_loop);
230
230
  if (joint_kwargs.round) {
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wind_chill_temperature = wind_chill_temperature;
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
+ /**
6
+ * Calculates the Wind Chill Temperature (WCT) using the North American
7
+ * formula adopted by the US National Weather Service and Environment
8
+ * Canada in 2001 {@link https://en.wikipedia.org/wiki/Wind_chill#North_American_and_United_Kingdom_wind_chill_index}.
9
+ *
10
+ * WCT estimates the equivalent perceived air temperature on exposed skin
11
+ * given dry-bulb air temperature and 10 m wind speed. It is reported in
12
+ * the same unit as `tdb` (°C). The formula is empirical and is intended
13
+ * for cold-weather conditions; outside that range it still evaluates but
14
+ * carries no physical interpretation. Following `pythermalcomfort`, this
15
+ * implementation does not gate inputs against an applicability range; the
16
+ * formula is computed for any finite input.
17
+ *
18
+ * @public
19
+ * @memberof models
20
+ * @docname Wind chill temperature
21
+ *
22
+ * @param {number} tdb - dry-bulb air temperature, [°C]
23
+ * @param {number} v - wind speed 10 m above ground level, [km/h]
24
+ * @param {boolean} [round_output=true] - if true, rounds the returned value to one decimal place; if false, returns the unrounded value.
25
+ * @returns {{wct: number}} wind chill temperature, [°C]
26
+ */
27
+ const WCT_SCHEMA = {
28
+ tdb: { type: "number" },
29
+ v: { type: "number" },
30
+ round_output: { type: "boolean", required: false },
31
+ };
32
+ function wind_chill_temperature(tdb, v, round_output = true) {
33
+ (0, utilities_js_1.validateInputs)({ tdb, v, round_output }, WCT_SCHEMA);
34
+ let wct = 13.12 +
35
+ 0.6215 * tdb -
36
+ 11.37 * Math.pow(v, 0.16) +
37
+ 0.3965 * tdb * Math.pow(v, 0.16);
38
+ if (round_output) {
39
+ wct = (0, utilities_js_1.round)(wct, 1);
40
+ }
41
+ return { wct };
42
+ }
@@ -1,4 +1,4 @@
1
- export function adaptive_ashrae(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean): {
1
+ export function adaptive_ashrae(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean, round_output?: boolean): {
2
2
  tmp_cmf: number;
3
3
  tmp_cmf_80_low: number;
4
4
  tmp_cmf_80_up: number;
@@ -1 +1 @@
1
- {"version":3,"file":"adaptive_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_ashrae.js"],"names":[],"mappings":"AA4FA;;;;;;;;EA6EC;;;;;aA9Ja,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;sBACN,OAAO;;;;sBACP,OAAO"}
1
+ {"version":3,"file":"adaptive_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_ashrae.js"],"names":[],"mappings":"AA8FA;;;;;;;;EAwFC;;;;;aA3Ka,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;sBACN,OAAO;;;;sBACP,OAAO"}
@@ -1,4 +1,4 @@
1
- export function adaptive_en(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean): {
1
+ export function adaptive_en(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean, round_output?: boolean): {
2
2
  tmp_cmf: number;
3
3
  acceptability_cat_i: boolean;
4
4
  acceptability_cat_ii: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"adaptive_en.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_en.js"],"names":[],"mappings":"AA+EA;;;;;;;;;;;EAuFC;AACD;;;;;GAKG;AACH,0BAJW,MAAM,MACN,MAAM,GACJ,MAAM,CAclB;;;;;;;;aAhLa,MAAM;;;;yBACN,OAAO;;;;0BACP,OAAO;;;;2BACP,OAAO;;;;sBACP,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;yBACN,MAAM"}
1
+ {"version":3,"file":"adaptive_en.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_en.js"],"names":[],"mappings":"AAiFA;;;;;;;;;;;EA0GC;AACD;;;;;GAKG;AACH,0BAJW,MAAM,MACN,MAAM,GACJ,MAAM,CAclB;;;;;;;;aArMa,MAAM;;;;yBACN,OAAO;;;;0BACP,OAAO;;;;2BACP,OAAO;;;;sBACP,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;yBACN,MAAM"}
@@ -26,6 +26,7 @@ declare namespace _default {
26
26
  export { vertical_tmp_grad_ppd };
27
27
  export { wbgt };
28
28
  export { wc };
29
+ export { wind_chill_temperature };
29
30
  export { JOS3 };
30
31
  }
31
32
  export default _default;
@@ -56,6 +57,7 @@ import { use_fans_heatwaves } from "./use_fans_heatwave.js";
56
57
  import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd.js";
57
58
  import { wbgt } from "./wbgt.js";
58
59
  import { wc } from "./wc.js";
60
+ import { wind_chill_temperature } from "./wind_chill_temperature.js";
59
61
  import { JOS3 } from "./JOS3.js";
60
- export { adaptive_ashrae, adaptive_en, a_pmv, athb, e_pmv, at, ankle_draft, clo_tout, cooling_effect, discomfort_index, heat_index, humidex, net, phs, pet_steady, pmv_ppd, pmv_ppd_ashrae, pmv_ppd_iso, pmv, solar_gain, set_tmp, two_nodes, utci, use_fans_heatwaves, vertical_tmp_grad_ppd, wbgt, wc };
62
+ export { adaptive_ashrae, adaptive_en, a_pmv, athb, e_pmv, at, ankle_draft, clo_tout, cooling_effect, discomfort_index, heat_index, humidex, net, phs, pet_steady, pmv_ppd, pmv_ppd_ashrae, pmv_ppd_iso, pmv, solar_gain, set_tmp, two_nodes, utci, use_fans_heatwaves, vertical_tmp_grad_ppd, wbgt, wc, wind_chill_temperature };
61
63
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAcgC,sBAAsB;4BAL1B,kBAAkB;sBAUxB,YAAY;qBAFb,WAAW;sBAIV,YAAY;mBAXf,SAAS;4BAUA,kBAAkB;yBAIrB,eAAe;+BART,qBAAqB;iCAXnB,uBAAuB;2BAL7B,iBAAiB;wBAEpB,cAAc;oBAClB,UAAU;oBAFV,UAAU;2BAyBH,iBAAiB;wBAfpB,cAAc;+BACP,qBAAqB;4BACxB,kBAAkB;oBAK1B,UAAU;2BAHH,iBAAiB;wBARpB,cAAc;0BADZ,gBAAgB;qBAmBrB,WAAW;mCAFG,wBAAwB;sCADrB,4BAA4B;qBAlB7C,WAAW;mBAIb,SAAS;qBAmBP,WAAW"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAegC,sBAAsB;4BAL1B,kBAAkB;sBAUxB,YAAY;qBAFb,WAAW;sBAIV,YAAY;mBAXf,SAAS;4BAUA,kBAAkB;yBAIrB,eAAe;+BART,qBAAqB;iCAZnB,uBAAuB;2BAL7B,iBAAiB;wBAEpB,cAAc;oBAClB,UAAU;oBAFV,UAAU;2BA0BH,iBAAiB;wBAfpB,cAAc;+BACP,qBAAqB;4BACxB,kBAAkB;oBAK1B,UAAU;2BAHH,iBAAiB;wBATpB,cAAc;0BADZ,gBAAgB;qBAoBrB,WAAW;mCAFG,wBAAwB;sCADrB,4BAA4B;qBAnB7C,WAAW;mBAIb,SAAS;uCACW,6BAA6B;qBAmB/C,WAAW"}
@@ -0,0 +1,4 @@
1
+ export function wind_chill_temperature(tdb: any, v: any, round_output?: boolean): {
2
+ wct: number;
3
+ };
4
+ //# sourceMappingURL=wind_chill_temperature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wind_chill_temperature.d.ts","sourceRoot":"","sources":["../../../../src/models/wind_chill_temperature.js"],"names":[],"mappings":"AA8BA;;EAaC"}
@@ -8,6 +8,7 @@ declare namespace _default {
8
8
  export { met_typical_tasks };
9
9
  export { clo_typical_ensembles };
10
10
  export { clo_individual_garments };
11
+ export { check_standard_compliance };
11
12
  }
12
13
  export default _default;
13
14
  import { body_surface_area } from "./utilities.js";
@@ -19,5 +20,6 @@ import { f_svv } from "./utilities.js";
19
20
  import { met_typical_tasks } from "./utilities.js";
20
21
  import { clo_typical_ensembles } from "./utilities.js";
21
22
  import { clo_individual_garments } from "./utilities.js";
22
- export { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments };
23
+ import { check_standard_compliance } from "./utilities.js";
24
+ export { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments, check_standard_compliance };
23
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utilities/index.js"],"names":[],"mappings":";;;;;;;;;;;;kCAUO,gBAAgB;2BAAhB,gBAAgB;4BAAhB,gBAAgB;gCAAhB,gBAAgB;iDAAhB,gBAAgB;sBAAhB,gBAAgB;kCAAhB,gBAAgB;sCAAhB,gBAAgB;wCAAhB,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utilities/index.js"],"names":[],"mappings":";;;;;;;;;;;;;kCAWO,gBAAgB;2BAAhB,gBAAgB;4BAAhB,gBAAgB;gCAAhB,gBAAgB;iDAAhB,gBAAgB;sBAAhB,gBAAgB;kCAAhB,gBAAgB;sCAAhB,gBAAgB;wCAAhB,gBAAgB;0CAAhB,gBAAgB"}
@@ -14,19 +14,7 @@ export function round(number: number, precision: number): number;
14
14
  */
15
15
  export function transpose_sharp_altitude(sharp: number, altitude: number): [number, number];
16
16
  /**
17
- * @typedef {Object} ComplianceKwargs
18
- * @property {number} [met]
19
- * @property {number} [clo]
20
- * @property {number} [tdb]
21
- * @property {number} [tr]
22
- * @property {number} [v]
23
- * @property {number} [vr]
24
- * @property {number} [v_limited]
25
- * @property {number} [rh]
26
- * @property {boolean} [airspeed_control]
27
- */
28
- /**
29
- * @typedef {"ANKLE_DRAFT" | "ASHRAE" | "FAN_HEATWAVES" | "ISO" | "ISO7933"} Standard
17
+ * @typedef {(typeof Standard)[keyof typeof Standard]} Standard
30
18
  */
31
19
  /**
32
20
  * Check that the values comply with the standard provided
@@ -172,6 +160,30 @@ export function valid_range(range?: number[], [min, max]: [number, number]): num
172
160
  * const result = clo_typical_ensembles("Trousers, long-sleeve shirt"); // returns 0.61
173
161
  */
174
162
  export function clo_typical_ensembles(ensembles: "Walking shorts, short-sleeve shirt" | "Typical summer indoor clothing" | "Knee-length skirt, short-sleeve shirt, sandals, underwear" | "Trousers, long-sleeve shirt" | "Knee-length skirt, long-sleeve shirt, full slip" | "Sweat pants, long-sleeve sweatshirt" | "Jacket, Trousers, long-sleeve shirt" | "Typical winter indoor clothing"): number;
163
+ export type Standard = (typeof Standard)[keyof typeof Standard];
164
+ /**
165
+ * @typedef {Object} ComplianceKwargs
166
+ * @property {number} [met]
167
+ * @property {number} [clo]
168
+ * @property {number} [tdb]
169
+ * @property {number} [tr]
170
+ * @property {number} [v]
171
+ * @property {number} [vr]
172
+ * @property {number} [v_limited]
173
+ * @property {number} [rh]
174
+ * @property {boolean} [airspeed_control]
175
+ */
176
+ /**
177
+ * Standard names accepted by {@link check_standard_compliance}.
178
+ */
179
+ export const Standard: Readonly<{
180
+ ANKLE_DRAFT: "ANKLE_DRAFT";
181
+ ASHRAE: "ASHRAE";
182
+ FAN_HEATWAVES: "FAN_HEATWAVES";
183
+ ISO: "ISO";
184
+ ISO_7933_2004: "7933-2004";
185
+ ISO_7933_2023: "7933-2023";
186
+ }>;
175
187
  /**
176
188
  * Met values of typical tasks.
177
189
  * @public
@@ -298,5 +310,4 @@ export type ComplianceKwargs = {
298
310
  rh?: number;
299
311
  airspeed_control?: boolean;
300
312
  };
301
- export type Standard = "ANKLE_DRAFT" | "ASHRAE" | "FAN_HEATWAVES" | "ISO" | "ISO7933";
302
313
  //# sourceMappingURL=utilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../../src/utilities/utilities.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,8BAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAKlB;AAwBD;;;;;GAKG;AACH,gDAJW,MAAM,YACN,MAAM,GACJ,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB5B;AAED;;;;;;;;;;;GAWG;AAEH;;GAEG;AAEH;;;;;;;GAOG;AACH,oDALW,QAAQ,UACR,gBAAgB,GAEd,MAAM,EAAE,CAiBpB;AA+ND;;;;;;;;;;;;;GAaG;AACH,0CAPW,MAAM,UACN,MAAM,YACN,CAAC,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC,GAC/C,MAAM,CAiBlB;AAED;;;;;;;;;;;;;GAaG;AACH,8BAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAKlB;AAWD;;;;;;;;;;;;;;;;GAgBG;AACH,iCALW,MAAM,OACN,MAAM,aACN,CAAC,QAAQ,GAAG,KAAK,CAAC,GAChB,MAAM,CAUlB;AAWD;;;;;;;;;;;;GAYG;AACH,gCANuC,CAAC,SAA3B;QAAS,MAAM,GAAE,MAAM;CAAE,UAC3B,CAAC,eACD,IAAI,GAAG,IAAI,GACT,CAAC,CA4Bb;AAoED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,6DAhBW,MAAM,EAAE,UAKR,MAAM,UAON,IAAI,GAAG,IAAI,GAET,MAAM,CAmBlB;AAED;;;;;;;;;;;;GAYG;AACH,yBANW,MAAM,KACN,MAAM,KACN,MAAM,GAEJ,MAAM,CAMlB;AAED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,MAAM;uBACN,OAAO"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clo_individual_garments = exports.clo_typical_ensembles = exports.met_typical_tasks = exports.f_svv = exports.running_mean_outdoor_temperature = exports.units_converter = exports.clo_dynamic = exports.v_relative = exports.body_surface_area = void 0;
3
+ exports.check_standard_compliance = exports.clo_individual_garments = exports.clo_typical_ensembles = exports.met_typical_tasks = exports.f_svv = exports.running_mean_outdoor_temperature = exports.units_converter = exports.clo_dynamic = exports.v_relative = exports.body_surface_area = void 0;
4
4
  const utilities_js_1 = require("./utilities.js");
5
5
  Object.defineProperty(exports, "body_surface_area", { enumerable: true, get: function () { return utilities_js_1.body_surface_area; } });
6
6
  Object.defineProperty(exports, "v_relative", { enumerable: true, get: function () { return utilities_js_1.v_relative; } });
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "f_svv", { enumerable: true, get: function () { r
11
11
  Object.defineProperty(exports, "met_typical_tasks", { enumerable: true, get: function () { return utilities_js_1.met_typical_tasks; } });
12
12
  Object.defineProperty(exports, "clo_typical_ensembles", { enumerable: true, get: function () { return utilities_js_1.clo_typical_ensembles; } });
13
13
  Object.defineProperty(exports, "clo_individual_garments", { enumerable: true, get: function () { return utilities_js_1.clo_individual_garments; } });
14
+ Object.defineProperty(exports, "check_standard_compliance", { enumerable: true, get: function () { return utilities_js_1.check_standard_compliance; } });
14
15
  exports.default = {
15
16
  body_surface_area: utilities_js_1.body_surface_area,
16
17
  v_relative: utilities_js_1.v_relative,
@@ -21,6 +22,7 @@ exports.default = {
21
22
  met_typical_tasks: utilities_js_1.met_typical_tasks,
22
23
  clo_typical_ensembles: utilities_js_1.clo_typical_ensembles,
23
24
  clo_individual_garments: utilities_js_1.clo_individual_garments,
25
+ check_standard_compliance: utilities_js_1.check_standard_compliance,
24
26
  };
25
27
  /**
26
28
  * @public
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateInputs = exports.assertNumber = exports.clo_individual_garments = exports.met_typical_tasks = void 0;
3
+ exports.validateInputs = exports.assertNumber = exports.clo_individual_garments = exports.met_typical_tasks = exports.Standard = void 0;
4
4
  exports.round = round;
5
5
  exports.transpose_sharp_altitude = transpose_sharp_altitude;
6
6
  exports.check_standard_compliance = check_standard_compliance;
@@ -71,7 +71,18 @@ function transpose_sharp_altitude(sharp, altitude) {
71
71
  * @property {boolean} [airspeed_control]
72
72
  */
73
73
  /**
74
- * @typedef {"ANKLE_DRAFT" | "ASHRAE" | "FAN_HEATWAVES" | "ISO" | "ISO7933"} Standard
74
+ * Standard names accepted by {@link check_standard_compliance}.
75
+ */
76
+ exports.Standard = Object.freeze({
77
+ ANKLE_DRAFT: "ANKLE_DRAFT",
78
+ ASHRAE: "ASHRAE",
79
+ FAN_HEATWAVES: "FAN_HEATWAVES",
80
+ ISO: "ISO",
81
+ ISO_7933_2004: "7933-2004",
82
+ ISO_7933_2023: "7933-2023",
83
+ });
84
+ /**
85
+ * @typedef {(typeof Standard)[keyof typeof Standard]} Standard
75
86
  */
76
87
  /**
77
88
  * Check that the values comply with the standard provided
@@ -83,16 +94,18 @@ function transpose_sharp_altitude(sharp, altitude) {
83
94
  */
84
95
  function check_standard_compliance(standard, kwargs) {
85
96
  switch (standard) {
86
- case "ANKLE_DRAFT":
97
+ case exports.Standard.ANKLE_DRAFT:
87
98
  return _ankle_draft_compliance(kwargs);
88
- case "ASHRAE":
99
+ case exports.Standard.ASHRAE:
89
100
  return _ashrae_compliance(kwargs);
90
- case "FAN_HEATWAVES":
101
+ case exports.Standard.FAN_HEATWAVES:
91
102
  return _fan_heatwaves_compliance(kwargs);
92
- case "ISO":
103
+ case exports.Standard.ISO:
93
104
  return _iso_compliance(kwargs);
94
- case "ISO7933":
95
- return _iso7933_compliance(kwargs);
105
+ case exports.Standard.ISO_7933_2004:
106
+ return _iso7933_2004_compliance(kwargs);
107
+ case exports.Standard.ISO_7933_2023:
108
+ return _iso7933_2023_compliance(kwargs);
96
109
  default:
97
110
  throw new Error("Unknown standard");
98
111
  }
@@ -241,22 +254,21 @@ function _iso_compliance(kwargs) {
241
254
  *
242
255
  * @returns {string[]} strings with warnings emitted
243
256
  */
244
- function _iso7933_compliance(kwargs) {
257
+ function _iso7933_2004_compliance(kwargs) {
258
+ // based on ISO 7933:2004 Annex A
245
259
  if (kwargs.tdb === undefined ||
246
- kwargs.rh === undefined ||
260
+ kwargs.p_a === undefined ||
247
261
  kwargs.tr === undefined ||
248
262
  kwargs.v === undefined ||
249
263
  kwargs.met === undefined ||
250
264
  kwargs.clo === undefined) {
251
- throw new Error(`Missing arguments for ISO7933 compliance check, got: ${kwargs} and requires tdb, rh, tr, v, met and clo`);
265
+ throw new Error(`Missing arguments for ISO 7933:2004 compliance check, got: ${kwargs} and requires tdb, p_a, tr, v, met and clo`);
252
266
  }
253
267
  /** @type {string[]} */
254
268
  let warnings = [];
255
269
  if (kwargs.tdb > 50 || kwargs.tdb < 15)
256
270
  warnings.push("ISO 7933:2004 air temperature applicability limits between 15 and 50 ºC");
257
- const p_sat_result = (0, p_sat_js_1.p_sat)(kwargs.tdb);
258
- const p_a = ((p_sat_result / 1000) * kwargs.rh) / 100;
259
- if (p_a > 4.5 || p_a < 0)
271
+ if (kwargs.p_a > 4.5 || kwargs.p_a < 0)
260
272
  warnings.push("ISO 7933:2004 p_a applicability limits between 0 and 4.5 kPa");
261
273
  if (kwargs.tr > 60 || kwargs.tr < 0)
262
274
  warnings.push("ISO 7933:2004 tr applicability limits between 0 and 60 ºC");
@@ -268,6 +280,32 @@ function _iso7933_compliance(kwargs) {
268
280
  warnings.push("ISO 7933:2004 clo applicability limits between 0.1 and 1 clo");
269
281
  return warnings;
270
282
  }
283
+ function _iso7933_2023_compliance(kwargs) {
284
+ // based on ISO 7933:2023 Annex A
285
+ if (kwargs.tdb === undefined ||
286
+ kwargs.p_a === undefined ||
287
+ kwargs.tr === undefined ||
288
+ kwargs.v === undefined ||
289
+ kwargs.met === undefined ||
290
+ kwargs.clo === undefined) {
291
+ throw new Error(`Missing arguments for ISO 7933:2023 compliance check, got: ${kwargs} and requires tdb, p_a, tr, v, met and clo`);
292
+ }
293
+ /** @type {string[]} */
294
+ let warnings = [];
295
+ if (kwargs.tdb > 50 || kwargs.tdb < 15)
296
+ warnings.push("ISO 7933:2023 air temperature applicability limits between 15 and 50 ºC");
297
+ if (kwargs.p_a > 4.5 || kwargs.p_a < 0.5)
298
+ warnings.push("ISO 7933:2023 p_a applicability limits between 0.5 and 4.5 kPa");
299
+ if (kwargs.tr > 60 || kwargs.tr < 0)
300
+ warnings.push("ISO 7933:2023 tr applicability limits between 0 and 60 ºC");
301
+ if (kwargs.v > 3 || kwargs.v < 0)
302
+ warnings.push("ISO 7933:2023 air speed applicability limits between 0 and 3 m/s");
303
+ if (kwargs.met > 450 || kwargs.met < 100)
304
+ warnings.push("ISO 7933:2023 met applicability limits between 100 and 450 met");
305
+ if (kwargs.clo > 1 || kwargs.clo < 0.1)
306
+ warnings.push("ISO 7933:2023 clo applicability limits between 0.1 and 1 clo");
307
+ return warnings;
308
+ }
271
309
  /**
272
310
  * Returns the body surface area in square meters
273
311
  *
@@ -38,6 +38,7 @@ import { get_ce } from "./adaptive_en.js";
38
38
  * @param {boolean} limit_inputs - By default, if the inputs are outsude the standard applicability limits the
39
39
  * function returns nan. If False returns pmv and ppd values even if input values are
40
40
  * outside the applicability limits of the model.
41
+ * @param {boolean} [round_output=true] - if true, rounds `t_cmf` to one decimal place in SI before bounds are derived; if false, returns the unrounded values. Under `units = 'IP'` the rounded SI value is then converted to °F, so IP outputs carry the additional decimals from the °C-to-°F conversion.
41
42
  *
42
43
  * @returns {AdaptiveAshraeResult} set containing results for the model
43
44
  *
@@ -81,9 +82,18 @@ const ADAPTIVE_ASHRAE_SCHEMA = {
81
82
  v: { type: "number" },
82
83
  units: { enum: ["SI", "IP"] },
83
84
  limit_inputs: { type: "boolean" },
85
+ round_output: { type: "boolean", required: false },
84
86
  };
85
- export function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
86
- validateInputs({ tdb, tr, t_running_mean, v, units: units.toUpperCase(), limit_inputs }, ADAPTIVE_ASHRAE_SCHEMA);
87
+ export function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true, round_output = true) {
88
+ validateInputs({
89
+ tdb,
90
+ tr,
91
+ t_running_mean,
92
+ v,
93
+ units: units.toUpperCase(),
94
+ limit_inputs,
95
+ round_output,
96
+ }, ADAPTIVE_ASHRAE_SCHEMA);
87
97
  const standard = "ASHRAE";
88
98
  if (units.toUpperCase() === "IP") {
89
99
  ({
@@ -109,7 +119,9 @@ export function adaptive_ashrae(tdb, tr, t_running_mean, v, units = "SI", limit_
109
119
  if (warnings.length > 0 || !trm_valid)
110
120
  t_cmf = NaN;
111
121
  }
112
- t_cmf = round(t_cmf, 1);
122
+ if (round_output) {
123
+ t_cmf = round(t_cmf, 1);
124
+ }
113
125
  let tmp_cmf_80_low = t_cmf - 3.5;
114
126
  let tmp_cmf_90_low = t_cmf - 2.5;
115
127
  let tmp_cmf_80_up = t_cmf + 3.5 + ce;
@@ -42,6 +42,7 @@ import { units_converter, round, validateInputs, } from "../utilities/utilities.
42
42
  * @param {boolean} [limit_inputs=true] - By default, if the inputs are outsude the standard applicability limits the
43
43
  * function returns nan. If False returns pmv and ppd values even if input values are
44
44
  * outside the applicability limits of the model.
45
+ * @param {boolean} [round_output=true] - if true, rounds the returned comfort temperature and bounds to one decimal place in the output unit (rounding is applied after any IP unit conversion); if false, returns the unrounded values.
45
46
  *
46
47
  * @returns {AdaptiveEnResult} result set
47
48
  *
@@ -69,9 +70,18 @@ const ADAPTIVE_EN_SCHEMA = {
69
70
  v: { type: "number" },
70
71
  units: { enum: ["SI", "IP"] },
71
72
  limit_inputs: { type: "boolean" },
73
+ round_output: { type: "boolean", required: false },
72
74
  };
73
- export function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
74
- validateInputs({ tdb, tr, t_running_mean, v, units: units.toUpperCase(), limit_inputs }, ADAPTIVE_EN_SCHEMA);
75
+ export function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true, round_output = true) {
76
+ validateInputs({
77
+ tdb,
78
+ tr,
79
+ t_running_mean,
80
+ v,
81
+ units: units.toUpperCase(),
82
+ limit_inputs,
83
+ round_output,
84
+ }, ADAPTIVE_EN_SCHEMA);
75
85
  const standard = "ISO";
76
86
  if (units.toLowerCase() == "ip") {
77
87
  ({
@@ -120,17 +130,26 @@ export function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inpu
120
130
  tmp_cmf_cat_iii_low: t_cmf_iii_lower,
121
131
  }, "SI"));
122
132
  }
133
+ if (round_output) {
134
+ t_cmf = round(t_cmf, 1);
135
+ t_cmf_i_lower = round(t_cmf_i_lower, 1);
136
+ t_cmf_ii_lower = round(t_cmf_ii_lower, 1);
137
+ t_cmf_iii_lower = round(t_cmf_iii_lower, 1);
138
+ t_cmf_i_upper = round(t_cmf_i_upper, 1);
139
+ t_cmf_ii_upper = round(t_cmf_ii_upper, 1);
140
+ t_cmf_iii_upper = round(t_cmf_iii_upper, 1);
141
+ }
123
142
  return {
124
- tmp_cmf: round(t_cmf, 1),
143
+ tmp_cmf: t_cmf,
125
144
  acceptability_cat_i: acceptability_i,
126
145
  acceptability_cat_ii: acceptability_ii,
127
146
  acceptability_cat_iii: acceptability_iii,
128
- tmp_cmf_cat_i_up: round(t_cmf_i_upper, 1),
129
- tmp_cmf_cat_ii_up: round(t_cmf_ii_upper, 1),
130
- tmp_cmf_cat_iii_up: round(t_cmf_iii_upper, 1),
131
- tmp_cmf_cat_i_low: round(t_cmf_i_lower, 1),
132
- tmp_cmf_cat_ii_low: round(t_cmf_ii_lower, 1),
133
- tmp_cmf_cat_iii_low: round(t_cmf_iii_lower, 1),
147
+ tmp_cmf_cat_i_up: t_cmf_i_upper,
148
+ tmp_cmf_cat_ii_up: t_cmf_ii_upper,
149
+ tmp_cmf_cat_iii_up: t_cmf_iii_upper,
150
+ tmp_cmf_cat_i_low: t_cmf_i_lower,
151
+ tmp_cmf_cat_ii_low: t_cmf_ii_lower,
152
+ tmp_cmf_cat_iii_low: t_cmf_iii_lower,
134
153
  };
135
154
  }
136
155
  /**
@@ -7,6 +7,7 @@ import { discomfort_index } from "./discomfort_index.js";
7
7
  import { two_nodes } from "./two_nodes.js";
8
8
  import { set_tmp } from "./set_tmp.js";
9
9
  import { wc } from "./wc.js";
10
+ import { wind_chill_temperature } from "./wind_chill_temperature.js";
10
11
  import { adaptive_en } from "./adaptive_en.js";
11
12
  import { at } from "./at.js";
12
13
  import { pmv_ppd } from "./pmv_ppd.js";
@@ -31,7 +32,7 @@ import { JOS3 } from "./JOS3.js";
31
32
  * @name models
32
33
  * @docname Comfort Models
33
34
  */
34
- export { adaptive_ashrae, adaptive_en, a_pmv, athb, e_pmv, at, ankle_draft, clo_tout, cooling_effect, discomfort_index, heat_index, humidex, net, phs, pet_steady, pmv_ppd, pmv_ppd_ashrae, pmv_ppd_iso, pmv, solar_gain, set_tmp, two_nodes, utci, use_fans_heatwaves, vertical_tmp_grad_ppd, wbgt, wc, };
35
+ export { adaptive_ashrae, adaptive_en, a_pmv, athb, e_pmv, at, ankle_draft, clo_tout, cooling_effect, discomfort_index, heat_index, humidex, net, phs, pet_steady, pmv_ppd, pmv_ppd_ashrae, pmv_ppd_iso, pmv, solar_gain, set_tmp, two_nodes, utci, use_fans_heatwaves, vertical_tmp_grad_ppd, wbgt, wc, wind_chill_temperature, };
35
36
  export default {
36
37
  adaptive_ashrae,
37
38
  adaptive_en,
@@ -60,5 +61,6 @@ export default {
60
61
  vertical_tmp_grad_ppd,
61
62
  wbgt,
62
63
  wc,
64
+ wind_chill_temperature,
63
65
  JOS3,
64
66
  };
@@ -191,11 +191,18 @@ export function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-20
191
191
  }, PHS_SCHEMA);
192
192
  const met_watt = met * MET_WATT_PER_MET;
193
193
  const wme_watt = wme * MET_WATT_PER_MET;
194
- const warnings = check_standard_compliance("ISO7933", {
194
+ let p_a;
195
+ if (model === "7933-2023") {
196
+ p_a = 0.6105 * Math.exp((17.27 * tdb) / (tdb + 237.3)) * (rh / 100);
197
+ }
198
+ else {
199
+ p_a = ((p_sat(tdb) / 1000) * rh) / 100;
200
+ }
201
+ const warnings = check_standard_compliance(model, {
195
202
  tdb,
196
203
  tr,
197
204
  v,
198
- rh,
205
+ p_a,
199
206
  met: met_watt * body_surface_area(joint_kwargs.weight, joint_kwargs.height),
200
207
  clo,
201
208
  });
@@ -215,13 +222,6 @@ export function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-20
215
222
  evap_load_wm2_min: NaN,
216
223
  };
217
224
  }
218
- let p_a;
219
- if (model === "7933-2023") {
220
- p_a = 0.6105 * Math.exp((17.27 * tdb) / (tdb + 237.3)) * (rh / 100);
221
- }
222
- else {
223
- p_a = ((p_sat(tdb) / 1000) * rh) / 100;
224
- }
225
225
  const variables_for_loop = _calculate_variables_for_loop(v, met_watt, posture, clo, tdb, p_a, joint_kwargs);
226
226
  const result = _phs_loop(tdb, tr, v, met_watt, clo, wme_watt, p_a, joint_kwargs, variables_for_loop);
227
227
  if (joint_kwargs.round) {
@@ -0,0 +1,39 @@
1
+ import { round, validateInputs } from "../utilities/utilities.js";
2
+ /**
3
+ * Calculates the Wind Chill Temperature (WCT) using the North American
4
+ * formula adopted by the US National Weather Service and Environment
5
+ * Canada in 2001 {@link https://en.wikipedia.org/wiki/Wind_chill#North_American_and_United_Kingdom_wind_chill_index}.
6
+ *
7
+ * WCT estimates the equivalent perceived air temperature on exposed skin
8
+ * given dry-bulb air temperature and 10 m wind speed. It is reported in
9
+ * the same unit as `tdb` (°C). The formula is empirical and is intended
10
+ * for cold-weather conditions; outside that range it still evaluates but
11
+ * carries no physical interpretation. Following `pythermalcomfort`, this
12
+ * implementation does not gate inputs against an applicability range; the
13
+ * formula is computed for any finite input.
14
+ *
15
+ * @public
16
+ * @memberof models
17
+ * @docname Wind chill temperature
18
+ *
19
+ * @param {number} tdb - dry-bulb air temperature, [°C]
20
+ * @param {number} v - wind speed 10 m above ground level, [km/h]
21
+ * @param {boolean} [round_output=true] - if true, rounds the returned value to one decimal place; if false, returns the unrounded value.
22
+ * @returns {{wct: number}} wind chill temperature, [°C]
23
+ */
24
+ const WCT_SCHEMA = {
25
+ tdb: { type: "number" },
26
+ v: { type: "number" },
27
+ round_output: { type: "boolean", required: false },
28
+ };
29
+ export function wind_chill_temperature(tdb, v, round_output = true) {
30
+ validateInputs({ tdb, v, round_output }, WCT_SCHEMA);
31
+ let wct = 13.12 +
32
+ 0.6215 * tdb -
33
+ 11.37 * Math.pow(v, 0.16) +
34
+ 0.3965 * tdb * Math.pow(v, 0.16);
35
+ if (round_output) {
36
+ wct = round(wct, 1);
37
+ }
38
+ return { wct };
39
+ }
@@ -1,4 +1,4 @@
1
- export function adaptive_ashrae(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean): {
1
+ export function adaptive_ashrae(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean, round_output?: boolean): {
2
2
  tmp_cmf: number;
3
3
  tmp_cmf_80_low: number;
4
4
  tmp_cmf_80_up: number;
@@ -1 +1 @@
1
- {"version":3,"file":"adaptive_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_ashrae.js"],"names":[],"mappings":"AA4FA;;;;;;;;EA6EC;;;;;aA9Ja,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;sBACN,OAAO;;;;sBACP,OAAO"}
1
+ {"version":3,"file":"adaptive_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_ashrae.js"],"names":[],"mappings":"AA8FA;;;;;;;;EAwFC;;;;;aA3Ka,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;mBACN,MAAM;;;;sBACN,OAAO;;;;sBACP,OAAO"}
@@ -1,4 +1,4 @@
1
- export function adaptive_en(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean): {
1
+ export function adaptive_en(tdb: any, tr: any, t_running_mean: any, v: any, units?: string, limit_inputs?: boolean, round_output?: boolean): {
2
2
  tmp_cmf: number;
3
3
  acceptability_cat_i: boolean;
4
4
  acceptability_cat_ii: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"adaptive_en.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_en.js"],"names":[],"mappings":"AA+EA;;;;;;;;;;;EAuFC;AACD;;;;;GAKG;AACH,0BAJW,MAAM,MACN,MAAM,GACJ,MAAM,CAclB;;;;;;;;aAhLa,MAAM;;;;yBACN,OAAO;;;;0BACP,OAAO;;;;2BACP,OAAO;;;;sBACP,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;yBACN,MAAM"}
1
+ {"version":3,"file":"adaptive_en.d.ts","sourceRoot":"","sources":["../../../../src/models/adaptive_en.js"],"names":[],"mappings":"AAiFA;;;;;;;;;;;EA0GC;AACD;;;;;GAKG;AACH,0BAJW,MAAM,MACN,MAAM,GACJ,MAAM,CAclB;;;;;;;;aArMa,MAAM;;;;yBACN,OAAO;;;;0BACP,OAAO;;;;2BACP,OAAO;;;;sBACP,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM;;;;yBACN,MAAM"}
@@ -26,6 +26,7 @@ declare namespace _default {
26
26
  export { vertical_tmp_grad_ppd };
27
27
  export { wbgt };
28
28
  export { wc };
29
+ export { wind_chill_temperature };
29
30
  export { JOS3 };
30
31
  }
31
32
  export default _default;
@@ -56,6 +57,7 @@ import { use_fans_heatwaves } from "./use_fans_heatwave.js";
56
57
  import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd.js";
57
58
  import { wbgt } from "./wbgt.js";
58
59
  import { wc } from "./wc.js";
60
+ import { wind_chill_temperature } from "./wind_chill_temperature.js";
59
61
  import { JOS3 } from "./JOS3.js";
60
- export { adaptive_ashrae, adaptive_en, a_pmv, athb, e_pmv, at, ankle_draft, clo_tout, cooling_effect, discomfort_index, heat_index, humidex, net, phs, pet_steady, pmv_ppd, pmv_ppd_ashrae, pmv_ppd_iso, pmv, solar_gain, set_tmp, two_nodes, utci, use_fans_heatwaves, vertical_tmp_grad_ppd, wbgt, wc };
62
+ export { adaptive_ashrae, adaptive_en, a_pmv, athb, e_pmv, at, ankle_draft, clo_tout, cooling_effect, discomfort_index, heat_index, humidex, net, phs, pet_steady, pmv_ppd, pmv_ppd_ashrae, pmv_ppd_iso, pmv, solar_gain, set_tmp, two_nodes, utci, use_fans_heatwaves, vertical_tmp_grad_ppd, wbgt, wc, wind_chill_temperature };
61
63
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAcgC,sBAAsB;4BAL1B,kBAAkB;sBAUxB,YAAY;qBAFb,WAAW;sBAIV,YAAY;mBAXf,SAAS;4BAUA,kBAAkB;yBAIrB,eAAe;+BART,qBAAqB;iCAXnB,uBAAuB;2BAL7B,iBAAiB;wBAEpB,cAAc;oBAClB,UAAU;oBAFV,UAAU;2BAyBH,iBAAiB;wBAfpB,cAAc;+BACP,qBAAqB;4BACxB,kBAAkB;oBAK1B,UAAU;2BAHH,iBAAiB;wBARpB,cAAc;0BADZ,gBAAgB;qBAmBrB,WAAW;mCAFG,wBAAwB;sCADrB,4BAA4B;qBAlB7C,WAAW;mBAIb,SAAS;qBAmBP,WAAW"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAegC,sBAAsB;4BAL1B,kBAAkB;sBAUxB,YAAY;qBAFb,WAAW;sBAIV,YAAY;mBAXf,SAAS;4BAUA,kBAAkB;yBAIrB,eAAe;+BART,qBAAqB;iCAZnB,uBAAuB;2BAL7B,iBAAiB;wBAEpB,cAAc;oBAClB,UAAU;oBAFV,UAAU;2BA0BH,iBAAiB;wBAfpB,cAAc;+BACP,qBAAqB;4BACxB,kBAAkB;oBAK1B,UAAU;2BAHH,iBAAiB;wBATpB,cAAc;0BADZ,gBAAgB;qBAoBrB,WAAW;mCAFG,wBAAwB;sCADrB,4BAA4B;qBAnB7C,WAAW;mBAIb,SAAS;uCACW,6BAA6B;qBAmB/C,WAAW"}
@@ -0,0 +1,4 @@
1
+ export function wind_chill_temperature(tdb: any, v: any, round_output?: boolean): {
2
+ wct: number;
3
+ };
4
+ //# sourceMappingURL=wind_chill_temperature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wind_chill_temperature.d.ts","sourceRoot":"","sources":["../../../../src/models/wind_chill_temperature.js"],"names":[],"mappings":"AA8BA;;EAaC"}
@@ -8,6 +8,7 @@ declare namespace _default {
8
8
  export { met_typical_tasks };
9
9
  export { clo_typical_ensembles };
10
10
  export { clo_individual_garments };
11
+ export { check_standard_compliance };
11
12
  }
12
13
  export default _default;
13
14
  import { body_surface_area } from "./utilities.js";
@@ -19,5 +20,6 @@ import { f_svv } from "./utilities.js";
19
20
  import { met_typical_tasks } from "./utilities.js";
20
21
  import { clo_typical_ensembles } from "./utilities.js";
21
22
  import { clo_individual_garments } from "./utilities.js";
22
- export { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments };
23
+ import { check_standard_compliance } from "./utilities.js";
24
+ export { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments, check_standard_compliance };
23
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utilities/index.js"],"names":[],"mappings":";;;;;;;;;;;;kCAUO,gBAAgB;2BAAhB,gBAAgB;4BAAhB,gBAAgB;gCAAhB,gBAAgB;iDAAhB,gBAAgB;sBAAhB,gBAAgB;kCAAhB,gBAAgB;sCAAhB,gBAAgB;wCAAhB,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utilities/index.js"],"names":[],"mappings":";;;;;;;;;;;;;kCAWO,gBAAgB;2BAAhB,gBAAgB;4BAAhB,gBAAgB;gCAAhB,gBAAgB;iDAAhB,gBAAgB;sBAAhB,gBAAgB;kCAAhB,gBAAgB;sCAAhB,gBAAgB;wCAAhB,gBAAgB;0CAAhB,gBAAgB"}
@@ -14,19 +14,7 @@ export function round(number: number, precision: number): number;
14
14
  */
15
15
  export function transpose_sharp_altitude(sharp: number, altitude: number): [number, number];
16
16
  /**
17
- * @typedef {Object} ComplianceKwargs
18
- * @property {number} [met]
19
- * @property {number} [clo]
20
- * @property {number} [tdb]
21
- * @property {number} [tr]
22
- * @property {number} [v]
23
- * @property {number} [vr]
24
- * @property {number} [v_limited]
25
- * @property {number} [rh]
26
- * @property {boolean} [airspeed_control]
27
- */
28
- /**
29
- * @typedef {"ANKLE_DRAFT" | "ASHRAE" | "FAN_HEATWAVES" | "ISO" | "ISO7933"} Standard
17
+ * @typedef {(typeof Standard)[keyof typeof Standard]} Standard
30
18
  */
31
19
  /**
32
20
  * Check that the values comply with the standard provided
@@ -172,6 +160,30 @@ export function valid_range(range?: number[], [min, max]: [number, number]): num
172
160
  * const result = clo_typical_ensembles("Trousers, long-sleeve shirt"); // returns 0.61
173
161
  */
174
162
  export function clo_typical_ensembles(ensembles: "Walking shorts, short-sleeve shirt" | "Typical summer indoor clothing" | "Knee-length skirt, short-sleeve shirt, sandals, underwear" | "Trousers, long-sleeve shirt" | "Knee-length skirt, long-sleeve shirt, full slip" | "Sweat pants, long-sleeve sweatshirt" | "Jacket, Trousers, long-sleeve shirt" | "Typical winter indoor clothing"): number;
163
+ export type Standard = (typeof Standard)[keyof typeof Standard];
164
+ /**
165
+ * @typedef {Object} ComplianceKwargs
166
+ * @property {number} [met]
167
+ * @property {number} [clo]
168
+ * @property {number} [tdb]
169
+ * @property {number} [tr]
170
+ * @property {number} [v]
171
+ * @property {number} [vr]
172
+ * @property {number} [v_limited]
173
+ * @property {number} [rh]
174
+ * @property {boolean} [airspeed_control]
175
+ */
176
+ /**
177
+ * Standard names accepted by {@link check_standard_compliance}.
178
+ */
179
+ export const Standard: Readonly<{
180
+ ANKLE_DRAFT: "ANKLE_DRAFT";
181
+ ASHRAE: "ASHRAE";
182
+ FAN_HEATWAVES: "FAN_HEATWAVES";
183
+ ISO: "ISO";
184
+ ISO_7933_2004: "7933-2004";
185
+ ISO_7933_2023: "7933-2023";
186
+ }>;
175
187
  /**
176
188
  * Met values of typical tasks.
177
189
  * @public
@@ -298,5 +310,4 @@ export type ComplianceKwargs = {
298
310
  rh?: number;
299
311
  airspeed_control?: boolean;
300
312
  };
301
- export type Standard = "ANKLE_DRAFT" | "ASHRAE" | "FAN_HEATWAVES" | "ISO" | "ISO7933";
302
313
  //# sourceMappingURL=utilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../../src/utilities/utilities.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,8BAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAKlB;AAwBD;;;;;GAKG;AACH,gDAJW,MAAM,YACN,MAAM,GACJ,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB5B;AAED;;;;;;;;;;;GAWG;AAEH;;GAEG;AAEH;;;;;;;GAOG;AACH,oDALW,QAAQ,UACR,gBAAgB,GAEd,MAAM,EAAE,CAiBpB;AA+ND;;;;;;;;;;;;;GAaG;AACH,0CAPW,MAAM,UACN,MAAM,YACN,CAAC,Q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AoC,GAAG,gCAAgC,GACjF,2DAA6D,GAAG,6BAA6B,GAC7F,iDAAmD,GAAG,qCAAqC,GAC3F,qCAAuC,GAAG,gCAAgC,GAW9D,MAAM,CA4BlB;uBA/qBY,CAAC,OAAO,QAAQ,EAAE,MAAM,OAAO,QAAQ,CAAC;AA1BrD;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH;;;;;;;GAOG;AAqjBH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,oCAgCE;AAoDF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,0CAyDE;AAUK,oCAJI,GAAC,QACD,MAAM,QAOhB;AAwBM,uCAnBI,MAAM,UACN,MAAM,QAqDhB;;UA/4Ba,MAAM;UACN,MAAM;UACN,MAAM;SACN,MAAM;QACN,MAAM;SACN,MAAM;gBACN,MAAM;SACN,MAAM;uBACN,OAAO"}
@@ -1,10 +1,10 @@
1
- import { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments, } from "./utilities.js";
1
+ import { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments, check_standard_compliance, } from "./utilities.js";
2
2
  /**
3
3
  * @public
4
4
  * @name utilities
5
5
  * @docname Utilities
6
6
  */
7
- export { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments, };
7
+ export { body_surface_area, v_relative, clo_dynamic, units_converter, running_mean_outdoor_temperature, f_svv, met_typical_tasks, clo_typical_ensembles, clo_individual_garments, check_standard_compliance, };
8
8
  export default {
9
9
  body_surface_area,
10
10
  v_relative,
@@ -15,6 +15,7 @@ export default {
15
15
  met_typical_tasks,
16
16
  clo_typical_ensembles,
17
17
  clo_individual_garments,
18
+ check_standard_compliance,
18
19
  };
19
20
  /**
20
21
  * @public
@@ -57,7 +57,18 @@ export function transpose_sharp_altitude(sharp, altitude) {
57
57
  * @property {boolean} [airspeed_control]
58
58
  */
59
59
  /**
60
- * @typedef {"ANKLE_DRAFT" | "ASHRAE" | "FAN_HEATWAVES" | "ISO" | "ISO7933"} Standard
60
+ * Standard names accepted by {@link check_standard_compliance}.
61
+ */
62
+ export const Standard = Object.freeze({
63
+ ANKLE_DRAFT: "ANKLE_DRAFT",
64
+ ASHRAE: "ASHRAE",
65
+ FAN_HEATWAVES: "FAN_HEATWAVES",
66
+ ISO: "ISO",
67
+ ISO_7933_2004: "7933-2004",
68
+ ISO_7933_2023: "7933-2023",
69
+ });
70
+ /**
71
+ * @typedef {(typeof Standard)[keyof typeof Standard]} Standard
61
72
  */
62
73
  /**
63
74
  * Check that the values comply with the standard provided
@@ -69,16 +80,18 @@ export function transpose_sharp_altitude(sharp, altitude) {
69
80
  */
70
81
  export function check_standard_compliance(standard, kwargs) {
71
82
  switch (standard) {
72
- case "ANKLE_DRAFT":
83
+ case Standard.ANKLE_DRAFT:
73
84
  return _ankle_draft_compliance(kwargs);
74
- case "ASHRAE":
85
+ case Standard.ASHRAE:
75
86
  return _ashrae_compliance(kwargs);
76
- case "FAN_HEATWAVES":
87
+ case Standard.FAN_HEATWAVES:
77
88
  return _fan_heatwaves_compliance(kwargs);
78
- case "ISO":
89
+ case Standard.ISO:
79
90
  return _iso_compliance(kwargs);
80
- case "ISO7933":
81
- return _iso7933_compliance(kwargs);
91
+ case Standard.ISO_7933_2004:
92
+ return _iso7933_2004_compliance(kwargs);
93
+ case Standard.ISO_7933_2023:
94
+ return _iso7933_2023_compliance(kwargs);
82
95
  default:
83
96
  throw new Error("Unknown standard");
84
97
  }
@@ -227,22 +240,21 @@ function _iso_compliance(kwargs) {
227
240
  *
228
241
  * @returns {string[]} strings with warnings emitted
229
242
  */
230
- function _iso7933_compliance(kwargs) {
243
+ function _iso7933_2004_compliance(kwargs) {
244
+ // based on ISO 7933:2004 Annex A
231
245
  if (kwargs.tdb === undefined ||
232
- kwargs.rh === undefined ||
246
+ kwargs.p_a === undefined ||
233
247
  kwargs.tr === undefined ||
234
248
  kwargs.v === undefined ||
235
249
  kwargs.met === undefined ||
236
250
  kwargs.clo === undefined) {
237
- throw new Error(`Missing arguments for ISO7933 compliance check, got: ${kwargs} and requires tdb, rh, tr, v, met and clo`);
251
+ throw new Error(`Missing arguments for ISO 7933:2004 compliance check, got: ${kwargs} and requires tdb, p_a, tr, v, met and clo`);
238
252
  }
239
253
  /** @type {string[]} */
240
254
  let warnings = [];
241
255
  if (kwargs.tdb > 50 || kwargs.tdb < 15)
242
256
  warnings.push("ISO 7933:2004 air temperature applicability limits between 15 and 50 ºC");
243
- const p_sat_result = p_sat(kwargs.tdb);
244
- const p_a = ((p_sat_result / 1000) * kwargs.rh) / 100;
245
- if (p_a > 4.5 || p_a < 0)
257
+ if (kwargs.p_a > 4.5 || kwargs.p_a < 0)
246
258
  warnings.push("ISO 7933:2004 p_a applicability limits between 0 and 4.5 kPa");
247
259
  if (kwargs.tr > 60 || kwargs.tr < 0)
248
260
  warnings.push("ISO 7933:2004 tr applicability limits between 0 and 60 ºC");
@@ -254,6 +266,32 @@ function _iso7933_compliance(kwargs) {
254
266
  warnings.push("ISO 7933:2004 clo applicability limits between 0.1 and 1 clo");
255
267
  return warnings;
256
268
  }
269
+ function _iso7933_2023_compliance(kwargs) {
270
+ // based on ISO 7933:2023 Annex A
271
+ if (kwargs.tdb === undefined ||
272
+ kwargs.p_a === undefined ||
273
+ kwargs.tr === undefined ||
274
+ kwargs.v === undefined ||
275
+ kwargs.met === undefined ||
276
+ kwargs.clo === undefined) {
277
+ throw new Error(`Missing arguments for ISO 7933:2023 compliance check, got: ${kwargs} and requires tdb, p_a, tr, v, met and clo`);
278
+ }
279
+ /** @type {string[]} */
280
+ let warnings = [];
281
+ if (kwargs.tdb > 50 || kwargs.tdb < 15)
282
+ warnings.push("ISO 7933:2023 air temperature applicability limits between 15 and 50 ºC");
283
+ if (kwargs.p_a > 4.5 || kwargs.p_a < 0.5)
284
+ warnings.push("ISO 7933:2023 p_a applicability limits between 0.5 and 4.5 kPa");
285
+ if (kwargs.tr > 60 || kwargs.tr < 0)
286
+ warnings.push("ISO 7933:2023 tr applicability limits between 0 and 60 ºC");
287
+ if (kwargs.v > 3 || kwargs.v < 0)
288
+ warnings.push("ISO 7933:2023 air speed applicability limits between 0 and 3 m/s");
289
+ if (kwargs.met > 450 || kwargs.met < 100)
290
+ warnings.push("ISO 7933:2023 met applicability limits between 100 and 450 met");
291
+ if (kwargs.clo > 1 || kwargs.clo < 0.1)
292
+ warnings.push("ISO 7933:2023 clo applicability limits between 0.1 and 1 clo");
293
+ return warnings;
294
+ }
257
295
  /**
258
296
  * Returns the body surface area in square meters
259
297
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsthermalcomfort",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "A JavaScript package to calculate thermophysiological, thermal comfort, thermal stress indices",
5
5
  "type": "module",
6
6
  "files": [