Skip to content

Commit

Permalink
fix(feat-119): Fix pertes distribution ecs recup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme GAVIGNET authored and jzck committed Oct 24, 2024
1 parent 17134c8 commit 7a61c7f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/9_besoin_ch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export default function calc_besoin_ch(
const dh19 = tvs.dh19[ilpa];
const Nref21 = tvs.nref21[ilpa];
const Nref19 = tvs.nref19[ilpa];

let sumNref19 = 0;
let sumNref21 = 0;
let QrecDistr = 0;
let QrecDistrDepensier = 0;
const e = tvs.e[ilpa];

let pertes_distribution_ecs_recup = 0;
Expand Down Expand Up @@ -67,13 +72,11 @@ export default function calc_besoin_ch(
// pertes distribution
const becs_j = calc_besoin_ecs_j(ilpa, ca, mois, zc, nadeq, false);
const becs_j_dep = calc_besoin_ecs_j(ilpa, ca, mois, zc, nadeq, true);
const Qrec_distr = instal_ecs.reduce((acc, ecs) => acc + calc_Qdw_j(ecs, becs_j), 0);
const Qrec_distr_dep = instal_ecs.reduce((acc, ecs) => acc + calc_Qdw_j(ecs, becs_j_dep), 0);
pertes_distribution_ecs_recup += (0.48 * nref19 * Qrec_distr) / Njj[mois];
pertes_distribution_ecs_recup_depensier += (0.48 * nref21 * Qrec_distr_dep) / Njj[mois];
/* pertes_distribution_ecs_recup += 0.48 * nref19 * Qrec_distr */
/* pertes_distribution_ecs_recup_depensier += 0.48 * nref21 * Qrec_distr_dep */
/* console.warn(pertes_distribution_ecs_recup) */

sumNref19 += nref19;
sumNref21 += nref21;
QrecDistr += instal_ecs.reduce((acc, ecs) => acc + calc_Qdw_j(ecs, becs_j), 0);
QrecDistrDepensier += instal_ecs.reduce((acc, ecs) => acc + calc_Qdw_j(ecs, becs_j_dep), 0);

// bvj
const dh19j = dh19[ca][mois][zc];
Expand Down Expand Up @@ -101,9 +104,9 @@ export default function calc_besoin_ch(
besoin_ch_depensier += (bvj_dep * dh21j) / 1000;
}

pertes_distribution_ecs_recup /= 24;
pertes_distribution_ecs_recup_depensier /= 24;
/* console.warn(pertes_distribution_ecs_recup) */
pertes_distribution_ecs_recup = (0.48 * sumNref19 * QrecDistr) / 8760;
pertes_distribution_ecs_recup_depensier = (0.48 * sumNref21 * QrecDistrDepensier) / 8760;

const recup =
pertes_distribution_ecs_recup + pertes_stockage_ecs_recup + pertes_generateur_ch_recup;
const recup_depensier =
Expand Down

0 comments on commit 7a61c7f

Please sign in to comment.