Failed to fetch fork details. Try again later.
-
unknown authored9c6d0581
Forked from
HYCAR-Hydro / airGR
Source project has a limited visibility.
import { Result } from "../util/result";
import { RectangularStructure } from "./rectangular_structure";
import { RectangularStructureParams } from "./rectangular_structure_params";
import { Structure, StructureFlowMode, StructureFlowRegime } from "./structure";
import { LoiDebit } from "./structure_props";
export { RectangularStructureParams };
/**
* Equation CEM88D : déversoir / orifice (pelle importante) Cemagref 1988
*/
export class StructureWeirCem88d extends RectangularStructure {
constructor(prms: RectangularStructureParams, dbg: boolean = false) {
super(prms, dbg);
this._loiDebit = LoiDebit.WeirCem88d;
if (prms.W.v !== Infinity) {
this._isZDVcalculable = false;
}
}
/**
* Calcul analytique Q = f(Cd, L, h1, h2, W) CEM88D
* @param sVarCalc Variable à calculer (doit être "Q")
*/
public CalcQ(): Result {
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("StructureWeirCem88d.Equation b1=" + b1 + " b2=" + b2 + " cd1=" + cd1);
switch (data.ENUM_StructureFlowMode) {
case StructureFlowMode.WEIR:
switch (data.ENUM_StructureFlowRegime) {
case StructureFlowRegime.FREE:
v = cd * this.prms.h1.v * b1;
break;
case StructureFlowRegime.SUBMERGED:
v = cd1 * this.prms.h2.v * b2;
this.debug("StructureWeirCem88d.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.ENUM_StructureFlowRegime) {
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("StructureWeirCem88d.Equation ORIFICE SUBMERGED Q=" + v);
break;
}
}
this.debug(
"StructureWeirCem88d.Equation(h1=" + this.prms.h1.v + ",h2="
+ this.prms.h2.v + ",W=" + this.prms.W.v + ") => Q=" + v);
return new Result(v, this, data);
}
}
// tslint:disable-next-line:max-classes-per-file
71727374757677787980
export class StructureGateCem88d extends StructureWeirCem88d {
constructor(prms: RectangularStructureParams, dbg: boolean = false) {
super(prms, dbg);
this._loiDebit = LoiDebit.GateCem88d;
// afficher l'ouverture de vanne
this.prms.W.visible = true;
}
}