Skip to content
Snippets Groups Projects
Commit 83db3917 authored by David Dorchies's avatar David Dorchies
Browse files

Fix #97 ZDV à -Infinity

parent faf6ec5b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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);
......
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