@open3cl/engine 1.8.29 → 1.8.30
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_generateur_ch.js +1 -1
- 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_generateur_ch.js
CHANGED
|
@@ -249,7 +249,7 @@ 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
|
|
252
|
+
conso_aux_gen(di, de, 'ch', bch, bch_dep);
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* 15 Calcul des consommations d’auxiliaires des installations de chauffage (Caux_ch) et d’ECS (Caux_ecs)
|
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.30';
|
|
37
37
|
|
|
38
38
|
const dpeSanitizerService = new DpeSanitizerService();
|
|
39
39
|
|