diff --git a/spec/macrorugo/macrorugo.spec.ts b/spec/macrorugo/macrorugo.spec.ts index 0eb635f15779135ad3dcfc2fcc6910bb11c6353c..fe48196121e02214b42f96362b04b4370ea97949 100644 --- a/spec/macrorugo/macrorugo.spec.ts +++ b/spec/macrorugo/macrorugo.spec.ts @@ -85,19 +85,20 @@ describe("Class MacroRugo: ", () => { }); it(`Calc("Q", 0.1).extraResults.P should be around 759.240352`, () => { - checkPercent(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.P, 759.240352, 0.03); + checkPercent(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.PV, 759.240352, 0.03); }); it(`Calc("Q", 0.1).extraResults.FlowType should be MacroRugoFlowType.EMERGENT`, () => { - expect(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.FlowType).toBe(MacroRugoFlowType.EMERGENT); + expect(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.ENUM_MacroRugoFlowType) + .toBe(MacroRugoFlowType.EMERGENT); }); it(`Calc("Q", 0.1).extraResults.Q2 should be around 0.868672`, () => { - checkPercent(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.Q2, 0.868672, 0.03); + checkPercent(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.Q_GuideTech, 0.868672, 0.03); }); it(`Calc("Q", 0.1).extraResults.V2 should be around 1.991299`, () => { - checkPercent(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.V2, 1.991299, 0.03); + checkPercent(macroRugoInstanceEmergent().Calc("Q", 0.1).extraResults.V_GuideTech, 1.991299, 0.03); }); const nub = macroRugoInstanceEmergent(); diff --git a/spec/structure/functions.ts b/spec/structure/functions.ts index 800641dcb128957b41bf0f1704c9369e5d651c83..6d8e1e1e65629b70e7f0408120dcf02230b827c8 100644 --- a/spec/structure/functions.ts +++ b/spec/structure/functions.ts @@ -33,12 +33,12 @@ export function itCalcQ( }); if (mode !== undefined) { it("Q(Z1=" + Z1 + ",W=" + W + ") Mode should be " + mode, () => { - expect(res.extraResults.Mode).toBe(mode); + expect(res.extraResults.ENUM_StructureFlowMode).toBe(mode); }); } if (regime !== undefined) { it("Q(Z1=" + Z1 + ",W=" + W + ") Regime should be " + regime, () => { - expect(res.extraResults.Regime).toBe(regime); + expect(res.extraResults.ENUM_StructureFlowRegime).toBe(regime); }); } } diff --git a/spec/structure/parallel_structure.spec.ts b/spec/structure/parallel_structure.spec.ts index fcccae3e2bd580f998825ad636f42238c9a8714f..6ec41d511bb9979f4efb39493e6a21998457dcf3 100644 --- a/spec/structure/parallel_structure.spec.ts +++ b/spec/structure/parallel_structure.spec.ts @@ -67,12 +67,12 @@ function itParallelStructure(sVarCalc: string, rVcalc: number, Q?: number) { }); it(`ExtraResult[ouvrage[${i}].Q_Mode] should be 0`, () => { expect( - pstruct.Calc(sVarCalc).resultElement.extraResults[`ouvrage[${i}].Q_Mode`] + pstruct.Calc(sVarCalc).resultElement.extraResults[`ouvrage[${i}].Q_ENUM_StructureFlowMode`] ).toEqual(0); }); it(`ExtraResult[ouvrage[${i}].Q_Regime] should be 0`, () => { expect( - pstruct.Calc(sVarCalc).resultElement.extraResults[`ouvrage[${i}].Q_Regime`] + pstruct.Calc(sVarCalc).resultElement.extraResults[`ouvrage[${i}].Q_ENUM_StructureFlowRegime`] ).toEqual(0); }); } diff --git a/spec/structure/structure.spec.ts b/spec/structure/structure.spec.ts index 4a4c22b83fcb37f0d701e0346499461e02bd396c..62abfb7018aef7ab646aa122033b93a13df05c0b 100644 --- a/spec/structure/structure.spec.ts +++ b/spec/structure/structure.spec.ts @@ -46,7 +46,7 @@ describe("Class Structure: ", () => { }); describe("Calc()", () => { - const flagsNull = { Mode: StructureFlowMode.NULL, Regime: StructureFlowRegime.NULL }; + const flagsNull = { ENUM_StructureFlowMode: StructureFlowMode.NULL, ENUM_StructureFlowRegime: StructureFlowRegime.NULL }; it("Z1=Z2 => Q=0", () => { structTest.prms.Z2.v = structTest.prms.Z1.v; checkResult(structTest.Calc("Q"), 0); diff --git a/spec/structure/structure_triangular_trunc_weir_free.spec.ts b/spec/structure/structure_triangular_trunc_weir_free.spec.ts index f0e771dc22e8980e24039838f8173c26d7926660..c80ce74ca7f00d843aa9332c0d75625df774936c 100644 --- a/spec/structure/structure_triangular_trunc_weir_free.spec.ts +++ b/spec/structure/structure_triangular_trunc_weir_free.spec.ts @@ -17,15 +17,15 @@ const structTest: StructureTriangularTruncWeirFree = new StructureTriangularTrun describe("Class StructureTriangularTruncWeirFree: ", () => { describe("Calcul Q a surface libre avec h1 croissant: ", () => { - const h1: number[] = + const Z1: number[] = [100.1, 100.2, 100.3, 100.4, 100.5, 100.6, 100.7, 100.8, 100.9, 101, 101.1, 101.5, 101.8, 102]; const Q: number[] = [0., 0.004, 0.024, 0.067, 0.138, 0.240, 0.379, 0.558, 0.778, 1.045, 1.356, 2.914, 4.346, 5.407]; const mode: StructureFlowMode = StructureFlowMode.WEIR; const regime: StructureFlowRegime = StructureFlowRegime.FREE; - itCalcQ(structTest, h1[0], Infinity, Q[0], StructureFlowMode.NULL, StructureFlowRegime.NULL); + itCalcQ(structTest, Z1[0], Infinity, Q[0], StructureFlowMode.NULL, StructureFlowRegime.NULL); for (let i = 1; i < Q.length; i++) { - itCalcQ(structTest, h1[i], Infinity, Q[i], mode, regime); + itCalcQ(structTest, Z1[i], Infinity, Q[i], mode, regime); } }); }); diff --git a/spec/value_ref/value_ref_structure.spec.ts b/spec/value_ref/value_ref_structure.spec.ts index f49eb0a6805e8e240268189f5af17184e053a318..b24a97e5c7a46e5135a4d239ff6d5e01e7cb9d26 100644 --- a/spec/value_ref/value_ref_structure.spec.ts +++ b/spec/value_ref/value_ref_structure.spec.ts @@ -49,20 +49,20 @@ describe("référence d'un paramètre à un autre : ", () => { createEnv(); - prm4.Q.defineReference(nub1, "ouvrage[0].Q_Mode"); + prm4.Q.defineReference(nub1, "ouvrage[0].Q_ENUM_StructureFlowMode"); nub1.CalcSerie(0.001, 0.1, "Q"); nub2.CalcSerie(0.001, 0.1, "Q"); /* nub1.result.resultElements[0].extraResults = { "ouvrage[0].Q" : 6.264183905346331 - "ouvrage[0].Q_Mode" : 0 - "ouvrage[0].Q_Regime" : 0 + "ouvrage[0].Q_ENUM_StructureFlowMode" : 0 + "ouvrage[0].Q_ENUM_StructureFlowRegime" : 0 } nub2.result.resultElements[0].extraResults = { "ouvrage[0].Q" : 2.4110855093366834 - "ouvrage[0].Q_Mode" : 0 - "ouvrage[0].Q_Regime" : 0 + "ouvrage[0].Q_ENUM_StructureFlowMode" : 0 + "ouvrage[0].Q_ENUM_StructureFlowRegime" : 0 } */ @@ -83,13 +83,13 @@ describe("référence d'un paramètre à un autre : ", () => { /* nub1.result.resultElements[0].extraResults = { "ouvrage[0].Q" : 6.264183905346331 - "ouvrage[0].Q_Mode" : 0 - "ouvrage[0].Q_Regime" : 0 + "ouvrage[0].Q_ENUM_StructureFlowMode" : 0 + "ouvrage[0].Q_ENUM_StructureFlowRegime" : 0 } nub2.result.resultElements[0].extraResults = { "ouvrage[0].Q" : 2.4110855093366834 - "ouvrage[0].Q_Mode" : 0 - "ouvrage[0].Q_Regime" : 0 + "ouvrage[0].Q_ENUM_StructureFlowMode" : 0 + "ouvrage[0].Q_ENUM_StructureFlowRegime" : 0 } */ diff --git a/src/macrorugo/macrorugo.ts b/src/macrorugo/macrorugo.ts index 001b446a8ed159e42ba9885dce2394b13626686c..b69ba0d5432fc3b2be6c9d541540b8d40523ca68 100644 --- a/src/macrorugo/macrorugo.ts +++ b/src/macrorugo/macrorugo.ts @@ -1,8 +1,8 @@ import { Nub } from "../nub"; import { ParamCalculability } from "../param/param-definition"; +import { ParamValueMode } from "../param/param-value-mode"; import { Result } from "../util/result"; import { MacrorugoParams } from "./macrorugo_params"; -import { ParamValueMode } from "../param/param-value-mode"; export { MacrorugoParams }; @@ -75,11 +75,11 @@ export class MacroRugo extends Nub { r.extraResults.PV = 1000 * MacroRugo.g * this.V(this.prms.Q) / this.prms.B.v * this.prms.If.v; // Type d'écoulement if (this.prms.Y.v / this.prms.PBH.v < 1) { - r.extraResults.FlowType = MacroRugoFlowType.EMERGENT; + r.extraResults.ENUM_MacroRugoFlowType = MacroRugoFlowType.EMERGENT; } else if (this.prms.Y.v / this.prms.PBH.v < MacroRugo.limitSubmerg) { - r.extraResults.FlowType = MacroRugoFlowType.QUASI_EMERGENT; + r.extraResults.ENUM_MacroRugoFlowType = MacroRugoFlowType.QUASI_EMERGENT; } else { - r.extraResults.FlowType = MacroRugoFlowType.IMMERGE; + r.extraResults.ENUM_MacroRugoFlowType = MacroRugoFlowType.IMMERGE; } // Vitesse et débit du guide technique let cQ: [number, number, number, number]; diff --git a/src/structure/structure.ts b/src/structure/structure.ts index c3dfca928a2c59a0a010776e3383ad0010f2bf33..0494b4e1e8994c33adb5acba967fcd1a6d39f04c 100644 --- a/src/structure/structure.ts +++ b/src/structure/structure.ts @@ -110,7 +110,7 @@ export abstract class Structure extends Nub { this.prms.update_h1h2(); // Gestion du débit nul - const flagsNull = { Mode: StructureFlowMode.NULL, Regime: StructureFlowRegime.NULL }; + const flagsNull = { ENUM_StructureFlowMode: StructureFlowMode.NULL, ENUM_StructureFlowRegime: StructureFlowRegime.NULL }; if (sVarCalc === "Q") { if (this.prms.h1.v <= 0 || this.prms.Z1.v === this.prms.Z2.v || this.prms.W.v <= 0) { return new Result(0, flagsNull); @@ -166,8 +166,8 @@ export abstract class Structure extends Nub { protected getResultData() { return { - Mode: this.getFlowMode(), - Regime: this.getFlowRegime(), + ENUM_StructureFlowMode: this.getFlowMode(), + ENUM_StructureFlowRegime: this.getFlowRegime(), }; } diff --git a/src/structure/structure_cem88d.ts b/src/structure/structure_cem88d.ts index 0ddac7bdb41187a71f3eed1a07fa3bd55ae6f6a3..2040e13e26f91d4d107a6890a77d8d82767b2b16 100644 --- a/src/structure/structure_cem88d.ts +++ b/src/structure/structure_cem88d.ts @@ -31,9 +31,9 @@ export class StructureCem88d extends RectangularStructure { const b2: number = Math.sqrt(this.prms.h1.v - this.prms.h2.v); const cd1: number = cd * 2.5981; // cd * 3*sqrt(3)/2 this.debug("StructureCem88d.Equation b1=" + b1 + " b2=" + b2 + " cd1=" + cd1); - switch (data.Mode) { + switch (data.ENUM_StructureFlowMode) { case StructureFlowMode.WEIR: - switch (data.Regime) { + switch (data.ENUM_StructureFlowRegime) { case StructureFlowRegime.FREE: v = cd * this.prms.h1.v * b1; break; @@ -45,7 +45,7 @@ export class StructureCem88d extends RectangularStructure { break; case StructureFlowMode.ORIFICE: const b3: number = Math.pow(this.prms.h1.v - this.prms.W.v, 1.5); - switch (data.Regime) { + switch (data.ENUM_StructureFlowRegime) { case StructureFlowRegime.FREE: v = cd * (this.prms.h1.v * b1 - b3); break; diff --git a/src/structure/structure_cem88v.ts b/src/structure/structure_cem88v.ts index c0dc94caaaef79047b945e1fd85517529441c697..a7876538e36369e6fe7e82c87828a9224a861bc6 100644 --- a/src/structure/structure_cem88v.ts +++ b/src/structure/structure_cem88v.ts @@ -21,13 +21,13 @@ export class StructureCem88v extends RectangularStructure { let v: number; const mu0: number = 2 / 3 * this.prms.Cd.v; let KF: number; - if (data.Regime !== StructureFlowRegime.FREE) { + if (data.ENUM_StructureFlowRegime !== StructureFlowRegime.FREE) { KF = this.getKF(Math.sqrt(1 - this.prms.h2.v / this.prms.h1.v), this.getAlfa(this.prms.h2.v)); } - switch (data.Mode) { + switch (data.ENUM_StructureFlowMode) { case StructureFlowMode.WEIR: const muf: number = mu0 - 0.08; - switch (data.Regime) { + switch (data.ENUM_StructureFlowRegime) { case StructureFlowRegime.FREE: v = muf * this.prms.L.v * Structure.R2G * Math.pow(this.prms.h1.v, 1.5); break; @@ -40,12 +40,12 @@ export class StructureCem88v extends RectangularStructure { case StructureFlowMode.ORIFICE: const mu: number = mu0 - 0.08 / (this.prms.h1.v / this.prms.W.v); const mu1: number = mu0 - 0.08 / (this.prms.h1.v / this.prms.W.v - 1); - if (data.Regime === StructureFlowRegime.FREE) { + if (data.ENUM_StructureFlowRegime === StructureFlowRegime.FREE) { v = this.prms.L.v * Structure.R2G * (mu * Math.pow(this.prms.h1.v, 1.5) - mu1 * Math.pow(this.prms.h1.v - this.prms.W.v, 1.5)); } else { - if (data.Regime === StructureFlowRegime.PARTIAL) { + if (data.ENUM_StructureFlowRegime === StructureFlowRegime.PARTIAL) { v = this.prms.L.v * Structure.R2G * ( KF * mu * Math.pow(this.prms.h1.v, 1.5) - mu1 * Math.pow(this.prms.h1.v - this.prms.W.v, 1.5) diff --git a/src/structure/structure_cunge80.ts b/src/structure/structure_cunge80.ts index b278eadca75c9feb578e12a9cfdbcad4162ad789..eee8b87eacfbada092ae550eba1c34095a94979a 100644 --- a/src/structure/structure_cunge80.ts +++ b/src/structure/structure_cunge80.ts @@ -26,9 +26,9 @@ export class StructureCunge80 extends RectangularStructure { const data = this.getResultData(); let v: number; - switch (data.Regime) { + switch (data.ENUM_StructureFlowRegime) { case StructureFlowRegime.FREE: - if (data.Mode === StructureFlowMode.WEIR) { + if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) { const R32: number = 3 * Math.sqrt(3) / 2; v = this.prms.Cd.v * this.prms.L.v * Structure.R2G / R32 * Math.pow(this.prms.h1.v, 1.5); this.debug("StructureCunge80.Equation WEIR FREE Q=" + v); @@ -39,7 +39,7 @@ export class StructureCunge80 extends RectangularStructure { } break; case StructureFlowRegime.SUBMERGED: - if (data.Mode === StructureFlowMode.WEIR) { + if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) { v = this.prms.Cd.v * this.prms.L.v * Structure.R2G * this.prms.h2.v * Math.sqrt(this.prms.h1.v - this.prms.h2.v); this.debug("StructureCunge80.Equation WEIR SUBMERGED Q=" + v); diff --git a/src/structure/structure_kivi.ts b/src/structure/structure_kivi.ts index 082bdf614540ea028445f620f879ff7663914622..797f184f8bf7de0e3554ba51ea7164501e68681a 100644 --- a/src/structure/structure_kivi.ts +++ b/src/structure/structure_kivi.ts @@ -45,7 +45,7 @@ export class StructureKivi extends Structure { let Q = cd * this.prms.L.v * Structure.R2G * Math.pow(this.prms.h1.v, 1.5); - if (res.extraResults.Regime === StructureFlowRegime.SUBMERGED) { + if (res.extraResults.ENUM_StructureFlowRegime === StructureFlowRegime.SUBMERGED) { Q = Villemonte(this.prms.h1.v, this.prms.h2.v, 1.5) * Q; } diff --git a/src/structure/villemonte.ts b/src/structure/villemonte.ts index c2fdf090eb804fb167e3b52cc2b12e21d2565233..c78a2829f1fe457d8937177d2b63e7496005849f 100644 --- a/src/structure/villemonte.ts +++ b/src/structure/villemonte.ts @@ -2,7 +2,7 @@ * * @param h1 hauteur d'eau amont au dessus de la crête du seuil * @param h2 hauteur d'eau aval au dessus de la crête du seuil - * @param n n est l’exposant dans les relations d’écoulement dénoyé : + * @param n n est l'exposant dans les relations d'écoulement dénoyé : * déversoir proportionnel : n=1 déversoir rectangulaire : n=1,5 * déversoir parabolique : n=2 déversoir triangulaire : n=2,5 */