Commit 309e197c authored by Dorchies David's avatar Dorchies David
Browse files

fix(prebarrage): calculation error of PV

Fix #277
parent 97d1c720
......@@ -49,19 +49,17 @@ export class PbBassin extends Nub {
}
const r = this.result;
// Ajout du calcul de la puissance dissipée
const prms = this.getParamValuesAfterCalc(sVarCalc, r);
let sumQ = 0; // sum of Q in upstream walls
r.resultElement.values.Z = this.CalcZ().moy;
r.resultElement.values.Q = this.CalcQ();
r.resultElement.values.YMOY = r.resultElement.values.Z - this.prms.ZF.v;
// Puissance dissipée
let energy = 0; // sum of Energy of upstream walls
for (const w of this.cloisonsAmont) {
sumQ += w.prms.Q.v;
energy += w.prms.Q.v * (w.prms.Z1.V - w.prms.Z2.v);
}
const ro: number = 1000; // masse volumique de l'eau en kg/m3
const g: number = 9.81; // accélération de la gravité terrestre en m/s2.
r.resultElement.values.PV = ro * g * sumQ * (this.Z - prms.ZF) / (prms.S);
r.resultElement.values.Z = this.CalcZ().moy;
r.resultElement.values.Q = this.CalcQ();
r.resultElement.values.YMOY = r.resultElement.values.Z - this.prms.ZF.V;
r.resultElement.values.PV = ro * g * energy / r.resultElement.values.YMOY / this.prms.S.v;
return r;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment