jalhyd
Version:
JaLHyd, a Javascript Library for Hydraulics
148 lines • 5.01 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cSnPuiss = 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");
/**
* Calculs de la section parabolique ou "puissance"
*/
// tslint:disable-next-line:class-name
class cSnPuiss extends internal_modules_4.acSection {
constructor(prms, dbg = false) {
super(prms, dbg);
this.nbDessinPoints = 50;
this.nodeType = internal_modules_1.SectionType.SectionPuissance;
}
setParametersCalculability() {
super.setParametersCalculability();
this.prms.k.calculability = internal_modules_2.ParamCalculability.DICHO;
}
get prms() {
return this._prms;
}
/**
* Calcul de Lambda (mais on garde la routine Alpha commune avec la section circulaire)
* @return Lambda
*/
Calc_Alpha() {
const v = this.prms.LargeurBerge.v / Math.pow(this.prms.YB.v, this.prms.k.v);
return new internal_modules_3.Result(v);
}
/**
* Calcul de la largeur au miroir.
* @return B
*/
Calc_B() {
if (this.prms.Y.v >= this.prms.YB.v) {
return new internal_modules_3.Result(this.prms.LargeurBerge.v);
}
const rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const v = rAlpha.vCalc * Math.pow(this.prms.Y.v, this.prms.k.v);
return new internal_modules_3.Result(v);
}
/**
* Calcul du périmètre mouillé.
* @return B
*/
Calc_P() {
const rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const n = 100; /// Le nombre de partie pour le calcul de l'intégrale
// tslint:disable-next-line:variable-name
const Lambda2 = Math.pow(rAlpha.vCalc, 2);
let P = 0; /// Le périmètre à calculer
// tslint:disable-next-line:variable-name
let Previous = 0;
for (let i = 1; i <= n; i++) {
// tslint:disable-next-line:variable-name
const Current = Math.pow(this.prms.Y.v * i / n, this.prms.k.v) / 2;
P += Math.sqrt(Math.pow(n, -2) + Lambda2 * Math.pow(Current - Previous, 2));
Previous = Current;
}
P *= 2;
return new internal_modules_3.Result(P);
}
/**
* Calcul de la surface mouillée.
* @return S
*/
Calc_S() {
const rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const k = this.prms.k.v;
const v = rAlpha.vCalc * Math.pow(this.prms.Y.v, k + 1) / (k + 1);
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() {
const rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const k = this.prms.k.v;
const v = 2 * Math.sqrt(1 + Math.pow(k * rAlpha.vCalc / 2, 2) * Math.pow(this.prms.Y.v, 2 * (k - 1)));
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() {
const rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const k = this.prms.k.v;
const v = rAlpha.vCalc * k * Math.pow(this.prms.Y.v, k - 1);
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 rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const k = this.prms.k.v;
const v = rAlpha.vCalc * Math.pow(this.prms.Y.v, k + 2) / ((k + 1) * (k + 2));
return new internal_modules_3.Result(v);
}
/**
* Calcul de la dérivée distance du centre de gravité de la section à la surface libre
* multiplié par la surface hydraulique
* @return S x Yg
*/
Calc_dSYg() {
const rAlpha = this.calcFromY("Alpha");
if (!rAlpha.ok) {
return rAlpha;
}
const rDAlpha = this.calcFromY("dAlpha");
if (!rDAlpha.ok) {
return rDAlpha;
}
const k = this.prms.k.v;
const Y = this.prms.Y.v;
// tslint:disable-next-line:variable-name
const SYg = rDAlpha.vCalc * Math.pow(Y, k + 2) + rAlpha.vCalc * Math.pow(Y, k + 1) * (k + 2);
const v = SYg / ((k + 1) * (k + 2));
return new internal_modules_3.Result(v);
}
}
exports.cSnPuiss = cSnPuiss;
//# sourceMappingURL=section_puissance.js.map