@open3cl/engine 1.8.29 → 1.8.31
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/15_conso_aux.js +11 -13
- package/15_conso_aux.spec.js +25 -0
- package/9_conso_ch.js +32 -4
- package/9_conso_ch.spec.js +122 -2
- package/9_generateur_ch.js +12 -3
- package/9_generateur_ch.spec.js +68 -0
- package/README.md +20 -20
- package/engine.js +1 -1
- package/package.json +1 -1
package/15_conso_aux.js
CHANGED
|
@@ -16,9 +16,8 @@ const H_CHAUDIERE_BOIS = 10.5;
|
|
|
16
16
|
* @param type {'ecs'|'ch'}
|
|
17
17
|
* @param besoin {number} Besoin en chauffage ou ecs pour ce générateur
|
|
18
18
|
* @param besoin_dep {number} Besoin en chauffage ou ecs pour ce générateur (mode dépensier)
|
|
19
|
-
* @param Sh {number} Surface habitable du logement
|
|
20
19
|
*/
|
|
21
|
-
export function conso_aux_gen(di, de, type, besoin, besoin_dep
|
|
20
|
+
export function conso_aux_gen(di, de, type, besoin, besoin_dep) {
|
|
22
21
|
const typeGenerateur = parseInt(de[`enum_type_generateur_${type}_id`]);
|
|
23
22
|
|
|
24
23
|
const presenceVentilateur = de.presenceVentilateur || 0;
|
|
@@ -62,17 +61,16 @@ export function conso_aux_gen(di, de, type, besoin, besoin_dep, Sh) {
|
|
|
62
61
|
let besoinAppart = besoin * (de[`cle_repartition_${type}`] || 1);
|
|
63
62
|
let besoinAppartDep = besoin_dep * (de[`cle_repartition_${type}`] || 1);
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
di[`conso_auxiliaire_generation_${type}`] = (Paux_g_ch * besoinAppart
|
|
74
|
-
di[`conso_auxiliaire_generation_${type}_depensier`] =
|
|
75
|
-
(Paux_g_ch * besoinAppartDep * ratio) / pnReel || 0;
|
|
64
|
+
/**
|
|
65
|
+
* Le besoin reçu est déjà celui de l'installation : calc_chauffage le proratise par
|
|
66
|
+
* Sc / Sh (surface chauffée de l'installation / surface habitable). Ne pas le proratiser une
|
|
67
|
+
* seconde fois (sinon Bch × (Sc / Sh)²), comme le moteur de référence CSTB (Tribu).
|
|
68
|
+
* Autotest CSTB MI5-0-8 : radiateur gaz, Sc = 96 m², Sh = 136 m², Tribu Qaux_ch = 84,69 kWh
|
|
69
|
+
* (59,78 kWh avec le double prorata, −29 %).
|
|
70
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
|
|
71
|
+
*/
|
|
72
|
+
di[`conso_auxiliaire_generation_${type}`] = (Paux_g_ch * besoinAppart) / pnReel || 0;
|
|
73
|
+
di[`conso_auxiliaire_generation_${type}_depensier`] = (Paux_g_ch * besoinAppartDep) / pnReel || 0;
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
/**
|
package/15_conso_aux.spec.js
CHANGED
|
@@ -91,6 +91,31 @@ describe('conso_aux_gen - auxiliaires de génération', () => {
|
|
|
91
91
|
expect(diCap.conso_auxiliaire_generation_ch_depensier).toBeCloseTo(1.584, 10);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Le besoin transmis par calc_chauffage est déjà proratisé par Sc / Sh : aucun second prorata.
|
|
96
|
+
* Autotest CSTB MI5-0-8 : radiateur gaz (G = 40, H = 0), Sc = 96 m², Sh = 136 m².
|
|
97
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
|
|
98
|
+
*/
|
|
99
|
+
test('chauffage : surface chauffée partielle sans second prorata Sc / Sh du besoin', () => {
|
|
100
|
+
const diPartiel = { pn: 20000 };
|
|
101
|
+
const diTotal = { pn: 20000 };
|
|
102
|
+
conso_aux_gen(
|
|
103
|
+
diPartiel,
|
|
104
|
+
{ enum_type_generateur_ch_id: '90', surface_chauffee: 96 },
|
|
105
|
+
'ch',
|
|
106
|
+
1000,
|
|
107
|
+
1200
|
|
108
|
+
);
|
|
109
|
+
conso_aux_gen(diTotal, { enum_type_generateur_ch_id: '90' }, 'ch', 1000, 1200);
|
|
110
|
+
// Paux = 20 + 1,6 × 20 = 52 W ; conso = 52 × 1000 / 20000 = 2,6 (sans facteur 96 / 136)
|
|
111
|
+
expect(diPartiel.conso_auxiliaire_generation_ch).toBeCloseTo(2.6, 10);
|
|
112
|
+
expect(diPartiel.conso_auxiliaire_generation_ch_depensier).toBeCloseTo(3.12, 10);
|
|
113
|
+
expect(diPartiel.conso_auxiliaire_generation_ch).toBeCloseTo(
|
|
114
|
+
diTotal.conso_auxiliaire_generation_ch,
|
|
115
|
+
10
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
94
119
|
test('type ECS : aucun prorata de surface chauffée appliqué', () => {
|
|
95
120
|
const de = { enum_type_generateur_ecs_id: '50' };
|
|
96
121
|
conso_aux_gen(di, de, 'ecs', 800, 1000, 100);
|
package/9_conso_ch.js
CHANGED
|
@@ -59,6 +59,11 @@ function coef_ch(Fch) {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Calcule la consommation de chauffage du générateur (di.conso_ch, di.conso_ch_depensier).
|
|
64
|
+
* @return {number} besoin de chauffage effectivement couvert par le générateur (kWh), utilisé
|
|
65
|
+
* pour ses auxiliaires de génération (§15.1 : Caux_g = Paux_g × Bch_générateur / Pn)
|
|
66
|
+
*/
|
|
62
67
|
export function conso_ch(
|
|
63
68
|
di,
|
|
64
69
|
de,
|
|
@@ -94,7 +99,7 @@ export function conso_ch(
|
|
|
94
99
|
|
|
95
100
|
switch (cfg_ch) {
|
|
96
101
|
case 'installation de chauffage collectif avec base + appoint': {
|
|
97
|
-
calc_ch_base_appoint(
|
|
102
|
+
return calc_ch_base_appoint(
|
|
98
103
|
di,
|
|
99
104
|
de,
|
|
100
105
|
bch,
|
|
@@ -111,7 +116,6 @@ export function conso_ch(
|
|
|
111
116
|
ilpa,
|
|
112
117
|
tbase
|
|
113
118
|
);
|
|
114
|
-
break;
|
|
115
119
|
}
|
|
116
120
|
case 'convecteurs bi-jonction': {
|
|
117
121
|
// Installation individuelle
|
|
@@ -136,7 +140,7 @@ export function conso_ch(
|
|
|
136
140
|
di.conso_ch = consoInd.conso_ch + consoColl.conso_ch;
|
|
137
141
|
di.conso_ch_depensier = consoInd.conso_ch_dep + consoColl.conso_ch_dep;
|
|
138
142
|
|
|
139
|
-
|
|
143
|
+
return bch;
|
|
140
144
|
}
|
|
141
145
|
default: {
|
|
142
146
|
const { conso_ch, conso_ch_dep } = calc_conso_ch_default(
|
|
@@ -155,7 +159,12 @@ export function conso_ch(
|
|
|
155
159
|
);
|
|
156
160
|
di.conso_ch = conso_ch;
|
|
157
161
|
di.conso_ch_depensier = conso_ch_dep;
|
|
158
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Part du besoin couverte par le générateur selon la configuration (ex. 0,75 / 0,25 pour une
|
|
164
|
+
* chaudière en relève d'une chaudière bois, 0,8 / 0,2 pour une chaudière en relève de PAC).
|
|
165
|
+
* Les PAC hybrides ont déjà leur part (prorata de zone) dans bch.
|
|
166
|
+
*/
|
|
167
|
+
return isPacHybride(de.enum_type_generateur_ch_id) ? bch : coef * bch;
|
|
159
168
|
}
|
|
160
169
|
}
|
|
161
170
|
}
|
|
@@ -224,6 +233,12 @@ function calc_ch_base_appoint(
|
|
|
224
233
|
ilpa,
|
|
225
234
|
tbase
|
|
226
235
|
) {
|
|
236
|
+
/**
|
|
237
|
+
* Besoin couvert par le générateur : part de base (pos 0) ou d'appoint (bch - base), au prorata
|
|
238
|
+
* de la surface de ses émetteurs. Autotest CSTB APP3-0-3 : chaudière bois en base (Tribu
|
|
239
|
+
* Bgen = 3108,34 kWh, Qaux_ch = 13,27 kWh), générateur d'air chaud en appoint (Qaux_ch = 0).
|
|
240
|
+
*/
|
|
241
|
+
let besoinCouvert = 0;
|
|
227
242
|
if (bch > 0) {
|
|
228
243
|
let bch_base = 0;
|
|
229
244
|
|
|
@@ -296,15 +311,28 @@ function calc_ch_base_appoint(
|
|
|
296
311
|
}
|
|
297
312
|
if (!isAppoint) {
|
|
298
313
|
const ratio_s_em = em.donnee_entree.surface_chauffee / de.surface_chauffee;
|
|
314
|
+
besoinCouvert = ratio_s_em * (bch_base / 1000);
|
|
299
315
|
di.conso_ch = (ratio_s_em * (bch_base / 1000) * Ich * Int) / Rend;
|
|
300
316
|
} else {
|
|
301
317
|
const ratio_s_em =
|
|
302
318
|
em.donnee_entree.surface_chauffee / emAppoint.donnee_entree.surface_chauffee;
|
|
319
|
+
besoinCouvert = ratio_s_em * (bch - bch_base / 1000);
|
|
303
320
|
di.conso_ch = (ratio_s_em * (bch - bch_base / 1000) * Int * Ich) / Rend;
|
|
304
321
|
}
|
|
305
322
|
|
|
306
323
|
di.conso_ch = Math.max(di.conso_ch, 0);
|
|
307
324
|
}
|
|
325
|
+
return Math.max(besoinCouvert, 0);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* PAC hybride (partie PAC ou partie chaudière) : enum_type_generateur_ch_id 145 à 170.
|
|
330
|
+
* @param typeGenerateurId {string|number}
|
|
331
|
+
* @return {boolean}
|
|
332
|
+
*/
|
|
333
|
+
export function isPacHybride(typeGenerateurId) {
|
|
334
|
+
const id = Number.parseInt(typeGenerateurId);
|
|
335
|
+
return id >= 145 && id <= 170;
|
|
308
336
|
}
|
|
309
337
|
|
|
310
338
|
function getEmetteursFromGenerateur(de, em_filt, pos, cfg_ch) {
|
package/9_conso_ch.spec.js
CHANGED
|
@@ -50,7 +50,7 @@ vi.mock('./enums.js', () => ({
|
|
|
50
50
|
}
|
|
51
51
|
}));
|
|
52
52
|
|
|
53
|
-
const { conso_ch } = await import('./9_conso_ch.js');
|
|
53
|
+
const { conso_ch, isPacHybride } = await import('./9_conso_ch.js');
|
|
54
54
|
const { default: tvs } = await import('./tv.js');
|
|
55
55
|
const { requestInputID } = await import('./utils.js');
|
|
56
56
|
const { rendement_emission } = await import('./9_emetteur_ch.js');
|
|
@@ -366,7 +366,7 @@ describe('conso_ch - installation collective base + appoint', () => {
|
|
|
366
366
|
s_chauffee_inst,
|
|
367
367
|
gen_ch_list
|
|
368
368
|
] = baseAppointArgs(pos, opts);
|
|
369
|
-
conso_ch(
|
|
369
|
+
di.besoinCouvert = conso_ch(
|
|
370
370
|
di,
|
|
371
371
|
de,
|
|
372
372
|
{},
|
|
@@ -401,6 +401,23 @@ describe('conso_ch - installation collective base + appoint', () => {
|
|
|
401
401
|
expect(di.conso_ch).toBeCloseTo(55.55555555555556, 9);
|
|
402
402
|
});
|
|
403
403
|
|
|
404
|
+
/**
|
|
405
|
+
* Besoin couvert retourné (auxiliaires de génération, §15.1) : base = Σ besoin de base (kWh),
|
|
406
|
+
* appoint = bch - base ; la somme vaut le besoin de l'installation (50 kWh).
|
|
407
|
+
*/
|
|
408
|
+
test('besoin couvert : part de base (pos 0) et part d’appoint (pos 1) = besoin total', () => {
|
|
409
|
+
const base = callBaseAppoint(0).besoinCouvert;
|
|
410
|
+
const appoint = callBaseAppoint(1).besoinCouvert;
|
|
411
|
+
// référence de régression
|
|
412
|
+
expect(base).toBeCloseTo(5, 9);
|
|
413
|
+
expect(appoint).toBeCloseTo(45, 9);
|
|
414
|
+
expect(base + appoint).toBeCloseTo(50, 9);
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
test('besoin couvert nul quand la part de base calculée est nulle', () => {
|
|
418
|
+
expect(callBaseAppoint(0, { pn: 100 }).besoinCouvert).toBe(0);
|
|
419
|
+
});
|
|
420
|
+
|
|
404
421
|
test('puissance nulle (pe = 0) : le besoin de base est forfaitairement la moitié du besoin', () => {
|
|
405
422
|
const di = callBaseAppoint(0, { pn: 0 });
|
|
406
423
|
// pe = 0 => bch_base_j = besoin_ch_mois * 0.5 sur chaque mois
|
|
@@ -509,3 +526,106 @@ describe('conso_ch - installation collective base + appoint', () => {
|
|
|
509
526
|
expect(di.conso_ch).toBeUndefined();
|
|
510
527
|
});
|
|
511
528
|
});
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Besoin couvert par le générateur (retour de conso_ch), utilisé pour ses auxiliaires de
|
|
532
|
+
* génération (§15.1 : Caux_g = Paux_g × Bch_générateur / Pn).
|
|
533
|
+
* Autotests CSTB APP5-0-5 (relève de PAC, 0,8 / 0,2) et IC4-0-1 (relève d'une chaudière bois,
|
|
534
|
+
* 0,75 / 0,25).
|
|
535
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §9 et §15.1
|
|
536
|
+
*/
|
|
537
|
+
describe('conso_ch - besoin couvert par le générateur', () => {
|
|
538
|
+
beforeEach(() => {
|
|
539
|
+
vi.mocked(requestInputID).mockReset();
|
|
540
|
+
vi.mocked(rendement_emission).mockReset();
|
|
541
|
+
vi.mocked(calc_intermittence).mockReset();
|
|
542
|
+
vi.mocked(rendement_emission).mockReturnValue(0.8);
|
|
543
|
+
vi.mocked(calc_intermittence).mockImplementation((_gv, _sh, _hsp, i0) => i0);
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
function appel(de, pos, cfg, bch = 1000) {
|
|
547
|
+
const di = { rg: 1, rg_dep: 1 };
|
|
548
|
+
return conso_ch(
|
|
549
|
+
di,
|
|
550
|
+
{ surface_chauffee: 100, ...de },
|
|
551
|
+
{},
|
|
552
|
+
pos,
|
|
553
|
+
cfg,
|
|
554
|
+
[emetteur(1)],
|
|
555
|
+
150,
|
|
556
|
+
100,
|
|
557
|
+
2.5,
|
|
558
|
+
bch,
|
|
559
|
+
2 * bch,
|
|
560
|
+
-9.5,
|
|
561
|
+
0,
|
|
562
|
+
1,
|
|
563
|
+
1
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
test.each([
|
|
568
|
+
['installation de chauffage avec chaudière en relève de pac', 0, 800],
|
|
569
|
+
['installation de chauffage avec chaudière en relève de pac', 1, 200],
|
|
570
|
+
[
|
|
571
|
+
'installation de chauffage avec une chaudière ou une pac en relève d’une chaudière bois',
|
|
572
|
+
0,
|
|
573
|
+
750
|
|
574
|
+
],
|
|
575
|
+
[
|
|
576
|
+
'installation de chauffage avec une chaudière ou une pac en relève d’une chaudière bois',
|
|
577
|
+
1,
|
|
578
|
+
250
|
|
579
|
+
],
|
|
580
|
+
['installation de chauffage simple', 0, 1000]
|
|
581
|
+
])('%s, position %i : besoin couvert = coefficient × besoin (%d)', (cfg, pos, attendu) => {
|
|
582
|
+
expect(appel({ enum_type_generateur_ch_id: '10' }, pos, cfg)).toBeCloseTo(attendu, 9);
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
test('PAC hybride : part déjà appliquée au besoin, pas de second coefficient', () => {
|
|
586
|
+
const cfg = 'installation de chauffage avec chaudière en relève de pac';
|
|
587
|
+
expect(appel({ enum_type_generateur_ch_id: '148' }, 1, cfg)).toBe(1000);
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
test('convecteurs bi-jonction : tout le besoin est couvert', () => {
|
|
591
|
+
expect(appel({ enum_type_generateur_ch_id: '10' }, 0, 'convecteurs bi-jonction')).toBe(1000);
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
test('base + appoint collectif : besoin nul => besoin couvert nul', () => {
|
|
595
|
+
const di = { rg: 1, rg_dep: 1, pn: 0 };
|
|
596
|
+
const couvert = conso_ch(
|
|
597
|
+
di,
|
|
598
|
+
{ surface_chauffee: 100, enum_type_generateur_ch_id: '10' },
|
|
599
|
+
{},
|
|
600
|
+
0,
|
|
601
|
+
'installation de chauffage collectif avec base + appoint',
|
|
602
|
+
[emetteur(1)],
|
|
603
|
+
150,
|
|
604
|
+
100,
|
|
605
|
+
2.5,
|
|
606
|
+
0,
|
|
607
|
+
0,
|
|
608
|
+
-9.5,
|
|
609
|
+
0,
|
|
610
|
+
1,
|
|
611
|
+
1,
|
|
612
|
+
{ Janvier: 0, Février: 0 },
|
|
613
|
+
100,
|
|
614
|
+
[]
|
|
615
|
+
);
|
|
616
|
+
expect(couvert).toBe(0);
|
|
617
|
+
});
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
describe('isPacHybride', () => {
|
|
621
|
+
test.each([
|
|
622
|
+
['145', true],
|
|
623
|
+
[170, true],
|
|
624
|
+
['148', true],
|
|
625
|
+
['144', false],
|
|
626
|
+
['171', false],
|
|
627
|
+
[undefined, false]
|
|
628
|
+
])('type %s : %s', (id, attendu) => {
|
|
629
|
+
expect(isPacHybride(id)).toBe(attendu);
|
|
630
|
+
});
|
|
631
|
+
});
|
package/9_generateur_ch.js
CHANGED
|
@@ -249,8 +249,6 @@ export function calc_generateur_ch(
|
|
|
249
249
|
tv_rendement_generation(di, de, du);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
conso_aux_gen(di, de, 'ch', bch, bch_dep, Sh);
|
|
253
|
-
|
|
254
252
|
/**
|
|
255
253
|
* 15 Calcul des consommations d’auxiliaires des installations de chauffage (Caux_ch) et d’ECS (Caux_ecs)
|
|
256
254
|
*/
|
|
@@ -258,7 +256,7 @@ export function calc_generateur_ch(
|
|
|
258
256
|
conso_aux_distribution_ch(em_ch, de, di, du, Sh, zc_id, ca_id, ilpa, GV);
|
|
259
257
|
}
|
|
260
258
|
const paroi_ancienne = isParoisAncienneInertieLourde(dpe);
|
|
261
|
-
conso_ch(
|
|
259
|
+
const besoinCouvert = conso_ch(
|
|
262
260
|
di,
|
|
263
261
|
de,
|
|
264
262
|
du,
|
|
@@ -279,6 +277,17 @@ export function calc_generateur_ch(
|
|
|
279
277
|
gen_ch_list
|
|
280
278
|
);
|
|
281
279
|
|
|
280
|
+
/**
|
|
281
|
+
* 15.1 Auxiliaires de génération : Caux_g = Paux_g × Bch / Pn, avec Bch le besoin couvert par
|
|
282
|
+
* ce générateur (part de base / d'appoint, relève), et non le besoin de toute l'installation.
|
|
283
|
+
* Autotests CSTB APP5-0-5 (chaudière fioul en relève de PAC, Tribu Qaux_ch = 2,13 kWh) et
|
|
284
|
+
* IC4-0-1 (chaudière en relève d'une chaudière bois).
|
|
285
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
|
|
286
|
+
*/
|
|
287
|
+
const besoinGenerateur = besoinCouvert ?? bch;
|
|
288
|
+
const besoinGenerateurDep = bch > 0 ? (bch_dep * besoinGenerateur) / bch : 0;
|
|
289
|
+
conso_aux_gen(di, de, 'ch', besoinGenerateur, besoinGenerateurDep);
|
|
290
|
+
|
|
282
291
|
gen_ch.donnee_intermediaire = di;
|
|
283
292
|
gen_ch.donnee_utilisateur = du;
|
|
284
293
|
}
|
package/9_generateur_ch.spec.js
CHANGED
|
@@ -602,3 +602,71 @@ describe('calc_generateur_ch - orchestration du calcul générateur', () => {
|
|
|
602
602
|
expect(gen.donnee_utilisateur).toBeDefined();
|
|
603
603
|
});
|
|
604
604
|
});
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* 15.1 Auxiliaires de génération : Caux_g = Paux_g × Bch_générateur / Pn, avec le besoin
|
|
608
|
+
* effectivement couvert par le générateur (retourné par conso_ch : part de relève, de base ou
|
|
609
|
+
* d'appoint) et non le besoin de toute l'installation.
|
|
610
|
+
* Autotest CSTB APP5-0-5 : chaudière fioul en relève de PAC (part 0,2), Tribu Qaux_ch = 2,13 kWh.
|
|
611
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
|
|
612
|
+
*/
|
|
613
|
+
describe('calc_generateur_ch - besoin couvert transmis aux auxiliaires de génération', () => {
|
|
614
|
+
const dpe = {
|
|
615
|
+
logement: {
|
|
616
|
+
enveloppe: { inertie: { enum_classe_inertie_id: '3' }, mur_collection: { mur: [] } }
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
function appel(gen, bch, bchDep) {
|
|
621
|
+
calc_generateur_ch(
|
|
622
|
+
dpe,
|
|
623
|
+
gen,
|
|
624
|
+
1,
|
|
625
|
+
[{ donnee_entree: { enum_lien_generateur_emetteur_id: '1' } }],
|
|
626
|
+
'installation de chauffage avec chaudière en relève de pac',
|
|
627
|
+
bch,
|
|
628
|
+
bchDep,
|
|
629
|
+
150,
|
|
630
|
+
100,
|
|
631
|
+
2.5,
|
|
632
|
+
1,
|
|
633
|
+
1,
|
|
634
|
+
0,
|
|
635
|
+
-9.5,
|
|
636
|
+
{},
|
|
637
|
+
100,
|
|
638
|
+
[gen]
|
|
639
|
+
);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
test('relève : besoin couvert (part 0,2) et dépensier au même prorata', () => {
|
|
643
|
+
vi.mocked(conso_ch).mockReturnValue(200);
|
|
644
|
+
const gen = { donnee_entree: { enum_type_generateur_ch_id: '1' }, donnee_intermediaire: {} };
|
|
645
|
+
appel(gen, 1000, 1500);
|
|
646
|
+
expect(conso_aux_gen).toHaveBeenCalledWith(
|
|
647
|
+
gen.donnee_intermediaire,
|
|
648
|
+
gen.donnee_entree,
|
|
649
|
+
'ch',
|
|
650
|
+
200,
|
|
651
|
+
300
|
|
652
|
+
);
|
|
653
|
+
// les auxiliaires de génération sont calculés après la consommation du générateur
|
|
654
|
+
expect(vi.mocked(conso_ch).mock.invocationCallOrder[0]).toBeLessThan(
|
|
655
|
+
vi.mocked(conso_aux_gen).mock.invocationCallOrder[0]
|
|
656
|
+
);
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
test('conso_ch sans besoin couvert retourné : repli sur le besoin transmis', () => {
|
|
660
|
+
vi.mocked(conso_ch).mockReturnValue(undefined);
|
|
661
|
+
const gen = { donnee_entree: { enum_type_generateur_ch_id: '1' }, donnee_intermediaire: {} };
|
|
662
|
+
appel(gen, 1000, 1500);
|
|
663
|
+
expect(vi.mocked(conso_aux_gen).mock.calls[0].slice(2)).toEqual(['ch', 1000, 1500]);
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
test('besoin nul : besoin dépensier nul (pas de division par zéro)', () => {
|
|
667
|
+
vi.mocked(conso_ch).mockReturnValue(0);
|
|
668
|
+
const gen = { donnee_entree: { enum_type_generateur_ch_id: '1' }, donnee_intermediaire: {} };
|
|
669
|
+
appel(gen, 0, 0);
|
|
670
|
+
expect(vi.mocked(conso_aux_gen).mock.calls[0].slice(2)).toEqual(['ch', 0, 0]);
|
|
671
|
+
});
|
|
672
|
+
});
|
package/README.md
CHANGED
|
@@ -370,57 +370,57 @@ Ces résultats sont **générés automatiquement** à la fin de `npm run test:co
|
|
|
370
370
|
|
|
371
371
|
<!-- CORPUS:START -->
|
|
372
372
|
|
|
373
|
-
> **Version `1.8.
|
|
373
|
+
> **Version `1.8.29`** · branche `main` · généré le 2026-10-09
|
|
374
374
|
> Seuil de tolérance **5%**
|
|
375
375
|
|
|
376
376
|
<table>
|
|
377
377
|
<tr>
|
|
378
378
|
<td align="center"><strong>9</strong><br/><sub>corpus</sub></td>
|
|
379
|
-
<td align="center"><strong>89
|
|
380
|
-
<td align="center"><strong>60
|
|
379
|
+
<td align="center"><strong>89 988</strong><br/><sub>DPE analysés</sub></td>
|
|
380
|
+
<td align="center"><strong>60 937</strong><br/><sub>DPE conformes</sub></td>
|
|
381
381
|
<td align="center"><strong>67,72 %</strong><br/><sub>réussite globale</sub></td>
|
|
382
382
|
</tr>
|
|
383
383
|
</table>
|
|
384
384
|
|
|
385
385
|
| | Corpus | Réussite | | DPE conformes |
|
|
386
386
|
| :-: | :---------------------------------------------------------------------------------------------------------------------- | ----------: | :--------------------- | -------------: |
|
|
387
|
-
| 🔴 | **Généraliste**<br/><sub>`corpus_dpe.csv`</sub> | **46,
|
|
388
|
-
| 🟢 | **Appartement · chauffage individuel (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_individuel_2025.csv`</sub> | **92,
|
|
387
|
+
| 🔴 | **Généraliste**<br/><sub>`corpus_dpe.csv`</sub> | **46,04 %** | `█████████░░░░░░░░░░░` | 4 604 / 10 000 |
|
|
388
|
+
| 🟢 | **Appartement · chauffage individuel (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_individuel_2025.csv`</sub> | **92,52 %** | `███████████████████░` | 9 252 / 10 000 |
|
|
389
389
|
| 🟢 | **Logement individuel (2025)**<br/><sub>`dpe_logement_individuel_2025.csv`</sub> | **89,54 %** | `██████████████████░░` | 8 947 / 9 992 |
|
|
390
390
|
| 🟢 | **Maison individuelle (2025)**<br/><sub>`dpe_maison_individuelle_2025.csv`</sub> | **88,60 %** | `██████████████████░░` | 8 860 / 10 000 |
|
|
391
391
|
| 🟡 | **Immeuble · chauffage individuel**<br/><sub>`dpe_immeuble_chauffage_individuel.csv`</sub> | **76,99 %** | `███████████████░░░░░` | 7 697 / 9 998 |
|
|
392
392
|
| 🟡 | **Appartement · chauffage collectif (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_collectif_2025.csv`</sub> | **71,59 %** | `██████████████░░░░░░` | 7 159 / 10 000 |
|
|
393
393
|
| 🟡 | **Immeuble · chauffage collectif**<br/><sub>`dpe_immeuble_chauffage_collectif.csv`</sub> | **65,11 %** | `█████████████░░░░░░░` | 6 510 / 9 999 |
|
|
394
|
-
| 🔴 | **Immeuble · chauffage mixte**<br/><sub>`dpe_immeuble_chauffage_mixte.csv`</sub> | **52,
|
|
394
|
+
| 🔴 | **Immeuble · chauffage mixte**<br/><sub>`dpe_immeuble_chauffage_mixte.csv`</sub> | **52,15 %** | `██████████░░░░░░░░░░` | 5 214 / 9 999 |
|
|
395
395
|
| 🔴 | **Individuel généré depuis l'immeuble (2026)**<br/><sub>`dpe_individuel_a_partir_dpe_immeuble_2026.csv`</sub> | **26,94 %** | `█████░░░░░░░░░░░░░░░` | 2 694 / 10 000 |
|
|
396
396
|
|
|
397
397
|
<sub>🟢 ≥ 85 % · 🟡 ≥ 60 % · 🔴 < 60 %</sub>
|
|
398
398
|
|
|
399
399
|
#### Temps d’exécution
|
|
400
400
|
|
|
401
|
-
> Durée de l’appel à `calcul_3cl` par DPE, sur 89
|
|
401
|
+
> Durée de l’appel à `calcul_3cl` par DPE, sur 89 953 calculs.
|
|
402
402
|
> La copie défensive de l’entrée et la lecture du fichier sont exclues de la mesure.
|
|
403
403
|
|
|
404
404
|
<table>
|
|
405
405
|
<tr>
|
|
406
|
-
<td align="center"><strong>
|
|
407
|
-
<td align="center"><strong>
|
|
408
|
-
<td align="center"><strong>0,
|
|
409
|
-
<td align="center"><strong>
|
|
406
|
+
<td align="center"><strong>9,94 ms</strong><br/><sub>moyenne</sub></td>
|
|
407
|
+
<td align="center"><strong>7,15 ms</strong><br/><sub>médiane</sub></td>
|
|
408
|
+
<td align="center"><strong>0,19 ms</strong><br/><sub>min</sub></td>
|
|
409
|
+
<td align="center"><strong>66,85 s</strong><br/><sub>max</sub></td>
|
|
410
410
|
</tr>
|
|
411
411
|
</table>
|
|
412
412
|
|
|
413
413
|
| Corpus | Moyenne | Médiane | Min | Max | p95 | p99 |
|
|
414
414
|
| :--------------------------------------------- | ------: | ------: | ------: | -------: | ------: | ------: |
|
|
415
|
-
| **Généraliste** |
|
|
416
|
-
| **Appartement · chauffage individuel (2025)** |
|
|
417
|
-
| **Logement individuel (2025)** |
|
|
418
|
-
| **Maison individuelle (2025)** |
|
|
419
|
-
| **Immeuble · chauffage individuel** |
|
|
420
|
-
| **Appartement · chauffage collectif (2025)** |
|
|
421
|
-
| **Immeuble · chauffage collectif** |
|
|
422
|
-
| **Immeuble · chauffage mixte** |
|
|
423
|
-
| **Individuel généré depuis l'immeuble (2026)** |
|
|
415
|
+
| **Généraliste** | 6,79 ms | 5,99 ms | 0,39 ms | 52,1 ms | 13,0 ms | 19,5 ms |
|
|
416
|
+
| **Appartement · chauffage individuel (2025)** | 8,93 ms | 7,17 ms | 1,94 ms | 180,6 ms | 18,4 ms | 31,1 ms |
|
|
417
|
+
| **Logement individuel (2025)** | 5,69 ms | 5,16 ms | 1,61 ms | 35,6 ms | 10,4 ms | 13,9 ms |
|
|
418
|
+
| **Maison individuelle (2025)** | 6,07 ms | 5,48 ms | 1,91 ms | 46,2 ms | 10,8 ms | 14,1 ms |
|
|
419
|
+
| **Immeuble · chauffage individuel** | 11,6 ms | 8,93 ms | 0,19 ms | 194,3 ms | 27,2 ms | 49,5 ms |
|
|
420
|
+
| **Appartement · chauffage collectif (2025)** | 9,01 ms | 7,02 ms | 1,88 ms | 173,7 ms | 18,6 ms | 30,2 ms |
|
|
421
|
+
| **Immeuble · chauffage collectif** | 14,3 ms | 11,0 ms | 0,20 ms | 218,6 ms | 30,1 ms | 63,7 ms |
|
|
422
|
+
| **Immeuble · chauffage mixte** | 7,99 ms | 6,27 ms | 0,28 ms | 1,25 s | 18,0 ms | 32,0 ms |
|
|
423
|
+
| **Individuel généré depuis l'immeuble (2026)** | 19,1 ms | 7,29 ms | 1,74 ms | 66,85 s | 16,6 ms | 35,0 ms |
|
|
424
424
|
|
|
425
425
|
<sub>La moyenne est tirée vers le haut par les DPE collectifs, dont le coût atteint plusieurs
|
|
426
426
|
dizaines de fois la médiane : c’est la médiane qui décrit le cas courant, et p95/p99 le cas
|
package/engine.js
CHANGED
|
@@ -33,7 +33,7 @@ import getFicheTechnique from './ficheTechnique.js';
|
|
|
33
33
|
import { ProductionENR } from './16.2_production_enr.js';
|
|
34
34
|
import DpeSanitizerService from './dpe-sanitizer.service.js';
|
|
35
35
|
|
|
36
|
-
const LIB_VERSION = '1.8.
|
|
36
|
+
const LIB_VERSION = '1.8.31';
|
|
37
37
|
|
|
38
38
|
const dpeSanitizerService = new DpeSanitizerService();
|
|
39
39
|
|