jsthermalcomfort 1.1.0 → 1.1.1
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.
- package/lib/cjs/index.js +17 -0
- package/lib/cjs/models/a_pmv.js +25 -0
- package/lib/cjs/models/adaptive_ashrae.js +9 -0
- package/lib/cjs/models/adaptive_en.js +9 -0
- package/lib/cjs/models/ankle_draft.js +11 -0
- package/lib/cjs/models/at.js +8 -0
- package/lib/cjs/models/athb.js +9 -0
- package/lib/cjs/models/clo_tout.js +6 -0
- package/lib/cjs/models/cooling_effect.js +11 -0
- package/lib/cjs/models/discomfort_index.js +5 -0
- package/lib/cjs/models/e_pmv.js +25 -0
- package/lib/cjs/models/heat_index.js +9 -0
- package/lib/cjs/models/humidex.js +6 -0
- package/lib/cjs/models/index.js +28 -5
- package/lib/cjs/models/net.js +7 -0
- package/lib/cjs/models/pet_steady.js +30 -0
- package/lib/cjs/models/phs.js +58 -0
- package/lib/cjs/models/pmv.js +28 -0
- package/lib/cjs/models/pmv_ppd.js +27 -3
- package/lib/cjs/models/pmv_ppd_ashrae.js +26 -0
- package/lib/cjs/models/pmv_ppd_iso.js +24 -0
- package/lib/cjs/models/set_tmp.js +33 -0
- package/lib/cjs/models/solar_gain.js +22 -2
- package/lib/cjs/models/two_nodes.js +42 -10
- package/lib/cjs/models/use_fans_heatwave.js +35 -0
- package/lib/cjs/models/utci.js +41 -27
- package/lib/cjs/models/vertical_tmp_grad_ppd.js +12 -0
- package/lib/cjs/models/wbgt.js +14 -0
- package/lib/cjs/models/wc.js +6 -0
- package/lib/cjs/psychrometrics/index.js +9 -5
- package/lib/cjs/psychrometrics/t_mrt.js +1 -1
- package/lib/cjs/types/index.d.ts +3 -0
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/models/JOS3.d.ts +3 -3
- package/lib/cjs/types/models/JOS3.d.ts.map +1 -1
- package/lib/cjs/types/models/a_pmv.d.ts +3 -68
- package/lib/cjs/types/models/a_pmv.d.ts.map +1 -1
- package/lib/cjs/types/models/adaptive_ashrae.d.ts +9 -74
- package/lib/cjs/types/models/adaptive_ashrae.d.ts.map +1 -1
- package/lib/cjs/types/models/adaptive_en.d.ts +12 -63
- package/lib/cjs/types/models/adaptive_en.d.ts.map +1 -1
- package/lib/cjs/types/models/ankle_draft.d.ts +4 -49
- package/lib/cjs/types/models/ankle_draft.d.ts.map +1 -1
- package/lib/cjs/types/models/at.d.ts +5 -38
- package/lib/cjs/types/models/at.d.ts.map +1 -1
- package/lib/cjs/types/models/athb.d.ts +3 -51
- package/lib/cjs/types/models/athb.d.ts.map +1 -1
- package/lib/cjs/types/models/clo_tout.d.ts +3 -26
- package/lib/cjs/types/models/clo_tout.d.ts.map +1 -1
- package/lib/cjs/types/models/cooling_effect.d.ts +3 -52
- package/lib/cjs/types/models/cooling_effect.d.ts.map +1 -1
- package/lib/cjs/types/models/discomfort_index.d.ts +4 -31
- package/lib/cjs/types/models/discomfort_index.d.ts.map +1 -1
- package/lib/cjs/types/models/e_pmv.d.ts +3 -71
- package/lib/cjs/types/models/e_pmv.d.ts.map +1 -1
- package/lib/cjs/types/models/heat_index.d.ts +6 -31
- package/lib/cjs/types/models/heat_index.d.ts.map +1 -1
- package/lib/cjs/types/models/humidex.d.ts +6 -37
- package/lib/cjs/types/models/humidex.d.ts.map +1 -1
- package/lib/cjs/types/models/index.d.ts +1 -0
- package/lib/cjs/types/models/net.d.ts +5 -43
- package/lib/cjs/types/models/net.d.ts.map +1 -1
- package/lib/cjs/types/models/pet_steady.d.ts +5 -56
- package/lib/cjs/types/models/pet_steady.d.ts.map +1 -1
- package/lib/cjs/types/models/phs.d.ts +28 -121
- package/lib/cjs/types/models/phs.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv.d.ts +1 -94
- package/lib/cjs/types/models/pmv.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv_ppd.d.ts +4 -102
- package/lib/cjs/types/models/pmv_ppd.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts +4 -48
- package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv_ppd_iso.d.ts +4 -48
- package/lib/cjs/types/models/pmv_ppd_iso.d.ts.map +1 -1
- package/lib/cjs/types/models/set_tmp.d.ts +3 -48
- package/lib/cjs/types/models/set_tmp.d.ts.map +1 -1
- package/lib/cjs/types/models/solar_gain.d.ts +4 -56
- package/lib/cjs/types/models/solar_gain.d.ts.map +1 -1
- package/lib/cjs/types/models/two_nodes.d.ts +58 -110
- package/lib/cjs/types/models/two_nodes.d.ts.map +1 -1
- package/lib/cjs/types/models/use_fans_heatwave.d.ts +1 -92
- package/lib/cjs/types/models/use_fans_heatwave.d.ts.map +1 -1
- package/lib/cjs/types/models/utci.d.ts +8 -35
- package/lib/cjs/types/models/utci.d.ts.map +1 -1
- package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts +4 -43
- package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts.map +1 -1
- package/lib/cjs/types/models/wbgt.d.ts +3 -55
- package/lib/cjs/types/models/wbgt.d.ts.map +1 -1
- package/lib/cjs/types/models/wc.d.ts +2 -25
- package/lib/cjs/types/models/wc.d.ts.map +1 -1
- package/lib/cjs/types/psychrometrics/index.d.ts +1 -0
- package/lib/cjs/types/utilities/index.d.ts +2 -0
- package/lib/cjs/types/utilities/index.d.ts.map +1 -1
- package/lib/cjs/types/utilities/utilities.d.ts +2 -0
- package/lib/cjs/types/utilities/utilities.d.ts.map +1 -1
- package/lib/cjs/utilities/index.js +11 -5
- package/lib/cjs/utilities/utilities.js +58 -1
- package/lib/esm/index.js +3 -0
- package/lib/esm/models/a_pmv.js +25 -1
- package/lib/esm/models/adaptive_ashrae.js +10 -1
- package/lib/esm/models/adaptive_en.js +10 -1
- package/lib/esm/models/ankle_draft.js +12 -1
- package/lib/esm/models/at.js +9 -1
- package/lib/esm/models/athb.js +10 -1
- package/lib/esm/models/clo_tout.js +7 -1
- package/lib/esm/models/cooling_effect.js +12 -1
- package/lib/esm/models/discomfort_index.js +6 -1
- package/lib/esm/models/e_pmv.js +25 -1
- package/lib/esm/models/heat_index.js +10 -1
- package/lib/esm/models/humidex.js +7 -1
- package/lib/esm/models/index.js +1 -0
- package/lib/esm/models/net.js +8 -1
- package/lib/esm/models/pet_steady.js +31 -1
- package/lib/esm/models/phs.js +59 -1
- package/lib/esm/models/pmv.js +27 -0
- package/lib/esm/models/pmv_ppd.js +27 -4
- package/lib/esm/models/pmv_ppd_ashrae.js +25 -0
- package/lib/esm/models/pmv_ppd_iso.js +23 -0
- package/lib/esm/models/set_tmp.js +34 -1
- package/lib/esm/models/solar_gain.js +23 -3
- package/lib/esm/models/two_nodes.js +43 -11
- package/lib/esm/models/use_fans_heatwave.js +36 -1
- package/lib/esm/models/utci.js +42 -29
- package/lib/esm/models/vertical_tmp_grad_ppd.js +13 -1
- package/lib/esm/models/wbgt.js +15 -1
- package/lib/esm/models/wc.js +7 -1
- package/lib/esm/psychrometrics/index.js +1 -0
- package/lib/esm/psychrometrics/t_mrt.js +1 -1
- package/lib/esm/types/index.d.ts +3 -0
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/models/JOS3.d.ts +3 -3
- package/lib/esm/types/models/JOS3.d.ts.map +1 -1
- package/lib/esm/types/models/a_pmv.d.ts +3 -68
- package/lib/esm/types/models/a_pmv.d.ts.map +1 -1
- package/lib/esm/types/models/adaptive_ashrae.d.ts +9 -74
- package/lib/esm/types/models/adaptive_ashrae.d.ts.map +1 -1
- package/lib/esm/types/models/adaptive_en.d.ts +12 -63
- package/lib/esm/types/models/adaptive_en.d.ts.map +1 -1
- package/lib/esm/types/models/ankle_draft.d.ts +4 -49
- package/lib/esm/types/models/ankle_draft.d.ts.map +1 -1
- package/lib/esm/types/models/at.d.ts +5 -38
- package/lib/esm/types/models/at.d.ts.map +1 -1
- package/lib/esm/types/models/athb.d.ts +3 -51
- package/lib/esm/types/models/athb.d.ts.map +1 -1
- package/lib/esm/types/models/clo_tout.d.ts +3 -26
- package/lib/esm/types/models/clo_tout.d.ts.map +1 -1
- package/lib/esm/types/models/cooling_effect.d.ts +3 -52
- package/lib/esm/types/models/cooling_effect.d.ts.map +1 -1
- package/lib/esm/types/models/discomfort_index.d.ts +4 -31
- package/lib/esm/types/models/discomfort_index.d.ts.map +1 -1
- package/lib/esm/types/models/e_pmv.d.ts +3 -71
- package/lib/esm/types/models/e_pmv.d.ts.map +1 -1
- package/lib/esm/types/models/heat_index.d.ts +6 -31
- package/lib/esm/types/models/heat_index.d.ts.map +1 -1
- package/lib/esm/types/models/humidex.d.ts +6 -37
- package/lib/esm/types/models/humidex.d.ts.map +1 -1
- package/lib/esm/types/models/index.d.ts +1 -0
- package/lib/esm/types/models/net.d.ts +5 -43
- package/lib/esm/types/models/net.d.ts.map +1 -1
- package/lib/esm/types/models/pet_steady.d.ts +5 -56
- package/lib/esm/types/models/pet_steady.d.ts.map +1 -1
- package/lib/esm/types/models/phs.d.ts +28 -121
- package/lib/esm/types/models/phs.d.ts.map +1 -1
- package/lib/esm/types/models/pmv.d.ts +1 -94
- package/lib/esm/types/models/pmv.d.ts.map +1 -1
- package/lib/esm/types/models/pmv_ppd.d.ts +4 -102
- package/lib/esm/types/models/pmv_ppd.d.ts.map +1 -1
- package/lib/esm/types/models/pmv_ppd_ashrae.d.ts +4 -48
- package/lib/esm/types/models/pmv_ppd_ashrae.d.ts.map +1 -1
- package/lib/esm/types/models/pmv_ppd_iso.d.ts +4 -48
- package/lib/esm/types/models/pmv_ppd_iso.d.ts.map +1 -1
- package/lib/esm/types/models/set_tmp.d.ts +3 -48
- package/lib/esm/types/models/set_tmp.d.ts.map +1 -1
- package/lib/esm/types/models/solar_gain.d.ts +4 -56
- package/lib/esm/types/models/solar_gain.d.ts.map +1 -1
- package/lib/esm/types/models/two_nodes.d.ts +58 -110
- package/lib/esm/types/models/two_nodes.d.ts.map +1 -1
- package/lib/esm/types/models/use_fans_heatwave.d.ts +1 -92
- package/lib/esm/types/models/use_fans_heatwave.d.ts.map +1 -1
- package/lib/esm/types/models/utci.d.ts +8 -35
- package/lib/esm/types/models/utci.d.ts.map +1 -1
- package/lib/esm/types/models/vertical_tmp_grad_ppd.d.ts +4 -43
- package/lib/esm/types/models/vertical_tmp_grad_ppd.d.ts.map +1 -1
- package/lib/esm/types/models/wbgt.d.ts +3 -55
- package/lib/esm/types/models/wbgt.d.ts.map +1 -1
- package/lib/esm/types/models/wc.d.ts +2 -25
- package/lib/esm/types/models/wc.d.ts.map +1 -1
- package/lib/esm/types/psychrometrics/index.d.ts +1 -0
- package/lib/esm/types/utilities/index.d.ts +2 -0
- package/lib/esm/types/utilities/index.d.ts.map +1 -1
- package/lib/esm/types/utilities/utilities.d.ts +2 -0
- package/lib/esm/types/utilities/utilities.d.ts.map +1 -1
- package/lib/esm/utilities/index.js +2 -1
- package/lib/esm/utilities/utilities.js +55 -0
- package/package.json +2 -2
package/lib/cjs/index.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
5
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./utilities/index.js"), exports);
|
|
21
|
+
__exportStar(require("./psychrometrics/index.js"), exports);
|
|
22
|
+
__exportStar(require("./models/index.js"), exports);
|
|
6
23
|
const index_js_1 = __importDefault(require("./utilities/index.js"));
|
|
7
24
|
const index_js_2 = __importDefault(require("./psychrometrics/index.js"));
|
|
8
25
|
const index_js_3 = __importDefault(require("./models/index.js"));
|
package/lib/cjs/models/a_pmv.js
CHANGED
|
@@ -70,7 +70,32 @@ const pmv_js_1 = require("./pmv.js");
|
|
|
70
70
|
* const result = a_pmv(tdb, tr, vr, rh, met, clo, a_coefficient, wme);
|
|
71
71
|
* console.log(result) //output { a_pmv: 0.48 }
|
|
72
72
|
*/
|
|
73
|
+
const A_PMV_SCHEMA = {
|
|
74
|
+
tdb: { type: "number" },
|
|
75
|
+
tr: { type: "number" },
|
|
76
|
+
vr: { type: "number" },
|
|
77
|
+
rh: { type: "number" },
|
|
78
|
+
met: { type: "number" },
|
|
79
|
+
clo: { type: "number" },
|
|
80
|
+
a_coefficient: { type: "number" },
|
|
81
|
+
wme: { type: "number" },
|
|
82
|
+
units: { enum: ["SI", "IP"] },
|
|
83
|
+
limit_inputs: { type: "boolean", required: false },
|
|
84
|
+
};
|
|
73
85
|
function a_pmv(tdb, tr, vr, rh, met, clo, a_coefficient, wme = 0, kwargs = {}) {
|
|
86
|
+
var _a;
|
|
87
|
+
(0, utilities_js_1.validateInputs)({
|
|
88
|
+
tdb,
|
|
89
|
+
tr,
|
|
90
|
+
vr,
|
|
91
|
+
rh,
|
|
92
|
+
met,
|
|
93
|
+
clo,
|
|
94
|
+
a_coefficient,
|
|
95
|
+
wme,
|
|
96
|
+
units: ((_a = kwargs.units) !== null && _a !== void 0 ? _a : "SI").toUpperCase(),
|
|
97
|
+
limit_inputs: kwargs.limit_inputs,
|
|
98
|
+
}, A_PMV_SCHEMA);
|
|
74
99
|
const default_kwargs = {
|
|
75
100
|
units: "SI",
|
|
76
101
|
limit_inputs: true,
|
|
@@ -77,7 +77,16 @@ const adaptive_en_js_1 = require("./adaptive_en.js");
|
|
|
77
77
|
* // The adaptive thermal comfort model can only be used
|
|
78
78
|
* // if the running mean temperature is higher than 10°C
|
|
79
79
|
*/
|
|
80
|
+
const ADAPTIVE_ASHRAE_SCHEMA = {
|
|
81
|
+
tdb: { type: "number" },
|
|
82
|
+
tr: { type: "number" },
|
|
83
|
+
t_running_mean: { type: "number" },
|
|
84
|
+
v: { type: "number" },
|
|
85
|
+
units: { enum: ["SI", "IP"] },
|
|
86
|
+
limit_inputs: { type: "boolean" },
|
|
87
|
+
};
|
|
80
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);
|
|
81
90
|
const standard = "ASHRAE";
|
|
82
91
|
if (units.toUpperCase() === "IP") {
|
|
83
92
|
({
|
|
@@ -66,7 +66,16 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
66
66
|
* // The adaptive thermal comfort model can only be used
|
|
67
67
|
* // if the running mean temperature is between 10 °C and 30 °C
|
|
68
68
|
*/
|
|
69
|
+
const ADAPTIVE_EN_SCHEMA = {
|
|
70
|
+
tdb: { type: "number" },
|
|
71
|
+
tr: { type: "number" },
|
|
72
|
+
t_running_mean: { type: "number" },
|
|
73
|
+
v: { type: "number" },
|
|
74
|
+
units: { enum: ["SI", "IP"] },
|
|
75
|
+
limit_inputs: { type: "boolean" },
|
|
76
|
+
};
|
|
69
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);
|
|
70
79
|
const standard = "ISO";
|
|
71
80
|
if (units.toLowerCase() == "ip") {
|
|
72
81
|
({
|
|
@@ -51,7 +51,18 @@ const pmv_js_1 = require("./pmv.js");
|
|
|
51
51
|
* console.log(results) // expected result is {PPD_ad: 18.5, Acceptability: true}
|
|
52
52
|
*
|
|
53
53
|
*/
|
|
54
|
+
const ANKLE_DRAFT_SCHEMA = {
|
|
55
|
+
tdb: { type: "number" },
|
|
56
|
+
tr: { type: "number" },
|
|
57
|
+
vr: { type: "number" },
|
|
58
|
+
rh: { type: "number" },
|
|
59
|
+
met: { type: "number" },
|
|
60
|
+
clo: { type: "number" },
|
|
61
|
+
v_ankle: { type: "number" },
|
|
62
|
+
units: { enum: ["SI", "IP"] },
|
|
63
|
+
};
|
|
54
64
|
function ankle_draft(tdb, tr, vr, rh, met, clo, v_ankle, units = "SI") {
|
|
65
|
+
(0, utilities_js_1.validateInputs)({ tdb, tr, vr, rh, met, clo, v_ankle, units: units.toUpperCase() }, ANKLE_DRAFT_SCHEMA);
|
|
55
66
|
let kwargs = {};
|
|
56
67
|
let ret = 0;
|
|
57
68
|
if (units.toLowerCase() == "ip") {
|
package/lib/cjs/models/at.js
CHANGED
|
@@ -38,7 +38,15 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
38
38
|
* const result = at(25, 30, 0.1);
|
|
39
39
|
* console.log(result); // {at: 24.1}
|
|
40
40
|
*/
|
|
41
|
+
const AT_SCHEMA = {
|
|
42
|
+
tdb: { type: "number" },
|
|
43
|
+
rh: { type: "number" },
|
|
44
|
+
v: { type: "number" },
|
|
45
|
+
q: { type: "number", required: false },
|
|
46
|
+
round: { type: "boolean", required: false },
|
|
47
|
+
};
|
|
41
48
|
function at(tdb, rh, v, q, kwargs = { round: true }) {
|
|
49
|
+
(0, utilities_js_1.validateInputs)({ tdb, rh, v, q, round: kwargs.round }, AT_SCHEMA);
|
|
42
50
|
// dividing it by 100 since the at eq. requires p_vap to be in hPa
|
|
43
51
|
const p_vap = (0, psy_ta_rh_js_1.psy_ta_rh)(tdb, rh).p_vap / 100;
|
|
44
52
|
let t_at;
|
package/lib/cjs/models/athb.js
CHANGED
|
@@ -53,7 +53,16 @@ const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
|
53
53
|
* const athb_result = athb(tdb, tr, vr, rh, met, t_running_mean);
|
|
54
54
|
* console.log(athb_result); // Output: {athb_pmv: 0.2}
|
|
55
55
|
*/
|
|
56
|
+
const ATHB_SCHEMA = {
|
|
57
|
+
tdb: { type: "number" },
|
|
58
|
+
tr: { type: "number" },
|
|
59
|
+
vr: { type: "number" },
|
|
60
|
+
rh: { type: "number" },
|
|
61
|
+
met: { type: "number" },
|
|
62
|
+
t_running_mean: { type: "number" },
|
|
63
|
+
};
|
|
56
64
|
function athb(tdb, tr, vr, rh, met, t_running_mean) {
|
|
65
|
+
(0, utilities_js_1.validateInputs)({ tdb, tr, vr, rh, met, t_running_mean }, ATHB_SCHEMA);
|
|
57
66
|
const met_adapted = met - (0.234 * t_running_mean) / 58.2;
|
|
58
67
|
const clo_adapted = Math.pow(10, -0.17168 -
|
|
59
68
|
0.000485 * t_running_mean +
|
|
@@ -27,7 +27,13 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
27
27
|
*
|
|
28
28
|
* @returns {CloToutResult} set containing results for the model
|
|
29
29
|
*/
|
|
30
|
+
const CLO_TOUT_SCHEMA = {
|
|
31
|
+
tout: { type: "number" },
|
|
32
|
+
units: { enum: ["SI", "IP"] },
|
|
33
|
+
};
|
|
30
34
|
function clo_tout(tout, units = "SI") {
|
|
35
|
+
units = units.toUpperCase();
|
|
36
|
+
(0, utilities_js_1.validateInputs)({ tout, units }, CLO_TOUT_SCHEMA);
|
|
31
37
|
const t = units === "IP" ? (0, utilities_js_1.units_converter)({ tmp: tout }).tmp : tout;
|
|
32
38
|
let clo = t < 26 ? Math.pow(10, (-0.1635 - 0.0066 * t)) : 0.46;
|
|
33
39
|
clo = t < 5 ? 0.818 - 0.0364 * t : clo;
|
|
@@ -55,7 +55,18 @@ const set_tmp_js_1 = require("./set_tmp.js");
|
|
|
55
55
|
* const CE_IP = cooling_effect(77, 77, 1.64, 50, 1, 0.6, "IP");
|
|
56
56
|
* console.log(CE_IP); // Output: {ce: 3.74}
|
|
57
57
|
*/
|
|
58
|
+
const COOLING_EFFECT_SCHEMA = {
|
|
59
|
+
tdb: { type: "number" },
|
|
60
|
+
tr: { type: "number" },
|
|
61
|
+
vr: { type: "number" },
|
|
62
|
+
rh: { type: "number" },
|
|
63
|
+
met: { type: "number" },
|
|
64
|
+
clo: { type: "number" },
|
|
65
|
+
wme: { type: "number" },
|
|
66
|
+
units: { enum: ["SI", "IP"] },
|
|
67
|
+
};
|
|
58
68
|
function cooling_effect(tdb, tr, vr, rh, met, clo, wme = 0, units = "SI") {
|
|
69
|
+
(0, utilities_js_1.validateInputs)({ tdb, tr, vr, rh, met, clo, wme, units: units.toUpperCase() }, COOLING_EFFECT_SCHEMA);
|
|
59
70
|
if (units.toLowerCase() === "ip") {
|
|
60
71
|
const result = (0, utilities_js_1.units_converter)({ tdb, tr, vr }, "IP");
|
|
61
72
|
tdb = result.tdb;
|
|
@@ -32,7 +32,12 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
32
32
|
* @example
|
|
33
33
|
* const DI = discomfort_index(25, 50); // returns { di: 22.1, discomfort_condition: 'Less than 50% feels discomfort' }
|
|
34
34
|
*/
|
|
35
|
+
const DISCOMFORT_INDEX_SCHEMA = {
|
|
36
|
+
tdb: { type: "number" },
|
|
37
|
+
rh: { type: "number" },
|
|
38
|
+
};
|
|
35
39
|
function discomfort_index(tdb, rh) {
|
|
40
|
+
(0, utilities_js_1.validateInputs)({ tdb, rh }, DISCOMFORT_INDEX_SCHEMA);
|
|
36
41
|
const di = calculate_di(tdb, rh);
|
|
37
42
|
const condition = check_categories(di);
|
|
38
43
|
return {
|
package/lib/cjs/models/e_pmv.js
CHANGED
|
@@ -73,12 +73,37 @@ const pmv_js_1 = require("./pmv.js");
|
|
|
73
73
|
* const result = e_pmv(tdb, tr, v_r, rh, met, clo_d, e_coefficient);
|
|
74
74
|
* console.log(result) // output {e_pmv: 0.51}
|
|
75
75
|
*/
|
|
76
|
+
const E_PMV_SCHEMA = {
|
|
77
|
+
tdb: { type: "number" },
|
|
78
|
+
tr: { type: "number" },
|
|
79
|
+
vr: { type: "number" },
|
|
80
|
+
rh: { type: "number" },
|
|
81
|
+
met: { type: "number" },
|
|
82
|
+
clo: { type: "number" },
|
|
83
|
+
e_coefficient: { type: "number" },
|
|
84
|
+
wme: { type: "number" },
|
|
85
|
+
units: { enum: ["SI", "IP"] },
|
|
86
|
+
limit_inputs: { type: "boolean", required: false },
|
|
87
|
+
};
|
|
76
88
|
function e_pmv(tdb, tr, vr, rh, met, clo, e_coefficient, wme = 0, kwargs = {}) {
|
|
89
|
+
var _a;
|
|
77
90
|
const default_kwargs = {
|
|
78
91
|
units: "SI",
|
|
79
92
|
limit_inputs: true,
|
|
80
93
|
};
|
|
81
94
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
95
|
+
(0, utilities_js_1.validateInputs)({
|
|
96
|
+
tdb,
|
|
97
|
+
tr,
|
|
98
|
+
vr,
|
|
99
|
+
rh,
|
|
100
|
+
met,
|
|
101
|
+
clo,
|
|
102
|
+
e_coefficient,
|
|
103
|
+
wme,
|
|
104
|
+
units: ((_a = kwargs.units) !== null && _a !== void 0 ? _a : "SI").toUpperCase(),
|
|
105
|
+
limit_inputs: kwargs.limit_inputs,
|
|
106
|
+
}, E_PMV_SCHEMA);
|
|
82
107
|
let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
83
108
|
met = _pmv > 0 ? met * (1 + _pmv * -0.067) : met;
|
|
84
109
|
_pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
@@ -29,7 +29,16 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
29
29
|
*
|
|
30
30
|
* @category Thermophysiological models
|
|
31
31
|
*/
|
|
32
|
+
const HEAT_INDEX_SCHEMA = {
|
|
33
|
+
tdb: { type: "number" },
|
|
34
|
+
rh: { type: "number" },
|
|
35
|
+
round: { type: "boolean", required: false },
|
|
36
|
+
units: { enum: ["SI", "IP"], required: false },
|
|
37
|
+
};
|
|
32
38
|
function heat_index(tdb, rh, options = { round: true, units: "SI" }) {
|
|
39
|
+
if (options.units)
|
|
40
|
+
options.units = options.units.toUpperCase();
|
|
41
|
+
(0, utilities_js_1.validateInputs)({ tdb, rh, round: options.round, units: options.units }, HEAT_INDEX_SCHEMA);
|
|
33
42
|
let hi;
|
|
34
43
|
let tdb_squared = Math.pow(tdb, 2);
|
|
35
44
|
let rh_squared = Math.pow(rh, 2);
|
|
@@ -36,7 +36,13 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
36
36
|
* const result = humidex(25, 50);
|
|
37
37
|
* console.log(result); // -> { humidex: 28.2, discomfort: "Little or no discomfort" }
|
|
38
38
|
*/
|
|
39
|
+
const HUMIDEX_SCHEMA = {
|
|
40
|
+
tdb: { type: "number" },
|
|
41
|
+
rh: { type: "number" },
|
|
42
|
+
round: { type: "boolean", required: false },
|
|
43
|
+
};
|
|
39
44
|
function humidex(tdb, rh, options = { round: true }) {
|
|
45
|
+
(0, utilities_js_1.validateInputs)({ tdb, rh, round: options.round }, HUMIDEX_SCHEMA);
|
|
40
46
|
let hi = tdb +
|
|
41
47
|
(5 / 9) * ((6.112 * Math.pow(10, ((7.5 * tdb) / (237.7 + tdb))) * rh) / 100 - 10);
|
|
42
48
|
if (options.round) {
|
package/lib/cjs/models/index.js
CHANGED
|
@@ -1,38 +1,61 @@
|
|
|
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
4
|
const heat_index_js_1 = require("./heat_index.js");
|
|
5
|
+
Object.defineProperty(exports, "heat_index", { enumerable: true, get: function () { return heat_index_js_1.heat_index; } });
|
|
4
6
|
const phs_js_1 = require("./phs.js");
|
|
7
|
+
Object.defineProperty(exports, "phs", { enumerable: true, get: function () { return phs_js_1.phs; } });
|
|
5
8
|
const humidex_js_1 = require("./humidex.js");
|
|
9
|
+
Object.defineProperty(exports, "humidex", { enumerable: true, get: function () { return humidex_js_1.humidex; } });
|
|
6
10
|
const net_js_1 = require("./net.js");
|
|
11
|
+
Object.defineProperty(exports, "net", { enumerable: true, get: function () { return net_js_1.net; } });
|
|
7
12
|
const wbgt_js_1 = require("./wbgt.js");
|
|
13
|
+
Object.defineProperty(exports, "wbgt", { enumerable: true, get: function () { return wbgt_js_1.wbgt; } });
|
|
8
14
|
const discomfort_index_js_1 = require("./discomfort_index.js");
|
|
15
|
+
Object.defineProperty(exports, "discomfort_index", { enumerable: true, get: function () { return discomfort_index_js_1.discomfort_index; } });
|
|
9
16
|
const two_nodes_js_1 = require("./two_nodes.js");
|
|
17
|
+
Object.defineProperty(exports, "two_nodes", { enumerable: true, get: function () { return two_nodes_js_1.two_nodes; } });
|
|
10
18
|
const set_tmp_js_1 = require("./set_tmp.js");
|
|
19
|
+
Object.defineProperty(exports, "set_tmp", { enumerable: true, get: function () { return set_tmp_js_1.set_tmp; } });
|
|
11
20
|
const wc_js_1 = require("./wc.js");
|
|
21
|
+
Object.defineProperty(exports, "wc", { enumerable: true, get: function () { return wc_js_1.wc; } });
|
|
12
22
|
const adaptive_en_js_1 = require("./adaptive_en.js");
|
|
23
|
+
Object.defineProperty(exports, "adaptive_en", { enumerable: true, get: function () { return adaptive_en_js_1.adaptive_en; } });
|
|
13
24
|
const at_js_1 = require("./at.js");
|
|
25
|
+
Object.defineProperty(exports, "at", { enumerable: true, get: function () { return at_js_1.at; } });
|
|
14
26
|
const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
27
|
+
Object.defineProperty(exports, "pmv_ppd", { enumerable: true, get: function () { return pmv_ppd_js_1.pmv_ppd; } });
|
|
15
28
|
const pmv_ppd_ashrae_js_1 = require("./pmv_ppd_ashrae.js");
|
|
29
|
+
Object.defineProperty(exports, "pmv_ppd_ashrae", { enumerable: true, get: function () { return pmv_ppd_ashrae_js_1.pmv_ppd_ashrae; } });
|
|
16
30
|
const pmv_ppd_iso_js_1 = require("./pmv_ppd_iso.js");
|
|
31
|
+
Object.defineProperty(exports, "pmv_ppd_iso", { enumerable: true, get: function () { return pmv_ppd_iso_js_1.pmv_ppd_iso; } });
|
|
17
32
|
const adaptive_ashrae_js_1 = require("./adaptive_ashrae.js");
|
|
33
|
+
Object.defineProperty(exports, "adaptive_ashrae", { enumerable: true, get: function () { return adaptive_ashrae_js_1.adaptive_ashrae; } });
|
|
18
34
|
const solar_gain_js_1 = require("./solar_gain.js");
|
|
35
|
+
Object.defineProperty(exports, "solar_gain", { enumerable: true, get: function () { return solar_gain_js_1.solar_gain; } });
|
|
19
36
|
const cooling_effect_js_1 = require("./cooling_effect.js");
|
|
37
|
+
Object.defineProperty(exports, "cooling_effect", { enumerable: true, get: function () { return cooling_effect_js_1.cooling_effect; } });
|
|
20
38
|
const athb_js_1 = require("./athb.js");
|
|
39
|
+
Object.defineProperty(exports, "athb", { enumerable: true, get: function () { return athb_js_1.athb; } });
|
|
21
40
|
const pmv_js_1 = require("./pmv.js");
|
|
41
|
+
Object.defineProperty(exports, "pmv", { enumerable: true, get: function () { return pmv_js_1.pmv; } });
|
|
22
42
|
const a_pmv_js_1 = require("./a_pmv.js");
|
|
43
|
+
Object.defineProperty(exports, "a_pmv", { enumerable: true, get: function () { return a_pmv_js_1.a_pmv; } });
|
|
23
44
|
const ankle_draft_js_1 = require("./ankle_draft.js");
|
|
45
|
+
Object.defineProperty(exports, "ankle_draft", { enumerable: true, get: function () { return ankle_draft_js_1.ankle_draft; } });
|
|
24
46
|
const e_pmv_js_1 = require("./e_pmv.js");
|
|
47
|
+
Object.defineProperty(exports, "e_pmv", { enumerable: true, get: function () { return e_pmv_js_1.e_pmv; } });
|
|
25
48
|
const vertical_tmp_grad_ppd_js_1 = require("./vertical_tmp_grad_ppd.js");
|
|
49
|
+
Object.defineProperty(exports, "vertical_tmp_grad_ppd", { enumerable: true, get: function () { return vertical_tmp_grad_ppd_js_1.vertical_tmp_grad_ppd; } });
|
|
26
50
|
const use_fans_heatwave_js_1 = require("./use_fans_heatwave.js");
|
|
51
|
+
Object.defineProperty(exports, "use_fans_heatwaves", { enumerable: true, get: function () { return use_fans_heatwave_js_1.use_fans_heatwaves; } });
|
|
27
52
|
const clo_tout_js_1 = require("./clo_tout.js");
|
|
53
|
+
Object.defineProperty(exports, "clo_tout", { enumerable: true, get: function () { return clo_tout_js_1.clo_tout; } });
|
|
28
54
|
const utci_js_1 = require("./utci.js");
|
|
55
|
+
Object.defineProperty(exports, "utci", { enumerable: true, get: function () { return utci_js_1.utci; } });
|
|
29
56
|
const pet_steady_js_1 = require("./pet_steady.js");
|
|
57
|
+
Object.defineProperty(exports, "pet_steady", { enumerable: true, get: function () { return pet_steady_js_1.pet_steady; } });
|
|
30
58
|
const JOS3_js_1 = require("./JOS3.js");
|
|
31
|
-
/**
|
|
32
|
-
* @public
|
|
33
|
-
* @name models
|
|
34
|
-
* @docname Comfort Models
|
|
35
|
-
*/
|
|
36
59
|
exports.default = {
|
|
37
60
|
adaptive_ashrae: adaptive_ashrae_js_1.adaptive_ashrae,
|
|
38
61
|
adaptive_en: adaptive_en_js_1.adaptive_en,
|
package/lib/cjs/models/net.js
CHANGED
|
@@ -42,7 +42,14 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
42
42
|
* const result = net(37, 100, 0.1);
|
|
43
43
|
* console.log(result); // -> {net: 37}
|
|
44
44
|
*/
|
|
45
|
+
const NET_SCHEMA = {
|
|
46
|
+
tdb: { type: "number" },
|
|
47
|
+
rh: { type: "number" },
|
|
48
|
+
v: { type: "number" },
|
|
49
|
+
round: { type: "boolean", required: false },
|
|
50
|
+
};
|
|
45
51
|
function net(tdb, rh, v, options = { round: true }) {
|
|
52
|
+
(0, utilities_js_1.validateInputs)({ tdb, rh, v, round: options.round }, NET_SCHEMA);
|
|
46
53
|
const frac = 1.0 / (1.76 + 1.4 * Math.pow(v, 0.75));
|
|
47
54
|
let et = 37 -
|
|
48
55
|
(37 - tdb) / (0.68 - 0.0014 * rh + frac) -
|
|
@@ -56,7 +56,37 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
56
56
|
* const result = pet_steady(20, 20, 50, 0.15, 1.37, 0.5);
|
|
57
57
|
* console.log(result); // {pet: 18.85}
|
|
58
58
|
*/
|
|
59
|
+
const PET_STEADY_SCHEMA = {
|
|
60
|
+
tdb: { type: "number" },
|
|
61
|
+
tr: { type: "number" },
|
|
62
|
+
v: { type: "number" },
|
|
63
|
+
rh: { type: "number" },
|
|
64
|
+
met: { type: "number" },
|
|
65
|
+
clo: { type: "number" },
|
|
66
|
+
p_atm: { type: "number" },
|
|
67
|
+
position: { type: "number" },
|
|
68
|
+
age: { type: "number" },
|
|
69
|
+
sex: { type: "number" },
|
|
70
|
+
weight: { type: "number" },
|
|
71
|
+
height: { type: "number" },
|
|
72
|
+
wme: { type: "number" },
|
|
73
|
+
};
|
|
59
74
|
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) {
|
|
75
|
+
(0, utilities_js_1.validateInputs)({
|
|
76
|
+
tdb,
|
|
77
|
+
tr,
|
|
78
|
+
v,
|
|
79
|
+
rh,
|
|
80
|
+
met,
|
|
81
|
+
clo,
|
|
82
|
+
p_atm,
|
|
83
|
+
position,
|
|
84
|
+
age,
|
|
85
|
+
sex,
|
|
86
|
+
weight,
|
|
87
|
+
height,
|
|
88
|
+
wme,
|
|
89
|
+
}, PET_STEADY_SCHEMA);
|
|
60
90
|
const met_factor = 58.2; // met conversion factor
|
|
61
91
|
met = met * met_factor; // metabolic rate
|
|
62
92
|
// initial guess
|
package/lib/cjs/models/phs.js
CHANGED
|
@@ -97,6 +97,35 @@ const MET_WATT_PER_MET = 58.15;
|
|
|
97
97
|
* const results = phs(40, 40, 0.3, 33.85, 2.5, 0.5, "standing");
|
|
98
98
|
* console.log(results); // {t_re: 37.5, d_lim_loss_50: 480, d_lim_loss_95: 480, d_lim_t_re: 480, sweat_loss_g: 5847.0, sweat_rate_watt: 252.1, ...}
|
|
99
99
|
*/
|
|
100
|
+
const PHS_SCHEMA = {
|
|
101
|
+
tdb: { type: "number" },
|
|
102
|
+
tr: { type: "number" },
|
|
103
|
+
v: { type: "number" },
|
|
104
|
+
rh: { type: "number" },
|
|
105
|
+
met: { type: "number" },
|
|
106
|
+
clo: { type: "number" },
|
|
107
|
+
wme: { type: "number" },
|
|
108
|
+
posture: { enum: [1, 2, 3] },
|
|
109
|
+
model: { enum: ["7933-2004", "7933-2023"] },
|
|
110
|
+
i_mst: { type: "number" },
|
|
111
|
+
a_p: { type: "number" },
|
|
112
|
+
drink: { enum: [0, 1] },
|
|
113
|
+
weight: { type: "number" },
|
|
114
|
+
height: { type: "number" },
|
|
115
|
+
walk_sp: { type: "number" },
|
|
116
|
+
theta: { type: "number" },
|
|
117
|
+
acclimatized: { type: "number" },
|
|
118
|
+
duration: { type: "number" },
|
|
119
|
+
f_r: { type: "number" },
|
|
120
|
+
t_sk: { type: "number" },
|
|
121
|
+
t_cr: { type: "number" },
|
|
122
|
+
t_re: { type: "number" },
|
|
123
|
+
t_cr_eq: { type: "number" },
|
|
124
|
+
t_sk_t_cr_wg: { type: "number" },
|
|
125
|
+
sweat_rate_watt: { type: "number" },
|
|
126
|
+
evap_load_wm2_min: { type: "number" },
|
|
127
|
+
round: { type: "boolean", required: false },
|
|
128
|
+
};
|
|
100
129
|
function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-2023", kwargs = {}) {
|
|
101
130
|
const defaults_kwargs = {
|
|
102
131
|
i_mst: 0.38,
|
|
@@ -131,6 +160,35 @@ function phs(tdb, tr, v, rh, met, clo, posture, wme = 0, model = "7933-2023", kw
|
|
|
131
160
|
else if (p === "crouching")
|
|
132
161
|
posture = 3;
|
|
133
162
|
}
|
|
163
|
+
(0, utilities_js_1.validateInputs)({
|
|
164
|
+
tdb,
|
|
165
|
+
tr,
|
|
166
|
+
v,
|
|
167
|
+
rh,
|
|
168
|
+
met,
|
|
169
|
+
clo,
|
|
170
|
+
wme,
|
|
171
|
+
posture,
|
|
172
|
+
model,
|
|
173
|
+
i_mst: joint_kwargs.i_mst,
|
|
174
|
+
a_p: joint_kwargs.a_p,
|
|
175
|
+
drink: joint_kwargs.drink,
|
|
176
|
+
weight: joint_kwargs.weight,
|
|
177
|
+
height: joint_kwargs.height,
|
|
178
|
+
walk_sp: joint_kwargs.walk_sp,
|
|
179
|
+
theta: joint_kwargs.theta,
|
|
180
|
+
acclimatized: joint_kwargs.acclimatized,
|
|
181
|
+
duration: joint_kwargs.duration,
|
|
182
|
+
f_r: joint_kwargs.f_r,
|
|
183
|
+
t_sk: joint_kwargs.t_sk,
|
|
184
|
+
t_cr: joint_kwargs.t_cr,
|
|
185
|
+
t_re: joint_kwargs.t_re,
|
|
186
|
+
t_cr_eq: joint_kwargs.t_cr_eq,
|
|
187
|
+
t_sk_t_cr_wg: joint_kwargs.t_sk_t_cr_wg,
|
|
188
|
+
sweat_rate_watt: joint_kwargs.sweat_rate_watt,
|
|
189
|
+
evap_load_wm2_min: joint_kwargs.evap_load_wm2_min,
|
|
190
|
+
round: joint_kwargs.round,
|
|
191
|
+
}, PHS_SCHEMA);
|
|
134
192
|
const met_watt = met * MET_WATT_PER_MET;
|
|
135
193
|
const wme_watt = wme * MET_WATT_PER_MET;
|
|
136
194
|
const warnings = (0, utilities_js_1.check_standard_compliance)("ISO7933", {
|
package/lib/cjs/models/pmv.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pmv = pmv;
|
|
4
4
|
const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
5
|
+
const utilities_js_1 = require("../utilities/utilities.js");
|
|
5
6
|
/**
|
|
6
7
|
* @typedef {Object} PmvKwargs
|
|
7
8
|
* @property {'SI'|'IP'} units - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
@@ -95,13 +96,40 @@ const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
|
95
96
|
* const results = pmv(tdb, tr, v_r, rh, met, clo_d);
|
|
96
97
|
* console.log(results); // 0.06
|
|
97
98
|
*/
|
|
99
|
+
const PMV_SCHEMA = {
|
|
100
|
+
tdb: { type: "number" },
|
|
101
|
+
tr: { type: "number" },
|
|
102
|
+
vr: { type: "number" },
|
|
103
|
+
rh: { type: "number" },
|
|
104
|
+
met: { type: "number" },
|
|
105
|
+
clo: { type: "number" },
|
|
106
|
+
wme: { type: "number" },
|
|
107
|
+
standard: { enum: ["ISO", "ASHRAE"] },
|
|
108
|
+
units: { enum: ["SI", "IP"] },
|
|
109
|
+
limit_inputs: { type: "boolean", required: false },
|
|
110
|
+
airspeed_control: { type: "boolean", required: false },
|
|
111
|
+
};
|
|
98
112
|
function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
113
|
+
var _a;
|
|
99
114
|
const default_kwargs = {
|
|
100
115
|
units: "SI",
|
|
101
116
|
limit_inputs: true,
|
|
102
117
|
airspeed_control: true,
|
|
103
118
|
};
|
|
104
119
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
120
|
+
(0, utilities_js_1.validateInputs)({
|
|
121
|
+
tdb,
|
|
122
|
+
tr,
|
|
123
|
+
vr,
|
|
124
|
+
rh,
|
|
125
|
+
met,
|
|
126
|
+
clo,
|
|
127
|
+
wme,
|
|
128
|
+
standard,
|
|
129
|
+
units: ((_a = kwargs.units) !== null && _a !== void 0 ? _a : "SI").toUpperCase(),
|
|
130
|
+
limit_inputs: kwargs.limit_inputs,
|
|
131
|
+
airspeed_control: kwargs.airspeed_control,
|
|
132
|
+
}, PMV_SCHEMA);
|
|
105
133
|
const pmv_ppdValue = (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, standard, kwargs);
|
|
106
134
|
if (!pmv_ppdValue.hasOwnProperty("pmv")) {
|
|
107
135
|
throw new Error("pmv property not found in pmv_ppdValue");
|
|
@@ -105,20 +105,44 @@ const cooling_effect_js_1 = require("./cooling_effect.js");
|
|
|
105
105
|
* console.log(results); // Output: { pmv: 0.06, ppd: 5.1 }
|
|
106
106
|
* console.log(results.pmv); // Output: -0.06
|
|
107
107
|
*/
|
|
108
|
+
const PMV_PPD_SCHEMA = {
|
|
109
|
+
tdb: { type: "number" },
|
|
110
|
+
tr: { type: "number" },
|
|
111
|
+
vr: { type: "number" },
|
|
112
|
+
rh: { type: "number" },
|
|
113
|
+
met: { type: "number" },
|
|
114
|
+
clo: { type: "number" },
|
|
115
|
+
wme: { type: "number" },
|
|
116
|
+
standard: { enum: ["ISO", "ASHRAE"] },
|
|
117
|
+
units: { enum: ["SI", "IP"], required: false },
|
|
118
|
+
limit_inputs: { type: "boolean", required: false },
|
|
119
|
+
airspeed_control: { type: "boolean", required: false },
|
|
120
|
+
};
|
|
108
121
|
function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
122
|
+
var _a;
|
|
109
123
|
const default_kwargs = {
|
|
110
124
|
units: "SI",
|
|
111
125
|
limit_inputs: true,
|
|
112
126
|
airspeed_control: true,
|
|
113
127
|
};
|
|
114
128
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
129
|
+
(0, utilities_js_1.validateInputs)({
|
|
130
|
+
tdb,
|
|
131
|
+
tr,
|
|
132
|
+
vr,
|
|
133
|
+
rh,
|
|
134
|
+
met,
|
|
135
|
+
clo,
|
|
136
|
+
wme,
|
|
137
|
+
standard,
|
|
138
|
+
units: (_a = kwargs.units) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
139
|
+
limit_inputs: kwargs.limit_inputs,
|
|
140
|
+
airspeed_control: kwargs.airspeed_control,
|
|
141
|
+
}, PMV_PPD_SCHEMA);
|
|
115
142
|
if (kwargs.units && kwargs.units.toUpperCase() === "IP") {
|
|
116
143
|
// Conversion from IP to SI units
|
|
117
144
|
({ tdb, tr, vr } = (0, utilities_js_1.units_converter)({ tdb, tr, vr }, "IP"));
|
|
118
145
|
}
|
|
119
|
-
if (standard !== "ISO" && standard !== "ASHRAE") {
|
|
120
|
-
throw new Error("PMV calculations can only be performed in compliance with ISO or ASHRAE Standards");
|
|
121
|
-
}
|
|
122
146
|
const { tdb: tdb_valid, tr: tr_valid, v: v_valid, met: met_valid, clo: clo_valid, } = (0, utilities_js_1.check_standard_compliance_array)(standard, {
|
|
123
147
|
tdb: [tdb],
|
|
124
148
|
tr: [tr],
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pmv_ppd_ashrae = pmv_ppd_ashrae;
|
|
4
4
|
const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
5
|
+
const utilities_js_1 = require("../utilities/utilities.js");
|
|
5
6
|
/**
|
|
6
7
|
* @typedef {Object} PmvPpdAshrae
|
|
7
8
|
* @property {number} pmv - Predicted Mean Vote on the ASHRAE 55 scale [-3, +3]
|
|
@@ -45,6 +46,31 @@ const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
|
45
46
|
* @memberof models
|
|
46
47
|
* @docname PMV/PPD (ASHRAE 55)
|
|
47
48
|
*/
|
|
49
|
+
const PMV_PPD_ASHRAE_SCHEMA = {
|
|
50
|
+
tdb: { type: "number" },
|
|
51
|
+
tr: { type: "number" },
|
|
52
|
+
vr: { type: "number" },
|
|
53
|
+
rh: { type: "number" },
|
|
54
|
+
met: { type: "number" },
|
|
55
|
+
clo: { type: "number" },
|
|
56
|
+
wme: { type: "number" },
|
|
57
|
+
units: { enum: ["SI", "IP"], required: false },
|
|
58
|
+
limit_inputs: { type: "boolean", required: false },
|
|
59
|
+
airspeed_control: { type: "boolean", required: false },
|
|
60
|
+
};
|
|
48
61
|
function pmv_ppd_ashrae(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
62
|
+
var _a;
|
|
63
|
+
(0, utilities_js_1.validateInputs)({
|
|
64
|
+
tdb,
|
|
65
|
+
tr,
|
|
66
|
+
vr,
|
|
67
|
+
rh,
|
|
68
|
+
met,
|
|
69
|
+
clo,
|
|
70
|
+
wme,
|
|
71
|
+
units: (_a = kwargs.units) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
72
|
+
limit_inputs: kwargs.limit_inputs,
|
|
73
|
+
airspeed_control: kwargs.airspeed_control,
|
|
74
|
+
}, PMV_PPD_ASHRAE_SCHEMA);
|
|
49
75
|
return (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, "ASHRAE", kwargs);
|
|
50
76
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pmv_ppd_iso = pmv_ppd_iso;
|
|
4
4
|
const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
5
|
+
const utilities_js_1 = require("../utilities/utilities.js");
|
|
5
6
|
/**
|
|
6
7
|
* @typedef {Object} PmvPpdIso
|
|
7
8
|
* @property {number} pmv - Predicted Mean Vote on the ISO 7730 scale [-3, +3]
|
|
@@ -46,6 +47,29 @@ const pmv_ppd_js_1 = require("./pmv_ppd.js");
|
|
|
46
47
|
* @memberof models
|
|
47
48
|
* @docname PMV/PPD (ISO 7730)
|
|
48
49
|
*/
|
|
50
|
+
const PMV_PPD_ISO_SCHEMA = {
|
|
51
|
+
tdb: { type: "number" },
|
|
52
|
+
tr: { type: "number" },
|
|
53
|
+
vr: { type: "number" },
|
|
54
|
+
rh: { type: "number" },
|
|
55
|
+
met: { type: "number" },
|
|
56
|
+
clo: { type: "number" },
|
|
57
|
+
wme: { type: "number" },
|
|
58
|
+
units: { enum: ["SI", "IP"], required: false },
|
|
59
|
+
limit_inputs: { type: "boolean", required: false },
|
|
60
|
+
};
|
|
49
61
|
function pmv_ppd_iso(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
62
|
+
var _a;
|
|
63
|
+
(0, utilities_js_1.validateInputs)({
|
|
64
|
+
tdb,
|
|
65
|
+
tr,
|
|
66
|
+
vr,
|
|
67
|
+
rh,
|
|
68
|
+
met,
|
|
69
|
+
clo,
|
|
70
|
+
wme,
|
|
71
|
+
units: (_a = kwargs.units) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
72
|
+
limit_inputs: kwargs.limit_inputs,
|
|
73
|
+
}, PMV_PPD_ISO_SCHEMA);
|
|
50
74
|
return (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
51
75
|
}
|