Commit 1e967814 authored by Dorchies David's avatar Dorchies David
Browse files

feat: update vmax formula

Refs #295
parent 4106587f
......@@ -36,11 +36,11 @@ function macrorugo_resultComp(z_amont, S, long, Q, L, pf, C, Cd0, h, D)
V_technique=4.54*(pf/D)^0.32*S^0.56*(9.81*D)^0.5;
end
if Cd0 > 1.99
coeff_contraction=1.5;
rv=1.5;
else
coeff_contraction=1.2;
rv=1.2;
end
Vmax=max(Vg, Vg.*coeff_contraction*sqrt(calcfFr(Fr, 1)));
Vmax=Vg.*sqrt(calcfFr(Fr, rv));
print_r("Vmax");
print_r("V_technique");
end
......
......@@ -23,7 +23,7 @@ Vg: 1.559326,
Fr: 0.787177,
PV: 489.078970,
flowcond: emergent,
Vmax: 2.194842,
Vmax: 1.829035,
V_technique: 1.748990,
q_technique: 0.312101,
Strickler: 8.213879,
......@@ -54,7 +54,7 @@ const macroRugoExtraResultEmergentCd1: { [key: string]: number | MacroRugoFlowTy
Vg: 1.559326,
Fr: 0.787177,
PV: 489.078970,
Vmax: 2.194842,
Vmax: 1.829035,
Strickler: 8.213879
};
......@@ -78,7 +78,7 @@ Vg: 1.008811,
Fr: 0.509267,
PV: 316.411237,
flowcond: emergent,
Vmax: 1.618133,
Vmax: 1.581902,
V_technique: 1.748990,
q_technique: 0.312101,
Strickler: 5.313996
......@@ -98,7 +98,7 @@ const macroRugoExtraResultEmergentCd2: { [key: string]: number | MacroRugoFlowTy
Vg: 1.008811,
Fr: 0.509267,
PV: 316.411237,
Vmax: 1.618133,
Vmax: 1.581902,
Strickler: 5.313996
};
......
......@@ -901,7 +901,7 @@ describe("vérificateur de franchissement −", () => {
// vérificateur
const v = new Verificateur();
v.nubToVerify = mr;
v.speciesList.push(FishSpecies[FishSpecies.SPECIES_3a]); // 2.533 > 2.50
v.speciesList.push(FishSpecies[FishSpecies.SPECIES_8a]); // > 1.50
// résultat
const res = v.CalcSerie();
expect(res.ok).toBe(false);
......
......@@ -135,10 +135,7 @@ export class MacroRugo extends FishPass {
}
r.resultElement.values.Fr = resFr;
// Vitesse maximale
r.resultElement.values.Vmax = Math.max(
this.rV * r.resultElement.values.Vg * Math.sqrt(this.CalcfFr(resVdeb, 1)),
r.resultElement.values.Vg
);
r.resultElement.values.Vmax = r.resultElement.values.Vg * Math.sqrt(this.CalcfFr(resVdeb, this.rV));
}
// Puissance dissipée
r.resultElement.values.PV = 1000 * MacroRugo.g * r.resultElement.values.Vdeb * this.prms.If.v;
......@@ -446,7 +443,7 @@ export class MacroRugo extends FishPass {
const alpha = 1 - Math.pow(1 * this.prms.C.v, 0.5) - 0.5 * this.sigma * this.prms.C.v;
// tslint:disable-next-line: variable-name
const Cd = this.Cd * this.CalcfFr(U0);
const Cd = this.Cd * this.CalcfFr(U0, this.rQ);
const N = (alpha * this.calcCf(this.prms.Y.v)) /
(this.prms.Y.v / this.prms.PBD.v * Cd * this.prms.C.v);
......@@ -484,7 +481,7 @@ export class MacroRugo extends FishPass {
*/
private get fFr(): number {
if (this._cache.fFr === undefined) {
this._cache.fFr = this.CalcfFr(this.U0);
this._cache.fFr = this.CalcfFr(this.U0, this.rQ);
}
return this._cache.fFr;
}
......@@ -492,17 +489,12 @@ export class MacroRugo extends FishPass {
/**
* Calculation of Froude correction function (Cassan et al. 2014, Eq. 19)
*/
private CalcfFr(U0: number, rQ: number = this.rQ): number {
private CalcfFr(U0: number, r: number): number {
// tslint:disable-next-line:variable-name
const Fr = U0 /
(1 - Math.sqrt(MacroRugo.fracAxAy * this.prms.C.v)) /
Math.sqrt(MacroRugo.g * this.prms.Y.v);
if (Fr < 1) {
return Math.pow(Math.min(rQ / (1 - Math.pow(Fr, 2) / 4), Math.pow(Fr, -2 / 3)), 2);
} else {
return 1;
}
return Math.max(1, Math.pow(Math.min(r / (1 - Math.pow(Fr, 2) / 4), Math.pow(Fr, -2 / 3)), 2));
}
}
......
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