@open3cl/engine 1.8.51 → 1.8.53
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/11_ecs.js +33 -0
- package/11_ecs.spec.js +86 -1
- package/README.md +24 -24
- package/conso.js +15 -2
- package/conso.spec.js +40 -0
- package/engine.js +1 -1
- package/package.json +1 -1
package/11_ecs.js
CHANGED
|
@@ -179,6 +179,33 @@ export function ratio_besoin_ecs_individuel(dpe, de, surfaceImmeuble, nombreAppa
|
|
|
179
179
|
return ratio < 1 ? ratio : 1 / nombreAppartements;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* enum_type_installation_id des installations ECS collectives :
|
|
184
|
+
* 2 - installation collective ; 3 - installation collective multi-bâtiment (réseau de chaleur)
|
|
185
|
+
*/
|
|
186
|
+
const TYPES_INSTALLATION_ECS_COLLECTIVE = ['2', '3'];
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Rdim (nombre d'installations individuelles identiques) sans objet pour une installation ECS
|
|
190
|
+
* collective décrite dans un DPE immeuble : elle dessert tout l'immeuble, le besoin ECS n'est donc
|
|
191
|
+
* pas ramené à un logement type. Sinon, le besoin serait divisé par rdim alors que les pertes de
|
|
192
|
+
* stockage (Qgw) et à l'arrêt (qp0) du générateur collectif restent celles de l'immeuble,
|
|
193
|
+
* effondrant les rendements de génération et de stockage.
|
|
194
|
+
* @see Guide Tribu TE-211208 p. 24 (Rdim = nombre d'installations individuelles identiques)
|
|
195
|
+
* @see Moteur_DPE.dll Calcul_batiment.cs l.583-592 (Becs / Rdim seulement pour une installation
|
|
196
|
+
* individuelle en immeuble ; Becs × Sh_ecs / SH sans Rdim pour une installation collective)
|
|
197
|
+
* @param th {string} type de bâtiment (maison, appartement, immeuble)
|
|
198
|
+
* @param de {Donnee_entree} donnée d'entrée de l'installation ECS
|
|
199
|
+
* @returns {boolean}
|
|
200
|
+
*/
|
|
201
|
+
export function isRdimEcsNeutralise(th, de) {
|
|
202
|
+
return (
|
|
203
|
+
th === 'immeuble' &&
|
|
204
|
+
TYPES_INSTALLATION_ECS_COLLECTIVE.includes(String(de.enum_type_installation_id)) &&
|
|
205
|
+
Number(de.rdim) > 1
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
182
209
|
export default function calc_ecs(
|
|
183
210
|
dpe,
|
|
184
211
|
ecs,
|
|
@@ -227,6 +254,12 @@ export default function calc_ecs(
|
|
|
227
254
|
((de.surface_habitable / (surfaceImmeuble || 1)) * (de.rdim || 1)) /
|
|
228
255
|
(de.nombre_logement * nombreAppartements);
|
|
229
256
|
}
|
|
257
|
+
} else if (isRdimEcsNeutralise(th, de)) {
|
|
258
|
+
/**
|
|
259
|
+
* Installation ECS collective d'un DPE immeuble : le besoin est celui de l'immeuble (pas de
|
|
260
|
+
* division par rdim), la consommation n'étant pas remultipliée par rdim (conso.js).
|
|
261
|
+
*/
|
|
262
|
+
di.rdim_neutralise = true;
|
|
230
263
|
} else if (de.rdim) {
|
|
231
264
|
di.ratio_besoin_ecs = 1 / de.rdim || 1;
|
|
232
265
|
}
|
package/11_ecs.spec.js
CHANGED
|
@@ -31,7 +31,7 @@ vi.mock('./14_generateur_ecs.js', () => ({
|
|
|
31
31
|
default: vi.fn()
|
|
32
32
|
}));
|
|
33
33
|
|
|
34
|
-
const { default: calc_ecs } = await import('./11_ecs.js');
|
|
34
|
+
const { default: calc_ecs, isRdimEcsNeutralise } = await import('./11_ecs.js');
|
|
35
35
|
const { tv, requestInput } = await import('./utils.js');
|
|
36
36
|
const { default: calc_gen_ecs } = await import('./14_generateur_ecs.js');
|
|
37
37
|
|
|
@@ -379,6 +379,91 @@ describe('calc_ecs - immeuble à plusieurs installations ECS (prorata des surfac
|
|
|
379
379
|
});
|
|
380
380
|
});
|
|
381
381
|
|
|
382
|
+
/**
|
|
383
|
+
* Installation ECS collective unique d'un DPE immeuble : le rdim (nombre d'installations
|
|
384
|
+
* individuelles identiques) est sans objet, le besoin n'est pas divisé par rdim et la consommation
|
|
385
|
+
* n'est pas remultipliée par rdim à l'agrégation (conso.js getRdimEcs).
|
|
386
|
+
* @see Guide Tribu TE-211208 p. 24
|
|
387
|
+
* @see Moteur_DPE.dll Calcul_batiment.cs l.583-592 (Becs / Rdim seulement en installation individuelle)
|
|
388
|
+
*/
|
|
389
|
+
describe('calc_ecs - installation ECS collective en immeuble : rdim neutralisé', () => {
|
|
390
|
+
test.each([
|
|
391
|
+
['collective', '2'],
|
|
392
|
+
['collective multi-bâtiment', '3']
|
|
393
|
+
])('installation %s, rdim 22 : besoin de l’immeuble (ratio 1)', (_libelle, type) => {
|
|
394
|
+
const ecs = makeEcs({
|
|
395
|
+
tv_rendement_distribution_ecs_id: '5',
|
|
396
|
+
enum_type_installation_id: type,
|
|
397
|
+
rdim: 22
|
|
398
|
+
});
|
|
399
|
+
calc_ecs({}, ecs, 1000, 1500, 1, 'ca1', 'h1a', 'immeuble', false, 681, 22, false, {});
|
|
400
|
+
|
|
401
|
+
expect(ecs.donnee_intermediaire.ratio_besoin_ecs).toBe(1);
|
|
402
|
+
expect(ecs.donnee_intermediaire.besoin_ecs).toBe(1000);
|
|
403
|
+
expect(ecs.donnee_intermediaire.besoin_ecs_depensier).toBe(1500);
|
|
404
|
+
expect(ecs.donnee_intermediaire.rdim_neutralise).toBe(true);
|
|
405
|
+
// le générateur reçoit le besoin de l'immeuble (cohérent avec ses pertes Qgw / qp0)
|
|
406
|
+
expect(vi.mocked(calc_gen_ecs).mock.calls[0][2].besoin_ecs).toBe(1000);
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
test.each([
|
|
410
|
+
['installation individuelle en immeuble', '1', 'immeuble', 0.25],
|
|
411
|
+
['installation hybride collective-individuelle', '4', 'immeuble', 0.25],
|
|
412
|
+
['DPE appartement (installation collective)', '2', 'appartement', 0.25],
|
|
413
|
+
['DPE maison', '2', 'maison', 0.25]
|
|
414
|
+
])('%s : division par rdim conservée', (_libelle, type, th, ratio) => {
|
|
415
|
+
const ecs = makeEcs({
|
|
416
|
+
tv_rendement_distribution_ecs_id: '5',
|
|
417
|
+
enum_type_installation_id: type,
|
|
418
|
+
rdim: 4
|
|
419
|
+
});
|
|
420
|
+
calc_ecs({}, ecs, 1000, 1500, 1, 'ca1', 'h1a', th, false, 200, null, false, {});
|
|
421
|
+
|
|
422
|
+
expect(ecs.donnee_intermediaire.ratio_besoin_ecs).toBe(ratio);
|
|
423
|
+
expect(ecs.donnee_intermediaire.rdim_neutralise).toBeUndefined();
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
test('installation collective en immeuble, rdim 1 : inchangé (ratio 1, pas d’indicateur)', () => {
|
|
427
|
+
const ecs = makeEcs({
|
|
428
|
+
tv_rendement_distribution_ecs_id: '5',
|
|
429
|
+
enum_type_installation_id: '2',
|
|
430
|
+
rdim: 1
|
|
431
|
+
});
|
|
432
|
+
calc_ecs({}, ecs, 1000, 1500, 1, 'ca1', 'h1a', 'immeuble', false, 200, null, false, {});
|
|
433
|
+
|
|
434
|
+
expect(ecs.donnee_intermediaire.ratio_besoin_ecs).toBe(1);
|
|
435
|
+
expect(ecs.donnee_intermediaire.rdim_neutralise).toBeUndefined();
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
test('immeuble multi-installations : prorata Sh / SH / rdim conservé (branche prioritaire)', () => {
|
|
439
|
+
const ecs = makeEcs({
|
|
440
|
+
tv_rendement_distribution_ecs_id: '5',
|
|
441
|
+
enum_type_installation_id: '2',
|
|
442
|
+
surface_habitable: 100,
|
|
443
|
+
rdim: 4
|
|
444
|
+
});
|
|
445
|
+
calc_ecs({}, ecs, 1000, 1500, 1, 'ca1', 'h1a', 'immeuble', false, 200, null, false, {}, true);
|
|
446
|
+
|
|
447
|
+
expect(ecs.donnee_intermediaire.ratio_besoin_ecs).toBeCloseTo(100 / 200 / 4, 9);
|
|
448
|
+
expect(ecs.donnee_intermediaire.rdim_neutralise).toBeUndefined();
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
describe('isRdimEcsNeutralise', () => {
|
|
453
|
+
test.each([
|
|
454
|
+
['immeuble', '2', 22, true],
|
|
455
|
+
['immeuble', 3, '2', true],
|
|
456
|
+
['immeuble', '2', 1, false],
|
|
457
|
+
['immeuble', '2', undefined, false],
|
|
458
|
+
['immeuble', '1', 22, false],
|
|
459
|
+
['immeuble', '4', 22, false],
|
|
460
|
+
['appartement', '2', 22, false],
|
|
461
|
+
['maison', '2', 22, false]
|
|
462
|
+
])('th %s, type %s, rdim %s → %s', (th, type, rdim, attendu) => {
|
|
463
|
+
expect(isRdimEcsNeutralise(th, { enum_type_installation_id: type, rdim })).toBe(attendu);
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
|
|
382
467
|
describe('calc_ecs - rendement de distribution', () => {
|
|
383
468
|
test('la ligne forfaitaire alimente rendement_distribution et l’identifiant de table', () => {
|
|
384
469
|
const de = { tv_rendement_distribution_ecs_id: '5' };
|
package/README.md
CHANGED
|
@@ -370,29 +370,29 @@ 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.52`** · à publier · branche `main` · généré le 2026-10-12
|
|
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
379
|
<td align="center"><strong>89 984</strong><br/><sub>DPE analysés</sub></td>
|
|
380
|
-
<td align="center"><strong>
|
|
381
|
-
<td align="center"><strong>
|
|
380
|
+
<td align="center"><strong>65 424</strong><br/><sub>DPE conformes</sub></td>
|
|
381
|
+
<td align="center"><strong>72,71 %</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,65 %** | `█████████░░░░░░░░░░░` | 4 665 / 9 999 |
|
|
388
|
+
| 🟢 | **Appartement · chauffage individuel (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_individuel_2025.csv`</sub> | **92,90 %** | `███████████████████░` | 9 290 / 10 000 |
|
|
389
|
+
| 🟢 | **Appartement · chauffage collectif (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_collectif_2025.csv`</sub> | **91,27 %** | `██████████████████░░` | 9 127 / 10 000 |
|
|
389
390
|
| 🟢 | **Logement individuel (2025)**<br/><sub>`dpe_logement_individuel_2025.csv`</sub> | **89,93 %** | `██████████████████░░` | 8 986 / 9 992 |
|
|
390
|
-
| 🟢 | **Maison individuelle (2025)**<br/><sub>`dpe_maison_individuelle_2025.csv`</sub> | **88,
|
|
391
|
-
| 🟡 | **Immeuble · chauffage individuel**<br/><sub>`dpe_immeuble_chauffage_individuel.csv`</sub> | **84,
|
|
392
|
-
| 🟡 | **
|
|
393
|
-
|
|
|
394
|
-
| 🔴 | **
|
|
395
|
-
| 🔴 | **Individuel généré depuis l'immeuble (2026)**<br/><sub>`dpe_individuel_a_partir_dpe_immeuble_2026.csv`</sub> | **27,50 %** | `██████░░░░░░░░░░░░░░` | 2 750 / 10 000 |
|
|
391
|
+
| 🟢 | **Maison individuelle (2025)**<br/><sub>`dpe_maison_individuelle_2025.csv`</sub> | **88,88 %** | `██████████████████░░` | 8 887 / 9 999 |
|
|
392
|
+
| 🟡 | **Immeuble · chauffage individuel**<br/><sub>`dpe_immeuble_chauffage_individuel.csv`</sub> | **84,57 %** | `█████████████████░░░` | 8 455 / 9 998 |
|
|
393
|
+
| 🟡 | **Immeuble · chauffage collectif**<br/><sub>`dpe_immeuble_chauffage_collectif.csv`</sub> | **74,67 %** | `███████████████░░░░░` | 7 466 / 9 999 |
|
|
394
|
+
| 🔴 | **Immeuble · chauffage mixte**<br/><sub>`dpe_immeuble_chauffage_mixte.csv`</sub> | **56,65 %** | `███████████░░░░░░░░░` | 5 663 / 9 997 |
|
|
395
|
+
| 🔴 | **Individuel généré depuis l'immeuble (2026)**<br/><sub>`dpe_individuel_a_partir_dpe_immeuble_2026.csv`</sub> | **28,85 %** | `██████░░░░░░░░░░░░░░` | 2 885 / 10 000 |
|
|
396
396
|
|
|
397
397
|
<sub>🟢 ≥ 85 % · 🟡 ≥ 60 % · 🔴 < 60 %</sub>
|
|
398
398
|
|
|
@@ -403,24 +403,24 @@ Ces résultats sont **générés automatiquement** à la fin de `npm run test:co
|
|
|
403
403
|
|
|
404
404
|
<table>
|
|
405
405
|
<tr>
|
|
406
|
-
<td align="center"><strong>5,
|
|
407
|
-
<td align="center"><strong>
|
|
408
|
-
<td align="center"><strong>0,
|
|
409
|
-
<td align="center"><strong>
|
|
406
|
+
<td align="center"><strong>5,66 ms</strong><br/><sub>moyenne</sub></td>
|
|
407
|
+
<td align="center"><strong>4,98 ms</strong><br/><sub>médiane</sub></td>
|
|
408
|
+
<td align="center"><strong>0,13 ms</strong><br/><sub>min</sub></td>
|
|
409
|
+
<td align="center"><strong>869,7 ms</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** | 4,
|
|
416
|
-
| **Appartement · chauffage individuel (2025)** | 4,
|
|
417
|
-
| **
|
|
418
|
-
| **
|
|
419
|
-
| **
|
|
420
|
-
| **
|
|
421
|
-
| **Immeuble · chauffage collectif** | 6,
|
|
422
|
-
| **Immeuble · chauffage mixte** | 5,
|
|
423
|
-
| **Individuel généré depuis l'immeuble (2026)** | 6,
|
|
415
|
+
| **Généraliste** | 4,82 ms | 4,33 ms | 0,21 ms | 40,9 ms | 8,99 ms | 12,6 ms |
|
|
416
|
+
| **Appartement · chauffage individuel (2025)** | 4,00 ms | 3,65 ms | 1,55 ms | 36,8 ms | 6,83 ms | 8,63 ms |
|
|
417
|
+
| **Appartement · chauffage collectif (2025)** | 4,88 ms | 4,58 ms | 1,60 ms | 38,2 ms | 8,05 ms | 11,1 ms |
|
|
418
|
+
| **Logement individuel (2025)** | 5,39 ms | 4,83 ms | 1,75 ms | 36,5 ms | 9,91 ms | 13,4 ms |
|
|
419
|
+
| **Maison individuelle (2025)** | 6,37 ms | 5,75 ms | 1,94 ms | 46,1 ms | 11,4 ms | 15,0 ms |
|
|
420
|
+
| **Immeuble · chauffage individuel** | 7,22 ms | 6,19 ms | 0,13 ms | 127,3 ms | 14,6 ms | 22,8 ms |
|
|
421
|
+
| **Immeuble · chauffage collectif** | 6,13 ms | 5,37 ms | 0,21 ms | 135,7 ms | 11,2 ms | 20,3 ms |
|
|
422
|
+
| **Immeuble · chauffage mixte** | 5,77 ms | 4,63 ms | 0,19 ms | 869,7 ms | 12,1 ms | 19,7 ms |
|
|
423
|
+
| **Individuel généré depuis l'immeuble (2026)** | 6,39 ms | 5,45 ms | 1,80 ms | 65,3 ms | 12,2 ms | 20,2 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/conso.js
CHANGED
|
@@ -484,7 +484,7 @@ export default function calc_conso(
|
|
|
484
484
|
// S'il existe une clé de repartition ECS, utilisation de celle-ci pour répartir la conso ECS collective à l'appartement
|
|
485
485
|
generateur_ecs.forEach((value) => {
|
|
486
486
|
value.donnee_entree.cle_repartition_ecs =
|
|
487
|
-
(ecs.donnee_entree.cle_repartition_ecs || 1) * (ecs
|
|
487
|
+
(ecs.donnee_entree.cle_repartition_ecs || 1) * getRdimEcs(ecs);
|
|
488
488
|
(value.donnee_utilisateur = value.donnee_utilisateur || {}).coeffEmissionGes =
|
|
489
489
|
getGesCoeffForGenerateur(value, 'ecs', dateDpe, versionLogiciel);
|
|
490
490
|
});
|
|
@@ -872,6 +872,19 @@ function getEcsConso(gen_ecs, field, coef, prorataECS, prefix, facteurAc = 1) {
|
|
|
872
872
|
}, 0);
|
|
873
873
|
}
|
|
874
874
|
|
|
875
|
+
/**
|
|
876
|
+
* Rdim appliqué à la consommation d'une installation ECS lors de l'agrégation. Il vaut 1 lorsque le
|
|
877
|
+
* besoin n'a pas été divisé par rdim (installation ECS collective en immeuble, cf. 11_ecs.js
|
|
878
|
+
* isRdimEcsNeutralise), afin de rester cohérent avec le besoin calculé.
|
|
879
|
+
* @see Moteur_DPE.dll Calcul_batiment.cs l.1067 (conso × Rdim, Rdim = 1 transmis en collectif)
|
|
880
|
+
* @param inst {InstallationEcs}
|
|
881
|
+
* @returns {number}
|
|
882
|
+
*/
|
|
883
|
+
export function getRdimEcs(inst) {
|
|
884
|
+
if (inst.donnee_intermediaire?.rdim_neutralise) return 1;
|
|
885
|
+
return Number(inst.donnee_entree.rdim) || 1;
|
|
886
|
+
}
|
|
887
|
+
|
|
875
888
|
/**
|
|
876
889
|
* Consommation des auxiliaires de génération ECS (circulateurs des générateurs).
|
|
877
890
|
* Le besoin d'une installation dimensionnée (rdim > 1) est exprimé par unité : comme la
|
|
@@ -887,7 +900,7 @@ function getEcsConso(gen_ecs, field, coef, prorataECS, prefix, facteurAc = 1) {
|
|
|
887
900
|
*/
|
|
888
901
|
export function getAuxGenerationEcs(ecs, field, coef, prorataECS, facteurAc = 1) {
|
|
889
902
|
return ecs.reduce((acc, inst) => {
|
|
890
|
-
const rdim = prorataECS === 1 ?
|
|
903
|
+
const rdim = prorataECS === 1 ? getRdimEcs(inst) : 1;
|
|
891
904
|
return inst.generateur_ecs_collection.generateur_ecs.reduce((acc2, gen) => {
|
|
892
905
|
const conso = (gen.donnee_intermediaire[field] || 0) * rdim * facteurAc;
|
|
893
906
|
return acc2 + getConso(coef, 'électricité auxiliaire', conso);
|
package/conso.spec.js
CHANGED
|
@@ -64,6 +64,7 @@ const {
|
|
|
64
64
|
coefCoutProrata,
|
|
65
65
|
masqueEnergie,
|
|
66
66
|
getAuxGenerationEcs,
|
|
67
|
+
getRdimEcs,
|
|
67
68
|
DATE_BAREME_COUT_2024,
|
|
68
69
|
appointBijonction,
|
|
69
70
|
coutBijonction,
|
|
@@ -551,6 +552,20 @@ describe('calc_conso - agrégation des consommations', () => {
|
|
|
551
552
|
expect(res.ef_conso.conso_ecs).toBe(600);
|
|
552
553
|
});
|
|
553
554
|
|
|
555
|
+
test('ECS collective en immeuble, rdim neutralisé (11_ecs.js) : conso non remultipliée par rdim', () => {
|
|
556
|
+
const inst = installEcs({ cle_repartition_ecs: 2, rdim: 22 }, [
|
|
557
|
+
genEcs('1', { conso_ecs: 100, conso_ecs_depensier: 120 })
|
|
558
|
+
]);
|
|
559
|
+
inst.donnee_intermediaire.rdim_neutralise = true;
|
|
560
|
+
|
|
561
|
+
const res = calc_conso(100, 1, 1, [], [], [inst], [], 1, 1, DATE_DPE, coef_ep);
|
|
562
|
+
// clé = 2 × 1 (rdim neutralisé) => conso_ecs = 100 × 2
|
|
563
|
+
expect(inst.generateur_ecs_collection.generateur_ecs[0].donnee_entree.cle_repartition_ecs).toBe(
|
|
564
|
+
2
|
|
565
|
+
);
|
|
566
|
+
expect(res.ef_conso.conso_ecs).toBe(200);
|
|
567
|
+
});
|
|
568
|
+
|
|
554
569
|
test('ECS avec prorataECS différent de 1 : clé issue du prorata', () => {
|
|
555
570
|
// Quand prorataECS !== 1, la boucle ECS ne renseigne pas donnee_utilisateur :
|
|
556
571
|
// on la fournit en amont (coefficient GES déjà connu) pour refléter les données réelles.
|
|
@@ -991,6 +1006,14 @@ describe('getAuxGenerationEcs - auxiliaires de génération ECS et rdim', () =>
|
|
|
991
1006
|
expect(getAuxGenerationEcs(ecs, 'conso_auxiliaire_generation_ecs', coefUnitaire, 1)).toBe(4);
|
|
992
1007
|
});
|
|
993
1008
|
|
|
1009
|
+
test('installation ECS collective en immeuble (rdim neutralisé) : auxiliaires non multipliés', () => {
|
|
1010
|
+
const collective = inst(22, 4);
|
|
1011
|
+
collective.donnee_intermediaire.rdim_neutralise = true;
|
|
1012
|
+
const ecs = [collective, inst(3, 1)];
|
|
1013
|
+
// 4 × 1 (rdim neutralisé) + 1 × 3
|
|
1014
|
+
expect(getAuxGenerationEcs(ecs, 'conso_auxiliaire_generation_ecs', coefUnitaire, 1)).toBe(7);
|
|
1015
|
+
});
|
|
1016
|
+
|
|
994
1017
|
test('calc_conso : auxiliaire_generation_ecs intègre le rdim', () => {
|
|
995
1018
|
const ecs = [inst(2, 5)];
|
|
996
1019
|
const res = calc_conso(100, 1, 1, [], [], ecs, [], 1, 1, DATE_DPE, coef_ep);
|
|
@@ -1015,6 +1038,23 @@ describe('getAuxGenerationEcs - auxiliaires de génération ECS et rdim', () =>
|
|
|
1015
1038
|
});
|
|
1016
1039
|
});
|
|
1017
1040
|
|
|
1041
|
+
/**
|
|
1042
|
+
* Rdim appliqué à la conso ECS lors de l'agrégation : 1 si le besoin n'a pas été divisé par rdim.
|
|
1043
|
+
* @see Moteur_DPE.dll Calcul_batiment.cs l.1067
|
|
1044
|
+
*/
|
|
1045
|
+
describe('getRdimEcs', () => {
|
|
1046
|
+
test.each([
|
|
1047
|
+
['rdim renseigné', { rdim: 3 }, {}, 3],
|
|
1048
|
+
['rdim chaîne', { rdim: '2.5' }, {}, 2.5],
|
|
1049
|
+
['rdim absent', {}, {}, 1],
|
|
1050
|
+
['rdim non numérique', { rdim: 'abc' }, {}, 1],
|
|
1051
|
+
['rdim neutralisé', { rdim: 22 }, { rdim_neutralise: true }, 1],
|
|
1052
|
+
['sans donnée intermédiaire', { rdim: 4 }, undefined, 4]
|
|
1053
|
+
])('%s', (_libelle, de, di, attendu) => {
|
|
1054
|
+
expect(getRdimEcs({ donnee_entree: de, donnee_intermediaire: di })).toBe(attendu);
|
|
1055
|
+
});
|
|
1056
|
+
});
|
|
1057
|
+
|
|
1018
1058
|
/**
|
|
1019
1059
|
* Convecteurs bi-jonction (§9.1.6) : base (60 %) facturée en électricité collective, appoint
|
|
1020
1060
|
* individuel (40 %) en électricité individuelle.
|
package/engine.js
CHANGED
|
@@ -33,7 +33,7 @@ import getFicheTechnique from './ficheTechnique.js';
|
|
|
33
33
|
import { ProductionENR, ratioProrataPvLogement } 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.53';
|
|
37
37
|
|
|
38
38
|
const dpeSanitizerService = new DpeSanitizerService();
|
|
39
39
|
|