diff --git a/src/structure/structure.ts b/src/structure/structure.ts index a1bed2727d2da4dfe06a8f316bb955a6a312d2a1..6274720a964e03f1c881d8bcc911f5bb13aa2815 100644 --- a/src/structure/structure.ts +++ b/src/structure/structure.ts @@ -202,11 +202,13 @@ export abstract class Structure extends Nub { ); } + this.prms.update_h1h2(); + // Gestion du débit nul const flagsNull = { ENUM_StructureFlowMode: StructureFlowMode.NULL, ENUM_StructureFlowRegime: StructureFlowRegime.NULL }; if (sVarCalc === "Q") { - if (this.prms.Z1.v <= this.prms.ZDV.v || this.prms.Z1.v === this.prms.Z2.v || this.prms.W.v <= 0) { + if (this.prms.h1.v <= 0 || Math.abs(this.prms.h1.v - this.prms.h2.v) < 1E-20 || this.prms.W.v <= 1E-20) { return new Result(0, this, flagsNull); } } else if (this.prms.Q.v === 0) { @@ -234,7 +236,7 @@ export abstract class Structure extends Nub { let rPrm: number; switch (sVarCalc) { case "ZDV": - rPrm = Infinity; + rPrm = Math.max(this.prms.Z1.v, this.prms.Z2.v); break; default: rPrm = 0; diff --git a/src/structure/structure_orifice_submerged_params.ts b/src/structure/structure_orifice_submerged_params.ts index 68b0fc8ce2eef16034c0bcdc38eb38daaebd6a02..12e69efb48fc319db8ce38fa8a9f5e0ece6a9436 100644 --- a/src/structure/structure_orifice_submerged_params.ts +++ b/src/structure/structure_orifice_submerged_params.ts @@ -23,7 +23,7 @@ export class StructureOrificeSubmergedParams extends StructureParams { * @param rS Surface de l'orifice (m2) */ constructor(rQ: number, rZ1: number, rZ2: number, rCd: number, rS: number) { - super(rQ, -Infinity, rZ1, rZ2); + super(rQ, 100, rZ1, rZ2); this.S = new ParamDefinition(this, "S", ParamDomainValue.POS_NULL, rS); this.addParamDefinition(this.S); this.Cd = new ParamDefinition(this, "Cd", ParamDomainValue.POS_NULL, rCd);