Commit 7f710648 authored by Dorchies David's avatar Dorchies David
Browse files

feat: remove Cx

- Adjust linear regression for rQ

Refs #295
parent 553315fe
function [f] = calcfFr(Frg, rQ)
if ~exists("rQ","local") then
if(Cd0 > 1.99) then
rQ = 1.25
rQ = 1.21
else
rQ = 1
rQ = 1.12
end
end
......
......@@ -16,11 +16,11 @@ z_amont = 12.5; // Cote amont (m)
long = 6; // Longueur rampe (m)
// *****************************************************************************
printf("\n*** Emergent conditions Cd=1.15***\n")
printf("\n*** Emergent conditions Cd=1.***\n")
// *****************************************************************************
h = 0.4
k = 0.6
Cd0 = 1.15 // Forme ronde
Cd0 = 1. // Forme ronde
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
......@@ -28,21 +28,21 @@ printf("\n*** Emergent conditions Cd=2***\n")
// *****************************************************************************
h = 0.4
k = 0.6
Cd0 = 2.07// Forme plane
Cd0 = 2.// Forme plane
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** Submerged conditions Cd=1.15***\n")
printf("\n*** Submerged conditions Cd=1***\n")
// *****************************************************************************
k = 0.6
h = 0.8
Cd0 = 1.15 // Forme ronde
Cd0 = 1. // Forme ronde
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** JalHyd #85 ***\n")
// *****************************************************************************
Cd0 = 1.15
Cd0 = 1.
k = 0.8
C = 0.2; // Concentration
Q = []
......
......@@ -42,11 +42,8 @@ export class MacroRugo extends FishPass {
/** Coefficients used in f_h*(h*) */
private paramFhStar: [number, number, number] = [1, 0.8, 1.5];
/** Coefficient used in Cx */
private paramCx: [number, number] = [0.92, 0.23];
/** Coefficient used in rQ */
private paramRQ: [number, number] = [0.25, 0.75];
private paramRQ: [number, number] = [0.09, 1.03];
/** Coefficient used in rQ */
private paramRV: [number, number] = [0.2, 1];
......@@ -147,23 +144,6 @@ export class MacroRugo extends FishPass {
} else {
r.resultElement.values.ENUM_MacroRugoFlowType = MacroRugoFlowType.SUBMERGED;
}
// Vitesse et débit du guide technique
/* let cQ: [number, number, number, number];
let cV: [number, number, number];
let hdk: number;
if (r.resultElement.values.ENUM_MacroRugoFlowType === MacroRugoFlowType.SUBMERGED) {
cQ = [0.955, 2.282, 0.466, -0.23];
hdk = this.prms.PBH.v;
} else {
hdk = this.prms.PBD.v;
if (Math.abs(this.prms.Cd0.v - 2) < 0.05) {
cQ = [0.648, 1.084, 0.56, -0.456];
cV = [3.35, 0.27, 0.53];
} else {
cQ = [0.815, 1.45, 0.557, -0.456];
cV = [4.54, 0.32, 0.56];
}
} */
if (this.prms.Y.v > 0 && this.prms.If.v > 0) {
r.resultElement.values.Strickler =
this.prms.Q.V / (Math.pow(this.prms.Y.v, 5 / 3) * this.prms.B.v * Math.pow(this.prms.If.v, 0.5));
......@@ -176,7 +156,7 @@ export class MacroRugo extends FishPass {
public Equation(sVarCalc: string): Result {
const Q = this.prms.Q.v;
const q0 = Math.sqrt(2 * MacroRugo.g * this.prms.If.v * this.prms.PBD.v * (1 - (this.sigma * this.prms.C.v)) /
(this.Cx * this.prms.C.v)) * this.prms.Y.v * this.prms.B.v;
(this.prms.Cd0.v * this.prms.C.v)) * this.prms.Y.v * this.prms.B.v;
let r: Result;
if (q0 > 0) {
this.setFlowType();
......@@ -314,26 +294,15 @@ export class MacroRugo extends FishPass {
}
}
/**
* Interpolation of Cd0 for Cd from calibrated Cd0 (See #291)
* Cx = 1.15 for Cd0 = 1 and Cx = 2 for Cd0 = 2
*/
private get Cx(): number {
if (this._cache.Cx === undefined) {
this._cache.Cx = this.paramCx[0] * this.prms.Cd0.v + this.paramCx[1];
}
return this._cache.Cx;
}
/**
* Calculation of Cd : drag coefficient of a block under the actual flow conditions
*/
private get Cd(): number {
if (this._cache.Cd === undefined) {
if(this.paramCdNewVersion) {
this._cache.Cd = this.Cx * Math.min(this.paramMaxCd, (this.paramFhStar[0] + this.paramFhStar[1] / Math.pow(this.prms.Y.v / this.prms.PBD.v, this.paramFhStar[2])));
this._cache.Cd = this.prms.Cd0.v * Math.min(this.paramMaxCd, (this.paramFhStar[0] + this.paramFhStar[1] / Math.pow(this.prms.Y.v / this.prms.PBD.v, this.paramFhStar[2])));
} else {
this._cache.Cd = Math.min(this.paramMaxCd, this.Cx * (this.paramFhStar[0] + this.paramFhStar[1] / Math.pow(this.prms.Y.v / this.prms.PBD.v, this.paramFhStar[2])));
this._cache.Cd = Math.min(this.paramMaxCd, this.prms.Cd0.v * (this.paramFhStar[0] + this.paramFhStar[1] / Math.pow(this.prms.Y.v / this.prms.PBD.v, this.paramFhStar[2])));
}
}
return this._cache.Cd;
......
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