structure_cem88v.ts 5.32 KiB
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 CEM88V : déversoir / vanne de fond (pelle faible) Cemagref 1988
export class StructureCem88v extends RectangularStructure {
    /**
     * Calcul analytique Q = f(Cd, L, h1, h2, W) CEM88V
     * @param sVarCalc Variable à calculer (doit être "Q")
    public Equation(sVarCalc: string): Result {
        Structure.CheckEquation(sVarCalc);
        const data = this.getResultData();
        let v: number;
        const mu0: number = 2 / 3 * this.prms.Cd.v;
        let KF: number;
        if (data.Regime !== StructureFlowRegime.FREE) {
            KF = this.getKF(Math.sqrt(1 - this.prms.h2.v / this.prms.h1.v), this.getAlfa(this.prms.h2.v));
        switch (data.Mode) {
            case StructureFlowMode.WEIR:
                const muf: number = mu0 - 0.08;
                switch (data.Regime) {
                    case StructureFlowRegime.FREE:
                        v = muf * this.prms.L.v * Structure.R2G * Math.pow(this.prms.h1.v, 1.5);
                        break;
                    case StructureFlowRegime.SUBMERGED:
                        // console.log("KF="+KF+" muf="+muf);
                        v = KF * muf * this.prms.L.v * Structure.R2G * Math.pow(this.prms.h1.v, 1.5);
                        break;
                break;
            case StructureFlowMode.ORIFICE:
                const mu: number = mu0 - 0.08 / (this.prms.h1.v / this.prms.W.v);
                const mu1: number = mu0 - 0.08 / (this.prms.h1.v / this.prms.W.v - 1);
                if (data.Regime === StructureFlowRegime.FREE) {
                    v = this.prms.L.v * Structure.R2G
                        * (mu * Math.pow(this.prms.h1.v, 1.5)
                            - mu1 * Math.pow(this.prms.h1.v - this.prms.W.v, 1.5));
                } else {
                    if (data.Regime === StructureFlowRegime.PARTIAL) {
                        v = this.prms.L.v * Structure.R2G * (
                            KF * mu * Math.pow(this.prms.h1.v, 1.5)
                            - mu1 * Math.pow(this.prms.h1.v - this.prms.W.v, 1.5)
                    } else {
                        const KF1 = this.getKF(
                            Math.sqrt(1 - (this.prms.h2.v - this.prms.W.v) / (this.prms.h1.v - this.prms.W.v)),
                            this.getAlfa(this.prms.h2.v - this.prms.W.v),
                        v = this.prms.L.v * Structure.R2G * (
                            KF * mu * Math.pow(this.prms.h1.v, 1.5)
                            - KF1 * mu1 * Math.pow(this.prms.h1.v - this.prms.W.v, 1.5)
        this.debug(
            "StructureCem88v.Equation(h1=" + this.prms.h1.v
            + ",h2=" + this.prms.h2.v + ",W=" + this.prms.W.v + ") => Q=" + v);
        return new Result(v, data);
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
/** * Give the flow regime for Equation CEM88V : free, partially submerged or submerged flow */ protected getFlowRegime(): StructureFlowRegime { const mode: StructureFlowMode = this.getFlowMode(); // Weir have only two flow regimes: free and submerged flow let alfa: number; switch (mode) { case StructureFlowMode.WEIR: alfa = 0.75; break; case StructureFlowMode.ORIFICE: alfa = this.getAlfa(this.prms.h2.v); break; } if (this.prms.h2.v <= alfa * this.prms.h1.v) { this.debug( "StructureCem88v.getFlowRegime(h1=" + this.prms.h1.v + ",h2=" + this.prms.h2.v + ",W=" + this.prms.W.v + ")=FREE"); return StructureFlowRegime.FREE; } else { alfa = this.getAlfa(this.prms.h2.v - this.prms.W.v); if ( mode === StructureFlowMode.ORIFICE && this.prms.h2.v <= alfa * this.prms.h1.v + (1 - alfa) * this.prms.W.v ) { this.debug( "StructureCem88v.getFlowRegime(h1=" + this.prms.h1.v + ",h2=" + this.prms.h2.v + ",W=" + this.prms.W.v + ")=PARTIAL"); return StructureFlowRegime.PARTIAL; } else { this.debug( "StructureCem88v.getFlowRegime(h1=" + this.prms.h1.v + ",h2=" + this.prms.h2.v + ",W=" + this.prms.W.v + ")=SUBMERGED"); return StructureFlowRegime.SUBMERGED; } } } private getAlfa(h2: number): number { let alfa: number = 1 - 0.14 * (h2) / this.prms.W.v; alfa = Math.min(Math.max(alfa, 0.4), 0.75); // console.log("alfa=" + alfa); return alfa; } private getKF(x: number, alfa: number): number { const beta1 = -2 * alfa + 2.6; let KF: number; if (x > 0.2) { KF = 1 - Math.pow(1 - x / Math.sqrt(1 - alfa), beta1); } else { KF = 5 * x * (1 - Math.pow(1 - 0.2 / Math.sqrt(1 - alfa), beta1)); } // console.log("KF(x="+x+")="+KF); return KF; } }