@open3cl/engine 1.0.0
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/10_besoin_fr.js +76 -0
- package/10_clim.js +45 -0
- package/11_besoin_ecs.js +25 -0
- package/11_ecs.js +95 -0
- package/11_nadeq.js +87 -0
- package/11_nadeq.spec.js +55 -0
- package/12.4_pac.js +54 -0
- package/13.2_generateur_combustion.js +295 -0
- package/13.2_generateur_combustion_bouilleur.js +173 -0
- package/13.2_generateur_combustion_ch.js +195 -0
- package/13.2_generateur_combustion_chaudiere.js +151 -0
- package/13.2_generateur_pac.js +36 -0
- package/13_rendement_distribution_ecs.js +12 -0
- package/14_generateur_ecs.js +388 -0
- package/15_conso_aux.js +257 -0
- package/16.2_production_enr.js +328 -0
- package/16.2_production_enr.spec.js +251 -0
- package/16_conso_eclairage.js +37 -0
- package/2021_04_13_confort_ete.js +61 -0
- package/2021_04_13_qualite_isolation.js +174 -0
- package/3.1_b.js +141 -0
- package/3.2.1_mur.js +331 -0
- package/3.2.1_mur.spec.js +46 -0
- package/3.2.2_plancher_bas.js +259 -0
- package/3.2.2_plancher_bas.spec.js +88 -0
- package/3.2.3_plancher_haut.js +158 -0
- package/3.3.1.4_porte.js +32 -0
- package/3.3_baie_vitree.js +308 -0
- package/3.3_baie_vitree.spec.js +333 -0
- package/3.4_pont_thermique.js +463 -0
- package/3_deperdition.js +258 -0
- package/4_ventilation.js +197 -0
- package/5_conso_ventilation.js +127 -0
- package/6.1_apport_gratuit.js +61 -0
- package/6.1_apport_gratuit.spec.js +181 -0
- package/6.2_surface_sud_equivalente.js +109 -0
- package/7_inertie.js +178 -0
- package/7_inertie.spec.js +263 -0
- package/8_intermittence.js +5 -0
- package/9_besoin_ch.js +198 -0
- package/9_chauffage.js +291 -0
- package/9_chauffage.spec.js +101 -0
- package/9_conso_ch.js +95 -0
- package/9_conso_ch.spec.js +255 -0
- package/9_emetteur_ch.js +122 -0
- package/9_generateur_ch.js +230 -0
- package/9_generateur_ch.spec.js +87 -0
- package/README.md +43 -0
- package/apport_et_besoin.js +55 -0
- package/conso.js +529 -0
- package/conso.spec.js +90 -0
- package/core/assets/domain/add-additionnal-ue-values-tables.js +57 -0
- package/core/assets/domain/synchronize-assets.js +29 -0
- package/core/assets/domain/synchronize-assets.spec.js +37 -0
- package/core/assets/domain/synchronize-c1-tables.js +61 -0
- package/core/assets/domain/synchronize-c1-tables.spec.js +35 -0
- package/core/assets/domain/synchronize-dpe-ges-limit-values-tables.js +73 -0
- package/core/assets/domain/synchronize-dpe-ges-limit-values-tables.spec.js +72 -0
- package/core/assets/domain/synchronize-enum-tables.js +77 -0
- package/core/assets/domain/synchronize-enum-tables.spec.js +31 -0
- package/core/assets/domain/synchronize-solicitations-tables.js +72 -0
- package/core/assets/domain/synchronize-solicitations-tables.spec.js +47 -0
- package/core/assets/domain/synchronize-valeur-tables.js +146 -0
- package/core/assets/domain/synchronize-valeur-tables.spec.js +54 -0
- package/core/conf/infrastructure/application.config.js +33 -0
- package/core/file/infrastructure/adapter/file.store.js +75 -0
- package/core/file/infrastructure/adapter/file.store.spec.js +30 -0
- package/core/tv/infrastructure/assets/additional-ue-values.js +69 -0
- package/core/tv/infrastructure/tvs.store.js +40 -0
- package/core/tv/infrastructure/tvs.store.spec.js +34 -0
- package/core/util/infrastructure/object-util.js +23 -0
- package/core/util/infrastructure/object-util.spec.js +25 -0
- package/engine.js +503 -0
- package/enums.js +1155 -0
- package/ficheTechnique.js +86 -0
- package/ficheTechnique.spec.js +181 -0
- package/index.js +4 -0
- package/package.json +87 -0
- package/tv/18.2_sollicitations_ext.ods +0 -0
- package/tv/18.5_c1.ods +0 -0
- package/tv/dpe_ges_limit_values.ods +0 -0
- package/tv.js +80811 -0
- package/tvs.d.ts +7 -0
- package/utils.js +500 -0
- package/utils.spec.js +36 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { calc_ai, calc_as } from './6.1_apport_gratuit.js';
|
|
2
|
+
|
|
3
|
+
describe("Recherche de bugs dans le calcul de l'apport gratuit", () => {
|
|
4
|
+
/**
|
|
5
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf Page 43
|
|
6
|
+
*/
|
|
7
|
+
test('calcul de f apport solaire', () => {
|
|
8
|
+
const ilpa = '0';
|
|
9
|
+
const ca = '400-800m';
|
|
10
|
+
const zc = 'h1c';
|
|
11
|
+
const bv = [
|
|
12
|
+
{
|
|
13
|
+
donnee_entree: {
|
|
14
|
+
description: 'Fenêtre 1 Nord - Fenêtres battantes bois, orientées Nord, simple vitrage',
|
|
15
|
+
enum_type_adjacence_id: '1',
|
|
16
|
+
surface_totale_baie: 1.76,
|
|
17
|
+
nb_baie: 2,
|
|
18
|
+
tv_ug_id: 1,
|
|
19
|
+
enum_type_vitrage_id: '1',
|
|
20
|
+
enum_inclinaison_vitrage_id: '3',
|
|
21
|
+
enum_methode_saisie_perf_vitrage_id: '1',
|
|
22
|
+
tv_uw_id: 561,
|
|
23
|
+
enum_type_materiaux_menuiserie_id: '3',
|
|
24
|
+
enum_type_baie_id: '4',
|
|
25
|
+
double_fenetre: 0,
|
|
26
|
+
uw_1: 5.4,
|
|
27
|
+
sw_1: 0.52,
|
|
28
|
+
enum_type_fermeture_id: '1',
|
|
29
|
+
presence_retour_isolation: 0,
|
|
30
|
+
largeur_dormant: 5,
|
|
31
|
+
tv_sw_id: 89,
|
|
32
|
+
enum_type_pose_id: '3',
|
|
33
|
+
enum_orientation_id: '2',
|
|
34
|
+
tv_coef_masque_proche_id: 19,
|
|
35
|
+
masque_lointain_non_homogene_collection: '',
|
|
36
|
+
reference: 'baie_vitree_0',
|
|
37
|
+
tv_coef_reduction_deperdition_id: 1
|
|
38
|
+
},
|
|
39
|
+
donnee_intermediaire: {
|
|
40
|
+
b: 1,
|
|
41
|
+
sw: 0.52,
|
|
42
|
+
ug: 5.8,
|
|
43
|
+
uw: 5.4,
|
|
44
|
+
u_menuiserie: 5.4,
|
|
45
|
+
fe2: 1,
|
|
46
|
+
fe1: 1
|
|
47
|
+
},
|
|
48
|
+
donnee_utilisateur: {
|
|
49
|
+
enum_type_adjacence_id: [
|
|
50
|
+
'1',
|
|
51
|
+
'2',
|
|
52
|
+
'3',
|
|
53
|
+
'4',
|
|
54
|
+
'5',
|
|
55
|
+
'6',
|
|
56
|
+
'7',
|
|
57
|
+
'8',
|
|
58
|
+
'9',
|
|
59
|
+
'10',
|
|
60
|
+
'11',
|
|
61
|
+
'12',
|
|
62
|
+
'13',
|
|
63
|
+
'14',
|
|
64
|
+
'15',
|
|
65
|
+
'16',
|
|
66
|
+
'17',
|
|
67
|
+
'18',
|
|
68
|
+
'19',
|
|
69
|
+
'20',
|
|
70
|
+
'21',
|
|
71
|
+
'22'
|
|
72
|
+
],
|
|
73
|
+
enum_type_vitrage_id: ['1', '2', '3', '4', '5', '6'],
|
|
74
|
+
enum_type_baie_id: ['1', '2', '3', '4', '5', '6', '7', '8'],
|
|
75
|
+
enum_type_materiaux_menuiserie_id: ['1', '2', '3', '4', '5', '6', '7'],
|
|
76
|
+
vitrage_vir: 'bool',
|
|
77
|
+
enum_type_pose_id: ['1', '2', '3', '4'],
|
|
78
|
+
enum_type_fermeture_id: ['1', '2', '3', '4', '5', '6', '7', '8'],
|
|
79
|
+
presence_retour_isolation: 'bool',
|
|
80
|
+
largeur_dormant: 'float'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
donnee_entree: {
|
|
85
|
+
description:
|
|
86
|
+
'Fenêtre 2 Sud - Fenêtres battantes bois, orientées Sud, simple vitrage avec volets battants bois',
|
|
87
|
+
enum_type_adjacence_id: '1',
|
|
88
|
+
surface_totale_baie: 4,
|
|
89
|
+
nb_baie: 2,
|
|
90
|
+
tv_ug_id: 1,
|
|
91
|
+
enum_type_vitrage_id: '1',
|
|
92
|
+
enum_inclinaison_vitrage_id: '3',
|
|
93
|
+
enum_methode_saisie_perf_vitrage_id: '1',
|
|
94
|
+
tv_uw_id: 561,
|
|
95
|
+
enum_type_materiaux_menuiserie_id: '3',
|
|
96
|
+
enum_type_baie_id: '4',
|
|
97
|
+
double_fenetre: 0,
|
|
98
|
+
uw_1: 5.4,
|
|
99
|
+
sw_1: 0.52,
|
|
100
|
+
tv_deltar_id: 6,
|
|
101
|
+
tv_ujn_id: 224,
|
|
102
|
+
enum_type_fermeture_id: '7',
|
|
103
|
+
presence_retour_isolation: 0,
|
|
104
|
+
largeur_dormant: 5,
|
|
105
|
+
tv_sw_id: 89,
|
|
106
|
+
enum_type_pose_id: '2',
|
|
107
|
+
enum_orientation_id: '1',
|
|
108
|
+
tv_coef_masque_proche_id: 19,
|
|
109
|
+
masque_lointain_non_homogene_collection: '',
|
|
110
|
+
reference: 'baie_vitree_1',
|
|
111
|
+
tv_coef_reduction_deperdition_id: 1
|
|
112
|
+
},
|
|
113
|
+
donnee_intermediaire: {
|
|
114
|
+
b: 1,
|
|
115
|
+
sw: 0.52,
|
|
116
|
+
ug: 5.8,
|
|
117
|
+
uw: 5.4,
|
|
118
|
+
ujn: 3.8,
|
|
119
|
+
u_menuiserie: 3.8,
|
|
120
|
+
fe2: 1,
|
|
121
|
+
fe1: 1
|
|
122
|
+
},
|
|
123
|
+
donnee_utilisateur: {
|
|
124
|
+
enum_type_adjacence_id: [
|
|
125
|
+
'1',
|
|
126
|
+
'2',
|
|
127
|
+
'3',
|
|
128
|
+
'4',
|
|
129
|
+
'5',
|
|
130
|
+
'6',
|
|
131
|
+
'7',
|
|
132
|
+
'8',
|
|
133
|
+
'9',
|
|
134
|
+
'10',
|
|
135
|
+
'11',
|
|
136
|
+
'12',
|
|
137
|
+
'13',
|
|
138
|
+
'14',
|
|
139
|
+
'15',
|
|
140
|
+
'16',
|
|
141
|
+
'17',
|
|
142
|
+
'18',
|
|
143
|
+
'19',
|
|
144
|
+
'20',
|
|
145
|
+
'21',
|
|
146
|
+
'22'
|
|
147
|
+
],
|
|
148
|
+
enum_type_vitrage_id: ['1', '2', '3', '4', '5', '6'],
|
|
149
|
+
enum_type_baie_id: ['1', '2', '3', '4', '5', '6', '7', '8'],
|
|
150
|
+
enum_type_materiaux_menuiserie_id: ['1', '2', '3', '4', '5', '6', '7'],
|
|
151
|
+
vitrage_vir: 'bool',
|
|
152
|
+
enum_type_pose_id: ['1', '2', '3', '4'],
|
|
153
|
+
enum_type_fermeture_id: ['1', '2', '3', '4', '5', '6', '7', '8'],
|
|
154
|
+
presence_retour_isolation: 'bool',
|
|
155
|
+
largeur_dormant: 'float'
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
expect(calc_as(ilpa, ca, zc, bv)).toStrictEqual({
|
|
161
|
+
apport_solaire_ch: 1551436.4819200002,
|
|
162
|
+
apport_solaire_fr: 97009.81888
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf Page 43
|
|
168
|
+
*/
|
|
169
|
+
test('calcul de f apport interne', () => {
|
|
170
|
+
const ilpa = '0';
|
|
171
|
+
const ca = '400-800m';
|
|
172
|
+
const zc = 'h1c';
|
|
173
|
+
const Sh = '42.5';
|
|
174
|
+
const nadeq = '1.234375';
|
|
175
|
+
|
|
176
|
+
expect(calc_ai(ilpa, ca, zc, Sh, nadeq)).toStrictEqual({
|
|
177
|
+
apport_interne_ch: 1459229.75,
|
|
178
|
+
apport_interne_fr: 8589.5569375
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import enums from './enums.js';
|
|
2
|
+
import tvs from './tv.js';
|
|
3
|
+
import { mois_liste } from './utils.js';
|
|
4
|
+
|
|
5
|
+
export function calc_sse_j(bv_list, ets, ca, zc, mois) {
|
|
6
|
+
const ssej = bv_list.reduce((acc, bv) => {
|
|
7
|
+
const typeAdjacence = parseInt(bv.donnee_entree.enum_type_adjacence_id);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 6.3 Traitement des espaces tampons solarisés
|
|
11
|
+
* 10 - 'espace tampon solarisé (véranda,loggia fermée)'
|
|
12
|
+
*/
|
|
13
|
+
if (typeAdjacence === 10 && ets) {
|
|
14
|
+
// Certaines vérandas sont dupliqués dans les DPE.
|
|
15
|
+
if (Array.isArray(ets)) {
|
|
16
|
+
ets = ets[0];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const bver = ets.donnee_intermediaire.bver;
|
|
20
|
+
const T = ets.donnee_intermediaire.coef_transparence_ets;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Surface sud équivalente représentant l’impact des apports solaires associés au rayonnement solaire
|
|
24
|
+
* traversant directement l’espace tampon pour arriver dans la partie habitable du logement
|
|
25
|
+
* Calculés pour les baies vitrées qui séparent le logement de l'espace tampon
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
const Ssdj = getBaiesSurEspaceTampon(bv_list).reduce((acc, bv) => {
|
|
29
|
+
return acc + T * getSsd(bv, zc, mois, bv.donnee_intermediaire.sw);
|
|
30
|
+
}, 0);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Surface sud équivalente représentant les apports solaires indirects dans le logement
|
|
34
|
+
*/
|
|
35
|
+
let baies = ets.baie_ets_collection.baie_ets;
|
|
36
|
+
|
|
37
|
+
if (!Array.isArray(baies)) {
|
|
38
|
+
baies = [baies];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const Sstj = baies.reduce((acc, bv) => {
|
|
42
|
+
return acc + getSsd(bv, zc, mois, 0.8 * T + 0.024);
|
|
43
|
+
}, 0);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Surface sud équivalente représentant l’impact des apports solaires associés au rayonnement
|
|
47
|
+
* solaire entrant dans la partie habitable du logement après de multiples réflexions dans l’espace tampon solarisé
|
|
48
|
+
* @type {number}
|
|
49
|
+
*/
|
|
50
|
+
const Ssindj = Sstj - Ssdj;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Impact de l’espace tampon solarisé sur les apports solaires à travers les baies vitrées qui séparent le logement
|
|
54
|
+
* de l'espace tampon
|
|
55
|
+
* @type {number}
|
|
56
|
+
*/
|
|
57
|
+
const SseVerandaj = Ssdj + Ssindj * bver;
|
|
58
|
+
|
|
59
|
+
return acc + SseVerandaj;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Pour les fenêtres qui ne donnent pas sur l'extérieur, pas de surface sud équivalente
|
|
63
|
+
if (typeAdjacence !== 1) {
|
|
64
|
+
return acc;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return acc + getSsd(bv, zc, mois, bv.donnee_intermediaire.sw);
|
|
68
|
+
}, 0);
|
|
69
|
+
return ssej;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Retourne la liste des baies vitrées qui donnent sur l'espace tampon solarisé
|
|
74
|
+
* @param baiesVitrees {BaieVitreeItem[]}
|
|
75
|
+
*/
|
|
76
|
+
function getBaiesSurEspaceTampon(baiesVitrees) {
|
|
77
|
+
return baiesVitrees.filter((bv) => bv.donnee_entree.enum_type_adjacence_id === '10');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Calcul de la surface sur équivalente pour la baie vitrée bv pendant le mois $mois
|
|
82
|
+
*
|
|
83
|
+
* @param bv {BaieVitreeItem}
|
|
84
|
+
* @param zc {string} zone climatique du logement
|
|
85
|
+
* @param mois {string} mois au cours duquel calculer la surface sur équivalente de la baie vitrée
|
|
86
|
+
* @param coeff {number} coefficient à appliquer à cette surface sud
|
|
87
|
+
* @returns {number}
|
|
88
|
+
*/
|
|
89
|
+
function getSsd(bv, zc, mois, coeff) {
|
|
90
|
+
const c1 = tvs.c1;
|
|
91
|
+
|
|
92
|
+
const de = bv.donnee_entree;
|
|
93
|
+
const di = bv.donnee_intermediaire || {};
|
|
94
|
+
|
|
95
|
+
const orientation = enums.orientation[de.enum_orientation_id];
|
|
96
|
+
const inclinaison = enums.inclinaison_vitrage[de.enum_inclinaison_vitrage_id ?? 3];
|
|
97
|
+
let oi = `${orientation} ${inclinaison}`;
|
|
98
|
+
if (inclinaison === 'horizontal') oi = 'horizontal';
|
|
99
|
+
const c1j = c1[zc][mois][oi];
|
|
100
|
+
|
|
101
|
+
const fe1 = di.fe1 ?? 1;
|
|
102
|
+
const fe2 = di.fe2 ?? 1;
|
|
103
|
+
|
|
104
|
+
return de.surface_totale_baie * c1j * coeff * fe1 * fe2;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function calc_sse(ca, zc, bv_list, ets) {
|
|
108
|
+
return mois_liste.reduce((acc, mois) => acc + calc_sse_j(bv_list, ets, ca, zc, mois), 0);
|
|
109
|
+
}
|
package/7_inertie.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import enums from './enums.js';
|
|
2
|
+
import { getThicknessFromDescription, getKeyByValue } from './utils.js';
|
|
3
|
+
|
|
4
|
+
export class Inertie {
|
|
5
|
+
#classeInertieMapping = {
|
|
6
|
+
0: 'légère',
|
|
7
|
+
1: 'moyenne',
|
|
8
|
+
2: 'lourde',
|
|
9
|
+
3: 'très lourde'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Return 1 if the plancher_haut has high inertia, 0 otherwise
|
|
14
|
+
* @param de {Donnee_entree}
|
|
15
|
+
* @returns {number}
|
|
16
|
+
*/
|
|
17
|
+
calculateInertiePhLourd(de) {
|
|
18
|
+
const type_isolation = Number.parseInt(de.enum_type_isolation_id);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Type isolation
|
|
22
|
+
* 2 - Non isolé
|
|
23
|
+
* 4 - ITE
|
|
24
|
+
* 9 - isolé mais type d'isolation inconnu
|
|
25
|
+
*/
|
|
26
|
+
if ([2, 4, 9].includes(type_isolation)) {
|
|
27
|
+
/**
|
|
28
|
+
* Type Plancher Haut
|
|
29
|
+
* 8 - Dalle béton
|
|
30
|
+
* 11 - Plafond lourd type entrevous terre-cuite, poutrelles béton
|
|
31
|
+
*/
|
|
32
|
+
const type_plancher_haut = Number.parseInt(de.enum_type_plancher_haut_id);
|
|
33
|
+
if (!type_plancher_haut || [8, 11].includes(type_plancher_haut)) return 1;
|
|
34
|
+
}
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return 1 if the plancher_bas has high inertia, 0 otherwise
|
|
40
|
+
* @param de {Donnee_entree}
|
|
41
|
+
* @returns {number}
|
|
42
|
+
*/
|
|
43
|
+
calculateInertiePbLourd(de) {
|
|
44
|
+
const methode_saisie_u = Number.parseInt(de.enum_methode_saisie_u_id);
|
|
45
|
+
const type_isolation = Number.parseInt(de.enum_type_isolation_id);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Type isolation
|
|
49
|
+
* 2 - Non isolé
|
|
50
|
+
* 4 - ITE
|
|
51
|
+
* 9 - isolé mais type d'isolation inconnu
|
|
52
|
+
*
|
|
53
|
+
* Méthode Saisie
|
|
54
|
+
* 1 - non isolé
|
|
55
|
+
*/
|
|
56
|
+
if (methode_saisie_u === 1 || [2, 4, 9].includes(type_isolation)) {
|
|
57
|
+
/**
|
|
58
|
+
* Type Plancher Bas
|
|
59
|
+
* 9 - Dalle béton
|
|
60
|
+
* 11 - Plancher lourd type entrevous terre-cuite, poutrelles béton
|
|
61
|
+
* 12 - Plancher à entrevous isolant
|
|
62
|
+
*/
|
|
63
|
+
const type_plancher_bas = Number.parseInt(de.enum_type_plancher_bas_id);
|
|
64
|
+
if (!type_plancher_bas || [9, 11, 12].includes(type_plancher_bas)) return 1;
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Return 1 if the mur has high inertia, 0 otherwise
|
|
71
|
+
* @param de {Donnee_entree}
|
|
72
|
+
* @returns {number}
|
|
73
|
+
*/
|
|
74
|
+
calculateInertieMurLourd(de) {
|
|
75
|
+
const methode_saisie_u = Number.parseInt(de.enum_methode_saisie_u_id);
|
|
76
|
+
const type_isolation = Number.parseInt(de.enum_type_isolation_id);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Type isolation
|
|
80
|
+
* 2 - Non isolé
|
|
81
|
+
* 4 - ITE
|
|
82
|
+
* 9 - isolé mais type d'isolation inconnu
|
|
83
|
+
*
|
|
84
|
+
* Méthode Saisie
|
|
85
|
+
* 1 - non isolé
|
|
86
|
+
*/
|
|
87
|
+
if (methode_saisie_u === 1 || [2, 4, 9].includes(type_isolation)) {
|
|
88
|
+
const materiaux_structure_mur = Number.parseInt(de.enum_materiaux_structure_mur_id);
|
|
89
|
+
let epaisseur_structure = Number.parseFloat(de.epaisseur_structure);
|
|
90
|
+
|
|
91
|
+
if (!epaisseur_structure) {
|
|
92
|
+
epaisseur_structure = getThicknessFromDescription(de.description);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Matériaux Structure mur
|
|
97
|
+
* 2 - Murs en pierre de taille et moellons constitué d'un seul matériaux
|
|
98
|
+
* 3 - Murs en pierre de taille et moellons avec remplissage tout venant
|
|
99
|
+
* 4 - Murs en pisé ou béton de terre stabilisé (à partir d'argile crue)
|
|
100
|
+
* 19 - Murs sandwich béton/isolant/béton (sans isolation rapportée)
|
|
101
|
+
* 21 - Autre matériau traditionel ancien
|
|
102
|
+
*/
|
|
103
|
+
if ([2, 3, 4, 19].includes(materiaux_structure_mur)) return 1;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Matériaux Structure mur
|
|
107
|
+
* 11 - Murs en blocs de béton pleins
|
|
108
|
+
* 13 - Murs en béton banché
|
|
109
|
+
*/
|
|
110
|
+
if ([11, 13].includes(materiaux_structure_mur) && epaisseur_structure > 7) return 1;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Matériaux Structure mur
|
|
114
|
+
* 12 - Murs en blocs de béton creux
|
|
115
|
+
*/
|
|
116
|
+
if ([12].includes(materiaux_structure_mur) && epaisseur_structure > 11) return 1;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Matériaux Structure mur
|
|
120
|
+
* 8 - Murs en briques pleines simples
|
|
121
|
+
* 9 - Murs en briques pleines doubles avec lame d'air
|
|
122
|
+
* 10 - Murs en briques creuses
|
|
123
|
+
* 15 - Brique terre cuite alvéolaire
|
|
124
|
+
*/
|
|
125
|
+
if ([8, 9, 10, 15].includes(materiaux_structure_mur) && epaisseur_structure > 10.5) return 1;
|
|
126
|
+
}
|
|
127
|
+
return 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Get the inertia for a DPE based on the inertia of plancher_haut, plancher_bas and mur
|
|
132
|
+
* @param enveloppe {Enveloppe}
|
|
133
|
+
*/
|
|
134
|
+
calculateInertie(enveloppe) {
|
|
135
|
+
const inertie = {
|
|
136
|
+
inertie_plancher_bas_lourd: this.#calculateInertieForCollection(
|
|
137
|
+
enveloppe.plancher_bas_collection.plancher_bas || [],
|
|
138
|
+
this.calculateInertiePbLourd
|
|
139
|
+
),
|
|
140
|
+
inertie_plancher_haut_lourd: this.#calculateInertieForCollection(
|
|
141
|
+
enveloppe.plancher_haut_collection.plancher_haut || [],
|
|
142
|
+
this.calculateInertiePhLourd
|
|
143
|
+
),
|
|
144
|
+
inertie_paroi_verticale_lourd: this.#calculateInertieForCollection(
|
|
145
|
+
enveloppe.mur_collection.mur || [],
|
|
146
|
+
this.calculateInertieMurLourd
|
|
147
|
+
)
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const nb_inertie_lourde =
|
|
151
|
+
inertie.inertie_plancher_bas_lourd +
|
|
152
|
+
inertie.inertie_plancher_haut_lourd +
|
|
153
|
+
inertie.inertie_paroi_verticale_lourd;
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
...inertie,
|
|
157
|
+
enum_classe_inertie_id: getKeyByValue(
|
|
158
|
+
enums.classe_inertie,
|
|
159
|
+
this.#classeInertieMapping[nb_inertie_lourde]
|
|
160
|
+
)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Return 1 if the collection has high inertia (majority high inertia surface), 0 otherwise
|
|
166
|
+
* @param collection {PlancherBasItem[] || PlancherHautItem[] || MurItem[]}
|
|
167
|
+
* @param method - method to apply on each item to get inertia type
|
|
168
|
+
* @returns {number}
|
|
169
|
+
*/
|
|
170
|
+
#calculateInertieForCollection(collection, method) {
|
|
171
|
+
const s_lourd = collection.reduce((acc, item) => {
|
|
172
|
+
const de = item.donnee_entree;
|
|
173
|
+
return acc + de.surface_paroi_opaque * method(de);
|
|
174
|
+
}, 0);
|
|
175
|
+
const s_total = collection.reduce((acc, pb) => acc + pb.donnee_entree.surface_paroi_opaque, 0);
|
|
176
|
+
return s_lourd / s_total >= 0.5 ? 1 : 0;
|
|
177
|
+
}
|
|
178
|
+
}
|