diff --git a/spec/open-channel/regime_uniforme/regime_uniforme_rect.spec.ts b/spec/open-channel/regime_uniforme/regime_uniforme_rect.spec.ts index 4204d3419eb34264958bbbc5640567f35174563e..9d2d70dae7e2f7f9cb0368e89e09fc1c04dada86 100644 --- a/spec/open-channel/regime_uniforme/regime_uniforme_rect.spec.ts +++ b/spec/open-channel/regime_uniforme/regime_uniforme_rect.spec.ts @@ -31,11 +31,12 @@ describe("Class RegimeUniforme / section rectangulaire :", () => { ruRect1 = generateRegimeUniforme(generateRectangularSection()); SessionSettings.precision = 1E-7; }) - for (const p of ruRect1.calculableParameters) { - it(`${p.symbol} should be ${p.singleValue}`, () => { + for (const p0 of ruRect1.calculableParameters) { + it(`${p0.symbol} should be ${p0.singleValue}`, () => { + const p = ruRect1.section.prms.get(p0.symbol); const ref: number = p.singleValue; - p.singleValue = undefined; - p.initValue = 1e-8; + p.singleValue = 1e-8; + p.v = p.initValue; ruRect1.calculatedParam = p; checkResult(ruRect1.CalcSerie(), ref); expect(ruRect1.result.values.V).toBeCloseTo(0.784, 3); diff --git a/spec/value_ref/value_ref_variable_extraresult.spec.ts b/spec/value_ref/value_ref_variable_extraresult.spec.ts index 2a8195fe236530972d8bb8e123e963b3c8d071b3..942c529cea2c56ce6258c5ae5466a0edd074e598 100644 --- a/spec/value_ref/value_ref_variable_extraresult.spec.ts +++ b/spec/value_ref/value_ref_variable_extraresult.spec.ts @@ -33,7 +33,7 @@ describe("référence d'un paramètre à un résultat complémentaire multivalu nub2.prms.V0.defineReference(nub1, "V"); nub2.CalcSerie(); - const refVals = [ 2.177, 2.011, 1.878, 1.769, 1.677, 1.598, 1.530, 1.469, 1.415, 1.367, 1.324 ]; + const refVals = [ 0.554, 0.574, 0.590, 0.602, 0.613, 0.622, 0.630, 0.636, 0.642, 0.647, 0.652 ]; let i = 0; for (const v of nub2.getParameter("V0").valueList) { diff --git a/src/open-channel/regime_uniforme.ts b/src/open-channel/regime_uniforme.ts index 857622bc5c2bbae2f635a41dde37db48f453f226..5859361784ffefa14d4337d9a8e303982e00631f 100644 --- a/src/open-channel/regime_uniforme.ts +++ b/src/open-channel/regime_uniforme.ts @@ -107,8 +107,8 @@ export class RegimeUniforme extends SectionNub { return rS; } - const v = this.section.prms.Ks.v * Math.pow(rR.vCalc, 2 / 3) * rS.vCalc * Math.sqrt(this.section.prms.If.v); - return new Result(v, this); + this.section.prms.Q.v = this.section.prms.Ks.v * Math.pow(rR.vCalc, 2 / 3) * rS.vCalc * Math.sqrt(this.section.prms.If.v); + return new Result(this.section.prms.Q.v, this); } }