Commit f0a8431a by Dorchies David

Merge branch '297-macrorugo-back-to-v4-13-1-formulas' into 'devel'

```Resolve "MacroRugo: back to v4.13.1 formulas"

See merge request cassiopee/jalhyd!98```
parents 97d137af dbf76ac5
 function [f] = calcfFr(Frg, rQ) if ~exists("rQ","local") then rQ = 0.091 * Cd0 + 1.033 rQ = 0.4 * Cd0 + 0.7 end if abs(Frg) < 1 ... ...
 ... ... @@ -19,7 +19,7 @@ function [res]=find_Q_nat(Q,ks,D,h,Cd0,S,L,pf,C,sigma,bDbg) fFr = calcfFr(Frg) //Cd=Cd0.*(1+0.4./(pf./D).^2); Cd=Cd0.*min(3,(1+0.8./(pf./D).^1.5)); Cd=Cd0.*min(1E9,(1+1./(pf./D).^2)); //Cd=Cd0.*(0.8-2*C).*(1+0.4./(pf./D).^2).*fFr; R=(1-sigma*C);//%.*(1-C.^0.5).^2; if(bDbg) then ... ...
 ... ... @@ -36,9 +36,9 @@ function macrorugo_resultComp(z_amont, S, long, Q, L, pf, C, Cd0, h, D) V_technique=4.54*(pf/D)^0.32*S^0.56*(9.81*D)^0.5; end if Cd0 > 1.99 rv=1.4; rv=1.5; else rv=1.2; rv=1.1; end Vmax=Vg.*sqrt(calcfFr(Fr, rv)); print_r("Vmax"); ... ...
 ... ... @@ -15,18 +15,18 @@ B: 1.000000, h: 0.400000, C: 0.130000, RESULTS: find_Q_nat(0.736243)=0.625925 Q=0.485873 fVal=0.000000 find_Q_nat(0.736243)=0.913414 Q=0.370878 fVal=0.000000 ZF2: 12.200000, Vdeb: 1.214683, Vg: 1.899590, Fr: 0.958949, PV: 595.801953, Vdeb: 0.927194, Vg: 1.449999, Fr: 0.731987, PV: 454.788830, flowcond: emergent, Vmax: 1.953423, Vmax: 1.785249, V_technique: 1.748990, q_technique: 0.312101, Strickler: 10.006248 Strickler: 7.637991, */ function macroRugoInstanceEmergentCd1(): MacroRugo { ... ... @@ -36,7 +36,7 @@ function macroRugoInstanceEmergentCd1(): MacroRugo { 6, // L 1, // B 0.05, // If 0.485873, // Q 0.370878, // Q 0.4, // h 0.01, // Ks 0.13, // C ... ... @@ -50,12 +50,12 @@ function macroRugoInstanceEmergentCd1(): MacroRugo { const macroRugoExtraResultEmergentCd1: { [key: string]: number | MacroRugoFlowType } = { ENUM_MacroRugoFlowType: MacroRugoFlowType.EMERGENT, ZF2: 12.200000, Vdeb: 1.214683, Vg: 1.899590, Fr: 0.958949, PV: 595.801953, Vmax: 1.953423, Strickler: 10.006248 Vdeb: 0.927194, Vg: 1.449999, Fr: 0.731987, PV: 454.788830, Vmax: 1.785249, Strickler: 7.637991 }; /* ... ... @@ -70,36 +70,36 @@ B: 1.000000, h: 0.400000, C: 0.130000, RESULTS: find_Q_nat(0.512451)=0.610003 Q=0.268450 fVal=0.000000 find_Q_nat(0.512451)=0.770391 Q=0.204295 fVal=0.000000 ZF2: 12.200000, Vdeb: 0.671125, Vg: 1.049543, Fr: 0.529829, PV: 329.186776, Vdeb: 0.510737, Vg: 0.798720, Fr: 0.403209, PV: 250.516618, flowcond: emergent, Vmax: 1.580263, Vmax: 1.248838, V_technique: 1.427752, q_technique: 0.266857, Strickler: 5.528556 Strickler: 4.207323, */ function macroRugoInstanceEmergentCd2(): MacroRugo { const nub: MacroRugo = macroRugoInstanceEmergentCd1(); nub.prms.Cd0.singleValue = 2; nub.prms.Q.singleValue = 0.268450; nub.prms.Q.singleValue = 0.204295; return nub; } const macroRugoExtraResultEmergentCd2: { [key: string]: number | MacroRugoFlowType } = { ENUM_MacroRugoFlowType: MacroRugoFlowType.EMERGENT, ZF2: 12.200000, Vdeb: 0.671125, Vg: 1.049543, Fr: 0.529829, PV: 329.186776, Vmax: 1.580263, Strickler: 5.528556 Vdeb: 0.510737, Vg: 0.798720, Fr: 0.403209, PV: 250.516618, Vmax: 1.248838, Strickler: 4.207323 }; /* ... ... @@ -114,31 +114,31 @@ B: 1.000000, h: 0.800000, C: 0.130000, RESULTS: find_Q_nat(1.472487)=0.092897 Q=1.546804 fVal=0.000000 find_Q_nat(1.472487)=0.095732 Q=1.549073 fVal=0.000000 ZF2: 12.200000, Vdeb: 1.933505, Vg: 3.023725, Fr: 1.079351, PV: 948.384279, Vdeb: 1.936341, Vg: 3.028159, Fr: 1.080934, PV: 949.775168, flowcond: immerge, q_technique: 1.060933, Strickler: 10.033836, Strickler: 10.048552, */ function macroRugoInstanceSubmerged(): MacroRugo { const nub: MacroRugo = macroRugoInstanceEmergentCd1(); nub.prms.Y.singleValue = 0.8; nub.prms.Q.singleValue = 1.546804; nub.prms.Q.singleValue = 1.549073; return nub; } const macroRugoExtraResultSubmerged: { [key: string]: number | MacroRugoFlowType } = { ENUM_MacroRugoFlowType: MacroRugoFlowType.SUBMERGED, ZF2: 12.200000, Vdeb: 1.933505, PV: 948.384279, Strickler: 10.033836 Vdeb: 1.936341, PV: 949.775168, Strickler: 10.048552, }; function MacroRugoFactory(sInstance: string): MacroRugo { ... ... @@ -215,8 +215,8 @@ function macroRugoInstanceJalHyd85(): MacroRugo { describe("Class MacroRugo: ", () => { testMacroRugoConfig("EmergentCd1", 0.736243, 0.625925, macroRugoExtraResultEmergentCd1); testMacroRugoConfig("EmergentCd2", 0.512451, 0.610003, macroRugoExtraResultEmergentCd2); testMacroRugoConfig("EmergentCd1", 0.736243, 0.913414, macroRugoExtraResultEmergentCd1); testMacroRugoConfig("EmergentCd2", 0.512451, 0.770391, macroRugoExtraResultEmergentCd2); // Le test passe en debug mais pas sous Jasmine !?? // describe(`Condition Submerged` , () => { // it(`resolveAlpha_t(0.07) should be 0.074752`, () => { ... ... @@ -224,7 +224,7 @@ describe("Class MacroRugo: ", () => { // expect(macroRugoInstanceSubmerged()["resolveAlpha_t"](0.07)).toBeCloseTo(0.074752, 5); // }); // }); testMacroRugoConfig("Submerged", 1.472487, 0.092897, macroRugoExtraResultSubmerged); testMacroRugoConfig("Submerged", 1.472487, 0.095732, macroRugoExtraResultSubmerged); describe("JalHyd #85", () => { it("CalcSerie Q should return the good result :)", () => { ... ... @@ -232,7 +232,7 @@ describe("Class MacroRugo: ", () => { const nubMR2 = macroRugoInstanceJalHyd85(); nubMR.prms.Y.setValues(0.7, 1.2, 0.1); const aQ: number[] = [0.656297, 0.778636, 1.211155, 1.523789, 1.902439, 2.345380]; const aQ: number[] = [0.662919, 0.793504, 1.221194, 1.542033, 1.928510, 2.378835]; nubMR.CalcSerie(); for (let i = 0; i < aQ.length; i++) { ... ...
 ... ... @@ -40,16 +40,16 @@ export class MacroRugo extends FishPass { private _cache: { [key: string]: number }; /** Coefficients used in f_h*(h*) */ private paramFhStar: [number, number, number] = [1, 0.8, 1.5]; private paramFhStar: [number, number, number] = [1, 1, 2]; /** Coefficient used in rQ */ private paramRQ: [number, number] = [0.091, 1.033]; private paramRQ: [number, number] = [0.4, 0.7]; /** Coefficient used in rQ */ private paramRV: [number, number] = [0.2, 1]; private paramRV: [number, number] = [0.4, 0.7]; /** Maximum value for Cd */ private paramMaxCd: number = 6; private paramMaxCd: number = Infinity; /** true: Cd0 * min(3, fh), false : min(6, Cd0 * fh) */ private paramCdNewVersion: boolean = true; ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!