-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilisationfactor.js
More file actions
65 lines (50 loc) · 1.77 KB
/
utilisationfactor.js
File metadata and controls
65 lines (50 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Calculation of mean internal temperature for heating
// Calculation of mean internal temperature is based on the heating patterns defined in Table 9.
function calc_utilisation_factor(TMP,HLP,H,Ti,Te,G)
{
/*
Symbols and units
H = heat transfer coefficient, (39)m (W/K)
G = total gains, (84)m (W)
Ti = internal temperature (°C)
Te = external temperature, (96)m (°C)
TMP = Thermal Mass Parameter, (35), (kJ/m2K) (= Cm for building / total floor area)
HLP = Heat Loss Parameter, (40)m (W/m2K)
τ = time constant (h)
η = utilisation factor
L = heat loss rate (W)
*/
// Calculation of utilisation factor
var tau = TMP / (3.6 * HLP);
var a = 1.0 + tau / 15.0;
var L = H * (Ti - Te);
var y = G / L;
// Note: to avoid instability when γ is close to 1 round γ to 8 decimal places
// y = y.toFixed(8);
y = Math.round(y*100000000.0) / 100000000.0;
var n = 0.0;
if (y>0.0 && y!=1.0) n = (1.0 - Math.pow(y,a)) / (1.0 - Math.pow(y,a+1.0));
if (y == 1.0) n = a / (a + 1.0);
return n;
}
function calc_temperature_reduction(TMP,HLP,H,Ti,Te,G, R,Th,toff)
{
// Calculation of utilisation factor
var tau = TMP / (3.6 * HLP);
var a = 1.0 + tau / 15.0;
var L = H * (Ti - Te);
var y = G / L;
// Note: to avoid instability when γ is close to 1 round γ to 8 decimal places
// y = y.toFixed(8);
y = Math.round(y*100000000.0) / 100000000.0;
var n = 0.0;
if (y>0.0 && y!=1.0) n = (1.0 - Math.pow(y,a)) / (1.0 - Math.pow(y,a+1.0));
if (y == 1.0) n = a / (a + 1.0);
var tc = 4.0 + 0.25 * tau;
var Tsc = (1.0 - R) * (Th - 2.0) + R * (Te + n * G / H);
var u;
if (toff <= tc) u = 0.5 * toff * toff * (Th - Tsc) / (24 * tc);
if (toff > tc) u = (Th - Tsc) * (toff - 0.5 * tc) / 24;
//console.log(Tsc);
return u;
}