jsthermalcomfort 1.1.1 → 1.1.2
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/models/JOS3.js +5 -6
- package/lib/cjs/models/a_pmv.js +1 -1
- package/lib/cjs/models/ankle_draft.js +1 -1
- package/lib/cjs/models/e_pmv.js +2 -2
- package/lib/cjs/models/pmv.js +6 -2
- package/lib/cjs/models/pmv_ppd.js +11 -4
- package/lib/cjs/models/pmv_ppd_ashrae.js +3 -0
- package/lib/cjs/models/pmv_ppd_iso.js +3 -0
- package/lib/cjs/models/vertical_tmp_grad_ppd.js +1 -1
- package/lib/cjs/models/wbgt.js +6 -6
- package/lib/cjs/types/models/JOS3.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv.d.ts +7 -1
- package/lib/cjs/types/models/pmv.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv_ppd.d.ts +4 -0
- package/lib/cjs/types/models/pmv_ppd.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts.map +1 -1
- package/lib/cjs/types/models/pmv_ppd_iso.d.ts.map +1 -1
- package/lib/cjs/types/models/wbgt.d.ts +1 -1
- package/lib/esm/models/JOS3.js +1 -2
- package/lib/esm/models/a_pmv.js +1 -1
- package/lib/esm/models/ankle_draft.js +1 -1
- package/lib/esm/models/e_pmv.js +2 -2
- package/lib/esm/models/pmv.js +6 -2
- package/lib/esm/models/pmv_ppd.js +11 -4
- package/lib/esm/models/pmv_ppd_ashrae.js +3 -0
- package/lib/esm/models/pmv_ppd_iso.js +3 -0
- package/lib/esm/models/vertical_tmp_grad_ppd.js +1 -1
- package/lib/esm/models/wbgt.js +6 -6
- package/lib/esm/types/models/JOS3.d.ts.map +1 -1
- package/lib/esm/types/models/pmv.d.ts +7 -1
- package/lib/esm/types/models/pmv.d.ts.map +1 -1
- package/lib/esm/types/models/pmv_ppd.d.ts +4 -0
- package/lib/esm/types/models/pmv_ppd.d.ts.map +1 -1
- package/lib/esm/types/models/pmv_ppd_ashrae.d.ts.map +1 -1
- package/lib/esm/types/models/pmv_ppd_iso.d.ts.map +1 -1
- package/lib/esm/types/models/wbgt.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/models/JOS3.js
CHANGED
|
@@ -65,7 +65,6 @@ const local_q_work_js_1 = require("../jos3_functions/thermoregulation/local_q_wo
|
|
|
65
65
|
const cr_ms_fat_blood_flow_js_1 = require("../jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js");
|
|
66
66
|
const resp_heat_loss_js_1 = require("../jos3_functions/thermoregulation/resp_heat_loss.js");
|
|
67
67
|
const sum_bf_js_1 = require("../jos3_functions/thermoregulation/sum_bf.js");
|
|
68
|
-
const object_js_1 = __importDefault(require("lodash/object.js"));
|
|
69
68
|
/**
|
|
70
69
|
* Create an array of shape (17,) with the given input.
|
|
71
70
|
*
|
|
@@ -231,7 +230,7 @@ class JOS3 {
|
|
|
231
230
|
// Iterate until the PMV (Predicted Mean Vote) value is less than 0.001
|
|
232
231
|
let vpmv;
|
|
233
232
|
for (let i = 0; i < 100; i++) {
|
|
234
|
-
vpmv = (0, pmv_js_1.pmv)(to, to, va, rh, met, clo);
|
|
233
|
+
vpmv = (0, pmv_js_1.pmv)(to, to, va, rh, met, clo).pmv;
|
|
235
234
|
// Break the loop if the absolute value of PMV is less than 0.001
|
|
236
235
|
if (math.abs(vpmv) < 0.001) {
|
|
237
236
|
break;
|
|
@@ -577,7 +576,7 @@ class JOS3 {
|
|
|
577
576
|
dict_out = Object.assign(Object.assign({}, dict_out), detail_out);
|
|
578
577
|
}
|
|
579
578
|
else if (Array.isArray(this._ex_output)) {
|
|
580
|
-
const out_keys =
|
|
579
|
+
const out_keys = Object.keys(detail_out);
|
|
581
580
|
for (const key in this._ex_output) {
|
|
582
581
|
if (out_keys.includes(key)) {
|
|
583
582
|
dict_out[key] = detail_out[key];
|
|
@@ -600,7 +599,7 @@ class JOS3 {
|
|
|
600
599
|
return args.some((arg) => word.includes(arg));
|
|
601
600
|
};
|
|
602
601
|
let key2keys = {}; // Column keys
|
|
603
|
-
for (let [key, value] of
|
|
602
|
+
for (let [key, value] of Object.entries(this._history[0])) {
|
|
604
603
|
let keys;
|
|
605
604
|
if (value.length !== undefined) {
|
|
606
605
|
if (typeof value === "string") {
|
|
@@ -629,7 +628,7 @@ class JOS3 {
|
|
|
629
628
|
}
|
|
630
629
|
let data = this._history.map((dictout) => {
|
|
631
630
|
let row = {};
|
|
632
|
-
for (let [key, value] of
|
|
631
|
+
for (let [key, value] of Object.entries(dictout)) {
|
|
633
632
|
let keys = key2keys[key];
|
|
634
633
|
let values = keys.length === 1 ? [value] : value;
|
|
635
634
|
keys.forEach((k, i) => {
|
|
@@ -639,7 +638,7 @@ class JOS3 {
|
|
|
639
638
|
return row;
|
|
640
639
|
});
|
|
641
640
|
let outDict = {};
|
|
642
|
-
|
|
641
|
+
Object.keys(data[0]).forEach((key) => {
|
|
643
642
|
outDict[key] = data.map((row) => row[key]);
|
|
644
643
|
});
|
|
645
644
|
return outDict;
|
package/lib/cjs/models/a_pmv.js
CHANGED
|
@@ -101,7 +101,7 @@ function a_pmv(tdb, tr, vr, rh, met, clo, a_coefficient, wme = 0, kwargs = {}) {
|
|
|
101
101
|
limit_inputs: true,
|
|
102
102
|
};
|
|
103
103
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
104
|
-
let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
104
|
+
let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs).pmv;
|
|
105
105
|
_pmv = (0, utilities_js_1.round)(_pmv / (1 + a_coefficient * _pmv), 2);
|
|
106
106
|
return { a_pmv: _pmv };
|
|
107
107
|
}
|
|
@@ -83,7 +83,7 @@ function ankle_draft(tdb, tr, vr, rh, met, clo, v_ankle, units = "SI") {
|
|
|
83
83
|
for (const warn of warns) {
|
|
84
84
|
console.warn("Warning:", warn);
|
|
85
85
|
}
|
|
86
|
-
const tsv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
|
|
86
|
+
const tsv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, 0, "ASHRAE").pmv;
|
|
87
87
|
const ppd_val = (0, utilities_js_1.round)((Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv) /
|
|
88
88
|
(1 + Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv))) *
|
|
89
89
|
100, 1);
|
package/lib/cjs/models/e_pmv.js
CHANGED
|
@@ -104,9 +104,9 @@ function e_pmv(tdb, tr, vr, rh, met, clo, e_coefficient, wme = 0, kwargs = {}) {
|
|
|
104
104
|
units: ((_a = kwargs.units) !== null && _a !== void 0 ? _a : "SI").toUpperCase(),
|
|
105
105
|
limit_inputs: kwargs.limit_inputs,
|
|
106
106
|
}, E_PMV_SCHEMA);
|
|
107
|
-
let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
107
|
+
let _pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs).pmv;
|
|
108
108
|
met = _pmv > 0 ? met * (1 + _pmv * -0.067) : met;
|
|
109
|
-
_pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
109
|
+
_pmv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs).pmv;
|
|
110
110
|
_pmv = (0, utilities_js_1.round)(_pmv * e_coefficient, 2);
|
|
111
111
|
return { e_pmv: _pmv };
|
|
112
112
|
}
|
package/lib/cjs/models/pmv.js
CHANGED
|
@@ -21,6 +21,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
21
21
|
* On the other hand, if the occupant has no control over the airspeed,
|
|
22
22
|
* the ASHRAE 55 imposes an upper limit for v which varies as a function of
|
|
23
23
|
* the operative temperature, for more information please consult the Standard.
|
|
24
|
+
* @property {boolean} round_output - If true, rounds pmv to 2 decimal places. Defaults to true.
|
|
24
25
|
* @public
|
|
25
26
|
*/
|
|
26
27
|
/**
|
|
@@ -78,7 +79,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
78
79
|
* {@link https://www.ashrae.org/file%20library/technical%20resources/standards%20and%20guidelines/standards%20addenda/55_2020_c_20210430.pdf|Addendum_C to Standard 55-2020}
|
|
79
80
|
* @param {PmvKwargs} kwargs - additional arguments
|
|
80
81
|
*
|
|
81
|
-
* @returns {number}
|
|
82
|
+
* @returns {{ pmv: number }} result - Object containing the Predicted Mean Vote
|
|
82
83
|
*
|
|
83
84
|
* @example
|
|
84
85
|
* const tdb = 25;
|
|
@@ -108,6 +109,7 @@ const PMV_SCHEMA = {
|
|
|
108
109
|
units: { enum: ["SI", "IP"] },
|
|
109
110
|
limit_inputs: { type: "boolean", required: false },
|
|
110
111
|
airspeed_control: { type: "boolean", required: false },
|
|
112
|
+
round_output: { type: "boolean", required: false },
|
|
111
113
|
};
|
|
112
114
|
function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
113
115
|
var _a;
|
|
@@ -115,6 +117,7 @@ function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {})
|
|
|
115
117
|
units: "SI",
|
|
116
118
|
limit_inputs: true,
|
|
117
119
|
airspeed_control: true,
|
|
120
|
+
round_output: true,
|
|
118
121
|
};
|
|
119
122
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
120
123
|
(0, utilities_js_1.validateInputs)({
|
|
@@ -129,10 +132,11 @@ function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {})
|
|
|
129
132
|
units: ((_a = kwargs.units) !== null && _a !== void 0 ? _a : "SI").toUpperCase(),
|
|
130
133
|
limit_inputs: kwargs.limit_inputs,
|
|
131
134
|
airspeed_control: kwargs.airspeed_control,
|
|
135
|
+
round_output: kwargs.round_output,
|
|
132
136
|
}, PMV_SCHEMA);
|
|
133
137
|
const pmv_ppdValue = (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, standard, kwargs);
|
|
134
138
|
if (!pmv_ppdValue.hasOwnProperty("pmv")) {
|
|
135
139
|
throw new Error("pmv property not found in pmv_ppdValue");
|
|
136
140
|
}
|
|
137
|
-
return pmv_ppdValue.pmv;
|
|
141
|
+
return { pmv: pmv_ppdValue.pmv };
|
|
138
142
|
}
|
|
@@ -22,6 +22,7 @@ const cooling_effect_js_1 = require("./cooling_effect.js");
|
|
|
22
22
|
* On the other hand, if the occupant has no control over the airspeed,
|
|
23
23
|
* the ASHRAE 55 imposes an upper limit for v which varies as a function of
|
|
24
24
|
* the operative temperature, for more information please consult the Standard.
|
|
25
|
+
* @property { boolean } round_output - If true, rounds pmv to 2 decimal places and ppd to 1. Defaults to true.
|
|
25
26
|
* @public
|
|
26
27
|
*/
|
|
27
28
|
/**
|
|
@@ -117,6 +118,7 @@ const PMV_PPD_SCHEMA = {
|
|
|
117
118
|
units: { enum: ["SI", "IP"], required: false },
|
|
118
119
|
limit_inputs: { type: "boolean", required: false },
|
|
119
120
|
airspeed_control: { type: "boolean", required: false },
|
|
121
|
+
round_output: { type: "boolean", required: false },
|
|
120
122
|
};
|
|
121
123
|
function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
122
124
|
var _a;
|
|
@@ -124,6 +126,7 @@ function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs =
|
|
|
124
126
|
units: "SI",
|
|
125
127
|
limit_inputs: true,
|
|
126
128
|
airspeed_control: true,
|
|
129
|
+
round_output: true,
|
|
127
130
|
};
|
|
128
131
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
129
132
|
(0, utilities_js_1.validateInputs)({
|
|
@@ -138,6 +141,7 @@ function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs =
|
|
|
138
141
|
units: (_a = kwargs.units) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
139
142
|
limit_inputs: kwargs.limit_inputs,
|
|
140
143
|
airspeed_control: kwargs.airspeed_control,
|
|
144
|
+
round_output: kwargs.round_output,
|
|
141
145
|
}, PMV_PPD_SCHEMA);
|
|
142
146
|
if (kwargs.units && kwargs.units.toUpperCase() === "IP") {
|
|
143
147
|
// Conversion from IP to SI units
|
|
@@ -179,10 +183,13 @@ function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs =
|
|
|
179
183
|
ppd = NaN;
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
if (kwargs.round_output) {
|
|
187
|
+
return {
|
|
188
|
+
pmv: (0, utilities_js_1.round)(pmv, 2),
|
|
189
|
+
ppd: (0, utilities_js_1.round)(ppd, 1),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
return { pmv, ppd };
|
|
186
193
|
}
|
|
187
194
|
/**
|
|
188
195
|
* @param {number} tdb
|
|
@@ -35,6 +35,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
35
35
|
* @param {'SI'|'IP'} [kwargs.units='SI'] - Unit system
|
|
36
36
|
* @param {boolean} [kwargs.limit_inputs=true] - Return NaN for out-of-range inputs
|
|
37
37
|
* @param {boolean} [kwargs.airspeed_control=true] - Occupant controls airspeed
|
|
38
|
+
* @param {boolean} [kwargs.round_output=true] - Round pmv to 2 decimal places and ppd to 1
|
|
38
39
|
* @returns {PmvPpdAshrae} PMV and PPD values
|
|
39
40
|
*
|
|
40
41
|
* @example
|
|
@@ -57,6 +58,7 @@ const PMV_PPD_ASHRAE_SCHEMA = {
|
|
|
57
58
|
units: { enum: ["SI", "IP"], required: false },
|
|
58
59
|
limit_inputs: { type: "boolean", required: false },
|
|
59
60
|
airspeed_control: { type: "boolean", required: false },
|
|
61
|
+
round_output: { type: "boolean", required: false },
|
|
60
62
|
};
|
|
61
63
|
function pmv_ppd_ashrae(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
62
64
|
var _a;
|
|
@@ -71,6 +73,7 @@ function pmv_ppd_ashrae(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
|
71
73
|
units: (_a = kwargs.units) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
72
74
|
limit_inputs: kwargs.limit_inputs,
|
|
73
75
|
airspeed_control: kwargs.airspeed_control,
|
|
76
|
+
round_output: kwargs.round_output,
|
|
74
77
|
}, PMV_PPD_ASHRAE_SCHEMA);
|
|
75
78
|
return (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, "ASHRAE", kwargs);
|
|
76
79
|
}
|
|
@@ -36,6 +36,7 @@ const utilities_js_1 = require("../utilities/utilities.js");
|
|
|
36
36
|
* @param {Object} [kwargs={}] - Optional overrides
|
|
37
37
|
* @param {'SI'|'IP'} [kwargs.units='SI'] - Unit system
|
|
38
38
|
* @param {boolean} [kwargs.limit_inputs=true] - Return NaN for out-of-range inputs
|
|
39
|
+
* @param {boolean} [kwargs.round_output=true] - Round pmv to 2 decimal places and ppd to 1
|
|
39
40
|
* @returns {PmvPpdIso} PMV and PPD values
|
|
40
41
|
*
|
|
41
42
|
* @example
|
|
@@ -57,6 +58,7 @@ const PMV_PPD_ISO_SCHEMA = {
|
|
|
57
58
|
wme: { type: "number" },
|
|
58
59
|
units: { enum: ["SI", "IP"], required: false },
|
|
59
60
|
limit_inputs: { type: "boolean", required: false },
|
|
61
|
+
round_output: { type: "boolean", required: false },
|
|
60
62
|
};
|
|
61
63
|
function pmv_ppd_iso(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
62
64
|
var _a;
|
|
@@ -70,6 +72,7 @@ function pmv_ppd_iso(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
|
70
72
|
wme,
|
|
71
73
|
units: (_a = kwargs.units) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
72
74
|
limit_inputs: kwargs.limit_inputs,
|
|
75
|
+
round_output: kwargs.round_output,
|
|
73
76
|
}, PMV_PPD_ISO_SCHEMA);
|
|
74
77
|
return (0, pmv_ppd_js_1.pmv_ppd)(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
75
78
|
}
|
|
@@ -75,7 +75,7 @@ function vertical_tmp_grad_ppd(tdb, tr, vr, rh, met, clo, vertical_tmp_grad, uni
|
|
|
75
75
|
clo: clo,
|
|
76
76
|
});
|
|
77
77
|
warnings.forEach((warning) => console.warn(warning));
|
|
78
|
-
const tsv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
|
|
78
|
+
const tsv = (0, pmv_js_1.pmv)(tdb, tr, vr, rh, met, clo, 0, "ASHRAE").pmv;
|
|
79
79
|
const ppd_vg = calculate_ppd_vg(tsv, vertical_tmp_grad);
|
|
80
80
|
const acceptability = check_acceptability(ppd_vg);
|
|
81
81
|
return {
|
package/lib/cjs/models/wbgt.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.wbgt = wbgt;
|
|
4
4
|
const utilities_js_1 = require("../utilities/utilities.js");
|
|
5
5
|
const optionDefaults = {
|
|
6
|
-
|
|
6
|
+
round_output: true,
|
|
7
7
|
tdb: undefined,
|
|
8
8
|
with_solar_load: false,
|
|
9
9
|
};
|
|
@@ -38,7 +38,7 @@ const optionDefaults = {
|
|
|
38
38
|
* @param {number} twb - natural (no forced air flow) wet bulb temperature, [°C]
|
|
39
39
|
* @param {number} tg - globe temperature, [°C]
|
|
40
40
|
* @param {object} [options] - configuration options for the function.
|
|
41
|
-
* @param {boolean} [options.
|
|
41
|
+
* @param {boolean} [options.round_output = true] - If true rounds output value. If
|
|
42
42
|
* false it does not round it.
|
|
43
43
|
* @param {number} [options.tdb = undefined] - Dry bulb air temperature, [°C].
|
|
44
44
|
* This value is needed as input if the person is exposed to direct solar
|
|
@@ -60,7 +60,7 @@ const optionDefaults = {
|
|
|
60
60
|
const WBGT_SCHEMA = {
|
|
61
61
|
twb: { type: "number" },
|
|
62
62
|
tg: { type: "number" },
|
|
63
|
-
|
|
63
|
+
round_output: { type: "boolean", required: false },
|
|
64
64
|
tdb: { type: "number", required: false },
|
|
65
65
|
with_solar_load: { type: "boolean", required: false },
|
|
66
66
|
};
|
|
@@ -69,7 +69,7 @@ function wbgt(twb, tg, options) {
|
|
|
69
69
|
(0, utilities_js_1.validateInputs)({
|
|
70
70
|
twb,
|
|
71
71
|
tg,
|
|
72
|
-
|
|
72
|
+
round_output: opt.round_output,
|
|
73
73
|
tdb: opt.tdb,
|
|
74
74
|
with_solar_load: opt.with_solar_load,
|
|
75
75
|
}, WBGT_SCHEMA);
|
|
@@ -83,8 +83,8 @@ function wbgt(twb, tg, options) {
|
|
|
83
83
|
else {
|
|
84
84
|
t_wbg = 0.7 * twb + 0.3 * tg;
|
|
85
85
|
}
|
|
86
|
-
if (opt.
|
|
87
|
-
|
|
86
|
+
if (opt.round_output) {
|
|
87
|
+
t_wbg = (0, utilities_js_1.round)(t_wbg, 1);
|
|
88
88
|
}
|
|
89
89
|
return { wbgt: t_wbg };
|
|
90
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JOS3.d.ts","sourceRoot":"","sources":["../../../../src/models/JOS3.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JOS3.d.ts","sourceRoot":"","sources":["../../../../src/models/JOS3.js"],"names":[],"mappings":"AAuEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,qBAdW,MAAM,WACN,MAAM,QACN,MAAM,QACN,MAAM,QACN,MAAM,GAAG,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AIG;IACH,YAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,gBAFY,IAAI,CAAC,MAAM,CAItB;IAED;;;;OAIG;IACH,cAFY,IAAI,CAAC,MAAM,CAItB;IAED;;;;OAIG;IACH,0BAFY,IAAI,CAAC,MAAM,CAItB;IAED;;;;OAIG;IACH,gBAFY,IAAI,CAAC,MAAM,CAItB;IAED;;;;OAIG;IACH,aAFY,IAAI,CAAC,MAAM,CAItB;IAED;;;;OAIG;IACH,kBAFY,MAAM,EAAE,CAInB;IAED;;;;OAIG;IACH,eAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,WAFa,MAAM,CAYlB;CACF;sBA1wCqB,QAAQ"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export function pmv(tdb: any, tr: any, vr: any, rh: any, met: any, clo: any, wme?: number, standard?: string, kwargs?: {}):
|
|
1
|
+
export function pmv(tdb: any, tr: any, vr: any, rh: any, met: any, clo: any, wme?: number, standard?: string, kwargs?: {}): {
|
|
2
|
+
pmv: number;
|
|
3
|
+
};
|
|
2
4
|
export type PmvKwargs = {
|
|
3
5
|
/**
|
|
4
6
|
* - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
@@ -25,5 +27,9 @@ export type PmvKwargs = {
|
|
|
25
27
|
* the operative temperature, for more information please consult the Standard.
|
|
26
28
|
*/
|
|
27
29
|
airspeed_control: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* - If true, rounds pmv to 2 decimal places. Defaults to true.
|
|
32
|
+
*/
|
|
33
|
+
round_output: boolean;
|
|
28
34
|
};
|
|
29
35
|
//# sourceMappingURL=pmv.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv.js"],"names":[],"mappings":"AAiHA;;EAsDC;;;;;WAlKa,IAAI,GAAC,IAAI;;;;;;;;;;;kBACT,OAAO;;;;;;;;;;sBAQP,OAAO;;;;kBAOP,OAAO"}
|
|
@@ -40,6 +40,10 @@ export type Pmv_ppdKwargs = {
|
|
|
40
40
|
* the operative temperature, for more information please consult the Standard.
|
|
41
41
|
*/
|
|
42
42
|
airspeed_control: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* - If true, rounds pmv to 2 decimal places and ppd to 1. Defaults to true.
|
|
45
|
+
*/
|
|
46
|
+
round_output: boolean;
|
|
43
47
|
};
|
|
44
48
|
export type Pmv_ppdReturns = {
|
|
45
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv_ppd.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv_ppd.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd.js"],"names":[],"mappings":"AAgIA;;;EAmGC;AAED;;;;;;;;;;GAUG;AACH,qCAVW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,GAEJ,MAAM,CA0ElB;;;;;WA7Sa,IAAI,GAAC,IAAI;;;;;;;;;;;kBACR,OAAO;;;;;;;;;;sBAQP,OAAO;;;;kBAOP,OAAO;;;;;;SAMP,MAAM;;;;SACN,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv_ppd_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_ashrae.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv_ppd_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_ashrae.js"],"names":[],"mappings":"AA8DA;;;EA2BC;;;;;SApFa,MAAM;;;;SACN,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv_ppd_iso.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_iso.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv_ppd_iso.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_iso.js"],"names":[],"mappings":"AA8DA;;;EAiBC;;;;;SA1Ea,MAAM;;;;SACN,MAAM"}
|
package/lib/esm/models/JOS3.js
CHANGED
|
@@ -26,7 +26,6 @@ import { local_q_work } from "../jos3_functions/thermoregulation/local_q_work.js
|
|
|
26
26
|
import { cr_ms_fat_blood_flow } from "../jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js";
|
|
27
27
|
import { resp_heat_loss } from "../jos3_functions/thermoregulation/resp_heat_loss.js";
|
|
28
28
|
import { sum_bf } from "../jos3_functions/thermoregulation/sum_bf.js";
|
|
29
|
-
import Object from "lodash/object.js";
|
|
30
29
|
/**
|
|
31
30
|
* Create an array of shape (17,) with the given input.
|
|
32
31
|
*
|
|
@@ -192,7 +191,7 @@ export class JOS3 {
|
|
|
192
191
|
// Iterate until the PMV (Predicted Mean Vote) value is less than 0.001
|
|
193
192
|
let vpmv;
|
|
194
193
|
for (let i = 0; i < 100; i++) {
|
|
195
|
-
vpmv = pmv(to, to, va, rh, met, clo);
|
|
194
|
+
vpmv = pmv(to, to, va, rh, met, clo).pmv;
|
|
196
195
|
// Break the loop if the absolute value of PMV is less than 0.001
|
|
197
196
|
if (math.abs(vpmv) < 0.001) {
|
|
198
197
|
break;
|
package/lib/esm/models/a_pmv.js
CHANGED
|
@@ -97,7 +97,7 @@ export function a_pmv(tdb, tr, vr, rh, met, clo, a_coefficient, wme = 0, kwargs
|
|
|
97
97
|
limit_inputs: true,
|
|
98
98
|
};
|
|
99
99
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
100
|
-
let _pmv = pmv(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
100
|
+
let _pmv = pmv(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs).pmv;
|
|
101
101
|
_pmv = round(_pmv / (1 + a_coefficient * _pmv), 2);
|
|
102
102
|
return { a_pmv: _pmv };
|
|
103
103
|
}
|
|
@@ -80,7 +80,7 @@ export function ankle_draft(tdb, tr, vr, rh, met, clo, v_ankle, units = "SI") {
|
|
|
80
80
|
for (const warn of warns) {
|
|
81
81
|
console.warn("Warning:", warn);
|
|
82
82
|
}
|
|
83
|
-
const tsv = pmv(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
|
|
83
|
+
const tsv = pmv(tdb, tr, vr, rh, met, clo, 0, "ASHRAE").pmv;
|
|
84
84
|
const ppd_val = round((Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv) /
|
|
85
85
|
(1 + Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv))) *
|
|
86
86
|
100, 1);
|
package/lib/esm/models/e_pmv.js
CHANGED
|
@@ -100,9 +100,9 @@ export function e_pmv(tdb, tr, vr, rh, met, clo, e_coefficient, wme = 0, kwargs
|
|
|
100
100
|
units: (kwargs.units ?? "SI").toUpperCase(),
|
|
101
101
|
limit_inputs: kwargs.limit_inputs,
|
|
102
102
|
}, E_PMV_SCHEMA);
|
|
103
|
-
let _pmv = pmv(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
103
|
+
let _pmv = pmv(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs).pmv;
|
|
104
104
|
met = _pmv > 0 ? met * (1 + _pmv * -0.067) : met;
|
|
105
|
-
_pmv = pmv(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
105
|
+
_pmv = pmv(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs).pmv;
|
|
106
106
|
_pmv = round(_pmv * e_coefficient, 2);
|
|
107
107
|
return { e_pmv: _pmv };
|
|
108
108
|
}
|
package/lib/esm/models/pmv.js
CHANGED
|
@@ -18,6 +18,7 @@ import { validateInputs } from "../utilities/utilities.js";
|
|
|
18
18
|
* On the other hand, if the occupant has no control over the airspeed,
|
|
19
19
|
* the ASHRAE 55 imposes an upper limit for v which varies as a function of
|
|
20
20
|
* the operative temperature, for more information please consult the Standard.
|
|
21
|
+
* @property {boolean} round_output - If true, rounds pmv to 2 decimal places. Defaults to true.
|
|
21
22
|
* @public
|
|
22
23
|
*/
|
|
23
24
|
/**
|
|
@@ -75,7 +76,7 @@ import { validateInputs } from "../utilities/utilities.js";
|
|
|
75
76
|
* {@link https://www.ashrae.org/file%20library/technical%20resources/standards%20and%20guidelines/standards%20addenda/55_2020_c_20210430.pdf|Addendum_C to Standard 55-2020}
|
|
76
77
|
* @param {PmvKwargs} kwargs - additional arguments
|
|
77
78
|
*
|
|
78
|
-
* @returns {number}
|
|
79
|
+
* @returns {{ pmv: number }} result - Object containing the Predicted Mean Vote
|
|
79
80
|
*
|
|
80
81
|
* @example
|
|
81
82
|
* const tdb = 25;
|
|
@@ -105,12 +106,14 @@ const PMV_SCHEMA = {
|
|
|
105
106
|
units: { enum: ["SI", "IP"] },
|
|
106
107
|
limit_inputs: { type: "boolean", required: false },
|
|
107
108
|
airspeed_control: { type: "boolean", required: false },
|
|
109
|
+
round_output: { type: "boolean", required: false },
|
|
108
110
|
};
|
|
109
111
|
export function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
110
112
|
const default_kwargs = {
|
|
111
113
|
units: "SI",
|
|
112
114
|
limit_inputs: true,
|
|
113
115
|
airspeed_control: true,
|
|
116
|
+
round_output: true,
|
|
114
117
|
};
|
|
115
118
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
116
119
|
validateInputs({
|
|
@@ -125,10 +128,11 @@ export function pmv(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs
|
|
|
125
128
|
units: (kwargs.units ?? "SI").toUpperCase(),
|
|
126
129
|
limit_inputs: kwargs.limit_inputs,
|
|
127
130
|
airspeed_control: kwargs.airspeed_control,
|
|
131
|
+
round_output: kwargs.round_output,
|
|
128
132
|
}, PMV_SCHEMA);
|
|
129
133
|
const pmv_ppdValue = pmv_ppd(tdb, tr, vr, rh, met, clo, wme, standard, kwargs);
|
|
130
134
|
if (!pmv_ppdValue.hasOwnProperty("pmv")) {
|
|
131
135
|
throw new Error("pmv property not found in pmv_ppdValue");
|
|
132
136
|
}
|
|
133
|
-
return pmv_ppdValue.pmv;
|
|
137
|
+
return { pmv: pmv_ppdValue.pmv };
|
|
134
138
|
}
|
|
@@ -18,6 +18,7 @@ import { cooling_effect } from "./cooling_effect.js";
|
|
|
18
18
|
* On the other hand, if the occupant has no control over the airspeed,
|
|
19
19
|
* the ASHRAE 55 imposes an upper limit for v which varies as a function of
|
|
20
20
|
* the operative temperature, for more information please consult the Standard.
|
|
21
|
+
* @property { boolean } round_output - If true, rounds pmv to 2 decimal places and ppd to 1. Defaults to true.
|
|
21
22
|
* @public
|
|
22
23
|
*/
|
|
23
24
|
/**
|
|
@@ -113,12 +114,14 @@ const PMV_PPD_SCHEMA = {
|
|
|
113
114
|
units: { enum: ["SI", "IP"], required: false },
|
|
114
115
|
limit_inputs: { type: "boolean", required: false },
|
|
115
116
|
airspeed_control: { type: "boolean", required: false },
|
|
117
|
+
round_output: { type: "boolean", required: false },
|
|
116
118
|
};
|
|
117
119
|
export function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
118
120
|
const default_kwargs = {
|
|
119
121
|
units: "SI",
|
|
120
122
|
limit_inputs: true,
|
|
121
123
|
airspeed_control: true,
|
|
124
|
+
round_output: true,
|
|
122
125
|
};
|
|
123
126
|
kwargs = Object.assign(default_kwargs, kwargs);
|
|
124
127
|
validateInputs({
|
|
@@ -133,6 +136,7 @@ export function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kw
|
|
|
133
136
|
units: kwargs.units?.toUpperCase(),
|
|
134
137
|
limit_inputs: kwargs.limit_inputs,
|
|
135
138
|
airspeed_control: kwargs.airspeed_control,
|
|
139
|
+
round_output: kwargs.round_output,
|
|
136
140
|
}, PMV_PPD_SCHEMA);
|
|
137
141
|
if (kwargs.units && kwargs.units.toUpperCase() === "IP") {
|
|
138
142
|
// Conversion from IP to SI units
|
|
@@ -174,10 +178,13 @@ export function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kw
|
|
|
174
178
|
ppd = NaN;
|
|
175
179
|
}
|
|
176
180
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
if (kwargs.round_output) {
|
|
182
|
+
return {
|
|
183
|
+
pmv: round(pmv, 2),
|
|
184
|
+
ppd: round(ppd, 1),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return { pmv, ppd };
|
|
181
188
|
}
|
|
182
189
|
/**
|
|
183
190
|
* @param {number} tdb
|
|
@@ -32,6 +32,7 @@ import { validateInputs } from "../utilities/utilities.js";
|
|
|
32
32
|
* @param {'SI'|'IP'} [kwargs.units='SI'] - Unit system
|
|
33
33
|
* @param {boolean} [kwargs.limit_inputs=true] - Return NaN for out-of-range inputs
|
|
34
34
|
* @param {boolean} [kwargs.airspeed_control=true] - Occupant controls airspeed
|
|
35
|
+
* @param {boolean} [kwargs.round_output=true] - Round pmv to 2 decimal places and ppd to 1
|
|
35
36
|
* @returns {PmvPpdAshrae} PMV and PPD values
|
|
36
37
|
*
|
|
37
38
|
* @example
|
|
@@ -54,6 +55,7 @@ const PMV_PPD_ASHRAE_SCHEMA = {
|
|
|
54
55
|
units: { enum: ["SI", "IP"], required: false },
|
|
55
56
|
limit_inputs: { type: "boolean", required: false },
|
|
56
57
|
airspeed_control: { type: "boolean", required: false },
|
|
58
|
+
round_output: { type: "boolean", required: false },
|
|
57
59
|
};
|
|
58
60
|
export function pmv_ppd_ashrae(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
59
61
|
validateInputs({
|
|
@@ -67,6 +69,7 @@ export function pmv_ppd_ashrae(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {})
|
|
|
67
69
|
units: kwargs.units?.toUpperCase(),
|
|
68
70
|
limit_inputs: kwargs.limit_inputs,
|
|
69
71
|
airspeed_control: kwargs.airspeed_control,
|
|
72
|
+
round_output: kwargs.round_output,
|
|
70
73
|
}, PMV_PPD_ASHRAE_SCHEMA);
|
|
71
74
|
return pmv_ppd(tdb, tr, vr, rh, met, clo, wme, "ASHRAE", kwargs);
|
|
72
75
|
}
|
|
@@ -33,6 +33,7 @@ import { validateInputs } from "../utilities/utilities.js";
|
|
|
33
33
|
* @param {Object} [kwargs={}] - Optional overrides
|
|
34
34
|
* @param {'SI'|'IP'} [kwargs.units='SI'] - Unit system
|
|
35
35
|
* @param {boolean} [kwargs.limit_inputs=true] - Return NaN for out-of-range inputs
|
|
36
|
+
* @param {boolean} [kwargs.round_output=true] - Round pmv to 2 decimal places and ppd to 1
|
|
36
37
|
* @returns {PmvPpdIso} PMV and PPD values
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
@@ -54,6 +55,7 @@ const PMV_PPD_ISO_SCHEMA = {
|
|
|
54
55
|
wme: { type: "number" },
|
|
55
56
|
units: { enum: ["SI", "IP"], required: false },
|
|
56
57
|
limit_inputs: { type: "boolean", required: false },
|
|
58
|
+
round_output: { type: "boolean", required: false },
|
|
57
59
|
};
|
|
58
60
|
export function pmv_ppd_iso(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
59
61
|
validateInputs({
|
|
@@ -66,6 +68,7 @@ export function pmv_ppd_iso(tdb, tr, vr, rh, met, clo, wme = 0, kwargs = {}) {
|
|
|
66
68
|
wme,
|
|
67
69
|
units: kwargs.units?.toUpperCase(),
|
|
68
70
|
limit_inputs: kwargs.limit_inputs,
|
|
71
|
+
round_output: kwargs.round_output,
|
|
69
72
|
}, PMV_PPD_ISO_SCHEMA);
|
|
70
73
|
return pmv_ppd(tdb, tr, vr, rh, met, clo, wme, "ISO", kwargs);
|
|
71
74
|
}
|
|
@@ -72,7 +72,7 @@ export function vertical_tmp_grad_ppd(tdb, tr, vr, rh, met, clo, vertical_tmp_gr
|
|
|
72
72
|
clo: clo,
|
|
73
73
|
});
|
|
74
74
|
warnings.forEach((warning) => console.warn(warning));
|
|
75
|
-
const tsv = pmv(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
|
|
75
|
+
const tsv = pmv(tdb, tr, vr, rh, met, clo, 0, "ASHRAE").pmv;
|
|
76
76
|
const ppd_vg = calculate_ppd_vg(tsv, vertical_tmp_grad);
|
|
77
77
|
const acceptability = check_acceptability(ppd_vg);
|
|
78
78
|
return {
|
package/lib/esm/models/wbgt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { round, validateInputs } from "../utilities/utilities.js";
|
|
2
2
|
const optionDefaults = {
|
|
3
|
-
|
|
3
|
+
round_output: true,
|
|
4
4
|
tdb: undefined,
|
|
5
5
|
with_solar_load: false,
|
|
6
6
|
};
|
|
@@ -35,7 +35,7 @@ const optionDefaults = {
|
|
|
35
35
|
* @param {number} twb - natural (no forced air flow) wet bulb temperature, [°C]
|
|
36
36
|
* @param {number} tg - globe temperature, [°C]
|
|
37
37
|
* @param {object} [options] - configuration options for the function.
|
|
38
|
-
* @param {boolean} [options.
|
|
38
|
+
* @param {boolean} [options.round_output = true] - If true rounds output value. If
|
|
39
39
|
* false it does not round it.
|
|
40
40
|
* @param {number} [options.tdb = undefined] - Dry bulb air temperature, [°C].
|
|
41
41
|
* This value is needed as input if the person is exposed to direct solar
|
|
@@ -57,7 +57,7 @@ const optionDefaults = {
|
|
|
57
57
|
const WBGT_SCHEMA = {
|
|
58
58
|
twb: { type: "number" },
|
|
59
59
|
tg: { type: "number" },
|
|
60
|
-
|
|
60
|
+
round_output: { type: "boolean", required: false },
|
|
61
61
|
tdb: { type: "number", required: false },
|
|
62
62
|
with_solar_load: { type: "boolean", required: false },
|
|
63
63
|
};
|
|
@@ -66,7 +66,7 @@ export function wbgt(twb, tg, options) {
|
|
|
66
66
|
validateInputs({
|
|
67
67
|
twb,
|
|
68
68
|
tg,
|
|
69
|
-
|
|
69
|
+
round_output: opt.round_output,
|
|
70
70
|
tdb: opt.tdb,
|
|
71
71
|
with_solar_load: opt.with_solar_load,
|
|
72
72
|
}, WBGT_SCHEMA);
|
|
@@ -80,8 +80,8 @@ export function wbgt(twb, tg, options) {
|
|
|
80
80
|
else {
|
|
81
81
|
t_wbg = 0.7 * twb + 0.3 * tg;
|
|
82
82
|
}
|
|
83
|
-
if (opt.
|
|
84
|
-
|
|
83
|
+
if (opt.round_output) {
|
|
84
|
+
t_wbg = round(t_wbg, 1);
|
|
85
85
|
}
|
|
86
86
|
return { wbgt: t_wbg };
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JOS3.d.ts","sourceRoot":"","sources":["../../../../src/models/JOS3.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JOS3.d.ts","sourceRoot":"","sources":["../../../../src/models/JOS3.js"],"names":[],"mappings":"AAuEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,qBAdW,MAAM,WACN,MAAM,QACN,MAAM,QACN,MAAM,QACN,MAAM,GAAG,QAAQ,OACjB,MAAM,iBACN,iBAAiB,GAAG,wBAAwB,GAAG,UAAU,GAAG,SAAS,iBAErE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,cAE/C,EAAE,GAAG,KAAK,EAmGpB;IAnFC,gBAAqB;IACrB,gBAAqB;IACrB,aAAe;IACf,aAAe;IACf,wBAAe;IACf,YAAa;IACb,qFAAiC;IACjC,+DAAiC;IACjC,uBAA2B;IAG3B,kBAAuD;IAGvD,wCAAmD;IAGnD,kBAAgE;IAGhE,wCAA0D;IAG1D,eAA2D;IAG3D,wBAA2E;IAC3E,wBAA2E;IAG3E,yBAGC;IAID,mBAGC;IACD,mBAGC;IACD,mBAAuE;IACvE,mBAA+D;IAC/D,oBAA0E;IAC1E,qBAGC;IACD,aAAg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, rh: any, met: any, clo: any, wme?: number, standard?: string, kwargs?: {}):
|
|
1
|
+
export function pmv(tdb: any, tr: any, vr: any, rh: any, met: any, clo: any, wme?: number, standard?: string, kwargs?: {}): {
|
|
2
|
+
pmv: number;
|
|
3
|
+
};
|
|
2
4
|
export type PmvKwargs = {
|
|
3
5
|
/**
|
|
4
6
|
* - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
@@ -25,5 +27,9 @@ export type PmvKwargs = {
|
|
|
25
27
|
* the operative temperature, for more information please consult the Standard.
|
|
26
28
|
*/
|
|
27
29
|
airspeed_control: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* - If true, rounds pmv to 2 decimal places. Defaults to true.
|
|
32
|
+
*/
|
|
33
|
+
round_output: boolean;
|
|
28
34
|
};
|
|
29
35
|
//# sourceMappingURL=pmv.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv.js"],"names":[],"mappings":"AAiHA;;EAsDC;;;;;WAlKa,IAAI,GAAC,IAAI;;;;;;;;;;;kBACT,OAAO;;;;;;;;;;sBAQP,OAAO;;;;kBAOP,OAAO"}
|
|
@@ -40,6 +40,10 @@ export type Pmv_ppdKwargs = {
|
|
|
40
40
|
* the operative temperature, for more information please consult the Standard.
|
|
41
41
|
*/
|
|
42
42
|
airspeed_control: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* - If true, rounds pmv to 2 decimal places and ppd to 1. Defaults to true.
|
|
45
|
+
*/
|
|
46
|
+
round_output: boolean;
|
|
43
47
|
};
|
|
44
48
|
export type Pmv_ppdReturns = {
|
|
45
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv_ppd.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv_ppd.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd.js"],"names":[],"mappings":"AAgIA;;;EAmGC;AAED;;;;;;;;;;GAUG;AACH,qCAVW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,GAEJ,MAAM,CA0ElB;;;;;WA7Sa,IAAI,GAAC,IAAI;;;;;;;;;;;kBACR,OAAO;;;;;;;;;;sBAQP,OAAO;;;;kBAOP,OAAO;;;;;;SAMP,MAAM;;;;SACN,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv_ppd_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_ashrae.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv_ppd_ashrae.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_ashrae.js"],"names":[],"mappings":"AA8DA;;;EA2BC;;;;;SApFa,MAAM;;;;SACN,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pmv_ppd_iso.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_iso.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pmv_ppd_iso.d.ts","sourceRoot":"","sources":["../../../../src/models/pmv_ppd_iso.js"],"names":[],"mappings":"AA8DA;;;EAiBC;;;;;SA1Ea,MAAM;;;;SACN,MAAM"}
|