@open3cl/engine 1.8.16 → 1.8.17

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 CHANGED
@@ -41,7 +41,13 @@ export function conso_aux_gen(di, de, type, besoin, besoin_dep, Sh) {
41
41
  pe = 70000;
42
42
  }
43
43
 
44
- const Paux_g_ch = g + (h * (pe / 1000)) / (de.ratio_virtualisation || 1);
44
+ /**
45
+ * Installation collective virtualisée : Paux_g (W) est celle du générateur de l'immeuble
46
+ * (Pn = pe, puissance immeuble) et Caux_g = Paux_g × Bch_logement / Pn. Le terme G ne doit pas
47
+ * être proratisé par ratio_virtualisation (sinon G × ratio), comme le moteur CSTB (Tribu).
48
+ * @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
49
+ */
50
+ const Paux_g_ch = g + h * (pe / 1000);
45
51
 
46
52
  // Pour les installations collectives, la conso des auxiliaires est calculée à partir du besoin de l'appartement
47
53
  let besoinAppart = besoin * (de[`cle_repartition_${type}`] || 1);
@@ -55,10 +61,9 @@ export function conso_aux_gen(di, de, type, besoin, besoin_dep, Sh) {
55
61
  ratio = Sc / Sh;
56
62
  }
57
63
 
58
- di[`conso_auxiliaire_generation_${type}`] =
59
- ((de.ratio_virtualisation || 1) * (Paux_g_ch * besoinAppart * ratio)) / pe || 0;
64
+ di[`conso_auxiliaire_generation_${type}`] = (Paux_g_ch * besoinAppart * ratio) / pe || 0;
60
65
  di[`conso_auxiliaire_generation_${type}_depensier`] =
61
- (Paux_g_ch * besoinAppartDep * ratio) / di.pn || 0;
66
+ (Paux_g_ch * besoinAppartDep * ratio) / (di.pn / (de.ratio_virtualisation || 1)) || 0;
62
67
  }
63
68
 
64
69
  /**
@@ -131,6 +131,49 @@ describe('conso_aux_gen - auxiliaires de génération', () => {
131
131
  expect(diInconnu.conso_auxiliaire_generation_autre).toBe(0);
132
132
  expect(diInconnu.conso_auxiliaire_generation_autre_depensier).toBe(0);
133
133
  });
134
+
135
+ /**
136
+ * Installation collective virtualisée (appartement) : di.pn est la puissance ramenée au logement,
137
+ * pe = di.pn / ratio_virtualisation la puissance du générateur de l'immeuble.
138
+ * Caux_g = (G + H × Pn_immeuble) × Bch_logement / Pn_immeuble : G n'est pas proratisé.
139
+ * Cas des autotests CSTB APP5-0-1 (chaudière fioul collective, Tribu Qaux_ch = 15,9928 kWh).
140
+ */
141
+ test('installation virtualisée : Paux_g calculée sur le générateur immeuble, G non proratisé', () => {
142
+ const diVirt = { pn: 35000 };
143
+ conso_aux_gen(
144
+ diVirt,
145
+ { enum_type_generateur_ch_id: '78', ratio_virtualisation: 0.1 },
146
+ 'ch',
147
+ 1000,
148
+ 1200,
149
+ 100
150
+ );
151
+ // pe = 350 kW => Paux = 20 + 1,6 × 350 = 580 W ; conso = 580 × 1000 / 350000
152
+ expect(diVirt.conso_auxiliaire_generation_ch).toBeCloseTo(580 / 350, 10);
153
+ expect(diVirt.conso_auxiliaire_generation_ch_depensier).toBeCloseTo((580 * 1.2) / 350, 10);
154
+ });
155
+
156
+ test('installation virtualisée : identique au calcul non virtualisé du générateur immeuble', () => {
157
+ const diVirt = { pn: 2000 };
158
+ const diImmeuble = { pn: 20000 };
159
+ conso_aux_gen(
160
+ diVirt,
161
+ { enum_type_generateur_ecs_id: '50', ratio_virtualisation: 0.1 },
162
+ 'ecs',
163
+ 800,
164
+ 1000,
165
+ 100
166
+ );
167
+ conso_aux_gen(diImmeuble, { enum_type_generateur_ecs_id: '50' }, 'ecs', 800, 1000, 100);
168
+ expect(diVirt.conso_auxiliaire_generation_ecs).toBeCloseTo(
169
+ diImmeuble.conso_auxiliaire_generation_ecs,
170
+ 10
171
+ );
172
+ expect(diVirt.conso_auxiliaire_generation_ecs_depensier).toBeCloseTo(
173
+ diImmeuble.conso_auxiliaire_generation_ecs_depensier,
174
+ 10
175
+ );
176
+ });
134
177
  });
135
178
 
136
179
  /**
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.16';
36
+ const LIB_VERSION = '1.8.17';
37
37
 
38
38
  const dpeSanitizerService = new DpeSanitizerService();
39
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open3cl/engine",
3
- "version": "1.8.16",
3
+ "version": "1.8.17",
4
4
  "description": "Open Source 3CL-DPE engine",
5
5
  "main": "index.js",
6
6
  "directories": {