• Mathias Chouet's avatar
    refactor nubs · 7b6e5403
    Mathias Chouet authored
    merged cParamsCanal and ParamsSection
    Structures are now only defined by their LoiDebit (no more StructureType)
    Session : fixed serialization of lately registered Nubs
    Sections are now defined by a CalculatorType and a NodeType
    fixed bug in findFirstSingleParameter
    added tests for session serialisation
    7b6e5403
structure_weir_free.ts 1.16 KiB
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 classique seuil dénoyé
export class StructureWeirFree extends RectangularStructure {
    constructor(prms: RectangularStructureParams, dbg: boolean = false) {
        super(prms, dbg);
        this._loiDebit = LoiDebit.WeirFree;
    /**
     * Calcul analytique Q = f(Cd, L, h1, h2, W) seuil dénoyé
     * @param sVarCalc Variable à calculer (doit être "Q")
    public Equation(sVarCalc: string): Result {
        Structure.CheckEquation(sVarCalc);
        const data = this.getResultData();
        const v = this.prms.Cd.v * this.prms.L.v * Structure.R2G * Math.pow(this.prms.h1.v, 1.5);
        return new Result(v, this, data);
    protected getFlowRegime() {
        return StructureFlowRegime.FREE;
    protected getFlowMode() {
        return StructureFlowMode.WEIR;