section_param_circ_torrentiel.spec.ts 3.35 KiB
/// <reference path="../node_modules/@types/jasmine/index.d.ts" />
import { Result } from "../src/base";
import { precDist, equalEpsilon } from "./nubtest";
import { ParamsSectionCirc, cSnCirc } from "../src/section/section_circulaire";
let paramSection: ParamsSectionCirc;
let sect: cSnCirc;
function createSection(prec: number): cSnCirc {
    paramSection = new ParamsSectionCirc(2, // diamètre
        0.8, // tirant d'eau
        40, //  Ks=Strickler
        10,  //  Q=Débit
        0.001, //  If=pente du fond
        prec, // précision
        1 // YB= hauteur de berge
        // YCL=Condition limite en cote à l'amont ou à l'aval
    return new cSnCirc(undefined, paramSection);
function check(val1: number, val2: number) {
    expect(equalEpsilon(val1, val2)).toBeTruthy("expected " + val2 + ", got " + val1);
describe('Section paramétrée circulaire : ', () => {
    beforeEach(() => {
        sect = createSection(precDist);
    });
    describe('torrentiel :', () => {
        // charge spécifique
        it('Hs should equal to 4.501', () => {
            check(sect.Calc("Hs"), 4.501);
        });
        // charge critique
        it('Hsc should equal to 2.263', () => {
            check(sect.Calc("Hsc"), 2.263);
        });
        // largeur au miroir
        it('B should equal to 1.960', () => {
            check(sect.Calc("B"), 1.960);
        });
        // périmètre mouillé
        it('P should equal to 2.739', () => {
            check(sect.Calc("P"), 2.739);
        });
        // surface mouillée
        it('S should equal to 1.173', () => {
            check(sect.Calc("S"), 1.173);
        });
        // rayon hydraulique
        it('R should equal to 0.428', () => {
            check(sect.Calc("R"), 0.428);
        });
        // vitesse moyenne
        it('V should equal to 8.522', () => {
            check(sect.Calc("V"), 8.522);
        });
        // nombre de Froude
        it('Fr should equal to 3.516', () => {
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
check(sect.Calc("Fr"), 3.516); }); // tirant d'eau critique it('Yc should equal to 1.581', () => { check(sect.Calc("Yc"), 1.581); }); // tirant d'eau normal it('Yn should equal to 4.624', () => { check(sect.Calc("Yn"), 4.624); }); // tirant d'eau fluvial it('Yf should equal to 4.43', () => { check(sect.Calc("Yf"), 4.43); }); // tirant d'eau torrentiel it('Yt should equal to 0.8', () => { check(sect.Calc("Yt"), 0.8); }); // tirant d'eau conjugué it('Yco should equal to 0.8', () => { check(sect.Calc("Yco"), 0.8); }); // perte de charge it('J should equal to 0.141', () => { //sect = createSection(0.00001); check(sect.Calc("J"), 0.141); }); // Variation linéaire de l'énergie spécifique it('I-J should equal to -0.14', () => { //sect = createSection(0.00001); check(sect.Calc("I-J"), -0.14); }); // impulsion hydraulique it('Imp should equal to 89065.861', () => { check(sect.Calc("Imp"), 89065.861); }); // force tractrice (contrainte de cisaillement) it('Tau0 should equal to 590.605', () => { check(sect.Calc("Tau0"), 590.605); }); }); });