@open3cl/engine 1.8.37 → 1.8.38
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/conso.js +34 -8
- package/conso.spec.js +63 -0
- package/engine.js +1 -1
- package/package.json +1 -1
package/conso.js
CHANGED
|
@@ -626,6 +626,28 @@ function getEcsConso(gen_ecs, field, coef, prorataECS, prefix) {
|
|
|
626
626
|
}, 0);
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
+
/**
|
|
630
|
+
* Consommation des auxiliaires de génération ECS (circulateurs des générateurs).
|
|
631
|
+
* Le besoin d'une installation dimensionnée (rdim > 1) est exprimé par unité : comme la
|
|
632
|
+
* consommation ECS (cle_repartition_ecs × rdim), les auxiliaires de génération sont multipliés
|
|
633
|
+
* par le rdim de l'installation lorsque la conso est calculée à l'échelle du DPE (prorataECS = 1).
|
|
634
|
+
* @see Moteur_DPE.dll Calcul_batiment.cs l.660 (Qcirc_ecs1 += Qcirc × Rdim)
|
|
635
|
+
* @param ecs {InstallationEcs[]}
|
|
636
|
+
* @param field {string} conso_auxiliaire_generation_ecs[_depensier]
|
|
637
|
+
* @param coef {object}
|
|
638
|
+
* @param prorataECS {number}
|
|
639
|
+
* @returns {number}
|
|
640
|
+
*/
|
|
641
|
+
export function getAuxGenerationEcs(ecs, field, coef, prorataECS) {
|
|
642
|
+
return ecs.reduce((acc, inst) => {
|
|
643
|
+
const rdim = prorataECS === 1 ? Number(inst.donnee_entree.rdim) || 1 : 1;
|
|
644
|
+
return inst.generateur_ecs_collection.generateur_ecs.reduce((acc2, gen) => {
|
|
645
|
+
const conso = (gen.donnee_intermediaire[field] || 0) * rdim;
|
|
646
|
+
return acc2 + getConso(coef, 'électricité auxiliaire', conso);
|
|
647
|
+
}, acc);
|
|
648
|
+
}, 0);
|
|
649
|
+
}
|
|
650
|
+
|
|
629
651
|
/**
|
|
630
652
|
* Calcul de la consommation globale de chauffage
|
|
631
653
|
* @param gen_ch {Generateur_chauffage_collection}
|
|
@@ -721,15 +743,19 @@ function calc_conso_pond(
|
|
|
721
743
|
prefix
|
|
722
744
|
);
|
|
723
745
|
|
|
724
|
-
ret.auxiliaire_generation_ecs =
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
746
|
+
ret.auxiliaire_generation_ecs = getAuxGenerationEcs(
|
|
747
|
+
ecs_installations,
|
|
748
|
+
'conso_auxiliaire_generation_ecs',
|
|
749
|
+
coef,
|
|
750
|
+
prorataECS
|
|
751
|
+
);
|
|
728
752
|
|
|
729
|
-
ret.auxiliaire_generation_ecs_depensier =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
753
|
+
ret.auxiliaire_generation_ecs_depensier = getAuxGenerationEcs(
|
|
754
|
+
ecs_installations,
|
|
755
|
+
'conso_auxiliaire_generation_ecs_depensier',
|
|
756
|
+
coef,
|
|
757
|
+
prorataECS
|
|
758
|
+
);
|
|
733
759
|
|
|
734
760
|
ret.auxiliaire_distribution_ecs = ecs_installations.reduce((acc, inst) => {
|
|
735
761
|
const conso = inst.donnee_intermediaire.conso_auxiliaire_distribution_ecs || 0;
|
package/conso.spec.js
CHANGED
|
@@ -55,6 +55,7 @@ const {
|
|
|
55
55
|
getCoefCout,
|
|
56
56
|
coefCoutProrata,
|
|
57
57
|
masqueEnergie,
|
|
58
|
+
getAuxGenerationEcs,
|
|
58
59
|
DATE_BAREME_COUT_2024
|
|
59
60
|
} = await import('./conso.js');
|
|
60
61
|
|
|
@@ -734,3 +735,65 @@ describe('coefCoutProrata - ratio de surface des installations collectives', ()
|
|
|
734
735
|
});
|
|
735
736
|
});
|
|
736
737
|
});
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Auxiliaires de génération ECS : multipliés par le rdim de l'installation (comme la conso ECS).
|
|
741
|
+
* @see Moteur_DPE.dll Calcul_batiment.cs l.660 (Qcirc_ecs1 += Qcirc × Rdim) ; autotests IC-echantillon-gaz.
|
|
742
|
+
*/
|
|
743
|
+
describe('getAuxGenerationEcs - auxiliaires de génération ECS et rdim', () => {
|
|
744
|
+
const coefUnitaire = { 'électricité auxiliaire': 1 };
|
|
745
|
+
const inst = (rdim, ...consos) =>
|
|
746
|
+
installEcs(
|
|
747
|
+
rdim === undefined ? {} : { rdim },
|
|
748
|
+
consos.map((c) =>
|
|
749
|
+
genEcs('1', {
|
|
750
|
+
conso_auxiliaire_generation_ecs: c,
|
|
751
|
+
conso_auxiliaire_generation_ecs_depensier: 2 * c
|
|
752
|
+
})
|
|
753
|
+
)
|
|
754
|
+
);
|
|
755
|
+
|
|
756
|
+
test('installation dimensionnée (rdim 3,25) : auxiliaires × rdim à l’échelle du DPE', () => {
|
|
757
|
+
const ecs = [inst(3.25, 2.74, 2.97), inst(undefined, 10)];
|
|
758
|
+
// (2,74 + 2,97) × 3,25 + 10 × 1
|
|
759
|
+
expect(
|
|
760
|
+
getAuxGenerationEcs(ecs, 'conso_auxiliaire_generation_ecs', coefUnitaire, 1)
|
|
761
|
+
).toBeCloseTo((2.74 + 2.97) * 3.25 + 10, 9);
|
|
762
|
+
expect(
|
|
763
|
+
getAuxGenerationEcs(ecs, 'conso_auxiliaire_generation_ecs_depensier', coefUnitaire, 1)
|
|
764
|
+
).toBeCloseTo(2 * ((2.74 + 2.97) * 3.25 + 10), 9);
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
test('appartement proratisé (prorataECS ≠ 1) : rdim non appliqué', () => {
|
|
768
|
+
const ecs = [inst(3.25, 4)];
|
|
769
|
+
expect(getAuxGenerationEcs(ecs, 'conso_auxiliaire_generation_ecs', coefUnitaire, 0.4)).toBe(4);
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
test('rdim non numérique ou générateur sans conso : neutre', () => {
|
|
773
|
+
const ecs = [inst('abc', 4), installEcs({ rdim: 2 }, [genEcs('1', {})])];
|
|
774
|
+
expect(getAuxGenerationEcs(ecs, 'conso_auxiliaire_generation_ecs', coefUnitaire, 1)).toBe(4);
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
test('calc_conso : auxiliaire_generation_ecs intègre le rdim', () => {
|
|
778
|
+
const ecs = [inst(2, 5)];
|
|
779
|
+
const res = calc_conso(100, 1, 1, [], [], ecs, [], 1, 1, DATE_DPE, coef_ep);
|
|
780
|
+
const sansRdim = calc_conso(
|
|
781
|
+
100,
|
|
782
|
+
1,
|
|
783
|
+
1,
|
|
784
|
+
[],
|
|
785
|
+
[],
|
|
786
|
+
[inst(undefined, 5)],
|
|
787
|
+
[],
|
|
788
|
+
1,
|
|
789
|
+
1,
|
|
790
|
+
DATE_DPE,
|
|
791
|
+
coef_ep
|
|
792
|
+
);
|
|
793
|
+
expect(res.ef_conso.conso_auxiliaire_generation_ecs).toBeCloseTo(
|
|
794
|
+
2 * sansRdim.ef_conso.conso_auxiliaire_generation_ecs,
|
|
795
|
+
9
|
|
796
|
+
);
|
|
797
|
+
expect(res.ef_conso.conso_auxiliaire_generation_ecs).toBeGreaterThan(0);
|
|
798
|
+
});
|
|
799
|
+
});
|
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.38';
|
|
37
37
|
|
|
38
38
|
const dpeSanitizerService = new DpeSanitizerService();
|
|
39
39
|
|