From d6b482ad73eee1646df99b15788022aeb8d9b1c7 Mon Sep 17 00:00:00 2001 From: Dorchies David <dorch@laposte.net> Date: Tue, 4 Dec 2018 09:21:06 +0100 Subject: [PATCH] #22 Solve NaN in submerged conditions --- src/macrorugo/macrorugo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macrorugo/macrorugo.ts b/src/macrorugo/macrorugo.ts index d1342103..e104ce24 100644 --- a/src/macrorugo/macrorugo.ts +++ b/src/macrorugo/macrorugo.ts @@ -171,7 +171,7 @@ export class MacroRugo extends Nub { /** Velocity at the bed §2.3.2 Cassan et al., 2016 */ this.u0 = Math.sqrt(2 * g * S * D * this.R / (this.calcCd(this.calc_fFr(this.U0)) * C)); /** turbulent length scale (m) within the blocks layer (alpha_t) */ - const alpha = uniroot(this.resolveAlpha_t, this, 0, 100); + const alpha = uniroot(this.resolveAlpha_t, this, 1E-6, 100); /** averaged velocity at the top of blocks (m.s-1) */ const uk = this.calcUz(alpha); /** Equation (13) Cassan et al., 2016 */ -- GitLab