section_param_circ_fluvial.spec.ts 6.34 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
        1.2,  //  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 createSectionDebordement(prec: number): cSnCirc {
    paramSection = new ParamsSectionCirc(2, // diamètre
        2, // tirant d'eau
        40, //  Ks=Strickler
        1.2,  //  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('fluvial / pas de débordement :', () => {
        // charge spécifique
        it('Hs should equal to 0.853', () => {
            check(sect.Calc("Hs"), 0.853);
        });
        // charge critique
        it('Hsc should equal to 0.694', () => {
            check(sect.Calc("Hsc"), 0.694);
        });
        // largeur au miroir
        it('B should equal to 1.959', () => {
            check(sect.Calc("B"), 1.959);
        });
        // périmètre mouillé
        it('P should equal to 2.738', () => {
            check(sect.Calc("P"), 2.738);
        });
        // surface mouillée
        it('S should equal to 1.173', () => {
            check(sect.Calc("S"), 1.173);
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
}); // rayon hydraulique it('R should equal to 0.428', () => { check(sect.Calc("R"), 0.428); }); // vitesse moyenne it('V should equal to 1.023', () => { check(sect.Calc("V"), 1.023); }); // nombre de Froude it('Fr should equal to 0.422', () => { check(sect.Calc("Fr"), 0.422); }); // tirant d'eau critique it('Yc should equal to 0.512', () => { check(sect.Calc("Yc"), 0.512); }); // tirant d'eau normal it('Yn should equal to 0.976', () => { check(sect.Calc("Yn"), 0.976); }); // tirant d'eau fluvial it('Yf should equal to 0.8', () => { check(sect.Calc("Yf"), 0.8); }); // tirant d'eau torrentiel it('Yt should equal to 0.361', () => { check(sect.Calc("Yt"), 0.361); }); // tirant d'eau conjugué it('Yco should equal to 0.307', () => { check(sect.Calc("Yco"), 0.307); }); // perte de charge it('J should equal to 0.002', () => { //sect = createSection(0.00001); check(sect.Calc("J"), 0.002); }); // Variation linéaire de l'énergie spécifique it('I-J should equal to -0.00102', () => { sect = createSection(0.00001); check(sect.Calc("I-J"), -0.00102); }); // impulsion hydraulique it('Imp should equal to 5076.304', () => { check(sect.Calc("Imp"), 5076.304); }); // force tractrice (contrainte de cisaillement) it('Tau0 should equal to 8.505', () => { check(sect.Calc("Tau0"), 8.505); }); }); }); describe('Section paramétrée circulaire : ', () => { beforeEach(() => { sect = createSectionDebordement(precDist);
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
}); describe('fluvial / débordement :', () => { // charge spécifique it('Hs should equal to 2.006', () => { check(sect.Calc("Hs"), 2.006); }); // charge critique it('Hsc should equal to 0.694', () => { check(sect.Calc("Hsc"), 0.694); }); // largeur au miroir it('B should equal to 2', () => { check(sect.Calc("B"), 2); }); // périmètre mouillé it('P should equal to 5.142', () => { check(sect.Calc("P"), 5.142); }); // surface mouillée it('S should equal to 3.571', () => { check(sect.Calc("S"), 3.571); }); // rayon hydraulique it('R should equal to 0.694', () => { check(sect.Calc("R"), 0.694); }); // vitesse moyenne it('V should equal to 0.336', () => { check(sect.Calc("V"), 0.336); }); // nombre de Froude it('Fr should equal to 0.08', () => { check(sect.Calc("Fr"), 0.08); }); // tirant d'eau critique it('Yc should equal to 0.512', () => { check(sect.Calc("Yc"), 0.512); }); // tirant d'eau normal it('Yn should equal to 0.976', () => { check(sect.Calc("Yn"), 0.976); }); // tirant d'eau fluvial it('Yf should equal to 2', () => { check(sect.Calc("Yf"), 2); }); // tirant d'eau torrentiel it('Yt should equal to 0.232', () => { check(sect.Calc("Yt"), 0.232); }); // tirant d'eau conjugué it('Yco should equal to 0.24', () => { check(sect.Calc("Yco"), 0.24); }); // perte de charge it('J should equal to 0.0001', () => {
211212213214215216217218219220221222223224225226227228229230231232
sect = createSectionDebordement(0.00001); check(sect.Calc("J"), 0.0001); }); // Variation linéaire de l'énergie spécifique it('I-J should equal to 0.001', () => { sect = createSectionDebordement(0.00001); check(sect.Calc("I-J"), 0.001); }); // impulsion hydraulique it('Imp should equal to 6943.271', () => { check(sect.Calc("Imp"), 6943.271); }); // force tractrice (contrainte de cisaillement) it('Tau0 should equal to 0.782', () => { check(sect.Calc("Tau0"), 0.782); }); }); });