• 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
section_param_rect_fluvial.spec.ts 6.42 KiB
import { cSnRectang, ParamsSectionRectang } from "../../src/section/section_rectang";
import { precDist } from "../test_config";
import { checkResult } from "../test_func";
let paramSection: ParamsSectionRectang;
let sect: cSnRectang;
function createSection(prec: number): cSnRectang {
    paramSection = new ParamsSectionRectang(0.8, // tirant d'eau
        2.5, // largeur de fond
        40, //  Ks=Strickler
        1.2,  //  Q=Débit
        0.001, //  If=pente du fond
        1, // YB= hauteur de berge
    paramSection.Pr.v = prec;
    return new cSnRectang(paramSection);
function createSectionDebordement(prec: number): cSnRectang {
    paramSection = new ParamsSectionRectang(2, // tirant d'eau
        2.5, // largeur de fond
        40, //  Ks=Strickler
        1.2,  //  Q=Débit
        0.001, //  If=pente du fond
        1, // YB= hauteur de berge
    paramSection.Pr.v = prec;
    return new cSnRectang(paramSection);
describe("Section paramétrée rectangulaire : ", () => {
    beforeEach(() => {
        sect = createSection(precDist);
    });
    describe("fluvial / pas de débordement :", () => {
        // charge spécifique
        it("Hs should equal to 0.818", () => {
            checkResult(sect.CalcSection("Hs"), 0.818);
        });
        // charge critique
        it("Hsc should equal to 0.43", () => {
            checkResult(sect.CalcSection("Hsc"), 0.43);
        });
        // largeur au miroir
        it("B should equal to 2.5", () => {
            checkResult(sect.CalcSection("B"), 2.5);
        });
        // périmètre mouillé
        it("P should equal to 4.1", () => {
            checkResult(sect.CalcSection("P"), 4.1);
        });
        // surface mouillée
        it("S should equal to 2", () => {
            checkResult(sect.CalcSection("S"), 2);
        });
        // rayon hydraulique
        it("R should equal to 0.488", () => {
            checkResult(sect.CalcSection("R"), 0.488);
        });
        // vitesse moyenne
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
it("V should equal to 0.6", () => { checkResult(sect.CalcSection("V"), 0.6); }); // nombre de Froude it("Fr should equal to 0.214", () => { checkResult(sect.CalcSection("Fr"), 0.214); }); // tirant d'eau critique it("Yc should equal to 0.286", () => { checkResult(sect.CalcSection("Yc"), 0.286); }); // tirant d'eau normal it("Yn should equal to 0.663", () => { checkResult(sect.CalcSection("Yn"), 0.663); }); // tirant d'eau fluvial it("Yf should equal to 0.8", () => { checkResult(sect.CalcSection("Yf"), 0.8); }); // tirant d'eau torrentiel it("Yt should equal to 0.131", () => { checkResult(sect.CalcSection("Yt"), 0.131); }); // tirant d'eau conjugué it("Yco should equal to 0.068", () => { checkResult(sect.CalcSection("Yco"), 0.068); }); // perte de charge it("J should equal to 0.00059", () => { sect = createSection(0.00001); checkResult(sect.CalcSection("J"), 0.00059); }); // Variation linéaire de l'énergie spécifique it("I-J should equal to 0.00041", () => { sect = createSection(0.00001); checkResult(sect.CalcSection("I-J"), 0.00041); }); // impulsion hydraulique it("Imp should equal to 8568", () => { checkResult(sect.CalcSection("Imp"), 8568); }); // force tractrice (contrainte de cisaillement) it("Tau0 should equal to 2.804", () => { checkResult(sect.CalcSection("Tau0"), 2.804); }); }); }); describe("Section paramétrée rectangulaire : ", () => { beforeEach(() => { sect = createSectionDebordement(precDist); }); describe("fluvial / débordement :", () => { // charge spécifique it("Hs should equal to 2.003", () => { checkResult(sect.CalcSection("Hs"), 2.003); }); // charge critique
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
it("Hsc should equal to 0.43", () => { checkResult(sect.CalcSection("Hsc"), 0.43); }); // largeur au miroir it("B should equal to 2.5", () => { checkResult(sect.CalcSection("B"), 2.5); }); // périmètre mouillé it("P should equal to 6.5", () => { checkResult(sect.CalcSection("P"), 6.5); }); // surface mouillée it("S should equal to 5", () => { checkResult(sect.CalcSection("S"), 5); }); // rayon hydraulique it("R should equal to 0.769", () => { checkResult(sect.CalcSection("R"), 0.769); }); // vitesse moyenne it("V should equal to 0.24", () => { checkResult(sect.CalcSection("V"), 0.24); }); // nombre de Froude it("Fr should equal to 0.0542", () => { checkResult(sect.CalcSection("Fr"), 0.0542); }); // tirant d'eau critique it("Yc should equal to 0.286", () => { checkResult(sect.CalcSection("Yc"), 0.286); }); // tirant d'eau normal it("Yn should equal to 0.663", () => { checkResult(sect.CalcSection("Yn"), 0.663); }); // tirant d'eau fluvial it("Yf should equal to 2", () => { checkResult(sect.CalcSection("Yf"), 2); }); // tirant d'eau torrentiel it("Yt should equal to 0.078", () => { checkResult(sect.CalcSection("Yt"), 0.078); }); // tirant d'eau conjugué it("Yco should equal to 0.012", () => { checkResult(sect.CalcSection("Yco"), 0.012); }); // perte de charge it("J should equal to 0.00059", () => { sect = createSection(0.00001); checkResult(sect.CalcSection("J"), 0.00059); }); // Variation linéaire de l'énergie spécifique it("I-J should equal to 0.0009", () => { sect = createSection(0.00001); checkResult(sect.CalcSection("I-J"), 0.0009); });
211212213214215216217218219220221222223
// impulsion hydraulique it("Imp should equal to 49338", () => { checkResult(sect.CalcSection("Imp"), 49338); }); // force tractrice (contrainte de cisaillement) it("Tau0 should equal to 0.385", () => { checkResult(sect.CalcSection("Tau0"), 0.385); }); }); });