jsthermalcomfort 0.0.2 → 0.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/README.md +196 -6
- package/lib/cjs/index.js +7 -434
- package/lib/cjs/models/a_pmv.js +140 -0
- package/lib/cjs/models/adaptive_ashrae.js +290 -0
- package/lib/cjs/models/adaptive_en.js +300 -0
- package/lib/cjs/models/ankle_draft.js +82 -0
- package/lib/cjs/models/at.js +52 -0
- package/lib/cjs/models/athb.js +135 -0
- package/lib/cjs/models/clo_tout.js +58 -0
- package/lib/cjs/models/cooling_effect.js +164 -0
- package/lib/cjs/models/discomfort_index.js +115 -0
- package/lib/cjs/models/e_pmv.js +154 -0
- package/lib/cjs/models/heat_index.js +60 -0
- package/lib/cjs/models/humidex.js +63 -0
- package/lib/cjs/models/index.js +71 -0
- package/lib/cjs/models/net.js +50 -0
- package/lib/cjs/models/pet_steady.js +443 -0
- package/lib/cjs/models/phs.js +458 -0
- package/lib/cjs/models/pmv.js +200 -0
- package/lib/cjs/models/pmv_ppd.js +404 -0
- package/lib/cjs/models/set_tmp.js +203 -0
- package/lib/cjs/models/solar_gain.js +163 -0
- package/lib/cjs/models/two_nodes.js +790 -0
- package/lib/cjs/models/use_fans_heatwave.js +203 -0
- package/lib/cjs/models/utci.js +609 -0
- package/lib/cjs/models/vertical_tmp_grad_ppd.js +95 -0
- package/lib/cjs/models/wbgt.js +72 -0
- package/lib/cjs/models/wc.js +37 -0
- package/lib/cjs/psychrometrics/enthalpy.js +24 -0
- package/lib/cjs/psychrometrics/index.js +28 -0
- package/lib/cjs/psychrometrics/p_sat.js +46 -0
- package/lib/cjs/psychrometrics/p_sat_torr.js +34 -0
- package/lib/cjs/psychrometrics/psy_ta_rh.js +51 -0
- package/lib/cjs/psychrometrics/t_dp.js +19 -0
- package/lib/cjs/psychrometrics/t_mrt.js +117 -0
- package/lib/cjs/psychrometrics/t_o.js +82 -0
- package/lib/cjs/psychrometrics/t_wb.js +23 -0
- package/lib/cjs/types/index.d.ts +7 -79
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/models/a_pmv.d.ts +133 -0
- package/lib/cjs/types/models/a_pmv.d.ts.map +1 -0
- package/lib/cjs/types/models/adaptive_ashrae.d.ts +211 -0
- package/lib/cjs/types/models/adaptive_ashrae.d.ts.map +1 -0
- package/lib/cjs/types/models/adaptive_en.d.ts +217 -0
- package/lib/cjs/types/models/adaptive_en.d.ts.map +1 -0
- package/lib/cjs/types/models/ankle_draft.d.ts +60 -0
- package/lib/cjs/types/models/ankle_draft.d.ts.map +1 -0
- package/lib/cjs/types/models/at.d.ts +34 -0
- package/lib/cjs/types/models/at.d.ts.map +1 -0
- package/lib/cjs/types/models/athb.d.ts +96 -0
- package/lib/cjs/types/models/athb.d.ts.map +1 -0
- package/lib/cjs/types/models/clo_tout.d.ts +45 -0
- package/lib/cjs/types/models/clo_tout.d.ts.map +1 -0
- package/lib/cjs/types/models/cooling_effect.d.ts +49 -0
- package/lib/cjs/types/models/cooling_effect.d.ts.map +1 -0
- package/lib/cjs/types/models/discomfort_index.d.ts +91 -0
- package/lib/cjs/types/models/discomfort_index.d.ts.map +1 -0
- package/lib/cjs/types/models/e_pmv.d.ts +139 -0
- package/lib/cjs/types/models/e_pmv.d.ts.map +1 -0
- package/lib/cjs/types/models/heat_index.d.ts +27 -0
- package/lib/cjs/types/models/heat_index.d.ts.map +1 -0
- package/lib/cjs/types/models/humidex.d.ts +54 -0
- package/lib/cjs/types/models/humidex.d.ts.map +1 -0
- package/lib/cjs/types/models/index.d.ts +78 -0
- package/lib/cjs/types/models/index.d.ts.map +1 -0
- package/lib/cjs/types/models/net.d.ts +39 -0
- package/lib/cjs/types/models/net.d.ts.map +1 -0
- package/lib/cjs/types/models/pet_steady.d.ts +59 -0
- package/lib/cjs/types/models/pet_steady.d.ts.map +1 -0
- package/lib/cjs/types/models/phs.d.ts +242 -0
- package/lib/cjs/types/models/phs.d.ts.map +1 -0
- package/lib/cjs/types/models/pmv.d.ts +198 -0
- package/lib/cjs/types/models/pmv.d.ts.map +1 -0
- package/lib/cjs/types/models/pmv_ppd.d.ts +246 -0
- package/lib/cjs/types/models/pmv_ppd.d.ts.map +1 -0
- package/lib/cjs/types/models/set_tmp.d.ts +124 -0
- package/lib/cjs/types/models/set_tmp.d.ts.map +1 -0
- package/lib/cjs/types/models/solar_gain.d.ts +76 -0
- package/lib/cjs/types/models/solar_gain.d.ts.map +1 -0
- package/lib/cjs/types/models/two_nodes.d.ts +412 -0
- package/lib/cjs/types/models/two_nodes.d.ts.map +1 -0
- package/lib/cjs/types/models/use_fans_heatwave.d.ts +188 -0
- package/lib/cjs/types/models/use_fans_heatwave.d.ts.map +1 -0
- package/lib/cjs/types/models/utci.d.ts +79 -0
- package/lib/cjs/types/models/utci.d.ts.map +1 -0
- package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts +58 -0
- package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts.map +1 -0
- package/lib/cjs/types/models/wbgt.d.ts +51 -0
- package/lib/cjs/types/models/wbgt.d.ts.map +1 -0
- package/lib/cjs/types/models/wc.d.ts +29 -0
- package/lib/cjs/types/models/wc.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/enthalpy.d.ts +12 -0
- package/lib/cjs/types/psychrometrics/enthalpy.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/index.d.ts +26 -0
- package/lib/cjs/types/psychrometrics/index.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/p_sat.d.ts +13 -0
- package/lib/cjs/types/psychrometrics/p_sat.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/p_sat_torr.d.ts +26 -0
- package/lib/cjs/types/psychrometrics/p_sat_torr.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/psy_ta_rh.d.ts +51 -0
- package/lib/cjs/types/psychrometrics/psy_ta_rh.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/t_dp.d.ts +9 -0
- package/lib/cjs/types/psychrometrics/t_dp.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/t_mrt.d.ts +43 -0
- package/lib/cjs/types/psychrometrics/t_mrt.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/t_o.d.ts +31 -0
- package/lib/cjs/types/psychrometrics/t_o.d.ts.map +1 -0
- package/lib/cjs/types/psychrometrics/t_wb.d.ts +12 -0
- package/lib/cjs/types/psychrometrics/t_wb.d.ts.map +1 -0
- package/lib/cjs/types/utilities/index.d.ts +28 -0
- package/lib/cjs/types/utilities/index.d.ts.map +1 -0
- package/lib/cjs/types/utilities/utilities.d.ts +377 -0
- package/lib/cjs/types/utilities/utilities.d.ts.map +1 -0
- package/lib/cjs/utilities/index.js +27 -0
- package/lib/cjs/utilities/utilities.js +903 -0
- package/lib/esm/index.js +4 -0
- package/lib/esm/models/a_pmv.js +135 -0
- package/lib/esm/models/adaptive_ashrae.js +285 -0
- package/lib/esm/models/adaptive_en.js +294 -0
- package/lib/esm/models/ankle_draft.js +78 -0
- package/lib/esm/models/at.js +48 -0
- package/lib/esm/models/athb.js +130 -0
- package/lib/esm/models/clo_tout.js +53 -0
- package/lib/esm/models/cooling_effect.js +159 -0
- package/lib/esm/models/discomfort_index.js +110 -0
- package/lib/esm/models/e_pmv.js +149 -0
- package/lib/esm/models/heat_index.js +56 -0
- package/lib/esm/models/humidex.js +59 -0
- package/lib/esm/models/index.js +69 -0
- package/lib/esm/models/net.js +46 -0
- package/lib/esm/models/pet_steady.js +439 -0
- package/lib/esm/models/phs.js +454 -0
- package/lib/esm/models/pmv.js +195 -0
- package/lib/esm/models/pmv_ppd.js +398 -0
- package/lib/esm/models/set_tmp.js +198 -0
- package/lib/esm/models/solar_gain.js +158 -0
- package/lib/esm/models/two_nodes.js +784 -0
- package/lib/esm/models/use_fans_heatwave.js +199 -0
- package/lib/esm/models/utci.js +604 -0
- package/lib/esm/models/wbgt.js +68 -0
- package/lib/esm/models/wc.js +33 -0
- package/lib/esm/psychrometrics/enthalpy.js +20 -0
- package/lib/esm/psychrometrics/index.js +26 -0
- package/lib/esm/psychrometrics/p_sat.js +42 -0
- package/lib/esm/psychrometrics/p_sat_torr.js +29 -0
- package/lib/esm/psychrometrics/psy_ta_rh.js +47 -0
- package/lib/esm/psychrometrics/t_dp.js +15 -0
- package/lib/esm/psychrometrics/t_mrt.js +112 -0
- package/lib/esm/psychrometrics/t_o.js +77 -0
- package/lib/esm/psychrometrics/t_wb.js +19 -0
- package/lib/esm/types/index.d.ts +7 -79
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/models/a_pmv.d.ts +133 -0
- package/lib/esm/types/models/a_pmv.d.ts.map +1 -0
- package/lib/esm/types/models/adaptive_ashrae.d.ts +211 -0
- package/lib/esm/types/models/adaptive_ashrae.d.ts.map +1 -0
- package/lib/esm/types/models/adaptive_en.d.ts +217 -0
- package/lib/esm/types/models/adaptive_en.d.ts.map +1 -0
- package/lib/esm/types/models/ankle_draft.d.ts +60 -0
- package/lib/esm/types/models/ankle_draft.d.ts.map +1 -0
- package/lib/esm/types/models/at.d.ts +34 -0
- package/lib/esm/types/models/at.d.ts.map +1 -0
- package/lib/esm/types/models/athb.d.ts +96 -0
- package/lib/esm/types/models/athb.d.ts.map +1 -0
- package/lib/esm/types/models/clo_tout.d.ts +45 -0
- package/lib/esm/types/models/clo_tout.d.ts.map +1 -0
- package/lib/esm/types/models/cooling_effect.d.ts +49 -0
- package/lib/esm/types/models/cooling_effect.d.ts.map +1 -0
- package/lib/esm/types/models/discomfort_index.d.ts +91 -0
- package/lib/esm/types/models/discomfort_index.d.ts.map +1 -0
- package/lib/esm/types/models/e_pmv.d.ts +139 -0
- package/lib/esm/types/models/e_pmv.d.ts.map +1 -0
- package/lib/esm/types/models/heat_index.d.ts +27 -0
- package/lib/esm/types/models/heat_index.d.ts.map +1 -0
- package/lib/esm/types/models/humidex.d.ts +54 -0
- package/lib/esm/types/models/humidex.d.ts.map +1 -0
- package/lib/esm/types/models/index.d.ts +77 -0
- package/lib/esm/types/models/index.d.ts.map +1 -0
- package/lib/esm/types/models/net.d.ts +39 -0
- package/lib/esm/types/models/net.d.ts.map +1 -0
- package/lib/esm/types/models/pet_steady.d.ts +59 -0
- package/lib/esm/types/models/pet_steady.d.ts.map +1 -0
- package/lib/esm/types/models/phs.d.ts +242 -0
- package/lib/esm/types/models/phs.d.ts.map +1 -0
- package/lib/esm/types/models/pmv.d.ts +198 -0
- package/lib/esm/types/models/pmv.d.ts.map +1 -0
- package/lib/esm/types/models/pmv_ppd.d.ts +246 -0
- package/lib/esm/types/models/pmv_ppd.d.ts.map +1 -0
- package/lib/esm/types/models/set_tmp.d.ts +124 -0
- package/lib/esm/types/models/set_tmp.d.ts.map +1 -0
- package/lib/esm/types/models/solar_gain.d.ts +76 -0
- package/lib/esm/types/models/solar_gain.d.ts.map +1 -0
- package/lib/esm/types/models/two_nodes.d.ts +412 -0
- package/lib/esm/types/models/two_nodes.d.ts.map +1 -0
- package/lib/esm/types/models/use_fans_heatwave.d.ts +188 -0
- package/lib/esm/types/models/use_fans_heatwave.d.ts.map +1 -0
- package/lib/esm/types/models/utci.d.ts +79 -0
- package/lib/esm/types/models/utci.d.ts.map +1 -0
- package/lib/esm/types/models/wbgt.d.ts +51 -0
- package/lib/esm/types/models/wbgt.d.ts.map +1 -0
- package/lib/esm/types/models/wc.d.ts +29 -0
- package/lib/esm/types/models/wc.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/enthalpy.d.ts +12 -0
- package/lib/esm/types/psychrometrics/enthalpy.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/index.d.ts +26 -0
- package/lib/esm/types/psychrometrics/index.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/p_sat.d.ts +13 -0
- package/lib/esm/types/psychrometrics/p_sat.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/p_sat_torr.d.ts +26 -0
- package/lib/esm/types/psychrometrics/p_sat_torr.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/psy_ta_rh.d.ts +51 -0
- package/lib/esm/types/psychrometrics/psy_ta_rh.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/t_dp.d.ts +9 -0
- package/lib/esm/types/psychrometrics/t_dp.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/t_mrt.d.ts +43 -0
- package/lib/esm/types/psychrometrics/t_mrt.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/t_o.d.ts +31 -0
- package/lib/esm/types/psychrometrics/t_o.d.ts.map +1 -0
- package/lib/esm/types/psychrometrics/t_wb.d.ts +12 -0
- package/lib/esm/types/psychrometrics/t_wb.d.ts.map +1 -0
- package/lib/esm/types/utilities/index.d.ts +28 -0
- package/lib/esm/types/utilities/index.d.ts.map +1 -0
- package/lib/esm/types/utilities/utilities.d.ts +377 -0
- package/lib/esm/types/utilities/utilities.d.ts.map +1 -0
- package/lib/esm/utilities/index.js +25 -0
- package/lib/esm/utilities/utilities.js +885 -0
- package/package.json +22 -15
- package/lib/esm/index.mjs +0 -430
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pmv_calculation = exports.pmv_ppd_array = exports.pmv_ppd = void 0;
|
|
4
|
+
const utilities_js_1 = require("../utilities/utilities.js");
|
|
5
|
+
const cooling_effect_js_1 = require("./cooling_effect.js");
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} Pmv_ppdKwargs
|
|
8
|
+
* @property {'SI'|'IP'} units - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
9
|
+
* @property { boolean } limit_inputs - Default is True. By default, if the inputs are outside the standard applicability
|
|
10
|
+
* limits the function returns NaN. If false, returns pmv and ppd values even if input values are outside
|
|
11
|
+
* the applicability limits of the model.
|
|
12
|
+
*
|
|
13
|
+
* The ASHRAE 55 2020 limits are 10 < tdb [°C] < 40, 10 < tr [°C] < 40,
|
|
14
|
+
* 0 < vr [m/s] < 2, 1 < met [met] < 4, and 0 < clo [clo] < 1.5.
|
|
15
|
+
* The ISO 7730 2005 limits are 10 < tdb [°C] < 30, 10 < tr [°C] < 40,
|
|
16
|
+
* 0 < vr [m/s] < 1, 0.8 < met [met] < 4, 0 < clo [clo] < 2, and -2 < PMV < 2.
|
|
17
|
+
* @property { boolean } airspeed_control - This only applies if standard = "ASHRAE".
|
|
18
|
+
*
|
|
19
|
+
* Default is True. By default, it is assumed that the occupant has control over the airspeed.
|
|
20
|
+
* In this case, the ASHRAE 55 Standard does not impose any airspeed limits.
|
|
21
|
+
* On the other hand, if the occupant has no control over the airspeed,
|
|
22
|
+
* the ASHRAE 55 imposes an upper limit for v which varies as a function of
|
|
23
|
+
* the operative temperature, for more information please consult the Standard.
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} Pmv_ppdReturns
|
|
28
|
+
* @property { number } pmv - Predicted Mean Vote
|
|
29
|
+
* @property { number } ppd - Predicted Percentage of Dissatisfied occupants, [%]
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Returns Predicted Mean Vote ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} ) and
|
|
34
|
+
* Predicted Percentage of Dissatisfied ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PPD} )
|
|
35
|
+
* calculated in accordance with main thermal comfort Standards. The PMV is an index that predicts the mean
|
|
36
|
+
* value of the thermal sensation votes (self-reported perceptions) of a large group of people on a
|
|
37
|
+
* sensation scale expressed from –3 to +3 corresponding to the categories:
|
|
38
|
+
* cold, cool, slightly cool, neutral, slightly warm, warm, and hot. {@link #ref_1|[1]}
|
|
39
|
+
*
|
|
40
|
+
* While the PMV equation is the same for both the ISO and ASHRAE standards, in the
|
|
41
|
+
* ASHRAE 55 PMV equation, the SET is used to calculate the cooling effect first,
|
|
42
|
+
* this is then subtracted from both the air and mean radiant temperatures, and the
|
|
43
|
+
* differences are used as input to the PMV model, while the airspeed is set to 0.1m/s.
|
|
44
|
+
* Please read more in the Note below.
|
|
45
|
+
*
|
|
46
|
+
* Notes:
|
|
47
|
+
*
|
|
48
|
+
* You can use this function to calculate the {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV}
|
|
49
|
+
* and {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PPD} in accordance with
|
|
50
|
+
* either the ASHRAE 55 2020 Standard {@link #ref_1|[1]} or the ISO 7730 Standard {@link #ref_2|[2]}.
|
|
51
|
+
*
|
|
52
|
+
* This is a version that supports scalar arguments.
|
|
53
|
+
* @see {@link pmv_ppd_array} for a version that supports arrays.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
* @memberof models
|
|
57
|
+
* @docname Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD)
|
|
58
|
+
*
|
|
59
|
+
* @param { number } tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
60
|
+
* @param { number } tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
61
|
+
* @param { number } vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
|
|
62
|
+
*
|
|
63
|
+
* Note: vr is the relative air speed caused by body movement and not the air
|
|
64
|
+
* speed measured by the air speed sensor. The relative air speed is the sum of the
|
|
65
|
+
* average air speed measured by the sensor plus the activity-generated air speed
|
|
66
|
+
* (Vag). Where Vag is the activity-generated air speed caused by motion of
|
|
67
|
+
* individual body parts. vr can be calculated using the function `v_relative` which is in .utilities.js.
|
|
68
|
+
* @param { number } rh - relative humidity, [%]
|
|
69
|
+
* @param { number } met - metabolic rate
|
|
70
|
+
* @param { number } clo - clothing insulation
|
|
71
|
+
*
|
|
72
|
+
* Note: The activity as well as the air speed modify the insulation characteristics
|
|
73
|
+
* of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
|
|
74
|
+
* the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
|
|
75
|
+
* for the effect of the body movement for met equal or higher than 1.2 met using
|
|
76
|
+
* the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
|
|
77
|
+
* can be calculated using the function `clo_dynamic` which is in .utilities.js.
|
|
78
|
+
* @param { number } [wme=0] - external work
|
|
79
|
+
* @param { "ISO"|"ASHRAE" } [standard="ISO"] - comfort standard used for calculation
|
|
80
|
+
*
|
|
81
|
+
* · If "ISO", then the ISO Equation is used
|
|
82
|
+
*
|
|
83
|
+
* · If "ASHRAE", then the ASHRAE Equation is used
|
|
84
|
+
*
|
|
85
|
+
* Note: While the PMV equation is the same for both the ISO and ASHRAE standards, the ASHRAE Standard Use of
|
|
86
|
+
* the PMV model is limited to air speeds below 0.10m/s (20 fpm). When air speeds exceed 0.10 m/s (20 fpm), the comfort
|
|
87
|
+
* zone boundaries are adjusted based on the SET model. This change was introduced by the
|
|
88
|
+
* {@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}
|
|
89
|
+
* @param { Pmv_ppdKwargs }kwargs - additional arguments
|
|
90
|
+
*
|
|
91
|
+
* @returns { Pmv_ppdReturns } - Result of pmv and ppd
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* const tdb = 25;
|
|
95
|
+
* const tr = 25;
|
|
96
|
+
* const rh = 50;
|
|
97
|
+
* const v = 0.1;
|
|
98
|
+
* const met = 1.4;
|
|
99
|
+
* const clo = 0.5;
|
|
100
|
+
* // Calculate relative air speed
|
|
101
|
+
* const v_r = v_relative(v, met);
|
|
102
|
+
* // Calculate dynamic clothing
|
|
103
|
+
* const clo_d = clo_dynamic(clo, met);
|
|
104
|
+
* const results = pmv_ppd(tdb, tr, v_r, rh, met, clo_d);
|
|
105
|
+
* console.log(results); // Output: { pmv: 0.06, ppd: 5.1 }
|
|
106
|
+
* console.log(results.pmv); // Output: -0.06
|
|
107
|
+
*/
|
|
108
|
+
function pmv_ppd(tdb, tr, vr, rh, met, clo, wme = 0, standard = "ISO", kwargs = {}) {
|
|
109
|
+
const default_kwargs = {
|
|
110
|
+
units: "SI",
|
|
111
|
+
limit_inputs: true,
|
|
112
|
+
airspeed_control: true,
|
|
113
|
+
};
|
|
114
|
+
kwargs = Object.assign(default_kwargs, kwargs);
|
|
115
|
+
if (kwargs.units && kwargs.units === "IP") {
|
|
116
|
+
// Conversion from IP to SI units
|
|
117
|
+
({ tdb, tr, vr } = (0, utilities_js_1.units_converter)({ tdb, tr, vr }, "IP"));
|
|
118
|
+
}
|
|
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
|
+
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
|
+
tdb: [tdb],
|
|
124
|
+
tr: [tr],
|
|
125
|
+
v: [vr],
|
|
126
|
+
met: [met],
|
|
127
|
+
clo: [clo],
|
|
128
|
+
airspeed_control: kwargs.airspeed_control,
|
|
129
|
+
});
|
|
130
|
+
let ce = 0;
|
|
131
|
+
if (standard === "ASHRAE") {
|
|
132
|
+
//if v_r is higher than 0.1 follow methodology ASHRAE Appendix H, H3
|
|
133
|
+
ce = vr > 0.1 ? (0, cooling_effect_js_1.cooling_effect)(tdb, tr, vr, rh, met, clo, wme) : 0;
|
|
134
|
+
}
|
|
135
|
+
tdb = tdb - ce;
|
|
136
|
+
tr = tr - ce;
|
|
137
|
+
vr = ce > 0 ? 0.1 : vr;
|
|
138
|
+
let pmv = pmv_calculation(tdb, tr, vr, rh, met, clo, wme);
|
|
139
|
+
let ppd = 100.0 -
|
|
140
|
+
95.0 *
|
|
141
|
+
Math.exp(-0.03353 * Math.pow(pmv, 4.0) - 0.2179 * Math.pow(pmv, 2.0));
|
|
142
|
+
// Checks that inputs are within the bounds accepted by the model if not return NaN
|
|
143
|
+
if (kwargs.limit_inputs) {
|
|
144
|
+
const pmv_valid = standard === "ASHRAE"
|
|
145
|
+
? (0, utilities_js_1.valid_range)([pmv], [-100, 100])
|
|
146
|
+
: (0, utilities_js_1.valid_range)([pmv], [-2, 2]); // this is the ISO limit
|
|
147
|
+
if (isNaN(pmv) ||
|
|
148
|
+
tdb_valid.includes(NaN) ||
|
|
149
|
+
tr_valid.includes(NaN) ||
|
|
150
|
+
v_valid.includes(NaN) ||
|
|
151
|
+
met_valid.includes(NaN) ||
|
|
152
|
+
clo_valid.includes(NaN) ||
|
|
153
|
+
pmv_valid.includes(NaN)) {
|
|
154
|
+
pmv = NaN;
|
|
155
|
+
ppd = NaN;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
pmv: (0, utilities_js_1.round)(pmv, 2),
|
|
160
|
+
ppd: (0, utilities_js_1.round)(ppd, 1),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
exports.pmv_ppd = pmv_ppd;
|
|
164
|
+
/**
|
|
165
|
+
* @typedef {Object} Pmv_ppd_arrayReturns
|
|
166
|
+
* @property { number[] } pmv - Predicted Mean Vote
|
|
167
|
+
* @property { number[] } ppd - Predicted Percentage of Dissatisfied occupants, [%]
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
/**
|
|
171
|
+
* Returns Predicted Mean Vote ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV} ) and
|
|
172
|
+
* Predicted Percentage of Dissatisfied ( {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PPD} )
|
|
173
|
+
* calculated in accordance with main thermal comfort Standards. The PMV is an index that predicts the mean
|
|
174
|
+
* value of the thermal sensation votes (self-reported perceptions) of a large group of people on a
|
|
175
|
+
* sensation scale expressed from –3 to +3 corresponding to the categories:
|
|
176
|
+
* cold, cool, slightly cool, neutral, slightly warm, warm, and hot. {@link #ref_1|[1]}
|
|
177
|
+
*
|
|
178
|
+
* While the PMV equation is the same for both the ISO and ASHRAE standards, in the
|
|
179
|
+
* ASHRAE 55 PMV equation, the SET is used to calculate the cooling effect first,
|
|
180
|
+
* this is then subtracted from both the air and mean radiant temperatures, and the
|
|
181
|
+
* differences are used as input to the PMV model, while the airspeed is set to 0.1m/s.
|
|
182
|
+
* Please read more in the Note below.
|
|
183
|
+
*
|
|
184
|
+
* Notes:
|
|
185
|
+
*
|
|
186
|
+
* You can use this function to calculate the {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PMV}
|
|
187
|
+
* and {@link https://en.wikipedia.org/wiki/Thermal_comfort#PMV/PPD_method|PPD} in accordance with
|
|
188
|
+
* either the ASHRAE 55 2020 Standard {@link #ref_1|[1]} or the ISO 7730 Standard {@link #ref_2|[2]}.
|
|
189
|
+
*
|
|
190
|
+
* This is a version that supports arrays.
|
|
191
|
+
* @see {@link pmv_ppd} for a version that supports scalar arguments.
|
|
192
|
+
*
|
|
193
|
+
* @public
|
|
194
|
+
* @memberof models
|
|
195
|
+
* @docname Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD) (array version)
|
|
196
|
+
*
|
|
197
|
+
* @param { number[] } tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
198
|
+
* @param { number[] } tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
199
|
+
* @param { number[] } vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
|
|
200
|
+
*
|
|
201
|
+
* Note: vr is the relative air speed caused by body movement and not the air
|
|
202
|
+
* speed measured by the air speed sensor. The relative air speed is the sum of the
|
|
203
|
+
* average air speed measured by the sensor plus the activity-generated air speed
|
|
204
|
+
* (Vag). Where Vag is the activity-generated air speed caused by motion of
|
|
205
|
+
* individual body parts. vr can be calculated using the function `v_relative_array` which is in .utilities.js.
|
|
206
|
+
* @param { number[] } rh - relative humidity, [%]
|
|
207
|
+
* @param { number[] } met - metabolic rate, [met]
|
|
208
|
+
* @param { number[] } clo - clothing insulation, [clo]
|
|
209
|
+
*
|
|
210
|
+
* Note: The activity as well as the air speed modify the insulation characteristics
|
|
211
|
+
* of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
|
|
212
|
+
* the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
|
|
213
|
+
* for the effect of the body movement for met equal or higher than 1.2 met using
|
|
214
|
+
* the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
|
|
215
|
+
* can be calculated using the function `clo_dynamic_array` which is in .utilities.js.
|
|
216
|
+
* @param { number[] } wme - external work, default is array of 0
|
|
217
|
+
* @param { "ISO"|"ASHRAE" } [standard="ISO"] - comfort standard used for calculation
|
|
218
|
+
*
|
|
219
|
+
* · If "ISO", then the ISO Equation is used
|
|
220
|
+
*
|
|
221
|
+
* · If "ASHRAE", then the ASHRAE Equation is used
|
|
222
|
+
*
|
|
223
|
+
* Note: While the PMV equation is the same for both the ISO and ASHRAE standards, the ASHRAE Standard Use of
|
|
224
|
+
* the PMV model is limited to air speeds below 0.10m/s (20 fpm). When air speeds exceed 0.10 m/s (20 fpm), the comfort
|
|
225
|
+
* zone boundaries are adjusted based on the SET model. This change was introduced by the
|
|
226
|
+
* {@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}
|
|
227
|
+
* @param { Pmv_ppdKwargs }kwargs - additional arguments
|
|
228
|
+
*
|
|
229
|
+
* @returns {Pmv_ppd_arrayReturns} - Result of pmv and ppd
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* const tdb = [22, 25];
|
|
233
|
+
* const tr = [25, 25];
|
|
234
|
+
* const rh = [50, 50];
|
|
235
|
+
* const v = [0.1, 0.1];
|
|
236
|
+
* const met = [1.4, 1.4];
|
|
237
|
+
* const clo = [0.5, 0.5];
|
|
238
|
+
* // Calculate relative air speed
|
|
239
|
+
* const v_r = v_relative_array(v, met);
|
|
240
|
+
* // Calculate dynamic clothing
|
|
241
|
+
* const clo_d = clo_dynamic_array(clo, met);
|
|
242
|
+
* const arrayResults = pmv_ppd_array(tdb, tr, v_r, rh, met, clo_d);
|
|
243
|
+
* console.log(arrayResults); // Output: { pmv: [-0.47, 0.06], ppd: [9.6, 5.1] }
|
|
244
|
+
* console.log(results.pmv); // Output: [-0.47, 0.06]
|
|
245
|
+
*/
|
|
246
|
+
function pmv_ppd_array(tdb, tr, vr, rh, met, clo, wme, standard = "ISO", kwargs = {}) {
|
|
247
|
+
const default_kwargs = {
|
|
248
|
+
units: "SI",
|
|
249
|
+
limit_inputs: true,
|
|
250
|
+
airspeed_control: true,
|
|
251
|
+
};
|
|
252
|
+
kwargs = Object.assign(default_kwargs, kwargs);
|
|
253
|
+
// default wme is an array of 0
|
|
254
|
+
if (wme === undefined) {
|
|
255
|
+
wme = tdb.map(() => 0);
|
|
256
|
+
}
|
|
257
|
+
if (kwargs.units && kwargs.units === "IP") {
|
|
258
|
+
// Conversion from IP to SI units
|
|
259
|
+
({ tdb, tr, vr } = (0, utilities_js_1.units_converter_array)({ tdb, tr, vr }, "IP"));
|
|
260
|
+
}
|
|
261
|
+
if (standard !== "ISO" && standard !== "ASHRAE") {
|
|
262
|
+
throw new Error("PMV calculations can only be performed in compliance with ISO or ASHRAE Standards");
|
|
263
|
+
}
|
|
264
|
+
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, {
|
|
265
|
+
tdb,
|
|
266
|
+
tr,
|
|
267
|
+
v: vr,
|
|
268
|
+
met,
|
|
269
|
+
clo,
|
|
270
|
+
airspeed_control: kwargs.airspeed_control,
|
|
271
|
+
});
|
|
272
|
+
let ce = [];
|
|
273
|
+
if (standard === "ASHRAE") {
|
|
274
|
+
ce = vr.map((vrValue, i) => {
|
|
275
|
+
//if v_r is higher than 0.1 follow methodology ASHRAE Appendix H, H3
|
|
276
|
+
return vrValue > 0.1
|
|
277
|
+
? (0, cooling_effect_js_1.cooling_effect)(tdb[i], tr[i], vrValue, rh[i], met[i], clo[i], wme[i])
|
|
278
|
+
: 0;
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (ce.length === 0) {
|
|
282
|
+
for (let i = 0; i < tdb.length; i++) {
|
|
283
|
+
ce[i] = 0;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
for (let i = 0; i < tdb.length; i++) {
|
|
287
|
+
tdb[i] -= ce[i];
|
|
288
|
+
tr[i] -= ce[i];
|
|
289
|
+
if (ce[i] > 0) {
|
|
290
|
+
vr[i] = 0.1;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const pmv_array = tdb.map((tdbValue, i) => pmv_calculation(tdbValue, tr[i], vr[i], rh[i], met[i], clo[i], wme[i]));
|
|
294
|
+
const ppd_array = pmv_array.map((pmvValue) => {
|
|
295
|
+
return (100 -
|
|
296
|
+
95 *
|
|
297
|
+
Math.exp(-0.03353 * Math.pow(pmvValue, 4) - 0.2179 * Math.pow(pmvValue, 2)));
|
|
298
|
+
});
|
|
299
|
+
// Checks that inputs are within the bounds accepted by the model if not return NaN
|
|
300
|
+
if (kwargs.limit_inputs) {
|
|
301
|
+
const pmv_valid = standard === "ASHRAE"
|
|
302
|
+
? (0, utilities_js_1.valid_range)(pmv_array, [-100, 100])
|
|
303
|
+
: (0, utilities_js_1.valid_range)(pmv_array, [-2, 2]); // this is the ISO limit
|
|
304
|
+
for (let i = 0; i < pmv_array.length; ++i) {
|
|
305
|
+
if (isNaN(pmv_array[i]) ||
|
|
306
|
+
isNaN(tdb_valid[i]) ||
|
|
307
|
+
isNaN(tr_valid[i]) ||
|
|
308
|
+
isNaN(v_valid[i]) ||
|
|
309
|
+
isNaN(met_valid[i]) ||
|
|
310
|
+
isNaN(clo_valid[i]) ||
|
|
311
|
+
isNaN(pmv_valid[i])) {
|
|
312
|
+
pmv_array[i] = NaN;
|
|
313
|
+
ppd_array[i] = NaN;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
for (let i = 0; i < pmv_array.length; ++i) {
|
|
318
|
+
pmv_array[i] = (0, utilities_js_1.round)(pmv_array[i], 2);
|
|
319
|
+
ppd_array[i] = (0, utilities_js_1.round)(ppd_array[i], 1);
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
pmv: pmv_array,
|
|
323
|
+
ppd: ppd_array,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
exports.pmv_ppd_array = pmv_ppd_array;
|
|
327
|
+
/**
|
|
328
|
+
* @param {number} tdb
|
|
329
|
+
* @param {number} tr
|
|
330
|
+
* @param {number} vr
|
|
331
|
+
* @param {number} rh
|
|
332
|
+
* @param {number} met
|
|
333
|
+
* @param {number} clo
|
|
334
|
+
* @param {number} wme
|
|
335
|
+
*
|
|
336
|
+
* @returns {number} _pmv
|
|
337
|
+
*/
|
|
338
|
+
function pmv_calculation(tdb, tr, vr, rh, met, clo, wme) {
|
|
339
|
+
const pa = rh * 10 * Math.exp(16.6536 - 4030.183 / (tdb + 235));
|
|
340
|
+
const icl = 0.155 * clo; //thermal insulation of the clothing in M2K/W
|
|
341
|
+
const m = met * 58.15; //metabolic rate in W/M2
|
|
342
|
+
const w = wme * 58.15; //external work in W/M2
|
|
343
|
+
const mw = m - w; //internal heat production in the human body
|
|
344
|
+
//calculation of the clothing area factor
|
|
345
|
+
let f_cl;
|
|
346
|
+
if (icl <= 0.078) {
|
|
347
|
+
f_cl = 1 + 1.29 * icl; // ratio of surface clothed body over nude body
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
f_cl = 1.05 + 0.645 * icl;
|
|
351
|
+
}
|
|
352
|
+
//heat transfer coefficient by forced convection
|
|
353
|
+
const hcf = 12.1 * Math.sqrt(vr);
|
|
354
|
+
let hc = hcf;
|
|
355
|
+
const taa = tdb + 273;
|
|
356
|
+
const tra = tr + 273;
|
|
357
|
+
const t_cla = taa + (35.5 - tdb) / (3.5 * icl + 0.1);
|
|
358
|
+
const p1 = icl * f_cl;
|
|
359
|
+
const p2 = p1 * 3.96;
|
|
360
|
+
const p3 = p1 * 100;
|
|
361
|
+
const p4 = p1 * taa;
|
|
362
|
+
const p5 = 308.7 - 0.028 * mw + p2 * Math.pow(tra / 100.0, 4);
|
|
363
|
+
let xn = t_cla / 100;
|
|
364
|
+
let xf = t_cla / 50;
|
|
365
|
+
const eps = 0.00015;
|
|
366
|
+
let n = 0;
|
|
367
|
+
while (Math.abs(xn - xf) > eps) {
|
|
368
|
+
xf = (xf + xn) / 2;
|
|
369
|
+
let hcn = 2.38 * Math.pow(Math.abs(100.0 * xf - taa), 0.25);
|
|
370
|
+
if (hcf > hcn) {
|
|
371
|
+
hc = hcf;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
hc = hcn;
|
|
375
|
+
}
|
|
376
|
+
xn = (p5 + p4 * hc - p2 * Math.pow(xf, 4)) / (100 + p3 * hc);
|
|
377
|
+
n += 1;
|
|
378
|
+
if (n > 150) {
|
|
379
|
+
throw new Error("Max iterations exceeded");
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const tcl = 100 * xn - 273;
|
|
383
|
+
//heat loss diff. through skin
|
|
384
|
+
const hl1 = 3.05 * 0.001 * (5733 - 6.99 * mw - pa);
|
|
385
|
+
//heat loss by sweating
|
|
386
|
+
let hl2;
|
|
387
|
+
if (mw > 58.15) {
|
|
388
|
+
hl2 = 0.42 * (mw - 58.15);
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
hl2 = 0;
|
|
392
|
+
}
|
|
393
|
+
//latent respiration heat loss
|
|
394
|
+
const hl3 = 1.7 * 0.00001 * m * (5867 - pa);
|
|
395
|
+
//dry respiration heat loss
|
|
396
|
+
const hl4 = 0.0014 * m * (34 - tdb);
|
|
397
|
+
//heat loss by radiation
|
|
398
|
+
const hl5 = 3.96 * f_cl * (Math.pow(xn, 4) - Math.pow(tra / 100.0, 4));
|
|
399
|
+
//heat loss by convection
|
|
400
|
+
const hl6 = f_cl * hc * (tcl - tdb);
|
|
401
|
+
const ts = 0.303 * Math.exp(-0.036 * m) + 0.028;
|
|
402
|
+
return ts * (mw - hl1 - hl2 - hl3 - hl4 - hl5 - hl6);
|
|
403
|
+
}
|
|
404
|
+
exports.pmv_calculation = pmv_calculation;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.set_tmp_array = exports.set_tmp = void 0;
|
|
4
|
+
const utilities_js_1 = require("../utilities/utilities.js");
|
|
5
|
+
const two_nodes_js_1 = require("../models/two_nodes.js");
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} SetTmpKwargs - a keywords argument set containing the additional arguments for Standard Effective Temperature calculation
|
|
8
|
+
* @property {boolean} [round=true] - round the result of the SET
|
|
9
|
+
* @property {boolean} [calculate_ce=false] - select if SET is used to calculate Cooling Effect
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} SetTmpKwargsRequired
|
|
14
|
+
* @property {boolean} round
|
|
15
|
+
* @property {boolean} calculate_ce
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Calculates the Standard Effective Temperature (SET). The SET is the
|
|
19
|
+
* temperature of a hypothetical isothermal environment at 50% (rh),
|
|
20
|
+
* <0.1 m/s (20 fpm) average air speed (v), and tr = tdb, in which the
|
|
21
|
+
* total heat loss from the skin of an imaginary occupant wearing
|
|
22
|
+
* clothing, standardized for the activity concerned is the same as
|
|
23
|
+
* that from a person in the actual environment with actual clothing
|
|
24
|
+
* and activity level {@link #ref_10|[10]}.
|
|
25
|
+
* @public
|
|
26
|
+
* @memberof models
|
|
27
|
+
* @docname Standard Effective Temperature (SET)
|
|
28
|
+
*
|
|
29
|
+
* @see {@link set_tmp_array} for a version that supports arrays
|
|
30
|
+
*
|
|
31
|
+
* @param {number} tdb Dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'.
|
|
32
|
+
* @param {number} tr Mean radiant temperature, default in [°C]
|
|
33
|
+
* @param {number} v Air speed, default in [m/s]
|
|
34
|
+
* @param {number} rh Relative humidity, [%].
|
|
35
|
+
* @param {number} met Metabolic rate, [W/(m2)]
|
|
36
|
+
* @param {number} clo Clothing insulation, [clo]
|
|
37
|
+
* @param {number} [wme=0] External work, [W/(m2)] default 0
|
|
38
|
+
* @param {number} [body_surface_area] Body surface area, default value 1.8258 [m2] in [ft2] if units = ‘IP’
|
|
39
|
+
* @param {number} [p_atm] Atmospheric pressure, default value 101325 [Pa] in [atm] if units = ‘IP’
|
|
40
|
+
* @param {"standing" | "sitting"} [body_position="standing"] Select either “sitting” or “standing”
|
|
41
|
+
* @param {"SI" | "IP"} [units="SI"] Select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
42
|
+
* @param {boolean} [limit_inputs=true] By default, if the inputs are outsude the following limits the function returns nan. If False returns values regardless of the input values.
|
|
43
|
+
* @param {SetTmpKwargs} [kwargs]
|
|
44
|
+
* @returns {number} SET – Standard effective temperature in array, [°C]
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* const set = set_tmp(25, 25, 0.1, 50, 1.2, 0.5); // returns 24.3
|
|
48
|
+
*/
|
|
49
|
+
function set_tmp(tdb, tr, v, rh, met, clo, wme = 0, body_surface_area, p_atm, body_position = "standing", units = "SI", limit_inputs = true, kwargs = {}) {
|
|
50
|
+
const defaults_kwargs = {
|
|
51
|
+
calculate_ce: false,
|
|
52
|
+
round: true,
|
|
53
|
+
};
|
|
54
|
+
let joint_kwargs = Object.assign(defaults_kwargs, kwargs);
|
|
55
|
+
if (body_surface_area === undefined)
|
|
56
|
+
body_surface_area = units === "SI" ? 1.8258 : 19.65;
|
|
57
|
+
if (p_atm === undefined)
|
|
58
|
+
p_atm = units === "SI" ? 101325 : 1;
|
|
59
|
+
if (units === "IP") {
|
|
60
|
+
const unit_convert = (0, utilities_js_1.units_converter)({
|
|
61
|
+
tdb: tdb,
|
|
62
|
+
tr: tr,
|
|
63
|
+
v: v,
|
|
64
|
+
area: body_surface_area,
|
|
65
|
+
pressure: p_atm,
|
|
66
|
+
}, "IP");
|
|
67
|
+
tdb = unit_convert.tdb;
|
|
68
|
+
tr = unit_convert.tr;
|
|
69
|
+
v = unit_convert.v;
|
|
70
|
+
body_surface_area = unit_convert.area;
|
|
71
|
+
p_atm = unit_convert.pressure;
|
|
72
|
+
}
|
|
73
|
+
let set_tmp = (0, two_nodes_js_1.two_nodes)(tdb, tr, v, rh, met, clo, wme, body_surface_area, p_atm, body_position, undefined, { round: false, calculate_ce: joint_kwargs.calculate_ce }).set;
|
|
74
|
+
if (units === "IP") {
|
|
75
|
+
({ tmp: set_tmp } = (0, utilities_js_1.units_converter)({ tmp: set_tmp }, "SI"));
|
|
76
|
+
}
|
|
77
|
+
if (limit_inputs) {
|
|
78
|
+
const { tdb: tdb_valid, tr: tr_valid, v: v_valid, met: met_valid, clo: clo_valid, } = (0, utilities_js_1.check_standard_compliance_array)("ASHRAE", {
|
|
79
|
+
tdb: [tdb],
|
|
80
|
+
tr: [tr],
|
|
81
|
+
v: [v],
|
|
82
|
+
met: [met],
|
|
83
|
+
clo: [clo],
|
|
84
|
+
});
|
|
85
|
+
if (isNaN(tdb_valid[0]) ||
|
|
86
|
+
isNaN(tr_valid[0]) ||
|
|
87
|
+
isNaN(v_valid[0]) ||
|
|
88
|
+
isNaN(met_valid[0]) ||
|
|
89
|
+
isNaN(clo_valid[0])) {
|
|
90
|
+
set_tmp = NaN;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (joint_kwargs.round) {
|
|
94
|
+
return (0, utilities_js_1.round)(set_tmp, 1);
|
|
95
|
+
}
|
|
96
|
+
return set_tmp;
|
|
97
|
+
}
|
|
98
|
+
exports.set_tmp = set_tmp;
|
|
99
|
+
/**
|
|
100
|
+
* @typedef {Object} SetTmpArrayKwargs - a keywords argument set containing the additional arguments for SET array calculation
|
|
101
|
+
* @property {boolean} [round=true] - round the result of the SET
|
|
102
|
+
* @property {boolean} [calculate_ce=false] - select if SET array is used to calculate Cooling Effect
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* @typedef {Object} SetTmpArrayKwargsRequired
|
|
107
|
+
* @property {boolean} round
|
|
108
|
+
* @property {boolean} calculate_ce
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
* Calculates the SET when the input parameters are arrays. The SET is the
|
|
113
|
+
* temperature of a hypothetical isothermal environment at 50% (rh),
|
|
114
|
+
* <0.1 m/s (20 fpm) average air speed (v), and tr = tdb, in which the
|
|
115
|
+
* total heat loss from the skin of an imaginary occupant wearing
|
|
116
|
+
* clothing, standardized for the activity concerned is the same as
|
|
117
|
+
* that from a person in the actual environment with actual clothing
|
|
118
|
+
* and activity level {@link #ref_10|[10]}.
|
|
119
|
+
* @public
|
|
120
|
+
* @memberof models
|
|
121
|
+
* @docname Standard Effective Temperature (SET) (array version)
|
|
122
|
+
*
|
|
123
|
+
* @see {@link set_tmp} for a version that supports scalar arguments
|
|
124
|
+
*
|
|
125
|
+
* @param {number[]} tdbArray Dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'.
|
|
126
|
+
* @param {number[]} trArray Mean radiant temperature, default in [°C]
|
|
127
|
+
* @param {number[]} vArray Air speed, default in [m/s]
|
|
128
|
+
* @param {number[]} rhArray Relative humidity, [%].
|
|
129
|
+
* @param {number[]} metArray Metabolic rate, [W/(m2)]
|
|
130
|
+
* @param {number[]} cloArray Clothing insulation, [clo]
|
|
131
|
+
* @param {number[]} [wmeArray] External work, [W/(m2)] default 0
|
|
132
|
+
* @param {number[]} [bodySurfaceArray] Body surface area, default value 1.8258 [m2] in [ft2] if units = ‘IP’
|
|
133
|
+
* @param {number[]} [pAtmArray] Atmospheric pressure, default value 101325 [Pa] in [atm] if units = ‘IP’
|
|
134
|
+
* @param {"standing" | "sitting"} bodyPositionArray Select either “sitting” or “standing”
|
|
135
|
+
* @param {"SI" | "IP"} [units="SI"] Select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
136
|
+
* @param {boolean} [limit_inputs=true] By default, if the inputs are outsude the following limits the function returns nan. If False returns values regardless of the input values.
|
|
137
|
+
* @param {SetTmpKwargs} [kwargs]
|
|
138
|
+
* @returns {number[]} SET Array – Standard effective temperature in array, [°C]
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* const set = set_tmp_array([25, 25], [25, 25], [0.1, 0.1], [50, 50], [1.2, 1.2], [0.5, 0.5]); // returns [24.3, 24.3]
|
|
142
|
+
*/
|
|
143
|
+
function set_tmp_array(tdbArray, trArray, vArray, rhArray, metArray, cloArray, wmeArray, bodySurfaceArray, pAtmArray, bodyPositionArray, units = "SI", limit_inputs = true, kwargs = {}) {
|
|
144
|
+
const defaults_kwargs = {
|
|
145
|
+
calculate_ce: false,
|
|
146
|
+
round: true,
|
|
147
|
+
};
|
|
148
|
+
let joint_kwargs = Object.assign(defaults_kwargs, kwargs);
|
|
149
|
+
if (wmeArray === undefined) {
|
|
150
|
+
wmeArray = tdbArray.map((_) => 0);
|
|
151
|
+
}
|
|
152
|
+
if (bodyPositionArray === undefined) {
|
|
153
|
+
bodyPositionArray = tdbArray.map((_) => "standing");
|
|
154
|
+
}
|
|
155
|
+
if (bodySurfaceArray === undefined)
|
|
156
|
+
bodySurfaceArray = tdbArray.map((_) => (units === "SI" ? 1.8258 : 19.65));
|
|
157
|
+
if (pAtmArray === undefined)
|
|
158
|
+
pAtmArray = tdbArray.map((_) => (units === "SI" ? 101325 : 1));
|
|
159
|
+
if (units === "IP") {
|
|
160
|
+
const unit_convert = (0, utilities_js_1.units_converter_array)({
|
|
161
|
+
tdb: tdbArray,
|
|
162
|
+
tr: trArray,
|
|
163
|
+
v: vArray,
|
|
164
|
+
area: bodySurfaceArray,
|
|
165
|
+
pressure: pAtmArray,
|
|
166
|
+
}, "IP");
|
|
167
|
+
tdbArray = unit_convert.tdb;
|
|
168
|
+
trArray = unit_convert.tr;
|
|
169
|
+
vArray = unit_convert.v;
|
|
170
|
+
bodySurfaceArray = unit_convert.area;
|
|
171
|
+
pAtmArray = unit_convert.pressure;
|
|
172
|
+
}
|
|
173
|
+
let setArray = (0, two_nodes_js_1.two_nodes_array)(tdbArray, trArray, vArray, rhArray, metArray, cloArray, wmeArray, bodySurfaceArray, pAtmArray, bodyPositionArray, undefined, { round: false, calculate_ce: joint_kwargs.calculate_ce }).set;
|
|
174
|
+
if (units === "IP") {
|
|
175
|
+
const convertedSet = (0, utilities_js_1.units_converter_array)({
|
|
176
|
+
tmp: setArray,
|
|
177
|
+
}, "SI");
|
|
178
|
+
setArray = convertedSet.tmp;
|
|
179
|
+
}
|
|
180
|
+
if (limit_inputs) {
|
|
181
|
+
const { tdb: tdbValid, tr: trValid, v: vValid, met: metValid, clo: cloValid, } = (0, utilities_js_1.check_standard_compliance_array)("ASHRAE", {
|
|
182
|
+
tdb: tdbArray,
|
|
183
|
+
tr: trArray,
|
|
184
|
+
v: vArray,
|
|
185
|
+
met: metArray,
|
|
186
|
+
clo: cloArray,
|
|
187
|
+
});
|
|
188
|
+
for (let index = 0; index < tdbArray.length; index++) {
|
|
189
|
+
if (isNaN(tdbValid[index]) ||
|
|
190
|
+
isNaN(trValid[index]) ||
|
|
191
|
+
isNaN(vValid[index]) ||
|
|
192
|
+
isNaN(metValid[index]) ||
|
|
193
|
+
isNaN(cloValid[index])) {
|
|
194
|
+
setArray[index] = NaN;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (joint_kwargs.round) {
|
|
199
|
+
return (0, two_nodes_js_1.roundArray)(setArray, 1);
|
|
200
|
+
}
|
|
201
|
+
return setArray;
|
|
202
|
+
}
|
|
203
|
+
exports.set_tmp_array = set_tmp_array;
|