UNPKG

jalhyd

Version:

JaLHyd, a Javascript Library for Hydraulics

159 lines (158 loc) 6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cSnTrapez = void 0; const internal_modules_1 = require("../../internal_modules"); const internal_modules_2 = require("../../internal_modules"); const internal_modules_3 = require("../../internal_modules"); const internal_modules_4 = require("../../internal_modules"); const internal_modules_5 = require("../../internal_modules"); /** * Calculs de la section trapézoïdale */ // tslint:disable-next-line:class-name class cSnTrapez extends internal_modules_5.acSection { get prms() { return this._prms; } constructor(prms, dbg = false) { super(prms, dbg); this.nodeType = internal_modules_1.SectionType.SectionTrapeze; } setParametersCalculability() { super.setParametersCalculability(); this.prms.LargeurFond.calculability = internal_modules_2.ParamCalculability.DICHO; this.prms.Fruit.calculability = internal_modules_2.ParamCalculability.DICHO; } Calc_B() { let v; if (this.isDebordement()) { v = this.prms.LargeurFond.v + 2 * this.prms.Fruit.v * this.prms.YB.v; return new internal_modules_3.Result(v); } v = this.prms.LargeurFond.v + 2 * this.prms.Fruit.v * this.prms.Y.v; return new internal_modules_3.Result(v); } /** * Calcul du périmètre mouillé * @return Périmètre mouillé (m) */ Calc_P() { let v; if (this.isDebordement()) { // return this.CalcGeo("P") + super.Calc_P_Debordement(this.prms.Y.v - this.prms.YB.v); const rGeoP = this.CalcGeo("P"); if (!rGeoP.ok) { return rGeoP; } const rPDeb = super.Calc_P_Debordement(this.prms.Y.v - this.prms.YB.v); if (!rPDeb.ok) { return rPDeb; } v = rGeoP.vCalc + rPDeb.vCalc; return new internal_modules_3.Result(v); } v = this.prms.LargeurFond.v + 2 * Math.sqrt(1 + Math.pow(this.prms.Fruit.v, 2)) * this.prms.Y.v; return new internal_modules_3.Result(v); } /** * Calcul de la surface mouillée * @return Surface mouillée (m2) */ Calc_S() { let v; if (this.isDebordement()) { // return this.CalcGeo("S") + super.Calc_S_Debordement(this.prms.Y.v - this.prms.YB.v); const rGeoS = this.CalcGeo("S"); if (!rGeoS.ok) { return rGeoS; } const rSDeb = super.Calc_S_Debordement(this.prms.Y.v - this.prms.YB.v); if (!rSDeb.ok) { return rSDeb; } v = rGeoS.vCalc + rSDeb.vCalc; return new internal_modules_3.Result(v); } v = this.prms.Y.v * (this.prms.LargeurFond.v + this.prms.Fruit.v * this.prms.Y.v); return new internal_modules_3.Result(v); } /** * Calcul de dérivée de la surface hydraulique par rapport au tirant d'eau. * @return dS */ Calc_dS() { if (this.isDebordement()) { return super.Calc_dS(); } const v = this.prms.LargeurFond.v + 2 * this.prms.Fruit.v * this.prms.Y.v; return new internal_modules_3.Result(v); } /** * Calcul de dérivée du périmètre hydraulique par rapport au tirant d'eau. * @return dP */ Calc_dP() { if (this.isDebordement()) { return super.Calc_dP_Debordement(); } const v = 2 * Math.sqrt(1 + this.prms.Fruit.v * this.prms.Fruit.v); return new internal_modules_3.Result(v); } /** * Calcul de dérivée de la largeur au miroir par rapport au tirant d'eau. * @return dB */ Calc_dB() { if (this.isDebordement()) { return super.Calc_dB_Debordement(); } const v = 2 * this.prms.LargeurFond.v * this.prms.Fruit.v; return new internal_modules_3.Result(v); } /** * Calcul de la distance du centre de gravité de la section à la surface libre * multiplié par la surface hydraulique * @return S x Yg */ Calc_SYg() { const v = (this.prms.LargeurFond.v / 2 + this.prms.Fruit.v * this.prms.Y.v / 3) * Math.pow(this.prms.Y.v, 2); return new internal_modules_3.Result(v); } /** * Calcul de la dérivée de la distance du centre de gravité de la section à la surface libre * multiplié par la surface hydraulique * @return S x Yg */ Calc_dSYg() { // tslint:disable-next-line:variable-name let SYg = this.prms.Fruit.v / 3 * Math.pow(this.prms.Y.v, 2); SYg += (this.prms.LargeurFond.v / 2 + this.prms.Fruit.v * this.prms.Y.v / 3) * 2 * this.prms.Y.v; return new internal_modules_3.Result(SYg); } isDebordement() { return this.prms.Y.v > this.prms.YB.v; } /** * Critical depth calculation. * Calculation is performed by Newton algorithm initialised by approximation provided by * Vatankhah, A.R., 2013. Explicit solutions for critical and normal depths in trapezoidal * and parabolic open channels. * Ain Shams Engineering Journal 4, 17–23. https://doi.org/10.1016/j.asej.2012.05.002 * @return Result object with critical depth */ Calc_Yc() { const z = this.prms.Fruit.v; const Q = this.prms.Q.v; const g = internal_modules_4.ParamsSectionTrapez.G; const B = this.prms.LargeurFond.v; const Qstar = 4 * Math.pow(Math.pow(z, 3) * Math.pow(Q, 2) / g / Math.pow(B, 5), 1 / 3); const Yc_star = Math.pow(1 + 1.161 * Qstar * (1 + 2 / 3 * Math.pow(Qstar, 1.041), 0.374), 0.144); const nu = -0.5 + 0.5 * Math.pow((5 * Math.pow(Yc_star, 6) + 1) / (6 * Math.pow(Yc_star, 5) - Qstar), 3); const Yc = nu * B / z; return super.Calc_Yc(Yc); } } exports.cSnTrapez = cSnTrapez; //# sourceMappingURL=section_trapez.js.map