-
Dorchies David authorede6676ea0
import { Result } from "../util/result";
import { RectangularStructure } from "./rectangular_structure";
import { RectangularStructureParams } from "./rectangular_structure_params";
import { Structure, StructureFlowMode, StructureFlowRegime } from "./structure";
export { RectangularStructureParams };
/**
* Equation CEM88D : déversoir / orifice (pelle importante) Cemagref 1988
*/
export class StructureCem88d extends RectangularStructure {
/**
* Calcul analytique Q = f(Cd, L, h1, h2, W) CEM88D
* @param sVarCalc Variable à calculer (doit être "Q")
*/
public Equation(sVarCalc: string): Result {
Structure.CheckEquation(sVarCalc);
const data = this.getResultData();
let v: number;
const cd: number = this.prms.Cd.v * this.prms.L.v * Structure.R2G;
const b1: number = Math.sqrt(this.prms.h1.v);
const b2: number = Math.sqrt(this.prms.h1.v - this.prms.h2.v);
const cd1: number = cd * 2.5981; // cd * 3*sqrt(3)/2
this.debug("StructureCem88d.Equation b1=" + b1 + " b2=" + b2 + " cd1=" + cd1);
switch (data.Mode) {
case StructureFlowMode.WEIR:
switch (data.Regime) {
case StructureFlowRegime.FREE:
v = cd * this.prms.h1.v * b1;
break;
case StructureFlowRegime.SUBMERGED:
v = cd1 * this.prms.h2.v * b2;
this.debug("StructureCem88d.Equation WEIR SUBMERGED Q=" + v);
break;
}
break;
case StructureFlowMode.ORIFICE:
const b3: number = Math.pow(this.prms.h1.v - this.prms.W.v, 1.5);
switch (data.Regime) {
case StructureFlowRegime.FREE:
v = cd * (this.prms.h1.v * b1 - b3);
break;
case StructureFlowRegime.PARTIAL:
v = cd1 * b2 * this.prms.h2.v - cd * b3;
break;
case StructureFlowRegime.SUBMERGED:
v = cd1 * b2 * this.prms.W.v;
this.debug("StructureCem88d.Equation ORIFICE SUBMERGED Q=" + v);
break;
}
}
this.debug(
"StructureCem88d.Equation(h1=" + this.prms.h1.v + ",h2="
+ this.prms.h2.v + ",W=" + this.prms.W.v + ") => Q=" + v);
return new Result(v, data);
}
}