structure_weir_free.spec.ts 2.39 KiB
// tslint:disable-next-line:no-reference
/// <reference path="../../node_modules/@types/jasmine/index.d.ts" />
import { Result } from "../../src/base";
import { RectangularStructureParams } from "../../src/structure/rectangular_structure_params";
import { StructureFlowMode, StructureFlowRegime } from "../../src/structure/structure";
import { StructureWeirFree } from "../../src/structure/structure_weir_free";
import { itCalcQ } from "./rectangular_structure";
const structPrm: RectangularStructureParams = new RectangularStructureParams(1, 1, 1, 2, 0.6, 0);
const structTest: StructureWeirFree = new StructureWeirFree(structPrm, false);
describe("Class StructureWeirFree: ", () => {
    describe("Calcul Q avec W croissant: ", () => {
        const W: number[] = [
            0.000000, 0.100000, 0.200000, 0.300000, 0.400000, 0.500000, 0.600000,
            0.700000, 0.800000, 0.900000, 1.000000, 1.100000, 1.200000, 1.300000];
        const h1: number = 1.200000;
        const Q: number[] = [0.000000, 6.987191, 6.987191, 6.987191, 6.987191, 6.987191,
            6.987191, 6.987191, 6.987191, 6.987191, 6.987191, 6.987191, 6.987191, 6.987191];
        for (let i = 0; i < Q.length; i++ ) {
            itCalcQ(structTest, h1, W[i], Q[i]);
    });
    describe("Calcul Q en charge avec h1 croissant: ", () => {
        const W: number = 0.8;
        const h1: number[] = [1.050000, 1.300000, 1.500000];
        const Q: number[] = [5.718929, 7.878541, 9.764896];
        const mode: StructureFlowMode[] = [
            StructureFlowMode.WEIR, StructureFlowMode.WEIR, StructureFlowMode.WEIR];
        const regime: StructureFlowRegime[] = [
            StructureFlowRegime.FREE, StructureFlowRegime.FREE, StructureFlowRegime.FREE];
        for (let i = 0; i < Q.length; i++ ) {
            itCalcQ(structTest, h1[i], W, Q[i], mode[i], regime[i]);
    });
    describe("Calcul Q a surface libre avec h1 croissant: ", () => {
        const W: number = Infinity;
        const h1: number[] = [1.100000, 1.500000];
        const Q: number[] = [6.132249, 9.764896];
        const mode: StructureFlowMode[] = [
            StructureFlowMode.WEIR, StructureFlowMode.WEIR];
        const regime: StructureFlowRegime[] = [
            StructureFlowRegime.FREE, StructureFlowRegime.FREE];
        for (let i = 0; i < Q.length; i++ ) {
            itCalcQ(structTest, h1[i], W, Q[i], mode[i], regime[i]);
    });
});