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,294 @@
|
|
|
1
|
+
import { t_o, t_o_array } from "../psychrometrics/t_o.js";
|
|
2
|
+
import { units_converter, round, units_converter_array, valid_range, } from "../utilities/utilities.js";
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {object} AdaptiveEnResult - a result set containing the results for {@link #adative_en|adaptive_en}
|
|
5
|
+
* @property {number} tmp_cmf - Comfort temperature at that specific running mean temperature, default in [°C] or in [°F]
|
|
6
|
+
* @property {boolean} acceptability_cat_i - If the indoor conditions comply with comfort category I
|
|
7
|
+
* @property {boolean} acceptability_cat_ii - If the indoor conditions comply with comfort category II
|
|
8
|
+
* @property {boolean} acceptability_cat_iii - If the indoor conditions comply with comfort category III
|
|
9
|
+
* @property {number} tmp_cmf_cat_i_up - Upper acceptable comfort temperature for category I, default in [°C] or in [°F]
|
|
10
|
+
* @property {number} tmp_cmf_cat_ii_up - Upper acceptable comfort temperature for category II, default in [°C] or in [°F]
|
|
11
|
+
* @property {number} tmp_cmf_cat_iii_up - Upper acceptable comfort temperature for category III, default in [°C] or in [°F]
|
|
12
|
+
* @property {number} tmp_cmf_cat_i_low - Lower acceptable comfort temperature for category I, default in [°C] or in [°F]
|
|
13
|
+
* @property {number} tmp_cmf_cat_ii_low - Lower acceptable comfort temperature for category II, default in [°C] or in [°F]
|
|
14
|
+
* @property {number} tmp_cmf_cat_iii_low - Lower acceptable comfort temperature for category III, default in [°C] or in [°F]
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Determines the adaptive thermal comfort based on EN 16798-1 2019 {@link #ref_3|[3]}
|
|
19
|
+
*
|
|
20
|
+
* Note: You can use this function to calculate if your conditions are within the EN
|
|
21
|
+
* adaptive thermal comfort region. Calculations with comply with the EN 16798-1 2019 {@link #ref_3|[3]}.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link adaptive_en_array} for a version that supports array arguments
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
* @memberof models
|
|
27
|
+
* @docname Adaptive EN
|
|
28
|
+
*
|
|
29
|
+
* @param {number} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
30
|
+
* @param {number} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
31
|
+
* @param {number} t_running_mean - running mean temperature, default in [°C] in [°C] in [°F] if `units` = 'IP'
|
|
32
|
+
* The running mean temperature can be calculated using the function {@link #running_mean_outdoor_temperature|running_mean_outdoor_temperature}
|
|
33
|
+
*
|
|
34
|
+
* @param {number} v - air speed, default in [m/s] in [fps] if `units` = 'IP'
|
|
35
|
+
*
|
|
36
|
+
* Note: Indoor operative temperature correction is applicable for buildings equipped
|
|
37
|
+
* with fans or personal systems providing building occupants with personal
|
|
38
|
+
* control over air speed at occupant level.
|
|
39
|
+
* For operative temperatures above 25°C the comfort zone upper limit can be
|
|
40
|
+
* increased by 1.2 °C (0.6 < v < 0.9 m/s), 1.8 °C (0.9 < v < 1.2 m/s), 2.2 °C (v > 1.2 m/s)
|
|
41
|
+
*
|
|
42
|
+
* @param {"IP" | "SI"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
43
|
+
* @param {boolean} [limit_inputs=true] - By default, if the inputs are outsude the standard applicability limits the
|
|
44
|
+
* function returns nan. If False returns pmv and ppd values even if input values are
|
|
45
|
+
* outside the applicability limits of the model.
|
|
46
|
+
*
|
|
47
|
+
* @returns {AdaptiveEnResult} result set
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const results = adaptive_en(25, 25, 20, 0.1);
|
|
51
|
+
* console.log(results); // {tmp_cmf: 25.4, acceptability_cat_i: true, acceptability_cat_ii: true, ... }
|
|
52
|
+
* console.log(results.acceptability_cat_i); // true
|
|
53
|
+
* // The conditions you entered are considered to comply with Category I
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // for users who wants to use the IP system
|
|
57
|
+
* const results = adaptive_en(77, 77, 68, 0.3, 'IP');
|
|
58
|
+
* console.log(results); // {tmp_cmf: 77.7, acceptability_cat_i: true, acceptability_cat_ii: true, ... }
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const results = adaptive_en(25, 25, 9, 0.1);
|
|
62
|
+
* console.log(results); // {tmp_cmf: NaN, acceptability_cat_i: true, acceptability_cat_ii: true, ... }
|
|
63
|
+
* // The adaptive thermal comfort model can only be used
|
|
64
|
+
* // if the running mean temperature is between 10 °C and 30 °C
|
|
65
|
+
*/
|
|
66
|
+
export function adaptive_en(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
|
|
67
|
+
const standard = "ISO";
|
|
68
|
+
if (units.toLowerCase() == "ip") {
|
|
69
|
+
({
|
|
70
|
+
tdb,
|
|
71
|
+
tr,
|
|
72
|
+
tmp_running_mean: t_running_mean,
|
|
73
|
+
v,
|
|
74
|
+
} = units_converter({ tdb, tr, tmp_running_mean: t_running_mean, v }));
|
|
75
|
+
}
|
|
76
|
+
const to = t_o(tdb, tr, v, standard);
|
|
77
|
+
const ce = get_ce(v, to);
|
|
78
|
+
let t_cmf = 0.33 * t_running_mean + 18.8;
|
|
79
|
+
if (limit_inputs) {
|
|
80
|
+
const trm_valid = t_running_mean >= 10.0 && t_running_mean <= 33.5;
|
|
81
|
+
if (!trm_valid)
|
|
82
|
+
t_cmf = NaN;
|
|
83
|
+
}
|
|
84
|
+
let t_cmf_i_lower = t_cmf - 3.0;
|
|
85
|
+
let t_cmf_ii_lower = t_cmf - 4.0;
|
|
86
|
+
let t_cmf_iii_lower = t_cmf - 5.0;
|
|
87
|
+
let t_cmf_i_upper = t_cmf + 2.0 + ce;
|
|
88
|
+
let t_cmf_ii_upper = t_cmf + 3.0 + ce;
|
|
89
|
+
let t_cmf_iii_upper = t_cmf + 4.0 + ce;
|
|
90
|
+
const acceptability_i = t_cmf_i_lower <= to && to <= t_cmf_i_upper;
|
|
91
|
+
const acceptability_ii = t_cmf_ii_lower <= to && to <= t_cmf_ii_upper;
|
|
92
|
+
const acceptability_iii = t_cmf_iii_lower <= to && to <= t_cmf_iii_upper;
|
|
93
|
+
if (units.toLocaleLowerCase() === "ip") {
|
|
94
|
+
({
|
|
95
|
+
tmp_cmf: t_cmf,
|
|
96
|
+
tmp_cmf_cat_i_up: t_cmf_i_upper,
|
|
97
|
+
tmp_cmf_cat_ii_up: t_cmf_ii_upper,
|
|
98
|
+
tmp_cmf_cat_iii_up: t_cmf_iii_upper,
|
|
99
|
+
} = units_converter({
|
|
100
|
+
tmp_cmf: t_cmf,
|
|
101
|
+
tmp_cmf_cat_i_up: t_cmf_i_upper,
|
|
102
|
+
tmp_cmf_cat_ii_up: t_cmf_ii_upper,
|
|
103
|
+
tmp_cmf_cat_iii_up: t_cmf_iii_upper,
|
|
104
|
+
}, "SI"));
|
|
105
|
+
({
|
|
106
|
+
tmp_cmf_cat_i_low: t_cmf_i_lower,
|
|
107
|
+
tmp_cmf_cat_ii_low: t_cmf_ii_lower,
|
|
108
|
+
tmp_cmf_cat_iii_low: t_cmf_iii_lower,
|
|
109
|
+
} = units_converter({
|
|
110
|
+
tmp_cmf_cat_i_low: t_cmf_i_lower,
|
|
111
|
+
tmp_cmf_cat_ii_low: t_cmf_ii_lower,
|
|
112
|
+
tmp_cmf_cat_iii_low: t_cmf_iii_lower,
|
|
113
|
+
}, "SI"));
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
tmp_cmf: round(t_cmf, 1),
|
|
117
|
+
acceptability_cat_i: acceptability_i,
|
|
118
|
+
acceptability_cat_ii: acceptability_ii,
|
|
119
|
+
acceptability_cat_iii: acceptability_iii,
|
|
120
|
+
tmp_cmf_cat_i_up: round(t_cmf_i_upper, 1),
|
|
121
|
+
tmp_cmf_cat_ii_up: round(t_cmf_ii_upper, 1),
|
|
122
|
+
tmp_cmf_cat_iii_up: round(t_cmf_iii_upper, 1),
|
|
123
|
+
tmp_cmf_cat_i_low: round(t_cmf_i_lower, 1),
|
|
124
|
+
tmp_cmf_cat_ii_low: round(t_cmf_ii_lower, 1),
|
|
125
|
+
tmp_cmf_cat_iii_low: round(t_cmf_iii_lower, 1),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @typedef {object} AdaptiveEnArrayResult - a result set containing the results for {@link #adative_en_array|adaptive_en_array}
|
|
130
|
+
* @property {number[]} tmp_cmf - Comfort temperature at that specific running mean temperature, default in [°C] or in [°F]
|
|
131
|
+
* @property {boolean[]} acceptability_cat_i - If the indoor conditions comply with comfort category I
|
|
132
|
+
* @property {boolean[]} acceptability_cat_ii - If the indoor conditions comply with comfort category II
|
|
133
|
+
* @property {boolean[]} acceptability_cat_iii - If the indoor conditions comply with comfort category III
|
|
134
|
+
* @property {number[]} tmp_cmf_cat_i_up - Upper acceptable comfort temperature for category I, default in [°C] or in [°F]
|
|
135
|
+
* @property {number[]} tmp_cmf_cat_ii_up - Upper acceptable comfort temperature for category II, default in [°C] or in [°F]
|
|
136
|
+
* @property {number[]} tmp_cmf_cat_iii_up - Upper acceptable comfort temperature for category III, default in [°C] or in [°F]
|
|
137
|
+
* @property {number[]} tmp_cmf_cat_i_low - Lower acceptable comfort temperature for category I, default in [°C] or in [°F]
|
|
138
|
+
* @property {number[]} tmp_cmf_cat_ii_low - Lower acceptable comfort temperature for category II, default in [°C] or in [°F]
|
|
139
|
+
* @property {number[]} tmp_cmf_cat_iii_low - Lower acceptable comfort temperature for category III, default in [°C] or in [°F]
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* Determines the adaptive thermal comfort based on EN 16798-1 2019 {@link #ref_3|[3]}
|
|
144
|
+
*
|
|
145
|
+
* Note: You can use this function to calculate if your conditions are within the EN
|
|
146
|
+
* adaptive thermal comfort region. Calculations with comply with the EN 16798-1 2019 {@link #ref_3|[3]}.
|
|
147
|
+
*
|
|
148
|
+
* @public
|
|
149
|
+
* @memberof models
|
|
150
|
+
* @docname Adaptive EN (array version)
|
|
151
|
+
*
|
|
152
|
+
* @see {@link adaptive_en} for a version that supports scalar arguments
|
|
153
|
+
*
|
|
154
|
+
* @param {number[]} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
155
|
+
* @param {number[]} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
156
|
+
* @param {number[]} t_running_mean - running mean temperature, default in [°C] in [°C] in [°F] if `units` = 'IP'
|
|
157
|
+
* The running mean temperature can be calculated using the function {@link #running_mean_outdoor_temperature|running_mean_outdoor_temperature}
|
|
158
|
+
*
|
|
159
|
+
* @param {number[]} v - air speed, default in [m/s] in [fps] if `units` = 'IP'
|
|
160
|
+
*
|
|
161
|
+
* Note: Indoor operative temperature correction is applicable for buildings equipped
|
|
162
|
+
* with fans or personal systems providing building occupants with personal
|
|
163
|
+
* control over air speed at occupant level.
|
|
164
|
+
* For operative temperatures above 25°C the comfort zone upper limit can be
|
|
165
|
+
* increased by 1.2 °C (0.6 < v < 0.9 m/s), 1.8 °C (0.9 < v < 1.2 m/s), 2.2 °C (v> 1.2 m/s)
|
|
166
|
+
*
|
|
167
|
+
* @param {"IP" | "SI"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
168
|
+
* @param {boolean} [limit_inputs=true] - By default, if the inputs are outsude the standard applicability limits the
|
|
169
|
+
* function returns nan. If False returns pmv and ppd values even if input values are
|
|
170
|
+
* outside the applicability limits of the model.
|
|
171
|
+
*
|
|
172
|
+
* @returns {AdaptiveEnArrayResult} result set
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* const results = adaptive_en([25,25], [25,25], [20,9], [0.1,0.1]);
|
|
176
|
+
* console.log(results); // {tmp_cmf: [25.4, NaN], acceptability_cat_i: [true, true], acceptability_cat_ii: [true, true], ... }
|
|
177
|
+
* console.log(results.acceptability_cat_i); // [true, true]
|
|
178
|
+
* // The conditions you entered are considered to comply with Category I
|
|
179
|
+
* // The adaptive thermal comfort model can only be used
|
|
180
|
+
* // if the running mean temperature is between 10 °C and 30 °C
|
|
181
|
+
*/
|
|
182
|
+
export function adaptive_en_array(tdb, tr, t_running_mean, v, units = "SI", limit_inputs = true) {
|
|
183
|
+
const standard = "ISO";
|
|
184
|
+
if (units.toLowerCase() == "ip") {
|
|
185
|
+
({
|
|
186
|
+
tdb,
|
|
187
|
+
tr,
|
|
188
|
+
tmp_running_mean: t_running_mean,
|
|
189
|
+
v,
|
|
190
|
+
} = units_converter_array({
|
|
191
|
+
tdb,
|
|
192
|
+
tr,
|
|
193
|
+
tmp_running_mean: t_running_mean,
|
|
194
|
+
v,
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
const to = t_o_array(tdb, tr, v, standard);
|
|
198
|
+
const ce = v.map((_v, index) => get_ce(_v, to[index]));
|
|
199
|
+
let t_cmf = t_running_mean.map((_t_running_mean) => 0.33 * _t_running_mean + 18.8);
|
|
200
|
+
if (limit_inputs) {
|
|
201
|
+
const trm_valid = valid_range(t_running_mean, [10.0, 33.5]);
|
|
202
|
+
trm_valid.forEach((_trm_valid, index) => {
|
|
203
|
+
if (isNaN(_trm_valid))
|
|
204
|
+
t_cmf[index] = NaN;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
let t_cmf_i_lower = t_cmf.map((_t) => _t - 3.0);
|
|
208
|
+
let t_cmf_ii_lower = t_cmf.map((_t) => _t - 4.0);
|
|
209
|
+
let t_cmf_iii_lower = t_cmf.map((_t) => _t - 5.0);
|
|
210
|
+
let t_cmf_i_upper = t_cmf.map((_t, index) => _t + 2.0 + ce[index]);
|
|
211
|
+
let t_cmf_ii_upper = t_cmf.map((_t, index) => _t + 3.0 + ce[index]);
|
|
212
|
+
let t_cmf_iii_upper = t_cmf.map((_t, index) => _t + 4.0 + ce[index]);
|
|
213
|
+
const acceptability_i = to.map((_to, index) => t_cmf_i_lower[index] <= _to && _to <= t_cmf_i_upper[index]);
|
|
214
|
+
const acceptability_ii = to.map((_to, index) => t_cmf_ii_lower[index] <= _to && _to <= t_cmf_ii_upper[index]);
|
|
215
|
+
const acceptability_iii = to.map((_to, index) => t_cmf_iii_lower[index] <= _to && _to <= t_cmf_iii_upper[index]);
|
|
216
|
+
if (units.toLocaleLowerCase() === "ip") {
|
|
217
|
+
({
|
|
218
|
+
tmp_cmf: t_cmf,
|
|
219
|
+
tmp_cmf_cat_i_up: t_cmf_i_upper,
|
|
220
|
+
tmp_cmf_cat_ii_up: t_cmf_ii_upper,
|
|
221
|
+
tmp_cmf_cat_iii_up: t_cmf_iii_upper,
|
|
222
|
+
} = units_converter_array({
|
|
223
|
+
tmp_cmf: t_cmf,
|
|
224
|
+
tmp_cmf_cat_i_up: t_cmf_i_upper,
|
|
225
|
+
tmp_cmf_cat_ii_up: t_cmf_ii_upper,
|
|
226
|
+
tmp_cmf_cat_iii_up: t_cmf_iii_upper,
|
|
227
|
+
}, "SI"));
|
|
228
|
+
({
|
|
229
|
+
tmp_cmf_cat_i_low: t_cmf_i_lower,
|
|
230
|
+
tmp_cmf_cat_ii_low: t_cmf_ii_lower,
|
|
231
|
+
tmp_cmf_cat_iii_low: t_cmf_iii_lower,
|
|
232
|
+
} = units_converter_array({
|
|
233
|
+
tmp_cmf_cat_i_low: t_cmf_i_lower,
|
|
234
|
+
tmp_cmf_cat_ii_low: t_cmf_ii_lower,
|
|
235
|
+
tmp_cmf_cat_iii_low: t_cmf_iii_lower,
|
|
236
|
+
}, "SI"));
|
|
237
|
+
}
|
|
238
|
+
// NOTE: even all these arrays are the same length and this could be done in one loop
|
|
239
|
+
// doing it in seperate loops means that it is much more cache friendly which makes it faster
|
|
240
|
+
for (let i = 0; i < t_cmf.length; ++i) {
|
|
241
|
+
t_cmf[i] = round(t_cmf[i], 1);
|
|
242
|
+
}
|
|
243
|
+
for (let i = 0; i < t_cmf_i_lower.length; ++i) {
|
|
244
|
+
t_cmf_i_lower[i] = round(t_cmf_i_lower[i], 1);
|
|
245
|
+
}
|
|
246
|
+
for (let i = 0; i < t_cmf_ii_lower.length; ++i) {
|
|
247
|
+
t_cmf_ii_lower[i] = round(t_cmf_ii_lower[i], 1);
|
|
248
|
+
}
|
|
249
|
+
for (let i = 0; i < t_cmf_iii_lower.length; ++i) {
|
|
250
|
+
t_cmf_iii_lower[i] = round(t_cmf_iii_lower[i], 1);
|
|
251
|
+
}
|
|
252
|
+
for (let i = 0; i < t_cmf_i_upper.length; ++i) {
|
|
253
|
+
t_cmf_i_upper[i] = round(t_cmf_i_upper[i], 1);
|
|
254
|
+
}
|
|
255
|
+
for (let i = 0; i < t_cmf_ii_upper.length; ++i) {
|
|
256
|
+
t_cmf_ii_upper[i] = round(t_cmf_ii_upper[i], 1);
|
|
257
|
+
}
|
|
258
|
+
for (let i = 0; i < t_cmf_iii_upper.length; ++i) {
|
|
259
|
+
t_cmf_iii_upper[i] = round(t_cmf_iii_upper[i], 1);
|
|
260
|
+
}
|
|
261
|
+
return {
|
|
262
|
+
tmp_cmf: t_cmf,
|
|
263
|
+
acceptability_cat_i: acceptability_i,
|
|
264
|
+
acceptability_cat_ii: acceptability_ii,
|
|
265
|
+
acceptability_cat_iii: acceptability_iii,
|
|
266
|
+
tmp_cmf_cat_i_up: t_cmf_i_upper,
|
|
267
|
+
tmp_cmf_cat_ii_up: t_cmf_ii_upper,
|
|
268
|
+
tmp_cmf_cat_iii_up: t_cmf_iii_upper,
|
|
269
|
+
tmp_cmf_cat_i_low: t_cmf_i_lower,
|
|
270
|
+
tmp_cmf_cat_ii_low: t_cmf_ii_lower,
|
|
271
|
+
tmp_cmf_cat_iii_low: t_cmf_iii_lower,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
*
|
|
276
|
+
* @param {number} v
|
|
277
|
+
* @param {number} to
|
|
278
|
+
* @returns {number}
|
|
279
|
+
*/
|
|
280
|
+
export function get_ce(v, to) {
|
|
281
|
+
let ce = 0;
|
|
282
|
+
if (v >= 0.6 && to >= 25.0) {
|
|
283
|
+
if (v < 0.9) {
|
|
284
|
+
ce = 1.2;
|
|
285
|
+
}
|
|
286
|
+
else if (v < 1.2) {
|
|
287
|
+
ce = 1.8;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
ce = 2.2;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return ce;
|
|
294
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { pmv } from "./pmv.js";
|
|
2
|
+
import { units_converter, check_standard_compliance, round, } from "../utilities/utilities.js";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* @typedef {Object} AnkleDraftRet
|
|
6
|
+
* @property {number} PPD_ad - redicted Percentage of Dissatisfied occupants with ankle draft, [%]
|
|
7
|
+
* @property {boolean} Acceptability - The ASHRAE 55 2020 standard defines that the value of air speed at the ankle level is acceptable if PPD_ad is lower or equal than 20%
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Calculates the percentage of thermally dissatisfied people with the ankle draft (0.1 m) above floor level {@link #ref_23|[23]}.
|
|
11
|
+
This equation is only applicable for vr < 0.2 m/s (40 fps).
|
|
12
|
+
* @public
|
|
13
|
+
* @memberof models
|
|
14
|
+
* @docname Ankle draft
|
|
15
|
+
*
|
|
16
|
+
* @param {number} tdb - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
17
|
+
*
|
|
18
|
+
Note: The air temperature is the average value over two heights: 0.6 m (24 in.)
|
|
19
|
+
and 1.1 m (43 in.) for seated occupants
|
|
20
|
+
and 1.1 m (43 in.) and 1.7 m (67 in.) for standing occupants.
|
|
21
|
+
|
|
22
|
+
* @param {number} tr - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP'
|
|
23
|
+
* @param {number} vr - relative air speed, default in [m/s] in [fps] if `units` = 'IP'
|
|
24
|
+
|
|
25
|
+
Note: vr is the relative air speed caused by body movement and not the air
|
|
26
|
+
speed measured by the air speed sensor. The relative air speed is the sum of the
|
|
27
|
+
average air speed measured by the sensor plus the activity-generated air speed
|
|
28
|
+
(Vag). Where Vag is the activity-generated air speed caused by motion of
|
|
29
|
+
individual body parts. vr can be calculated using the function v_relative in utilities.js.
|
|
30
|
+
|
|
31
|
+
* @param {number} rh - relative humidity, [%]
|
|
32
|
+
* @param {number} met - metabolic rate, [met]
|
|
33
|
+
* @param {number} clo - clothing insulation, [clo]
|
|
34
|
+
|
|
35
|
+
Note: The activity as well as the air speed modify the insulation characteristics
|
|
36
|
+
of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that
|
|
37
|
+
the clothing insulation shall be corrected {@link #ref_2|[2]}. The ASHRAE 55 Standard corrects
|
|
38
|
+
for the effect of the body movement for met equal or higher than 1.2 met using
|
|
39
|
+
the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo,
|
|
40
|
+
can be calculated using the function clo_dynamic in utilities.js.
|
|
41
|
+
* @param {number} v_ankle - air speed at the 0.1 m (4 in.) above the floor, default in [m/s] in [fps] if
|
|
42
|
+
`units` = 'IP'
|
|
43
|
+
* @param {"IP"|"SI"} [units="SI"] - select the SI (International System of Units) or the IP (Imperial Units) system.
|
|
44
|
+
* @returns {AnkleDraftRet} - Returns {"PPD_ad": ppd_val, "Acceptability": acceptability}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* results = ankle_draft(25, 25, 0.2, 50, 1.2, 0.5, 0.3, "SI")
|
|
48
|
+
* console.log(results) // expected result is {PPD_ad: 18.5, Acceptability: true}
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export function ankle_draft(tdb, tr, vr, rh, met, clo, v_ankle, units = "SI") {
|
|
52
|
+
let kwargs = {};
|
|
53
|
+
let ret = 0;
|
|
54
|
+
if (units.toLowerCase() == "ip") {
|
|
55
|
+
kwargs = {
|
|
56
|
+
tdb: tdb,
|
|
57
|
+
tr: tr,
|
|
58
|
+
v: vr,
|
|
59
|
+
vel: v_ankle,
|
|
60
|
+
};
|
|
61
|
+
ret = units_converter(kwargs);
|
|
62
|
+
tdb = ret["tdb"];
|
|
63
|
+
tr = ret["tr"];
|
|
64
|
+
vr = ret["v"];
|
|
65
|
+
v_ankle = ret["vel"];
|
|
66
|
+
}
|
|
67
|
+
kwargs = { tdb: tdb, tr: tr, v_limited: vr, rh: rh, met: met, clo: clo };
|
|
68
|
+
const warns = check_standard_compliance("ASHRAE", kwargs);
|
|
69
|
+
for (const warn of warns) {
|
|
70
|
+
console.warn("Warning:", warn);
|
|
71
|
+
}
|
|
72
|
+
const tsv = pmv(tdb, tr, vr, rh, met, clo, 0, "ASHRAE");
|
|
73
|
+
const ppd_val = round((Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv) /
|
|
74
|
+
(1 + Math.exp(-2.58 + 3.05 * v_ankle - 1.06 * tsv))) *
|
|
75
|
+
100, 1);
|
|
76
|
+
const acceptability = ppd_val <= 20;
|
|
77
|
+
return { PPD_ad: ppd_val, Acceptability: acceptability };
|
|
78
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { round } from "../utilities/utilities.js";
|
|
2
|
+
import { psy_ta_rh } from "../psychrometrics/psy_ta_rh.js";
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the Apparent Temperature (AT). The AT is defined as the temperature at the reference
|
|
5
|
+
* humidity level producing the same amount of discomfort as that experienced under the current ambient
|
|
6
|
+
* temperature, humidity, and solar radiation {@link #ref_17|[17]}. In other words, the AT is an adjustment to the dry
|
|
7
|
+
* bulb temperature based on the relative humidity value. Absolute humidity with a dew point of 14°C
|
|
8
|
+
* is chosen as a reference.
|
|
9
|
+
*
|
|
10
|
+
* {@link #ref_16|[16]}. It includes the chilling effect of the wind at lower temperatures.
|
|
11
|
+
*
|
|
12
|
+
* Two formulas for AT are in use by the Australian Bureau of Meteorology: one includes solar
|
|
13
|
+
* radiation and the other one does not ({@link http://www.bom.gov.au/info/thermal_stress/}, 29 Sep 2021).
|
|
14
|
+
* Please specify q if you want to estimate AT with solar load.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @memberof models
|
|
18
|
+
* @docname Apparent Temperature (AT)
|
|
19
|
+
*
|
|
20
|
+
* @param {number} tdb - dry bulb air temperature, [°C]
|
|
21
|
+
* @param {number} rh - relative humidity, [%]
|
|
22
|
+
* @param {number} v - wind speed 10m above ground level, [m/s]
|
|
23
|
+
* @param {number | undefined} [q] - Net radiation absorbed per unit area of body surface [W/m2]
|
|
24
|
+
* @param {object} [kwargs] - other parameters
|
|
25
|
+
* @param {boolean} [kwargs.round=true] - if True rounds output value, if False it does not round it
|
|
26
|
+
*
|
|
27
|
+
* @returns {number} apparent temperature, [°C]
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const result = at(25, 30, 0.1);
|
|
31
|
+
* console.log(result); // 24.1
|
|
32
|
+
*/
|
|
33
|
+
export function at(tdb, rh, v, q, kwargs = { round: true }) {
|
|
34
|
+
// dividing it by 100 since the at eq. requires p_vap to be in hPa
|
|
35
|
+
const p_vap = psy_ta_rh(tdb, rh).p_vap / 100;
|
|
36
|
+
let t_at;
|
|
37
|
+
if (q !== undefined) {
|
|
38
|
+
// equation sources {@link #ref_16|[16]} and {@link http://www.bom.gov.au/info/thermal_stress/#apparent}
|
|
39
|
+
t_at = tdb + 0.348 * p_vap - 0.7 * v + (0.7 * q) / (v + 10) - 4.25;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
t_at = tdb + 0.33 * p_vap - 0.7 * v - 4.0;
|
|
43
|
+
}
|
|
44
|
+
if (kwargs.round) {
|
|
45
|
+
t_at = round(t_at, 1);
|
|
46
|
+
}
|
|
47
|
+
return t_at;
|
|
48
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { pmv_calculation } from "./pmv_ppd.js";
|
|
2
|
+
import { round } from "../utilities/utilities.js";
|
|
3
|
+
/**
|
|
4
|
+
* Return the PMV value calculated with the Adaptive Thermal Heat Balance
|
|
5
|
+
* Framework {@link #ref_27|[27]}. The adaptive thermal heat balance (ATHB) framework
|
|
6
|
+
* introduced a method to account for the three adaptive principals, namely
|
|
7
|
+
* physiological, behavioral, and psychological adaptation, individually
|
|
8
|
+
* within existing heat balance models. The objective is a predictive model of
|
|
9
|
+
* thermal sensation applicable during the design stage or in international
|
|
10
|
+
* standards without knowing characteristics of future occupants.
|
|
11
|
+
*
|
|
12
|
+
* This is a version that supports scalar arguments.
|
|
13
|
+
* @see {@link athb_array} for a version that supports arrays.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
* @memberof models
|
|
17
|
+
* @docname Adaptive Thermal Heat Balance (athb)
|
|
18
|
+
*
|
|
19
|
+
* @param { number } tdb - dry bulb air temperature, in [°C]
|
|
20
|
+
* @param { number } tr - mean radiant temperature, in [°C]
|
|
21
|
+
* @param { number } vr - relative air speed, in [m/s]
|
|
22
|
+
*
|
|
23
|
+
* Note: vr is the relative air speed caused by body movement and not the air
|
|
24
|
+
* speed measured by the air speed sensor. The relative air speed is the sum of the
|
|
25
|
+
* average air speed measured by the sensor plus the activity-generated air speed
|
|
26
|
+
* (Vag). Where Vag is the activity-generated air speed caused by motion of
|
|
27
|
+
* individual body parts. vr can be calculated using the function jsthermalcomfort.utilities.v_relative.
|
|
28
|
+
*
|
|
29
|
+
* @param { number } rh - relative humidity, [%]
|
|
30
|
+
* @param { number } met - metabolic rate, [met]
|
|
31
|
+
* @param { number } t_running_mean - running mean temperature, in [°C]
|
|
32
|
+
*
|
|
33
|
+
* The running mean temperature can be calculated using the function
|
|
34
|
+
* jsthermalcomfort.utilities.running_mean_outdoor_temperature.
|
|
35
|
+
*
|
|
36
|
+
* @returns { number } athb_pmv - Predicted Mean Vote calculated with the Adaptive Thermal Heat Balance framework
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const tdb = 25;
|
|
40
|
+
* const tr = 25;
|
|
41
|
+
* const vr = 0.1;
|
|
42
|
+
* const rh = 50;
|
|
43
|
+
* const met = 1.1;
|
|
44
|
+
* const t_running_mean = 20;
|
|
45
|
+
*
|
|
46
|
+
* const athb_result = athb(tdb, tr, vr, rh, met, t_running_mean);
|
|
47
|
+
* console.log(athb_result); // Output: 0.2
|
|
48
|
+
*/
|
|
49
|
+
export function athb(tdb, tr, vr, rh, met, t_running_mean) {
|
|
50
|
+
const met_adapted = met - (0.234 * t_running_mean) / 58.2;
|
|
51
|
+
const clo_adapted = Math.pow(10, -0.17168 -
|
|
52
|
+
0.000485 * t_running_mean +
|
|
53
|
+
0.08176 * met_adapted -
|
|
54
|
+
0.00527 * t_running_mean * met_adapted);
|
|
55
|
+
const pmv_res = pmv_calculation(tdb, tr, vr, rh, met_adapted, clo_adapted, 0);
|
|
56
|
+
const ts = 0.303 * Math.exp(-0.036 * met_adapted * 58.15) + 0.028;
|
|
57
|
+
const l_adapted = pmv_res / ts;
|
|
58
|
+
return round(1.484 +
|
|
59
|
+
0.0276 * l_adapted -
|
|
60
|
+
0.9602 * met_adapted -
|
|
61
|
+
0.0342 * t_running_mean +
|
|
62
|
+
0.0002264 * l_adapted * t_running_mean +
|
|
63
|
+
0.018696 * met_adapted * t_running_mean -
|
|
64
|
+
0.0002909 * l_adapted * met_adapted * t_running_mean, 3);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Return the PMV value calculated with the Adaptive Thermal Heat Balance
|
|
68
|
+
* Framework {@link #ref_27|[27]}. The adaptive thermal heat balance (ATHB) framework
|
|
69
|
+
* introduced a method to account for the three adaptive principals, namely
|
|
70
|
+
* physiological, behavioral, and psychological adaptation, individually
|
|
71
|
+
* within existing heat balance models. The objective is a predictive model of
|
|
72
|
+
* thermal sensation applicable during the design stage or in international
|
|
73
|
+
* standards without knowing characteristics of future occupants.
|
|
74
|
+
*
|
|
75
|
+
* This is a version that supports arrays.
|
|
76
|
+
* @see {@link athb} for a version that supports scalar arguments.
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
* @memberof models
|
|
80
|
+
* @docname Adaptive Thermal Heat Balance (athb) (array version)
|
|
81
|
+
*
|
|
82
|
+
* @param { number[] } tdb - dry bulb air temperature, in [°C]
|
|
83
|
+
* @param { number[] } tr - mean radiant temperature, in [°C]
|
|
84
|
+
* @param { number[] } vr - relative air speed, in [m/s]
|
|
85
|
+
*
|
|
86
|
+
* Note: vr is the relative air speed caused by body movement and not the air
|
|
87
|
+
* speed measured by the air speed sensor. The relative air speed is the sum of the
|
|
88
|
+
* average air speed measured by the sensor plus the activity-generated air speed
|
|
89
|
+
* (Vag). Where Vag is the activity-generated air speed caused by motion of
|
|
90
|
+
* individual body parts. vr can be calculated using the function
|
|
91
|
+
* jsthermalcomfort.utilities.v_relative.
|
|
92
|
+
*
|
|
93
|
+
* @param { number[] } rh - relative humidity, [%]
|
|
94
|
+
* @param { number[] } met - metabolic rate, [met]
|
|
95
|
+
* @param { number[] } t_running_mean - running mean temperature, in [°C]
|
|
96
|
+
*
|
|
97
|
+
* The running mean temperature can be calculated using the function
|
|
98
|
+
* jsthermalcomfort.utilities.running_mean_outdoor_temperature.
|
|
99
|
+
*
|
|
100
|
+
* @returns { number[] } athb_pmv - Predicted Mean Vote calculated with the Adaptive Thermal Heat Balance framework
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* const tdb = [25, 27];
|
|
104
|
+
* const tr = [25, 25];
|
|
105
|
+
* const vr = [0.1, 0.1];
|
|
106
|
+
* const rh = [50, 50];
|
|
107
|
+
* const met = [1.1, 1.1];
|
|
108
|
+
* const t_running_mean = [20, 20];
|
|
109
|
+
*
|
|
110
|
+
* const athb_array_result = athb_array(tdb, tr, vr, rh, met, t_running_mean);
|
|
111
|
+
* console.log(athb_array_result); // Output: [0.2, 0.209]
|
|
112
|
+
*/
|
|
113
|
+
export function athb_array(tdb, tr, vr, rh, met, t_running_mean) {
|
|
114
|
+
//assume all parameters have same length, and it should have same length when use this API
|
|
115
|
+
const met_adapted = met.map((metValue, index) => metValue - (0.234 * t_running_mean[index]) / 58.2);
|
|
116
|
+
const clo_adapted = met_adapted.map((metValue, index) => Math.pow(10, -0.17168 -
|
|
117
|
+
0.000485 * t_running_mean[index] +
|
|
118
|
+
0.08176 * metValue -
|
|
119
|
+
0.00527 * t_running_mean[index] * metValue));
|
|
120
|
+
const pmv_res = tdb.map((tdbValue, i) => pmv_calculation(tdbValue, tr[i], vr[i], rh[i], met_adapted[i], clo_adapted[i], 0));
|
|
121
|
+
const ts = met_adapted.map((metValue) => 0.303 * Math.exp(-0.036 * metValue * 58.15) + 0.028);
|
|
122
|
+
const l_adapted = pmv_res.map((pmv_res_Value, i) => pmv_res_Value / ts[i]);
|
|
123
|
+
return l_adapted.map((lValue, i) => round(1.484 +
|
|
124
|
+
0.0276 * lValue -
|
|
125
|
+
0.9602 * met_adapted[i] -
|
|
126
|
+
0.0342 * t_running_mean[i] +
|
|
127
|
+
0.0002264 * lValue * t_running_mean[i] +
|
|
128
|
+
0.018696 * met_adapted[i] * t_running_mean[i] -
|
|
129
|
+
0.0002909 * lValue * met_adapted[i] * t_running_mean[i], 3));
|
|
130
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { units_converter, round } from "../utilities/utilities";
|
|
2
|
+
/**
|
|
3
|
+
* Representative clothing insulation Icl as a function of outdoor air
|
|
4
|
+
* temperature at 06:00 a.m {@link #ref_4|[4]}.
|
|
5
|
+
*
|
|
6
|
+
* Note: The ASHRAE 55 2020 states that it is acceptable to determine the
|
|
7
|
+
* clothing insulation Icl using this equation in mechanically conditioned
|
|
8
|
+
* buildings {@link #ref_1|[1]}.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @memberof models
|
|
12
|
+
* @docname Clothing prediction
|
|
13
|
+
*
|
|
14
|
+
* @see {@link clo_tout_array} for a version that supports arrays
|
|
15
|
+
*
|
|
16
|
+
* @param {number} tout - outdoor air temperature at 06:00 a.m., default in
|
|
17
|
+
* [°C] in [°F] if `units` = 'IP'
|
|
18
|
+
* @param {("IP" | "SI")} units - select the SI (International System of Units)
|
|
19
|
+
* or the IP (Imperial Units) system.
|
|
20
|
+
*
|
|
21
|
+
* @returns {number} Representative clothing insulation Icl, [clo]
|
|
22
|
+
*/
|
|
23
|
+
export function clo_tout(tout, units = "SI") {
|
|
24
|
+
const t = units === "IP" ? units_converter({ tmp: tout }).tmp : tout;
|
|
25
|
+
let clo = t < 26 ? 10 ** (-0.1635 - 0.0066 * t) : 0.46;
|
|
26
|
+
clo = t < 5 ? 0.818 - 0.0364 * t : clo;
|
|
27
|
+
clo = t < -5 ? 1 : clo;
|
|
28
|
+
return round(clo, 2);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Representative clothing insulation Icl as a function of outdoor air
|
|
32
|
+
* temperature at 06:00 a.m {@link #ref_4|[4]}.
|
|
33
|
+
*
|
|
34
|
+
* Note: The ASHRAE 55 2020 states that it is acceptable to determine the
|
|
35
|
+
* clothing insulation Icl using this equation in mechanically conditioned
|
|
36
|
+
* buildings {@link #ref_1|[1]}.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
* @memberof models
|
|
40
|
+
* @docname Clothing prediction (array version)
|
|
41
|
+
*
|
|
42
|
+
* @see {@link clo_tout} for a version that supports scalar arguments
|
|
43
|
+
*
|
|
44
|
+
* @param {number[]} tout - outdoor air temperatures at 06:00 a.m., default in
|
|
45
|
+
* [°C] in [°F] if `units` = 'IP'
|
|
46
|
+
* @param {("IP" | "SI")} units - select the SI (International System of Units)
|
|
47
|
+
* or the IP (Imperial Units) system.
|
|
48
|
+
*
|
|
49
|
+
* @returns {number[]} Representative clothing insulation Icl, [clo]
|
|
50
|
+
*/
|
|
51
|
+
export function clo_tout_array(tout, units = "SI") {
|
|
52
|
+
return tout.map((t) => clo_tout(t, units));
|
|
53
|
+
}
|