jalhyd
Version:
JaLHyd, a Javascript Library for Hydraulics
78 lines • 2.85 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParTypeFatou = 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");
class ParTypeFatou extends internal_modules_1.ParTypePF {
constructor(prms) {
super(prms);
this.type = internal_modules_2.ParType.FATOU;
}
CalcAw() {
return 0.6 * this.CalcH() * this.prms.L.v;
}
// tslint:disable-next-line:variable-name
CalcZRFromZD(ZDv) {
return ZDv
- (Math.sqrt(2) * this.CalcA() * Math.sin(45 * Math.PI / 180 + Math.atan(this.prms.S.v)))
+ this.prms.L.V * 0.5 * this.prms.S.v;
}
// tslint:disable-next-line:variable-name
CalcZDFromZR(ZRv) {
return ZRv
+ (Math.sqrt(2) * this.CalcA() * Math.sin(45 * Math.PI / 180 + Math.atan(this.prms.S.v)))
- this.prms.L.V * 0.5 * this.prms.S.v;
}
CalcZM() {
const H = 1.333 * this.prms.L.v;
return this.ZD1 + H * Math.cos(Math.atan(this.prms.S.v));
}
CalcP() {
return 0.5 * this.prms.L.V;
}
addExtraResults(res) {
super.addExtraResults(res);
res.resultElement.values.B = 0.6 * this.prms.L.V;
res.resultElement.values.a = this.CalcA();
res.resultElement.values.H = 1.333 * this.prms.L.V;
}
checkInput() {
const status = super.checkInput();
// S
if ((0, internal_modules_4.isLowerThan)(this.prms.S.v, 0.08) || (0, internal_modules_4.isGreaterThan)(this.prms.S.v, 0.22)) {
status.fatal = true;
const m = new internal_modules_3.Message(internal_modules_3.MessageCode.ERROR_PAR_S);
m.extraVar.min = 0.08;
m.extraVar.max = 0.22;
status.messages.push(m);
}
else if ((0, internal_modules_4.isGreaterThan)(this.prms.S.v, 0.2)) {
const m = new internal_modules_3.Message(internal_modules_3.MessageCode.WARNING_PAR_S);
m.extraVar.min = 0.08;
m.extraVar.max = 0.2;
status.messages.push(m);
}
return status;
}
get coef() {
return {
"h": {
"c0": [-3.56494, 0.450262, 0.0407576],
"c1": [42.4113, -24.4941, 8.84146],
"c2": [-73.4829, 54.6733, -14.0622]
},
"ha": {
"c0": [15.8096, -5.19282, 0.465827],
"c1": [302.623, -106.203, 13.2957],
"c2": [-783.592, 269.991, -25.2637]
}
};
}
CalcA() {
return 0.2 * this.prms.L.V;
}
}
exports.ParTypeFatou = ParTypeFatou;
//# sourceMappingURL=par_type_fatou.js.map