@open3cl/engine 1.1.1 → 1.2.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/11_ecs.js CHANGED
@@ -64,16 +64,30 @@ export default function calc_ecs(
64
64
  const di = {};
65
65
  const du = {};
66
66
 
67
+ const multipleEcsInstallation = ecs.donnee_entree.enum_cfg_installation_ecs_id === '3';
68
+ const nbLogements = dpe.logement.caracteristique_generale.nombre_appartement || 1;
69
+
70
+ /**
71
+ * 11.4 Plusieurs systèmes d’ECS (limité à 2 systèmes différents par logement)
72
+ * Les besoins en ECS pour chaque générateur sont / 2
73
+ */
74
+ let becsLogement = becs;
75
+ let becsDepLogement = becs_dep;
76
+ if (multipleEcsInstallation) {
77
+ becsLogement = becs / 2;
78
+ becsDepLogement = becs_dep / 2;
79
+ }
80
+
67
81
  // La conso de chaque générateur ECS doit être ramenée au prorata de la surface du logement
68
82
  di.ratio_besoin_ecs = 1;
69
83
  if (virtualisationECS) {
70
84
  di.ratio_besoin_ecs = de.cle_repartition_ecs || 1;
71
- } else if (de.rdim) {
72
- di.ratio_besoin_ecs = 1 / de.rdim || 1;
85
+ } else if (nbLogements > 1) {
86
+ di.ratio_besoin_ecs = 1 / nbLogements || 1;
73
87
  }
74
88
 
75
- di.besoin_ecs = becs * di.ratio_besoin_ecs;
76
- di.besoin_ecs_depensier = becs_dep * di.ratio_besoin_ecs;
89
+ di.besoin_ecs = becsLogement * di.ratio_besoin_ecs;
90
+ di.besoin_ecs_depensier = becsDepLogement * di.ratio_besoin_ecs;
77
91
 
78
92
  const pvc = ecs.generateur_ecs_collection.generateur_ecs[0].donnee_entree.position_volume_chauffe;
79
93
  tv_rendement_distribution_ecs(di, de, du, pvc);
package/conso.js CHANGED
@@ -295,7 +295,7 @@ export default function calc_conso(
295
295
  return ret;
296
296
  }
297
297
 
298
- function classe_bilan_dpe(ep_conso_5_usages_m2, zc_id, ca_id, Sh) {
298
+ export function classe_bilan_dpe(ep_conso_5_usages_m2, zc_id, ca_id, Sh) {
299
299
  const ca = enums.classe_altitude[ca_id];
300
300
 
301
301
  const cut = tvs.dpe_class_limit[ca][Math.round(Sh)] ?? [];
@@ -318,7 +318,7 @@ function classe_bilan_dpe(ep_conso_5_usages_m2, zc_id, ca_id, Sh) {
318
318
  return 'G';
319
319
  }
320
320
 
321
- function classe_emission_ges(emission_ges_5_usages_m2, zc_id, ca_id, Sh) {
321
+ export function classe_emission_ges(emission_ges_5_usages_m2, zc_id, ca_id, Sh) {
322
322
  const ca = enums.classe_altitude[ca_id];
323
323
 
324
324
  const cut = tvs.ges_class_limit[ca][Math.round(Sh)] ?? [];
package/engine.js CHANGED
@@ -7,7 +7,7 @@ import calc_besoin_ch from './9_besoin_ch.js';
7
7
  import calc_chauffage, { tauxChargeForGenerator } from './9_chauffage.js';
8
8
  import calc_confort_ete from './2021_04_13_confort_ete.js';
9
9
  import calc_qualite_isolation from './2021_04_13_qualite_isolation.js';
10
- import calc_conso from './conso.js';
10
+ import calc_conso, { classe_bilan_dpe, classe_emission_ges } from './conso.js';
11
11
  import {
12
12
  add_references,
13
13
  bug_for_bug_compat,
@@ -269,15 +269,6 @@ export function calcul_3cl(dpe) {
269
269
  let becs = apport_et_besoin.besoin_ecs;
270
270
  let becs_dep = apport_et_besoin.besoin_ecs_depensier;
271
271
 
272
- /**
273
- * 11.4 Plusieurs systèmes d’ECS (limité à 2 systèmes différents par logement)
274
- * Les besoins en ECS pour chaque générateur sont / 2
275
- */
276
- if (ecs.length > 1) {
277
- becs /= 2;
278
- becs_dep /= 2;
279
- }
280
-
281
272
  ecs.forEach((ecs) => {
282
273
  if (bug_for_bug_compat) {
283
274
  /**
@@ -501,3 +492,29 @@ export function calcul_3cl(dpe) {
501
492
 
502
493
  return dpe;
503
494
  }
495
+
496
+ /**
497
+ * Retourne les classes calculées ges dpe.
498
+ * @param dpe {FullDpe}
499
+ * @returns {{dpeClass: string, gesClass: string}}
500
+ */
501
+ export function get_classe_ges_dpe(dpe) {
502
+ const zc_id = dpe.logement.meteo.enum_zone_climatique_id;
503
+ const ca_id = dpe.logement.meteo.enum_classe_altitude_id;
504
+ const th = calc_th(dpe.logement.caracteristique_generale.enum_methode_application_dpe_log_id);
505
+
506
+ let Sh;
507
+ if (th === 'maison' || th === 'appartement')
508
+ Sh = dpe.logement.caracteristique_generale.surface_habitable_logement;
509
+ else if (th === 'immeuble') Sh = dpe.logement.caracteristique_generale.surface_habitable_immeuble;
510
+
511
+ return {
512
+ dpeClass: classe_bilan_dpe(dpe.logement.sortie.ep_conso.ep_conso_5_usages_m2, zc_id, ca_id, Sh),
513
+ gesClass: classe_emission_ges(
514
+ dpe.logement.sortie.emission_ges.emission_ges_5_usages_m2,
515
+ zc_id,
516
+ ca_id,
517
+ Sh
518
+ )
519
+ };
520
+ }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { calcul_3cl } from './engine.js';
2
- export { calcul_3cl };
1
+ import { calcul_3cl, get_classe_ges_dpe } from './engine.js';
2
+ export { calcul_3cl, get_classe_ges_dpe };
3
3
  import { Umur, Uph, Upb, Uporte, Ubv, Upt } from './3_deperdition.js';
4
4
  export { Umur, Uph, Upb, Uporte, Ubv, Upt };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open3cl/engine",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Open Source 3CL-DPE engine",
5
5
  "main": "index.js",
6
6
  "directories": {