Skip to content
Snippets Groups Projects
Commit b707274b authored by François Grand's avatar François Grand
Browse files

feat: add skeleton of pressure loss nub

refs #334
parent cf249f30
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,8 @@ export enum CalculatorType {
PbCloison, // Cloison de pré-barrage
PbBassin, // Bassin de pré-barrage
Espece, // Critères de vérification pour une espèce de poissons
Verificateur // Vérificateur de contraintes sur une passe pour une ou plusieurs espèces
Verificateur, // Vérificateur de contraintes sur une passe pour une ou plusieurs espèces
PressureLoss // Pertes de charge (Lechapt-Calmon, Colebrook-White, Strickler, ...)
}
/** types de sections */
......
......@@ -62,6 +62,7 @@ export * from "./pab/pab_puissance_params";
export * from "./pab/cloison_aval";
export * from "./pipe_flow/pl_lechaptcalmon";
export * from "./pipe_flow/pressureloss";
export * from "./pipe_flow/pressureloss_law";
export * from "./lc-material";
export * from "./structure/dever";
export * from "./macrorugo/macrorugo";
......
import { CalculatorType } from "../compute-node";
import { LCMaterial } from "../lc-material";
import { Nub } from "../nub";
import { ParamCalculability } from "../param/param-definition";
import { Message, MessageCode } from "../util/message";
import { Observer } from "../util/observer";
import { Result } from "../util/result";
import { PL_LechaptCalmonParams } from "./pl_lechaptcalmon_params";
import { PressureLossLaw, PressureLossType } from "./pressureloss_law";
/**
* Calcul des pertes de charge dans un tube à partir des tables de Lechapt et Calmon
*/
export class PL_LechaptCalmon extends Nub implements Observer {
export class PL_LechaptCalmon extends PressureLossLaw implements Observer {
private static _materials: { L: number, M: number, N: number, title: string }[] = [
{
......@@ -72,6 +72,7 @@ export class PL_LechaptCalmon extends Nub implements Observer {
constructor(prms: PL_LechaptCalmonParams, dbg: boolean = false) {
super(prms, dbg);
this.setCalculatorType(CalculatorType.LechaptCalmon);
this._pressureLossType = PressureLossType.LechaptCalmon;
this._props.addObserver(this);
this.material = LCMaterial.PVCPolyethylene;
}
......
import { ParamDefinition, ParamFamily } from "../param/param-definition";
import { ParamDomain, ParamDomainValue } from "../param/param-domain";
import { ParamsEquation } from "../param/params-equation";
import { PressureLossParams } from "./pressureloss_params";
/**
* paramètres pour le calcul Lechapt et Calmon
*/
export class PL_LechaptCalmonParams extends ParamsEquation {
/** Débit */
private _Q: ParamDefinition;
/** Diamètre */
private _D: ParamDefinition;
/** Perte de charge */
private _J: ParamDefinition;
/** Longueur de la conduite */
private _Lg: ParamDefinition;
export class PL_LechaptCalmonParams extends PressureLossParams {
/** Paramètre de rugosité L */
private _L: ParamDefinition;
......@@ -27,50 +16,19 @@ export class PL_LechaptCalmonParams extends ParamsEquation {
/** Paramètre de rugosité N */
private _N: ParamDefinition;
/** Perte de charge singulière Ks */
private _Ks: ParamDefinition;
constructor(rQ: number, rD: number, rJ: number, rLg: number, rL: number, rM: number, rN: number, rKs: number,
nullParams: boolean = false) {
super();
this._Q = new ParamDefinition(this, "Q", ParamDomainValue.POS, "m³/s", rQ, ParamFamily.FLOWS, undefined, nullParams);
this._D = new ParamDefinition(
this, "D", new ParamDomain(ParamDomainValue.INTERVAL, 0, 20), "m", rD, ParamFamily.DIAMETERS, undefined, nullParams
);
this._J = new ParamDefinition(this, "J", ParamDomainValue.POS_NULL, "m", rJ, undefined, undefined, nullParams);
this._Lg = new ParamDefinition(this, "Lg", ParamDomainValue.POS, "m", rLg, ParamFamily.LENGTHS, undefined, nullParams);
super(rQ, rD, rJ, rLg, rKs, nullParams);
this._L = new ParamDefinition(this, "L", new ParamDomain(ParamDomainValue.INTERVAL, 0.8, 2), undefined, rL,
undefined, false, nullParams);
this._M = new ParamDefinition(this, "M", new ParamDomain(ParamDomainValue.INTERVAL, 1.5, 2.5), undefined, rM,
undefined, false, nullParams);
this._N = new ParamDefinition(this, "N", new ParamDomain(ParamDomainValue.INTERVAL, 4.5, 5.5), undefined, rN,
undefined, false, nullParams);
this._Ks = new ParamDefinition(this, "Ks", ParamDomainValue.POS_NULL, undefined, rKs, ParamFamily.STRICKLERS, undefined, nullParams);
this.addParamDefinition(this._Q);
this.addParamDefinition(this._D);
this.addParamDefinition(this._J);
this.addParamDefinition(this._Lg);
this.addParamDefinition(this._L);
this.addParamDefinition(this._M);
this.addParamDefinition(this._N);
this.addParamDefinition(this._Ks);
}
get Q() {
return this._Q;
}
get D() {
return this._D;
}
get J() {
return this._J;
}
get Lg() {
return this._Lg;
}
get L() {
......@@ -84,8 +42,4 @@ export class PL_LechaptCalmonParams extends ParamsEquation {
get N() {
return this._N;
}
get Ks() {
return this._Ks;
}
}
import { Nub } from "../nub";
import { Observer } from "../util/observer";
import { Result } from "../util/result";
import { CalculatorType } from "../compute-node";
import { PressureLossParams } from "./pressureloss_params";
export class PressureLoss extends Nub implements Observer {
constructor(prms: PressureLossParams, dbg: boolean = false) {
super(prms, dbg);
this.setCalculatorType(CalculatorType.PressureLoss);
}
/**
* paramétrage de la calculabilité des paramètres
*/
......
import { Nub } from "../nub";
/**
* Loi de perte de charge
*/
export enum PressureLossType {
LechaptCalmon
}
/**
* generic pressure loss law (analogous to acSection with respect to SectionParametree nub)
*/
export abstract class PressureLossLaw extends Nub {
protected _pressureLossType: PressureLossType;
public get pressureLossType(): PressureLossType {
return this._pressureLossType;
}
}
import { ParamDefinition, ParamFamily } from "../param/param-definition";
import { ParamsEquation } from "../param/params-equation";
import { ParamDomain, ParamDomainValue } from "../param/param-domain";
/**
* generic pressure loss parameters
*/
export class PressureLossParams extends ParamsEquation {
/** Débit */
private _Q: ParamDefinition;
/** Diamètre */
private _D: ParamDefinition;
/** Perte de charge */
private _J: ParamDefinition;
/** Longueur de la conduite */
private _Lg: ParamDefinition;
/** Perte de charge singulière Ks */
private _Ks: ParamDefinition;
constructor(rQ: number, rD: number, rJ: number, rLg: number, rKs: number, nullParams: boolean = false) {
super();
this._Q = new ParamDefinition(this, "Q", ParamDomainValue.POS, "m³/s", rQ, ParamFamily.FLOWS, undefined, nullParams);
this._D = new ParamDefinition(this, "D", new ParamDomain(ParamDomainValue.INTERVAL, 0, 20), "m", rD, ParamFamily.DIAMETERS, undefined, nullParams);
this._J = new ParamDefinition(this, "J", ParamDomainValue.POS_NULL, "m", rJ, undefined, undefined, nullParams);
this._Lg = new ParamDefinition(this, "Lg", ParamDomainValue.POS, "m", rLg, ParamFamily.LENGTHS, undefined, nullParams);
this._Ks = new ParamDefinition(this, "Ks", ParamDomainValue.POS_NULL, undefined, rKs, ParamFamily.STRICKLERS, undefined, nullParams);
this.addParamDefinition(this._Q);
this.addParamDefinition(this._D);
this.addParamDefinition(this._J);
this.addParamDefinition(this._Lg);
this.addParamDefinition(this._Ks);
}
get Q() {
return this._Q;
}
get D() {
return this._D;
}
get J() {
return this._J;
}
get Lg() {
return this._Lg;
}
get Ks() {
return this._Ks;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment