diff --git a/spec/pipe_flow/lechaptcalmon.spec.ts b/spec/pipe_flow/lechaptcalmon.spec.ts index 125dac098aaadabab2a99f7eda196c10d8e8f4c5..4a76a80a21a2a5742ddd1d672cd913a42875bb50 100644 --- a/spec/pipe_flow/lechaptcalmon.spec.ts +++ b/spec/pipe_flow/lechaptcalmon.spec.ts @@ -1,12 +1,12 @@ import { ParamCalculability } from "../../src/param/param-definition"; -import { LechaptCalmon } from "../../src/pipe_flow/lechaptcalmon"; -import { LechaptCalmonParams } from "../../src/pipe_flow/lechaptcalmon_params"; +import { PL_LechaptCalmon } from "../../src/pipe_flow/pl_lechaptcalmon"; +import { PL_LechaptCalmonParams } from "../../src/pipe_flow/pl_lechaptcalmon_params"; import { SessionSettings } from "../../src/session_settings"; import { MessageCode } from "../../src/util/message"; -function getLechapt(): LechaptCalmon { - const l = new LechaptCalmon( - new LechaptCalmonParams( +function getLechapt(): PL_LechaptCalmon { + const l = new PL_LechaptCalmon( + new PL_LechaptCalmonParams( 0.3, // débit 0.5, // diamètre 0.1, /// perte de charge @@ -22,7 +22,7 @@ function getLechapt(): LechaptCalmon { return l; } -let lechapt: LechaptCalmon = getLechapt(); +let lechapt: PL_LechaptCalmon = getLechapt(); describe("Class LechaptCalmon : ", () => { beforeAll(() => { diff --git a/src/index.ts b/src/index.ts index 72a9c87d76af75b95855c64e09fd9293e48f57c1..8c33e4b681a0fb4b3e2a73bab6af83c29f8e76bc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,7 @@ export * from "./pab/pab_nombre_params"; export * from "./pab/pab_puissance"; export * from "./pab/pab_puissance_params"; export * from "./pab/cloison_aval"; -export * from "./pipe_flow/lechaptcalmon"; +export * from "./pipe_flow/pl_lechaptcalmon"; export * from "./lc-material"; export * from "./structure/dever"; export * from "./macrorugo/macrorugo"; diff --git a/src/pipe_flow/lechaptcalmon.ts b/src/pipe_flow/pl_lechaptcalmon.ts similarity index 91% rename from src/pipe_flow/lechaptcalmon.ts rename to src/pipe_flow/pl_lechaptcalmon.ts index b430f33356032193baaf9ced75dda5060ded599e..46f6f33d2d50028ef81178ff0499fa232d5fd31a 100644 --- a/src/pipe_flow/lechaptcalmon.ts +++ b/src/pipe_flow/pl_lechaptcalmon.ts @@ -5,12 +5,12 @@ import { ParamCalculability } from "../param/param-definition"; import { Message, MessageCode } from "../util/message"; import { Observer } from "../util/observer"; import { Result } from "../util/result"; -import { LechaptCalmonParams } from "./lechaptcalmon_params"; +import { PL_LechaptCalmonParams } from "./pl_lechaptcalmon_params"; /** * Calcul des pertes de charge dans un tube à partir des tables de Lechapt et Calmon */ -export class LechaptCalmon extends Nub implements Observer { +export class PL_LechaptCalmon extends Nub implements Observer { private static _materials: { L: number, M: number, N: number, title: string }[] = [ { @@ -69,7 +69,7 @@ export class LechaptCalmon extends Nub implements Observer { } ]; - constructor(prms: LechaptCalmonParams, dbg: boolean = false) { + constructor(prms: PL_LechaptCalmonParams, dbg: boolean = false) { super(prms, dbg); this.setCalculatorType(CalculatorType.LechaptCalmon); this._props.addObserver(this); @@ -77,7 +77,7 @@ export class LechaptCalmon extends Nub implements Observer { } public static get materials() { - return LechaptCalmon._materials; + return PL_LechaptCalmon._materials; } public get material(): LCMaterial { @@ -91,8 +91,8 @@ export class LechaptCalmon extends Nub implements Observer { /** * paramètres castés au bon type */ - get prms(): LechaptCalmonParams { - return this._prms as LechaptCalmonParams; + get prms(): PL_LechaptCalmonParams { + return this._prms as PL_LechaptCalmonParams; } public Calc(sVarCalc: string, rInit?: number): Result { @@ -161,7 +161,7 @@ export class LechaptCalmon extends Nub implements Observer { private applyMaterialPreset() { const m = this.properties.getPropValue("material"); if (m > 0) { - const values = LechaptCalmon._materials[m - 1]; // "0" means no preset + const values = PL_LechaptCalmon._materials[m - 1]; // "0" means no preset this.prms.L.singleValue = values.L; this.prms.M.singleValue = values.M; this.prms.N.singleValue = values.N; diff --git a/src/pipe_flow/lechaptcalmon_params.ts b/src/pipe_flow/pl_lechaptcalmon_params.ts similarity index 97% rename from src/pipe_flow/lechaptcalmon_params.ts rename to src/pipe_flow/pl_lechaptcalmon_params.ts index c10163a437cb466487b6ec219aeb1b1931f489e3..147183f3968fdf3bf1b9cf2b9bc9cbfe1a5bccf0 100644 --- a/src/pipe_flow/lechaptcalmon_params.ts +++ b/src/pipe_flow/pl_lechaptcalmon_params.ts @@ -5,7 +5,7 @@ import { ParamsEquation } from "../param/params-equation"; /** * paramètres pour le calcul Lechapt et Calmon */ -export class LechaptCalmonParams extends ParamsEquation { +export class PL_LechaptCalmonParams extends ParamsEquation { /** Débit */ private _Q: ParamDefinition; diff --git a/src/pipe_flow/pressureloss.ts b/src/pipe_flow/pressureloss.ts new file mode 100644 index 0000000000000000000000000000000000000000..65b051d1b413109f37ea3f43661507a1a6b929ec --- /dev/null +++ b/src/pipe_flow/pressureloss.ts @@ -0,0 +1,21 @@ +import { Nub } from "../nub"; +import { Observer } from "../util/observer"; +import { Result } from "../util/result"; + +export class PressureLoss extends Nub implements Observer { + + /** + * paramétrage de la calculabilité des paramètres + */ + protected setParametersCalculability() { + } + + public Equation(sVarCalc: string): Result { + return undefined; + } + + // interface Observer + + public update(sender: any, data: any) { + } +} diff --git a/src/session.ts b/src/session.ts index 31f5cdcebdc95a30520eb6a7be7f72b0f8e24baf..0496e9ad0741d764b2a5f62a2eded5514c70e2f1 100644 --- a/src/session.ts +++ b/src/session.ts @@ -62,8 +62,8 @@ import { PabPuissance } from "./pab/pab_puissance"; import { PabPuissanceParams } from "./pab/pab_puissance_params"; import { ConduiteDistrib } from "./pipe_flow/cond_distri"; import { ConduiteDistribParams } from "./pipe_flow/cond_distri_params"; -import { LechaptCalmon } from "./pipe_flow/lechaptcalmon"; -import { LechaptCalmonParams } from "./pipe_flow/lechaptcalmon_params"; +import { PL_LechaptCalmon } from "./pipe_flow/pl_lechaptcalmon"; +import { PL_LechaptCalmonParams } from "./pipe_flow/pl_lechaptcalmon_params"; import { Solveur } from "./solveur/solveur"; import { SolveurParams } from "./solveur/solveur_params"; import { Dever } from "./structure/dever"; @@ -394,7 +394,7 @@ export class Session { break; case CalculatorType.LechaptCalmon: - prms = new LechaptCalmonParams( + prms = new PL_LechaptCalmonParams( 3, // débit 1.2, // diamètre 0.6, /// perte de charge @@ -405,7 +405,7 @@ export class Session { 0, // Ks Perte de charge singulière nullParams ); - nub = new LechaptCalmon(prms, dbg); + nub = new PL_LechaptCalmon(prms, dbg); break; case CalculatorType.SectionParametree: