diff --git a/spec/iterator/param_equation.spec.ts b/spec/iterator/param_equation.spec.ts index 54e25afaecaa3d9b4267cbf022dd049ea835e4e0..6d5c485591098639896bc958a48068294c90d580 100644 --- a/spec/iterator/param_equation.spec.ts +++ b/spec/iterator/param_equation.spec.ts @@ -39,7 +39,7 @@ describe("iterator : ", () => { pst.addChild(st); const symbs = [ - "Q", "Z1", "Z2", "CdWR", "CdGR", "CdWSL", "CdWS", "h1", "h2", "L", "Q", "W", "Z1", "Z2", "ZDV" + "Q", "Z1", "Z2", "CdWR", "CdGR", "CdCunge", "CdWSL", "CdWS", "h1", "h2", "L", "Q", "W", "Z1", "Z2", "ZDV" ]; const vals = [1, 2, 3]; checkParams(pst.parameterIterator, symbs, vals); diff --git a/spec/structure/functions.ts b/spec/structure/functions.ts index 0059762638421aeaac605cc29e753e0de6e3bfe5..bde4af06d37b470443adb35df3182ec17350c2b2 100644 --- a/spec/structure/functions.ts +++ b/spec/structure/functions.ts @@ -189,7 +189,8 @@ export function testParallelStructures(o: { ps: ParallelStructure, ld: number[] } else { // Cas normal : On teste la valeur calculée if (ParamCalculability.DICHO === prm.calculability) { - it(`should return ${ref}`, () => { + fit(`should return ${ref}`, () => { + // console.log(o.ps.serialise()); checkResult(o.ps.CalcSerie(), ref); /* checkResult(o.ps.Calc({ uid: o.ps.structures[i].uid, diff --git a/src/structure/factory_structure.ts b/src/structure/factory_structure.ts index b5dd0233f08bd21f04c8f97e7f5af6dfbae9fe9c..41fa3817c7d9bc59390dafd42a36ec8eab3ff951 100755 --- a/src/structure/factory_structure.ts +++ b/src/structure/factory_structure.ts @@ -81,10 +81,12 @@ export function CreateStructure(loiDebit: LoiDebit, parentNub?: ParallelStructur case LoiDebit.GateCunge80: ret = new StructureGateCunge80(rectStructPrms, dbg); + rectStructPrms.CdCunge.singleValue = 1; break; case LoiDebit.WeirCunge80: ret = new StructureWeirCunge80(rectStructPrms, dbg); + rectStructPrms.CdCunge.singleValue = 1; break; case LoiDebit.RectangularOrificeFree: diff --git a/src/structure/rectangular_structure.ts b/src/structure/rectangular_structure.ts index ae113b2652883a1a932553fea0257139a5a4e940..0fe0327afe6f157bf53a41e19ad988887639cbb4 100644 --- a/src/structure/rectangular_structure.ts +++ b/src/structure/rectangular_structure.ts @@ -13,6 +13,7 @@ export abstract class RectangularStructure extends Structure { this.prms.CdWR.visible = false; this.prms.CdWS.visible = false; this.prms.CdWSL.visible = false; + this.prms.CdCunge.visible = false; } /** diff --git a/src/structure/rectangular_structure_params.ts b/src/structure/rectangular_structure_params.ts index 10e16075ccff44b6f1e960b616d137c0e504d35b..51cb65b737dcadb201a4fc5aef62869b232e6f16 100644 --- a/src/structure/rectangular_structure_params.ts +++ b/src/structure/rectangular_structure_params.ts @@ -21,6 +21,9 @@ export class RectangularStructureParams extends StructureParams { public CdWSL: ParamDefinition; // tslint:disable-next-line:variable-name public CdWS: ParamDefinition; + // tslint:disable-next-line:variable-name + public CdCunge: ParamDefinition; + /** * Constructeur d'une structure rectangulaire @@ -45,5 +48,7 @@ export class RectangularStructureParams extends StructureParams { this.addParamDefinition(this.CdWSL); this.CdWS = new ParamDefinition(this, "CdWS", domainCd, undefined, rCd); this.addParamDefinition(this.CdWS); + this.CdCunge = new ParamDefinition(this, "CdCunge", domainCd, undefined, rCd); + this.addParamDefinition(this.CdCunge); } } diff --git a/src/structure/structure_gate_cunge80.ts b/src/structure/structure_gate_cunge80.ts index 3d87c971244b73b8acdd0f3ecf7cfe9154201ddf..d9ff383625af417477190b9042bff1fa379b88fb 100644 --- a/src/structure/structure_gate_cunge80.ts +++ b/src/structure/structure_gate_cunge80.ts @@ -17,7 +17,7 @@ export class StructureGateCunge80 extends RectangularStructure { this._isZDVcalculable = false; } this.prms.W.visible = true; - this.prms.CdGR.visible = true; + this.prms.CdCunge.visible = true; } /** @@ -32,21 +32,21 @@ export class StructureGateCunge80 extends RectangularStructure { case StructureFlowRegime.FREE: if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) { const R32: number = 3 * Math.sqrt(3) / 2; - v = this.prms.CdGR.v * this.prms.L.v * Structure.R2G / R32 * Math.pow(this.prms.h1.v, 1.5); + v = this.prms.CdCunge.v * this.prms.L.v * Structure.R2G / R32 * Math.pow(this.prms.h1.v, 1.5); this.debug("StructureCunge80.Equation WEIR FREE Q=" + v); } else { - v = this.prms.CdGR.v * this.prms.L.v * Structure.R2G + v = this.prms.CdCunge.v * this.prms.L.v * Structure.R2G * this.W * Math.pow(this.prms.h1.v - this.W, 0.5); this.debug("StructureCunge80.Equation ORIFICE FREE Q=" + v); } break; case StructureFlowRegime.SUBMERGED: if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) { - v = this.prms.CdGR.v * this.prms.L.v * Structure.R2G * this.prms.h2.v + v = this.prms.CdCunge.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); } else { - v = this.prms.CdGR.v * this.prms.L.v * Structure.R2G + v = this.prms.CdCunge.v * this.prms.L.v * Structure.R2G * this.W * Math.sqrt(this.prms.h1.v - this.prms.h2.v); this.debug("StructureCunge80.Equation ORIFICE SUBMERGED Q=" + v); } @@ -86,5 +86,6 @@ export class StructureGateCunge80 extends RectangularStructure { protected setParametersCalculability() { super.setParametersCalculability(); this.prms.W.calculability = ParamCalculability.DICHO; + this.prms.CdCunge.calculability = ParamCalculability.DICHO; } } diff --git a/src/structure/structure_props.ts b/src/structure/structure_props.ts index c0aa812217d50ab294de310740891e09ce5d7d49..5b63ba1c733a07d743083e7f0af4ef64016aa4ec 100644 --- a/src/structure/structure_props.ts +++ b/src/structure/structure_props.ts @@ -78,7 +78,7 @@ export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = { LoiDebit.OrificeSubmerged ], SeuilRectangulaire: [ - LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte + LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte, LoiDebit.WeirCunge80 ], SeuilTriangulaire: [ LoiDebit.TriangularWeirFree, LoiDebit.TriangularWeirBroad @@ -86,6 +86,9 @@ export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = { SeuilTriangulaireTrunc: [ LoiDebit.TriangularTruncWeirFree ], + VanneRectangulaire: [ + LoiDebit.GateCunge80 + ] }; export const loiAdmissiblesDever: { [key: string]: LoiDebit[] } = { @@ -105,7 +108,7 @@ export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = { LoiDebit.OrificeSubmerged ], SeuilRectangulaire: [ - LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte + LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte, LoiDebit.WeirCunge80 ], VanneLevante: [ LoiDebit.VanLevVillemonte, LoiDebit.VanLevLarinier @@ -115,6 +118,9 @@ export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = { ], SeuilTriangulaireTrunc: [ LoiDebit.TriangularTruncWeirFree + ], + VanneRectangulaire: [ + LoiDebit.GateCunge80 ] };