Skip to content
Snippets Groups Projects
Commit 0bf3e568 authored by Mathias Chouet's avatar Mathias Chouet
Browse files

[WIP] Fix #221 - add Cunge80 discharge law to Cloisons

parent 6b8ccc21
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ describe("iterator : ", () => { ...@@ -39,7 +39,7 @@ describe("iterator : ", () => {
pst.addChild(st); pst.addChild(st);
const symbs = [ 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]; const vals = [1, 2, 3];
checkParams(pst.parameterIterator, symbs, vals); checkParams(pst.parameterIterator, symbs, vals);
......
...@@ -189,7 +189,8 @@ export function testParallelStructures(o: { ps: ParallelStructure, ld: number[] ...@@ -189,7 +189,8 @@ export function testParallelStructures(o: { ps: ParallelStructure, ld: number[]
} else { } else {
// Cas normal : On teste la valeur calculée // Cas normal : On teste la valeur calculée
if (ParamCalculability.DICHO === prm.calculability) { 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.CalcSerie(), ref);
/* checkResult(o.ps.Calc({ /* checkResult(o.ps.Calc({
uid: o.ps.structures[i].uid, uid: o.ps.structures[i].uid,
......
...@@ -81,10 +81,12 @@ export function CreateStructure(loiDebit: LoiDebit, parentNub?: ParallelStructur ...@@ -81,10 +81,12 @@ export function CreateStructure(loiDebit: LoiDebit, parentNub?: ParallelStructur
case LoiDebit.GateCunge80: case LoiDebit.GateCunge80:
ret = new StructureGateCunge80(rectStructPrms, dbg); ret = new StructureGateCunge80(rectStructPrms, dbg);
rectStructPrms.CdCunge.singleValue = 1;
break; break;
case LoiDebit.WeirCunge80: case LoiDebit.WeirCunge80:
ret = new StructureWeirCunge80(rectStructPrms, dbg); ret = new StructureWeirCunge80(rectStructPrms, dbg);
rectStructPrms.CdCunge.singleValue = 1;
break; break;
case LoiDebit.RectangularOrificeFree: case LoiDebit.RectangularOrificeFree:
......
...@@ -13,6 +13,7 @@ export abstract class RectangularStructure extends Structure { ...@@ -13,6 +13,7 @@ export abstract class RectangularStructure extends Structure {
this.prms.CdWR.visible = false; this.prms.CdWR.visible = false;
this.prms.CdWS.visible = false; this.prms.CdWS.visible = false;
this.prms.CdWSL.visible = false; this.prms.CdWSL.visible = false;
this.prms.CdCunge.visible = false;
} }
/** /**
......
...@@ -21,6 +21,9 @@ export class RectangularStructureParams extends StructureParams { ...@@ -21,6 +21,9 @@ export class RectangularStructureParams extends StructureParams {
public CdWSL: ParamDefinition; public CdWSL: ParamDefinition;
// tslint:disable-next-line:variable-name // tslint:disable-next-line:variable-name
public CdWS: ParamDefinition; public CdWS: ParamDefinition;
// tslint:disable-next-line:variable-name
public CdCunge: ParamDefinition;
/** /**
* Constructeur d'une structure rectangulaire * Constructeur d'une structure rectangulaire
...@@ -45,5 +48,7 @@ export class RectangularStructureParams extends StructureParams { ...@@ -45,5 +48,7 @@ export class RectangularStructureParams extends StructureParams {
this.addParamDefinition(this.CdWSL); this.addParamDefinition(this.CdWSL);
this.CdWS = new ParamDefinition(this, "CdWS", domainCd, undefined, rCd); this.CdWS = new ParamDefinition(this, "CdWS", domainCd, undefined, rCd);
this.addParamDefinition(this.CdWS); this.addParamDefinition(this.CdWS);
this.CdCunge = new ParamDefinition(this, "CdCunge", domainCd, undefined, rCd);
this.addParamDefinition(this.CdCunge);
} }
} }
...@@ -17,7 +17,7 @@ export class StructureGateCunge80 extends RectangularStructure { ...@@ -17,7 +17,7 @@ export class StructureGateCunge80 extends RectangularStructure {
this._isZDVcalculable = false; this._isZDVcalculable = false;
} }
this.prms.W.visible = true; this.prms.W.visible = true;
this.prms.CdGR.visible = true; this.prms.CdCunge.visible = true;
} }
/** /**
...@@ -32,21 +32,21 @@ export class StructureGateCunge80 extends RectangularStructure { ...@@ -32,21 +32,21 @@ export class StructureGateCunge80 extends RectangularStructure {
case StructureFlowRegime.FREE: case StructureFlowRegime.FREE:
if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) { if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) {
const R32: number = 3 * Math.sqrt(3) / 2; 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); this.debug("StructureCunge80.Equation WEIR FREE Q=" + v);
} else { } 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.W * Math.pow(this.prms.h1.v - this.W, 0.5);
this.debug("StructureCunge80.Equation ORIFICE FREE Q=" + v); this.debug("StructureCunge80.Equation ORIFICE FREE Q=" + v);
} }
break; break;
case StructureFlowRegime.SUBMERGED: case StructureFlowRegime.SUBMERGED:
if (data.ENUM_StructureFlowMode === StructureFlowMode.WEIR) { 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); * Math.sqrt(this.prms.h1.v - this.prms.h2.v);
this.debug("StructureCunge80.Equation WEIR SUBMERGED Q=" + v); this.debug("StructureCunge80.Equation WEIR SUBMERGED Q=" + v);
} else { } 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.W * Math.sqrt(this.prms.h1.v - this.prms.h2.v);
this.debug("StructureCunge80.Equation ORIFICE SUBMERGED Q=" + v); this.debug("StructureCunge80.Equation ORIFICE SUBMERGED Q=" + v);
} }
...@@ -86,5 +86,6 @@ export class StructureGateCunge80 extends RectangularStructure { ...@@ -86,5 +86,6 @@ export class StructureGateCunge80 extends RectangularStructure {
protected setParametersCalculability() { protected setParametersCalculability() {
super.setParametersCalculability(); super.setParametersCalculability();
this.prms.W.calculability = ParamCalculability.DICHO; this.prms.W.calculability = ParamCalculability.DICHO;
this.prms.CdCunge.calculability = ParamCalculability.DICHO;
} }
} }
...@@ -78,7 +78,7 @@ export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = { ...@@ -78,7 +78,7 @@ export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = {
LoiDebit.OrificeSubmerged LoiDebit.OrificeSubmerged
], ],
SeuilRectangulaire: [ SeuilRectangulaire: [
LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte, LoiDebit.WeirCunge80
], ],
SeuilTriangulaire: [ SeuilTriangulaire: [
LoiDebit.TriangularWeirFree, LoiDebit.TriangularWeirBroad LoiDebit.TriangularWeirFree, LoiDebit.TriangularWeirBroad
...@@ -86,6 +86,9 @@ export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = { ...@@ -86,6 +86,9 @@ export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = {
SeuilTriangulaireTrunc: [ SeuilTriangulaireTrunc: [
LoiDebit.TriangularTruncWeirFree LoiDebit.TriangularTruncWeirFree
], ],
VanneRectangulaire: [
LoiDebit.GateCunge80
]
}; };
export const loiAdmissiblesDever: { [key: string]: LoiDebit[] } = { export const loiAdmissiblesDever: { [key: string]: LoiDebit[] } = {
...@@ -105,7 +108,7 @@ export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = { ...@@ -105,7 +108,7 @@ export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = {
LoiDebit.OrificeSubmerged LoiDebit.OrificeSubmerged
], ],
SeuilRectangulaire: [ SeuilRectangulaire: [
LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte, LoiDebit.WeirCunge80
], ],
VanneLevante: [ VanneLevante: [
LoiDebit.VanLevVillemonte, LoiDebit.VanLevLarinier LoiDebit.VanLevVillemonte, LoiDebit.VanLevLarinier
...@@ -115,6 +118,9 @@ export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = { ...@@ -115,6 +118,9 @@ export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = {
], ],
SeuilTriangulaireTrunc: [ SeuilTriangulaireTrunc: [
LoiDebit.TriangularTruncWeirFree LoiDebit.TriangularTruncWeirFree
],
VanneRectangulaire: [
LoiDebit.GateCunge80
] ]
}; };
......
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