@open3cl/engine 1.0.11 → 1.0.13
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/features/dpe/domain/models/dpe.model.ts +9 -0
- package/features/dpe/domain/models/installation-chauffage.model.ts +2 -2
- package/features/dpe/domain/models/installation-ecs.model.ts +15 -2
- package/features/dpe/domain/models/type-habitation.model.js +1 -0
- package/features/dpe/domain/models/type-stockage.model.js +8 -0
- package/features/dpe/infrastructure/ecs/ecsTv.store.js +43 -0
- package/features/dpe/infrastructure/ecs/ecsTv.store.spec.js +36 -0
- package/features/dpe/infrastructure/froid/frTv.store.js +4 -2
- package/features/engine/domain/apport_et_besoin/apport-et-besoin.service.js +69 -3
- package/features/engine/domain/apport_et_besoin/apport-et-besoin.service.spec.js +123 -1
- package/features/engine/domain/apport_et_besoin/apport_gratuit/apport-gratuit.service.js +18 -2
- package/features/engine/domain/apport_et_besoin/apport_gratuit/apport-gratuit.service.spec.js +13 -2
- package/features/engine/domain/apport_et_besoin/ch/besoin-ch.service.js +150 -0
- package/features/engine/domain/apport_et_besoin/ch/besoin-ch.service.spec.js +145 -0
- package/features/engine/domain/apport_et_besoin/ch/perte-ch-recup.service.js +168 -0
- package/features/engine/domain/apport_et_besoin/ch/perte-ch-recup.service.spec.js +313 -0
- package/features/engine/domain/apport_et_besoin/ecs/perte-ecs-recup.service.js +127 -0
- package/features/engine/domain/apport_et_besoin/ecs/perte-ecs-recup.service.spec.js +220 -0
- package/features/engine/domain/contexte.builder.js +5 -1
- package/features/engine/domain/ecs/generateur-ecs.service.js +106 -0
- package/features/engine/domain/ecs/generateur-ecs.service.spec.js +136 -0
- package/features/engine/domain/ecs/installation-ecs.service.js +156 -0
- package/features/engine/domain/ecs/installation-ecs.service.spec.js +284 -0
- package/features/engine/domain/engine.service.js +13 -2
- package/package.json +1 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { mois_liste } from '../../../../../utils.js';
|
|
2
|
+
import { inject } from 'dioma';
|
|
3
|
+
import { FrTvStore } from '../../../../dpe/infrastructure/froid/frTv.store.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Calcul du besoin en chauffage
|
|
7
|
+
* Chapitre 2 - Expression du besoin de chauffage
|
|
8
|
+
*
|
|
9
|
+
* Methode_de_calcul_3CL_DPE_2021 - Page 7
|
|
10
|
+
* Octobre 2021
|
|
11
|
+
* @see consolide_anne…arrete_du_31_03_2021_relatif_aux_methodes_et_procedures_applicables.pdf
|
|
12
|
+
*/
|
|
13
|
+
export class BesoinChService {
|
|
14
|
+
/**
|
|
15
|
+
* @type {FrTvStore}
|
|
16
|
+
*/
|
|
17
|
+
#tvStore;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param tvStore {FrTvStore}
|
|
21
|
+
*/
|
|
22
|
+
constructor(tvStore = inject(FrTvStore)) {
|
|
23
|
+
this.#tvStore = tvStore;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Besoin de chauffage hors pertes récupérées
|
|
28
|
+
* 9.1.1 - Consommation de chauffage
|
|
29
|
+
*
|
|
30
|
+
* @param ctx {Contexte}
|
|
31
|
+
* @param logement {Logement}
|
|
32
|
+
* @return {{besoin_ch_hp: number, besoin_ch_depensier_hp: number, fraction_apport_gratuit_ch: number, fraction_apport_gratuit_depensier_ch: number}}
|
|
33
|
+
*/
|
|
34
|
+
execute(ctx, logement) {
|
|
35
|
+
const besoinCh = mois_liste.reduce(
|
|
36
|
+
(acc, mois) => {
|
|
37
|
+
const dh19 = this.#tvStore.getData(
|
|
38
|
+
'dh19',
|
|
39
|
+
ctx.altitude.value,
|
|
40
|
+
ctx.zoneClimatique.value,
|
|
41
|
+
mois,
|
|
42
|
+
ctx.inertie.ilpa
|
|
43
|
+
);
|
|
44
|
+
const dh21 = this.#tvStore.getData(
|
|
45
|
+
'dh21',
|
|
46
|
+
ctx.altitude.value,
|
|
47
|
+
ctx.zoneClimatique.value,
|
|
48
|
+
mois,
|
|
49
|
+
ctx.inertie.ilpa
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const besoinCh = this.besoinChHorsPertesRecuperees(ctx, logement, mois, dh19);
|
|
53
|
+
acc.besoin_ch_hp += besoinCh.besoinChMoisHP;
|
|
54
|
+
acc.fraction_apport_gratuit_ch += besoinCh.fractionApportGratuitMois;
|
|
55
|
+
logement.donnees_de_calcul.besoinChauffageHP[mois] = besoinCh.besoinChMoisHP;
|
|
56
|
+
|
|
57
|
+
const besoinChDepensier = this.besoinChHorsPertesRecuperees(ctx, logement, mois, dh21);
|
|
58
|
+
acc.besoin_ch_depensier_hp += besoinChDepensier.besoinChMoisHP;
|
|
59
|
+
acc.fraction_apport_gratuit_depensier_ch += besoinChDepensier.fractionApportGratuitMois;
|
|
60
|
+
logement.donnees_de_calcul.besoinChauffageDepensierHP[mois] =
|
|
61
|
+
besoinChDepensier.besoinChMoisHP;
|
|
62
|
+
|
|
63
|
+
acc.dh19 += dh19;
|
|
64
|
+
acc.dh21 += dh21;
|
|
65
|
+
return acc;
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
besoin_ch_hp: 0,
|
|
69
|
+
besoin_ch_depensier_hp: 0,
|
|
70
|
+
fraction_apport_gratuit_ch: 0,
|
|
71
|
+
fraction_apport_gratuit_depensier_ch: 0,
|
|
72
|
+
dh19: 0,
|
|
73
|
+
dh21: 0
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
besoinCh.fraction_apport_gratuit_ch /= besoinCh.dh19;
|
|
78
|
+
besoinCh.fraction_apport_gratuit_depensier_ch /= besoinCh.dh21;
|
|
79
|
+
|
|
80
|
+
delete besoinCh.dh19;
|
|
81
|
+
delete besoinCh.dh19;
|
|
82
|
+
|
|
83
|
+
return besoinCh;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Fraction des besoins de chauffage couverts par les apports gratuits pour un mois donné
|
|
88
|
+
* 6.1 Calcul de F
|
|
89
|
+
*
|
|
90
|
+
* @param ctx {Contexte}
|
|
91
|
+
* @param logement {Logement}
|
|
92
|
+
* @param mois {string}
|
|
93
|
+
* @param dh {number} - degrés-heures de chauffage sur le mois j (°Ch)
|
|
94
|
+
* @returns {number}
|
|
95
|
+
*/
|
|
96
|
+
fractionBesoinCh(ctx, logement, mois, dh) {
|
|
97
|
+
// Apports internes dans le logement sur le mois
|
|
98
|
+
const Ai = logement.donnees_de_calcul.apportsInterneCh[mois];
|
|
99
|
+
// Apports solaires dans le logement sur le mois durant la période de chauffe
|
|
100
|
+
const As = logement.donnees_de_calcul.apportsSolaire[mois];
|
|
101
|
+
|
|
102
|
+
if (dh === 0) return 0;
|
|
103
|
+
|
|
104
|
+
let pow;
|
|
105
|
+
switch (ctx.inertie.id) {
|
|
106
|
+
// Inertie très lourde ou lourde
|
|
107
|
+
case 1:
|
|
108
|
+
case 2:
|
|
109
|
+
pow = 3.6;
|
|
110
|
+
break;
|
|
111
|
+
// Inertie moyenne
|
|
112
|
+
case 3:
|
|
113
|
+
pow = 2.9;
|
|
114
|
+
break;
|
|
115
|
+
// Inertie légère
|
|
116
|
+
case 4:
|
|
117
|
+
pow = 2.5;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const Xj = (As + Ai) / (logement.sortie.deperdition.deperdition_enveloppe * dh);
|
|
122
|
+
return (Xj - Xj ** pow) / (1 - Xj ** pow);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Besoin de chauffage hors pertes récupérées sur le mois (kWh) :
|
|
127
|
+
* 9.1.1 - Consommation de chauffage
|
|
128
|
+
*
|
|
129
|
+
* Fraction des besoins de chauffage couverts par les apports gratuits sur le mois
|
|
130
|
+
* 6.1 - Calcul de F
|
|
131
|
+
*
|
|
132
|
+
* @param ctx {Contexte}
|
|
133
|
+
* @param logement {Logement}
|
|
134
|
+
* @param mois {string}
|
|
135
|
+
* @param dh {number} - degrés-heures de chauffage sur le mois j (°Ch)
|
|
136
|
+
* @returns {{besoinChMoisHP: number, fractionApportGratuitMois: number}}
|
|
137
|
+
*/
|
|
138
|
+
besoinChHorsPertesRecuperees(ctx, logement, mois, dh) {
|
|
139
|
+
// Fraction des besoins de chauffage couverts par les apports gratuits pour un mois donné
|
|
140
|
+
const F = this.fractionBesoinCh(ctx, logement, mois, dh);
|
|
141
|
+
|
|
142
|
+
// Besoin de chauffage d’un logement par kelvin sur le mois j (W/K)
|
|
143
|
+
const BV = logement.sortie.deperdition.deperdition_enveloppe * (1 - F);
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
besoinChMoisHP: (BV * dh) / 1000,
|
|
147
|
+
fractionApportGratuitMois: F * dh
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
|
+
import { FrTvStore } from '../../../../dpe/infrastructure/froid/frTv.store.js';
|
|
3
|
+
import { BesoinChService } from './besoin-ch.service.js';
|
|
4
|
+
import { mois_liste } from '../../../../../utils.js';
|
|
5
|
+
|
|
6
|
+
/** @type {BesoinChService} **/
|
|
7
|
+
let service;
|
|
8
|
+
|
|
9
|
+
/** @type {FrTvStore} **/
|
|
10
|
+
let tvStore;
|
|
11
|
+
|
|
12
|
+
describe('Calcul des besoins en chauffage du logement', () => {
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
tvStore = new FrTvStore();
|
|
15
|
+
service = new BesoinChService(tvStore);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test.each([
|
|
19
|
+
{
|
|
20
|
+
inertie: 1,
|
|
21
|
+
expected: 0.24
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
inertie: 2,
|
|
25
|
+
expected: 0.24
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
inertie: 3,
|
|
29
|
+
expected: 0.23
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
inertie: 4,
|
|
33
|
+
expected: 0.22
|
|
34
|
+
}
|
|
35
|
+
])(
|
|
36
|
+
'Determination de la fraction des besoins de chauffage couverts par les apports gratuits pour un mois donné avec inertie = $inertie',
|
|
37
|
+
({ inertie, expected }) => {
|
|
38
|
+
/** @type {Contexte} */
|
|
39
|
+
const ctx = { inertie: { id: inertie } };
|
|
40
|
+
|
|
41
|
+
/** @type { Logement } **/
|
|
42
|
+
const logement = {
|
|
43
|
+
donnees_de_calcul: {
|
|
44
|
+
apportsInterneCh: { Janvier: 102.5 },
|
|
45
|
+
apportsSolaire: { Janvier: 12.5 }
|
|
46
|
+
},
|
|
47
|
+
sortie: { deperdition: { deperdition_enveloppe: 25.9 } }
|
|
48
|
+
};
|
|
49
|
+
expect(service.fractionBesoinCh(ctx, logement, 'Janvier', 18)).toBeCloseTo(expected, 2);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
test('Besoin de chauffage hors pertes récupérées et fraction des apports gratuits pour un mois', () => {
|
|
54
|
+
/** @type {Contexte} */
|
|
55
|
+
const ctx = { inertie: { id: 1 } };
|
|
56
|
+
|
|
57
|
+
/** @type { Logement } **/
|
|
58
|
+
const logement = {
|
|
59
|
+
donnees_de_calcul: {
|
|
60
|
+
apportsInterneCh: { Janvier: 102.5 },
|
|
61
|
+
apportsSolaire: { Janvier: 12.5 }
|
|
62
|
+
},
|
|
63
|
+
sortie: { deperdition: { deperdition_enveloppe: 25.9 } }
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const besoinHP = service.besoinChHorsPertesRecuperees(ctx, logement, 'Janvier', 12.5);
|
|
67
|
+
expect(besoinHP.besoinChMoisHP).toBeCloseTo(0.2139, 4);
|
|
68
|
+
expect(besoinHP.fractionApportGratuitMois).toBeCloseTo(4.2412, 4);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('Besoin total de chauffage hors pertes récupérées et fraction des apports gratuits', () => {
|
|
72
|
+
vi.spyOn(tvStore, 'getData').mockReturnValue(10);
|
|
73
|
+
|
|
74
|
+
/** @type {Contexte} */
|
|
75
|
+
const ctx = {
|
|
76
|
+
inertie: { id: 1, ilpa: 1 },
|
|
77
|
+
altitude: { value: '400-800m' },
|
|
78
|
+
zoneClimatique: { value: 'h3c' }
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @type { Logement } **/
|
|
82
|
+
const logement = {
|
|
83
|
+
donnees_de_calcul: {
|
|
84
|
+
apportsInterneCh: {
|
|
85
|
+
Janvier: 102.5,
|
|
86
|
+
Février: 102.5,
|
|
87
|
+
Mars: 102.5,
|
|
88
|
+
Avril: 102.5,
|
|
89
|
+
Mai: 102.5,
|
|
90
|
+
Juin: 102.5,
|
|
91
|
+
Juillet: 102.5,
|
|
92
|
+
Aout: 102.5,
|
|
93
|
+
Septembre: 102.5,
|
|
94
|
+
Octobre: 102.5,
|
|
95
|
+
Novembre: 102.5,
|
|
96
|
+
Décembre: 102.5
|
|
97
|
+
},
|
|
98
|
+
apportsSolaire: {
|
|
99
|
+
Janvier: 102.5,
|
|
100
|
+
Février: 102.5,
|
|
101
|
+
Mars: 102.5,
|
|
102
|
+
Avril: 102.5,
|
|
103
|
+
Mai: 102.5,
|
|
104
|
+
Juin: 102.5,
|
|
105
|
+
Juillet: 102.5,
|
|
106
|
+
Aout: 102.5,
|
|
107
|
+
Septembre: 102.5,
|
|
108
|
+
Octobre: 102.5,
|
|
109
|
+
Novembre: 102.5,
|
|
110
|
+
Décembre: 102.5
|
|
111
|
+
},
|
|
112
|
+
besoinChauffageHP: {},
|
|
113
|
+
besoinChauffageDepensierHP: {}
|
|
114
|
+
},
|
|
115
|
+
sortie: { deperdition: { deperdition_enveloppe: 25.9 } }
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const besoinTotalHP = service.execute(ctx, logement);
|
|
119
|
+
expect(besoinTotalHP.besoin_ch_hp).toBeCloseTo(1.1388, 4);
|
|
120
|
+
expect(besoinTotalHP.besoin_ch_depensier_hp).toBeCloseTo(1.1388, 4);
|
|
121
|
+
expect(besoinTotalHP.fraction_apport_gratuit_ch).toBeCloseTo(0.6336, 4);
|
|
122
|
+
expect(besoinTotalHP.fraction_apport_gratuit_depensier_ch).toBeCloseTo(0.6336, 4);
|
|
123
|
+
|
|
124
|
+
for (const mois of mois_liste) {
|
|
125
|
+
expect(tvStore.getData).toHaveBeenCalledWith(
|
|
126
|
+
'dh19',
|
|
127
|
+
ctx.altitude.value,
|
|
128
|
+
ctx.zoneClimatique.value,
|
|
129
|
+
mois,
|
|
130
|
+
ctx.inertie.ilpa
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
expect(tvStore.getData).toHaveBeenCalledWith(
|
|
134
|
+
'dh21',
|
|
135
|
+
ctx.altitude.value,
|
|
136
|
+
ctx.zoneClimatique.value,
|
|
137
|
+
mois,
|
|
138
|
+
ctx.inertie.ilpa
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
expect(logement.donnees_de_calcul.besoinChauffageHP[mois]).toBeCloseTo(0.0949, 4);
|
|
142
|
+
expect(logement.donnees_de_calcul.besoinChauffageDepensierHP[mois]).toBeCloseTo(0.0949, 4);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { mois_liste } from '../../../../../utils.js';
|
|
2
|
+
import { inject } from 'dioma';
|
|
3
|
+
import { FrTvStore } from '../../../../dpe/infrastructure/froid/frTv.store.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Calcul des pertes récupérées de génération de chauffage
|
|
7
|
+
* Chapitre 9.1.1 Consommation de chauffage
|
|
8
|
+
*
|
|
9
|
+
* Données calculées
|
|
10
|
+
* — pertes_generateur_ch_recup : pertes récupérées de génération pour le chauffage (kWh)
|
|
11
|
+
* — pertes_generateur_ch_recup_depensier : pertes récupérées de génération pour le chauffage (kWh) pour le scénario dépensier
|
|
12
|
+
*
|
|
13
|
+
* Methode_de_calcul_3CL_DPE_2021 - Page 57
|
|
14
|
+
* Octobre 2021
|
|
15
|
+
* @see consolide_anne…arrete_du_31_03_2021_relatif_aux_methodes_et_procedures_applicables.pdf
|
|
16
|
+
*/
|
|
17
|
+
export class PerteChRecupService {
|
|
18
|
+
/**
|
|
19
|
+
* @type {FrTvStore}
|
|
20
|
+
*/
|
|
21
|
+
#tvStore;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param tvStore {FrTvStore}
|
|
25
|
+
*/
|
|
26
|
+
constructor(tvStore = inject(FrTvStore)) {
|
|
27
|
+
this.#tvStore = tvStore;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Pertes récupérées des générateurs de chauffage pour le chauffage (kWh)
|
|
32
|
+
*
|
|
33
|
+
* @param ctx {Contexte}
|
|
34
|
+
* @param logement {Logement}
|
|
35
|
+
* @return {{pertes_generateur_ch_recup: number, pertes_generateur_ch_recup_depensier: number}}
|
|
36
|
+
*/
|
|
37
|
+
execute(ctx, logement) {
|
|
38
|
+
return {
|
|
39
|
+
pertes_generateur_ch_recup: this.pertesGenerateurChRecup(ctx, logement, false) / 1000,
|
|
40
|
+
pertes_generateur_ch_recup_depensier: this.pertesGenerateurChRecup(ctx, logement, true) / 1000
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Pertes récupérées des générateurs de chauffage pour le chauffage (Wh)
|
|
46
|
+
* 9.1.1 Consommation de chauffage
|
|
47
|
+
*
|
|
48
|
+
* @param ctx {Contexte}
|
|
49
|
+
* @param logement {Logement}
|
|
50
|
+
* @param depensier {boolean}
|
|
51
|
+
* @returns {number}
|
|
52
|
+
*/
|
|
53
|
+
pertesGenerateurChRecup(ctx, logement, depensier) {
|
|
54
|
+
const generateursWithPertesGeneration = this.generateursWithPertesGeneration(logement);
|
|
55
|
+
|
|
56
|
+
return mois_liste.reduce((acc, mois) => {
|
|
57
|
+
return (
|
|
58
|
+
acc +
|
|
59
|
+
this.Qrec(
|
|
60
|
+
generateursWithPertesGeneration,
|
|
61
|
+
this.#tvStore.getData(
|
|
62
|
+
depensier ? 'nref21' : 'nref19',
|
|
63
|
+
ctx.altitude.value,
|
|
64
|
+
ctx.zoneClimatique.value,
|
|
65
|
+
mois,
|
|
66
|
+
ctx.inertie.ilpa
|
|
67
|
+
),
|
|
68
|
+
depensier
|
|
69
|
+
? logement.donnees_de_calcul.besoinChauffageDepensierHP[mois]
|
|
70
|
+
: logement.donnees_de_calcul.besoinChauffageHP[mois]
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
}, 0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Pertes récupérées des générateurs de chauffage pour le chauffage
|
|
78
|
+
* 9.1.1 Consommation de chauffage
|
|
79
|
+
*
|
|
80
|
+
* Seules les pertes des générateurs en volume chauffé sont récupérables.
|
|
81
|
+
* Les pertes récupérées des générateurs d’air chaud sont nulles.
|
|
82
|
+
*
|
|
83
|
+
* @param logement {Logement}
|
|
84
|
+
*/
|
|
85
|
+
generateursWithPertesGeneration(logement) {
|
|
86
|
+
const installationsCh =
|
|
87
|
+
logement.installation_chauffage_collection?.installation_chauffage || [];
|
|
88
|
+
|
|
89
|
+
return installationsCh.reduce((acc, installation) => {
|
|
90
|
+
// Liste des générateurs de chauffage pour lesquels il y a une récupération d'énergie
|
|
91
|
+
return acc.concat(
|
|
92
|
+
(installation.generateur_chauffage_collection?.generateur_chauffage || []).filter(
|
|
93
|
+
(generateurChauffage) => {
|
|
94
|
+
const generateurChauffageDE = generateurChauffage.donnee_entree;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 50 - générateur à air chaud à combustion avant 2006
|
|
98
|
+
* 51 - générateur à air chaud à combustion standard a partir de 2006
|
|
99
|
+
* 52 - générateur à air chaud à combustion à condensation a partir de 2006
|
|
100
|
+
*/
|
|
101
|
+
return (
|
|
102
|
+
(generateurChauffageDE.position_volume_chauffe ?? 0) === 1 &&
|
|
103
|
+
![50, 51, 52].includes(parseInt(generateurChauffageDE.enum_type_generateur_ch_id))
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
}, []);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Pertes récupérées de génération pour le chauffage sur le mois j (Wh)
|
|
113
|
+
*
|
|
114
|
+
* @param generateurs {GenerateurChauffage[]}
|
|
115
|
+
* @param nref {number}
|
|
116
|
+
* @param besoinChauffageMois {number}
|
|
117
|
+
* @constructor
|
|
118
|
+
*/
|
|
119
|
+
Qrec(generateurs, nref, besoinChauffageMois) {
|
|
120
|
+
return generateurs.reduce((acc, generateur) => {
|
|
121
|
+
const generateurChauffageDE = generateur.donnee_entree;
|
|
122
|
+
const generateurChauffageDI = generateur.donnee_intermediaire;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Part des pertes par les parois égale à 0,75 pour les équipements à ventouse ou assistés par ventilateur
|
|
126
|
+
* et 0,5 pour les autres
|
|
127
|
+
* @type {number}
|
|
128
|
+
*/
|
|
129
|
+
const Cper = parseInt(generateurChauffageDE.presence_ventouse || 0) === 1 ? 0.75 : 0.5;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Durée pendant laquelle les pertes sont récupérées sur le mois (h)
|
|
133
|
+
*/
|
|
134
|
+
let Dperj;
|
|
135
|
+
switch (parseInt(generateurChauffageDE.enum_usage_generateur_id)) {
|
|
136
|
+
case 1:
|
|
137
|
+
// Pour les générateurs assurant le chauffage uniquement
|
|
138
|
+
Dperj = Math.min(
|
|
139
|
+
nref,
|
|
140
|
+
this.#pertes_gen_ch(besoinChauffageMois, generateurChauffageDI.pn)
|
|
141
|
+
);
|
|
142
|
+
break;
|
|
143
|
+
case 2:
|
|
144
|
+
// Pour les générateurs assurant l’ECS uniquement
|
|
145
|
+
Dperj = this.#pertes_gen_ecs(nref);
|
|
146
|
+
break;
|
|
147
|
+
case 3:
|
|
148
|
+
// Pour les générateurs assurant le chauffage et l’ECS
|
|
149
|
+
Dperj = Math.min(
|
|
150
|
+
nref,
|
|
151
|
+
this.#pertes_gen_ch(besoinChauffageMois, generateurChauffageDI.pn) +
|
|
152
|
+
this.#pertes_gen_ecs(nref)
|
|
153
|
+
);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return acc + 0.48 * Cper * generateurChauffageDI.qp0 * Dperj || 0;
|
|
158
|
+
}, 0);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
#pertes_gen_ch(Bch, pn) {
|
|
162
|
+
return (1.3 * Bch * 1000) / (0.3 * pn);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
#pertes_gen_ecs(nref) {
|
|
166
|
+
return (nref * 1790) / 8760;
|
|
167
|
+
}
|
|
168
|
+
}
|