jsthermalcomfort 0.1.2 → 0.1.3

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.clo_tout_array = exports.clo_tout = void 0;
4
- const utilities_1 = require("../utilities/utilities");
4
+ const utilities_js_1 = require("../utilities/utilities.js");
5
5
  /**
6
6
  * Representative clothing insulation Icl as a function of outdoor air
7
7
  * temperature at 06:00 a.m {@link #ref_4|[4]}.
@@ -24,11 +24,11 @@ const utilities_1 = require("../utilities/utilities");
24
24
  * @returns {number} Representative clothing insulation Icl, [clo]
25
25
  */
26
26
  function clo_tout(tout, units = "SI") {
27
- const t = units === "IP" ? (0, utilities_1.units_converter)({ tmp: tout }).tmp : tout;
27
+ const t = units === "IP" ? (0, utilities_js_1.units_converter)({ tmp: tout }).tmp : tout;
28
28
  let clo = t < 26 ? Math.pow(10, (-0.1635 - 0.0066 * t)) : 0.46;
29
29
  clo = t < 5 ? 0.818 - 0.0364 * t : clo;
30
30
  clo = t < -5 ? 1 : clo;
31
- return (0, utilities_1.round)(clo, 2);
31
+ return (0, utilities_js_1.round)(clo, 2);
32
32
  }
33
33
  exports.clo_tout = clo_tout;
34
34
  /**
@@ -20,7 +20,7 @@ const pmv_js_1 = require("./pmv.js");
20
20
  const a_pmv_js_1 = require("./a_pmv.js");
21
21
  const ankle_draft_js_1 = require("./ankle_draft.js");
22
22
  const e_pmv_js_1 = require("./e_pmv.js");
23
- const vertical_tmp_grad_ppd_1 = require("./vertical_tmp_grad_ppd");
23
+ const vertical_tmp_grad_ppd_js_1 = require("./vertical_tmp_grad_ppd.js");
24
24
  const use_fans_heatwave_js_1 = require("./use_fans_heatwave.js");
25
25
  const clo_tout_js_1 = require("./clo_tout.js");
26
26
  const utci_js_1 = require("./utci.js");
@@ -46,7 +46,7 @@ exports.default = {
46
46
  adaptive_en: adaptive_en_js_1.adaptive_en,
47
47
  adaptive_en_array: adaptive_en_js_1.adaptive_en_array,
48
48
  at: at_js_1.at,
49
- vertical_tmp_grad_ppd: vertical_tmp_grad_ppd_1.vertical_tmp_grad_ppd,
49
+ vertical_tmp_grad_ppd: vertical_tmp_grad_ppd_js_1.vertical_tmp_grad_ppd,
50
50
  set_tmp: set_tmp_js_1.set_tmp,
51
51
  set_tmp_array: set_tmp_js_1.set_tmp_array,
52
52
  adaptive_ashrae: adaptive_ashrae_js_1.adaptive_ashrae,
@@ -53,7 +53,7 @@ import { wc } from "./wc.js";
53
53
  import { adaptive_en } from "./adaptive_en.js";
54
54
  import { adaptive_en_array } from "./adaptive_en.js";
55
55
  import { at } from "./at.js";
56
- import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd";
56
+ import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd.js";
57
57
  import { set_tmp } from "./set_tmp.js";
58
58
  import { set_tmp_array } from "./set_tmp.js";
59
59
  import { adaptive_ashrae } from "./adaptive_ashrae.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA2B,iBAAiB;oBACxB,UAAU;wBACN,cAAc;oBAClB,UAAU;qBACT,WAAW;yBAqBS,eAAe;+BAAf,eAAe;iCAjBjD,uBAAuB;uCAAvB,uBAAuB;0BACa,gBAAgB;gCAAhB,gBAAgB;mBAExC,SAAS;4BACmB,kBAAkB;kCAAlB,kBAAkB;mBAC9C,SAAS;sCAUU,yBAAyB;wBAbxB,cAAc;8BAAd,cAAc;gCAKE,sBAAsB;sCAAtB,sBAAsB;2BAClD,iBAAiB;+BACb,qBAAqB;wBAHb,cAAc;8BAAd,cAAc;oBAKtB,UAAU;0BAAV,UAAU;qBADR,WAAW;2BAAX,WAAW;sBAET,YAAY;4BAAZ,YAAY;4BACnB,kBAAkB;sBACX,YAAY;4BAAZ,YAAY;mCAEZ,wBAAwB;qBAE1B,WAAW;2BAAX,WAAW;2BACjB,iBAAiB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA2B,iBAAiB;oBACxB,UAAU;wBACN,cAAc;oBAClB,UAAU;qBACT,WAAW;yBAqBS,eAAe;+BAAf,eAAe;iCAjBjD,uBAAuB;uCAAvB,uBAAuB;0BACa,gBAAgB;gCAAhB,gBAAgB;mBAExC,SAAS;4BACmB,kBAAkB;kCAAlB,kBAAkB;mBAC9C,SAAS;sCAUU,4BAA4B;wBAb3B,cAAc;8BAAd,cAAc;gCAKE,sBAAsB;sCAAtB,sBAAsB;2BAClD,iBAAiB;+BACb,qBAAqB;wBAHb,cAAc;8BAAd,cAAc;oBAKtB,UAAU;0BAAV,UAAU;qBADR,WAAW;2BAAX,WAAW;sBAET,YAAY;4BAAZ,YAAY;4BACnB,kBAAkB;sBACX,YAAY;4BAAZ,YAAY;mCAEZ,wBAAwB;qBAE1B,WAAW;2BAAX,WAAW;2BACjB,iBAAiB"}
@@ -1,4 +1,4 @@
1
- import { units_converter, round } from "../utilities/utilities";
1
+ import { units_converter, round } from "../utilities/utilities.js";
2
2
  /**
3
3
  * Representative clothing insulation Icl as a function of outdoor air
4
4
  * temperature at 06:00 a.m {@link #ref_4|[4]}.
@@ -18,7 +18,7 @@ import { pmv, pmv_array } from "./pmv.js";
18
18
  import { a_pmv, a_pmv_array } from "./a_pmv.js";
19
19
  import { ankle_draft } from "./ankle_draft.js";
20
20
  import { e_pmv, e_pmv_array } from "./e_pmv.js";
21
- import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd";
21
+ import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd.js";
22
22
  import { use_fans_heatwaves } from "./use_fans_heatwave.js";
23
23
  import { clo_tout, clo_tout_array } from "./clo_tout.js";
24
24
  import { utci, utci_array } from "./utci.js";
@@ -0,0 +1,91 @@
1
+ import { round, check_standard_compliance, units_converter, } from "../utilities/utilities.js";
2
+ import { pmv } from "../models/pmv.js";
3
+ /**
4
+ * @typedef {Object} VerTmpGradReturnType - a result set containing the predicted precentage of dissatisfied and the acceptability
5
+ * @property {number} PPD_vg Predicted Percentage of Dissatisfied occupants with vertical temperature gradient, [%]
6
+ * @property {boolean} Acceptability The ASHRAE 55 2020 standard defines that the value of air speed at the ankle level
7
+ * is acceptable if PPD_ad is lower or equal than 5 %
8
+ * @public
9
+ */
10
+ /**
11
+ * Calculates the percentage of thermally dissatisfied people with a vertical temperature gradient between feet and head {@link #ref_1|[1]} .
12
+ * This equation is only applicable for vr < 0.2 m/s (40 fps).
13
+ *
14
+ * @public
15
+ * @memberof models
16
+ * @docname Vertical air temperature gradient
17
+ *
18
+ * @param {number} tdb dry bulb air temperature, default in [°C] in [°F] if "units" = 'IP'.
19
+ *
20
+ * Note: The air temperature is the average value over two heights: 0.6 m (24 in.) and 1.1 m (43 in.) for seated occupants and 1.1 m
21
+ * (43 in.) and 1.7 m (67 in.) for standing occupants.
22
+ * @param {number} tr mean radiant temperature, default in [°C] in [°F] if "units" = 'IP'.
23
+ * @param {number} vr relative air speed, default in [m/s] in [fps] if "units" = "IP"
24
+ *
25
+ * Note: vr is the relative air speed caused by body movement and not the air speed measured by the air speed sensor.
26
+ * The relative air speed is the sum of the average air speed measured by the sensor plus the activity-generated air speed (Vag).
27
+ * Where Vag is the activity-generated air speed caused by motion of individual body parts. vr can be calculated using the function
28
+ * pythermalcomfort.utilities.v_relative().
29
+ * @param {number} rh relative humidity, [%].
30
+ * @param {number} met metabolic rate, [met]
31
+ * @param {number} clo clothing insulation, [clo]
32
+ *
33
+ * Note: The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent air layer.
34
+ * Consequently the ISO 7730 states that the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects for the effect of
35
+ * the body movement for met equal or higher than 1.2 met using the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation,
36
+ * clo, can be calculated using the function pythermalcomfort.utilities.clo_dynamic().
37
+ * @param {number} vertical_tmp_grad vertical temperature gradient between the feet and the head, default in [°C/m] in [°F/ft] if units = ‘IP’
38
+ * @param {"SI" | "IP"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
39
+ *
40
+ * @returns {VerTmpGradReturnType} Object with results of the PPD with vertical temprature gradient.
41
+ *
42
+ * @example
43
+ * const result = vertical_tmp_grad_ppd(25, 25, 0.1, 50, 1.2, 0.5, 7); // returns {'PPD_vg': 12.6, 'Acceptability': false}
44
+ */
45
+ export function vertical_tmp_grad_ppd(tdb, tr, vr, rh, met, clo, vertical_tmp_grad, units = "SI") {
46
+ if (units === "IP") {
47
+ ({
48
+ tdb: tdb,
49
+ tr: tr,
50
+ vr: vr,
51
+ } = units_converter({ tdb: tdb, tr: tr, vr: vr }, "IP"));
52
+ vertical_tmp_grad = (vertical_tmp_grad / 1.8) * 3.28;
53
+ }
54
+ const warnings = check_standard_compliance("ASHRAE", {
55
+ tdb: tdb,
56
+ tr: tr,
57
+ v_limited: vr,
58
+ rh: rh,
59
+ met: met,
60
+ clo: clo,
61
+ });
62
+ warnings.forEach((warning) => console.warn(warning));
63
+ const tsv = pmv(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
64
+ const ppd_vg = calculate_ppd_vg(tsv, vertical_tmp_grad);
65
+ const acceptability = check_acceptability(ppd_vg);
66
+ return {
67
+ PPD_vg: ppd_vg,
68
+ Acceptability: acceptability,
69
+ };
70
+ }
71
+ /**
72
+ * Calculate Predicted Percentage of Dissatisfied (PPD) based on tsv and vertical temperature gradient.
73
+ *
74
+ * @param {number} tsv - PMV in ashrae standard
75
+ * @param {number} vertical_tmp_grad - Vertical temperature gradient between the feet and the head
76
+ * @returns {number} Predicted Percentage of Dissatisfied occupants with vertical temperature gradient
77
+ */
78
+ function calculate_ppd_vg(tsv, vertical_tmp_grad) {
79
+ const numerator = Math.exp(0.13 * (tsv - 1.91) ** 2 + 0.15 * vertical_tmp_grad - 1.6);
80
+ const ppd_vg = round((numerator / (1 + numerator) - 0.345) * 100, 1);
81
+ return ppd_vg;
82
+ }
83
+ /**
84
+ * Check the acceptability based on ppd_vg
85
+ *
86
+ * @param {number} ppd_vg - PPD based on Vertical temperature gradient
87
+ * @returns {boolean} Acceptability
88
+ */
89
+ function check_acceptability(ppd_vg) {
90
+ return ppd_vg <= 5;
91
+ }
@@ -53,6 +53,7 @@ import { wc } from "./wc.js";
53
53
  import { adaptive_en } from "./adaptive_en.js";
54
54
  import { adaptive_en_array } from "./adaptive_en.js";
55
55
  import { at } from "./at.js";
56
+ import { vertical_tmp_grad_ppd } from "./vertical_tmp_grad_ppd.js";
56
57
  import { set_tmp } from "./set_tmp.js";
57
58
  import { set_tmp_array } from "./set_tmp.js";
58
59
  import { adaptive_ashrae } from "./adaptive_ashrae.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA2B,iBAAiB;oBACxB,UAAU;wBACN,cAAc;oBAClB,UAAU;qBACT,WAAW;yBAqBS,eAAe;+BAAf,eAAe;iCAjBjD,uBAAuB;uCAAvB,uBAAuB;0BACa,gBAAgB;gCAAhB,gBAAgB;mBAExC,SAAS;4BACmB,kBAAkB;kCAAlB,kBAAkB;mBAC9C,SAAS;wBAHW,cAAc;8BAAd,cAAc;gCAKE,sBAAsB;sCAAtB,sBAAsB;2BAClD,iBAAiB;+BACb,qBAAqB;wBAHb,cAAc;8BAAd,cAAc;oBAKtB,UAAU;0BAAV,UAAU;qBADR,WAAW;2BAAX,WAAW;sBAET,YAAY;4BAAZ,YAAY;4BACnB,kBAAkB;sBACX,YAAY;4BAAZ,YAAY;mCAEZ,wBAAwB;qBAE1B,WAAW;2BAAX,WAAW;2BACjB,iBAAiB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA2B,iBAAiB;oBACxB,UAAU;wBACN,cAAc;oBAClB,UAAU;qBACT,WAAW;yBAqBS,eAAe;+BAAf,eAAe;iCAjBjD,uBAAuB;uCAAvB,uBAAuB;0BACa,gBAAgB;gCAAhB,gBAAgB;mBAExC,SAAS;4BACmB,kBAAkB;kCAAlB,kBAAkB;mBAC9C,SAAS;sCAUU,4BAA4B;wBAb3B,cAAc;8BAAd,cAAc;gCAKE,sBAAsB;sCAAtB,sBAAsB;2BAClD,iBAAiB;+BACb,qBAAqB;wBAHb,cAAc;8BAAd,cAAc;oBAKtB,UAAU;0BAAV,UAAU;qBADR,WAAW;2BAAX,WAAW;sBAET,YAAY;4BAAZ,YAAY;4BACnB,kBAAkB;sBACX,YAAY;4BAAZ,YAAY;mCAEZ,wBAAwB;qBAE1B,WAAW;2BAAX,WAAW;2BACjB,iBAAiB"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @typedef {Object} VerTmpGradReturnType - a result set containing the predicted precentage of dissatisfied and the acceptability
3
+ * @property {number} PPD_vg Predicted Percentage of Dissatisfied occupants with vertical temperature gradient, [%]
4
+ * @property {boolean} Acceptability The ASHRAE 55 2020 standard defines that the value of air speed at the ankle level
5
+ * is acceptable if PPD_ad is lower or equal than 5 %
6
+ * @public
7
+ */
8
+ /**
9
+ * Calculates the percentage of thermally dissatisfied people with a vertical temperature gradient between feet and head {@link #ref_1|[1]} .
10
+ * This equation is only applicable for vr < 0.2 m/s (40 fps).
11
+ *
12
+ * @public
13
+ * @memberof models
14
+ * @docname Vertical air temperature gradient
15
+ *
16
+ * @param {number} tdb dry bulb air temperature, default in [°C] in [°F] if "units" = 'IP'.
17
+ *
18
+ * Note: The air temperature is the average value over two heights: 0.6 m (24 in.) and 1.1 m (43 in.) for seated occupants and 1.1 m
19
+ * (43 in.) and 1.7 m (67 in.) for standing occupants.
20
+ * @param {number} tr mean radiant temperature, default in [°C] in [°F] if "units" = 'IP'.
21
+ * @param {number} vr relative air speed, default in [m/s] in [fps] if "units" = "IP"
22
+ *
23
+ * Note: vr is the relative air speed caused by body movement and not the air speed measured by the air speed sensor.
24
+ * The relative air speed is the sum of the average air speed measured by the sensor plus the activity-generated air speed (Vag).
25
+ * Where Vag is the activity-generated air speed caused by motion of individual body parts. vr can be calculated using the function
26
+ * pythermalcomfort.utilities.v_relative().
27
+ * @param {number} rh relative humidity, [%].
28
+ * @param {number} met metabolic rate, [met]
29
+ * @param {number} clo clothing insulation, [clo]
30
+ *
31
+ * Note: The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent air layer.
32
+ * Consequently the ISO 7730 states that the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects for the effect of
33
+ * the body movement for met equal or higher than 1.2 met using the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation,
34
+ * clo, can be calculated using the function pythermalcomfort.utilities.clo_dynamic().
35
+ * @param {number} vertical_tmp_grad vertical temperature gradient between the feet and the head, default in [°C/m] in [°F/ft] if units = ‘IP’
36
+ * @param {"SI" | "IP"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
37
+ *
38
+ * @returns {VerTmpGradReturnType} Object with results of the PPD with vertical temprature gradient.
39
+ *
40
+ * @example
41
+ * const result = vertical_tmp_grad_ppd(25, 25, 0.1, 50, 1.2, 0.5, 7); // returns {'PPD_vg': 12.6, 'Acceptability': false}
42
+ */
43
+ export function vertical_tmp_grad_ppd(tdb: number, tr: number, vr: number, rh: number, met: number, clo: number, vertical_tmp_grad: number, units?: "SI" | "IP"): VerTmpGradReturnType;
44
+ /**
45
+ * - a result set containing the predicted precentage of dissatisfied and the acceptability
46
+ */
47
+ export type VerTmpGradReturnType = {
48
+ /**
49
+ * Predicted Percentage of Dissatisfied occupants with vertical temperature gradient, [%]
50
+ */
51
+ PPD_vg: number;
52
+ /**
53
+ * The ASHRAE 55 2020 standard defines that the value of air speed at the ankle level
54
+ * is acceptable if PPD_ad is lower or equal than 5 %
55
+ */
56
+ Acceptability: boolean;
57
+ };
58
+ //# sourceMappingURL=vertical_tmp_grad_ppd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vertical_tmp_grad_ppd.d.ts","sourceRoot":"","sources":["../../../../src/models/vertical_tmp_grad_ppd.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,2CA3BW,MAAM,MAIN,MAAM,MACN,MAAM,MAMN,MAAM,OACN,MAAM,OACN,MAAM,qBAMN,MAAM,UACN,IAAI,GAAG,IAAI,GAET,oBAAoB,CA0ChC;;;;;;;;YA9Ea,MAAM;;;;;mBACN,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsthermalcomfort",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A JavaScript package to calculate thermal comfort indices (e.g., Predicted Mean Vote, Standard Effective Temperature, Predicted Heat Strain).",
5
5
  "type": "module",
6
6
  "files": [