Commit ed890e73 authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

Update OrificeFree

parent a1eaa6ad
......@@ -3,15 +3,15 @@ import { StructureOrificeFree } from "../../src/structure/structure_orifice_free
import { StructureOrificeFreeParams } from "../../src/structure/structure_orifice_free_params";
import { itCalcQ } from "../structure/functions";
const prms: StructureOrificeFreeParams = new StructureOrificeFreeParams(0, 102, 101.5, 0.7, 0.1, 0.5);
const prms: StructureOrificeFreeParams = new StructureOrificeFreeParams(0, 102, 101.5, 0.7, 0.1, 101);
const test: StructureOrificeFree = new StructureOrificeFree(prms, false);
describe("Class StructureOrificeFree: ", () => {
describe("Calc(Q): ", () => {
const h1: number[] = [102];
const Q: number[] = [0.219];
const Q: number[] = [0.310];
const mode: StructureFlowMode = StructureFlowMode.ORIFICE;
const regime: StructureFlowRegime = StructureFlowRegime.SUBMERGED;
const regime: StructureFlowRegime = StructureFlowRegime.FREE;
for (let i = 0; i < Q.length; i++) {
itCalcQ(test, h1[i], Infinity, Q[i], mode, regime);
}
......
......@@ -167,7 +167,7 @@ export function CreateStructure(loiDebit: LoiDebit, parentNub?: ParallelStructur
101.5, // Z2
0.7, // Cd
0.1, // S
0.5 // H
101 // Zco
),
dbg
);
......
......@@ -28,7 +28,7 @@ export class StructureOrificeFree extends Structure {
public CalcQ(): Result {
const data = this.getResultData();
const v = this.prms.CdO.v * this.prms.S.v * Structure.R2G * Math.sqrt(this.prms.H.v);
const v = this.prms.CdO.v * this.prms.S.v * Structure.R2G * Math.sqrt(this.prms.h1.v);
return new Result(v, this, data);
}
......@@ -38,8 +38,7 @@ export class StructureOrificeFree extends Structure {
}
protected getFlowRegime() {
// @TODO ça dépend de H ?
return StructureFlowRegime.SUBMERGED;
return StructureFlowRegime.FREE;
}
protected getFlowMode() {
......@@ -50,7 +49,7 @@ export class StructureOrificeFree extends Structure {
super.setParametersCalculability();
this.prms.S.calculability = ParamCalculability.DICHO;
this.prms.CdO.calculability = ParamCalculability.DICHO;
this.prms.H.calculability = ParamCalculability.DICHO; // @TODO or not ?
this.prms.Zco.calculability = ParamCalculability.DICHO;
this.prms.ZDV.visible = false;
}
}
......@@ -11,8 +11,9 @@ export class StructureOrificeFreeParams extends StructureParams {
// tslint:disable-next-line:variable-name
public CdO: ParamDefinition; // @TODO rename ?
/** Water level between surface and orifice center */
public H: ParamDefinition; // @TODO or is it calculated using Z1/Z2 ?
/** Elevation of orifice center */
// tslint:disable-next-line:variable-name
public Zco: ParamDefinition;
/**
* Constructeur d'une structure rectangulaire
......@@ -21,25 +22,23 @@ export class StructureOrificeFreeParams extends StructureParams {
* @param rZ2 Cote de l'eau aval (m)
* @param rCd Coefficient de débit (-)
* @param rS Surface de l'orifice (m2)
* @param rH Hauteur d'eau entre la surface et le centre de l'orifice (m)
* @param rZco Cote du centre de l'orifice (m)
*/
constructor(rQ: number, rZ1: number, rZ2: number, rCd: number, rS: number, rH: number) {
constructor(rQ: number, rZ1: number, rZ2: number, rCd: number, rS: number, rZco: number) {
super(rQ, 100, rZ1, rZ2);
this.S = new ParamDefinition(this, "S", ParamDomainValue.POS_NULL, "", rS);
this.addParamDefinition(this.S);
this.CdO = new ParamDefinition(this, "CdO", new ParamDomain(ParamDomainValue.INTERVAL, 0, 10), undefined, rCd);
this.addParamDefinition(this.CdO);
this.H = new ParamDefinition(this, "H", new ParamDomain(ParamDomainValue.ANY), undefined, rH);
this.addParamDefinition(this.H);
this.Zco = new ParamDefinition(this, "Zco", new ParamDomain(ParamDomainValue.ANY), "m", rZco);
this.addParamDefinition(this.Zco);
// hide params
this.ZDV.visible = false;
}
/**
* Mise à jour de h1 et h2
*/
/** Mise à jour de h1 */
public update_h1h2() {
// Inutile pour cette équation qui ne fait pas intervenir ces variables
this.h1.v = this.Z1.v - this.Zco.v;
}
}
......@@ -71,7 +71,7 @@ export const loiAdmissiblesOuvrages: { [key: string]: LoiDebit[] } = {
export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = {
Orifice: [
LoiDebit.OrificeSubmerged, LoiDebit.OrificeFree
LoiDebit.OrificeSubmerged
],
SeuilRectangulaire: [
LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte
......@@ -98,7 +98,7 @@ export const loiAdmissiblesDever: { [key: string]: LoiDebit[] } = {
export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = {
Orifice: [
LoiDebit.OrificeSubmerged, LoiDebit.OrificeFree
LoiDebit.OrificeSubmerged
],
SeuilRectangulaire: [
LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment