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

Add structure OrificeFree

parent 0708e2c6
import { StructureFlowMode, StructureFlowRegime } from "../../src/structure/structure";
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 test: StructureOrificeFree = new StructureOrificeFree(prms, false);
describe("Class StructureOrificeFree: ", () => {
describe("Calc(Q): ", () => {
const h1: number[] = [102];
const Q: number[] = [0.219];
const mode: StructureFlowMode = StructureFlowMode.ORIFICE;
const regime: StructureFlowRegime = StructureFlowRegime.SUBMERGED;
for (let i = 0; i < Q.length; i++) {
itCalcQ(test, h1[i], Infinity, Q[i], mode, regime);
}
});
});
......@@ -11,6 +11,8 @@ import { StructureGateCem88v } from "./structure_gate_cem88v";
import { StructureGateCunge80 } from "./structure_gate_cunge80";
import { StructureKivi } from "./structure_kivi";
import { StructureKiviParams } from "./structure_kivi_params";
import { StructureOrificeFree } from "./structure_orifice_free";
import { StructureOrificeFreeParams } from "./structure_orifice_free_params";
import { StructureOrificeSubmerged } from "./structure_orifice_submerged";
import { StructureOrificeSubmergedParams } from "./structure_orifice_submerged_params";
import { StructureRectangularOrificeFree } from "./structure_rectangular_orifice_free";
......@@ -157,6 +159,20 @@ export function CreateStructure(loiDebit: LoiDebit, parentNub?: ParallelStructur
);
break;
case LoiDebit.OrificeFree:
ret = new StructureOrificeFree(
new StructureOrificeFreeParams(
0, // Q
102, // Z1
101.5, // Z2
0.7, // Cd
0.1, // S
0.5 // H
),
dbg
);
break;
case LoiDebit.WeirVillemonte:
ret = new StructureWeirVillemonte(rectStructPrms, dbg);
break;
......
import { ParamCalculability } from "../param/param-definition";
import { Structure, StructureFlowMode, StructureFlowRegime } from "../structure/structure";
import { Result } from "../util/result";
import { StructureOrificeFreeParams } from "./structure_orifice_free_params";
import { LoiDebit } from "./structure_props";
/**
* Equation classique orifice dénoyé
*/
export class StructureOrificeFree extends Structure {
constructor(prms: StructureOrificeFreeParams, dbg: boolean = false) {
super(prms, dbg);
this._loiDebit = LoiDebit.OrificeFree;
this._isZDVcalculable = false;
}
/**
* paramètres castés au bon type
*/
get prms(): StructureOrificeFreeParams {
return this._prms as StructureOrificeFreeParams;
}
/**
* Calcul du débit avec l'équation classique d'un orifice dénoyé
*/
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);
return new Result(v, this, data);
}
public calcA(): number {
return this.prms.S.v;
}
protected getFlowRegime() {
// @TODO ça dépend de H ?
return StructureFlowRegime.SUBMERGED;
}
protected getFlowMode() {
return StructureFlowMode.ORIFICE;
}
protected setParametersCalculability() {
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.ZDV.visible = false;
}
}
import { ParamDefinition } from "../param/param-definition";
import { ParamDomain, ParamDomainValue } from "../param/param-domain";
import { StructureParams } from "../structure/structure_params";
export class StructureOrificeFreeParams extends StructureParams {
/** Area of the orifice (m2) */
public S: ParamDefinition;
/** Discharge coefficient */
// 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 ?
/**
* Constructeur d'une structure rectangulaire
* @param rQ Débit (m3/s)
* @param rZ1 Cote de l'eau amont (m)
* @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)
*/
constructor(rQ: number, rZ1: number, rZ2: number, rCd: number, rS: number, rH: 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);
// hide params
this.ZDV.visible = false;
}
/**
* Mise à jour de h1 et h2
*/
public update_h1h2() {
// Inutile pour cette équation qui ne fait pas intervenir ces variables
}
}
......@@ -37,6 +37,8 @@ export enum LoiDebit {
WeirSubmergedLarinier,
// Loi de débit orifice noyé
OrificeSubmerged,
// Loi de débit orifice dénoyé
OrificeFree,
// Loi de seuil noyée Villemonte
WeirVillemonte,
// Vanne levante Larinier
......@@ -49,7 +51,7 @@ export enum LoiDebit {
export const loiAdmissiblesOuvrages: { [key: string]: LoiDebit[] } = {
Orifice: [
LoiDebit.OrificeSubmerged
LoiDebit.OrificeSubmerged, LoiDebit.OrificeFree
],
SeuilRectangulaire: [
LoiDebit.WeirCem88d, LoiDebit.WeirCem88v, LoiDebit.WeirSubmergedLarinier,
......@@ -69,7 +71,7 @@ export const loiAdmissiblesOuvrages: { [key: string]: LoiDebit[] } = {
export const loiAdmissiblesCloisons: { [key: string]: LoiDebit[] } = {
Orifice: [
LoiDebit.OrificeSubmerged
LoiDebit.OrificeSubmerged, LoiDebit.OrificeFree
],
SeuilRectangulaire: [
LoiDebit.WeirSubmergedLarinier, LoiDebit.WeirVillemonte
......@@ -96,7 +98,7 @@ export const loiAdmissiblesDever: { [key: string]: LoiDebit[] } = {
export const loiAdmissiblesCloisonAval: { [key: string]: LoiDebit[] } = {
Orifice: [
LoiDebit.OrificeSubmerged
LoiDebit.OrificeSubmerged, LoiDebit.OrificeFree
],
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