Turbulence model

RANS equations describe the mean flow. The effect of turbulent eddies on the mean flow appears as extra mixing, which is modelled by a turbulent viscosity \(\nu_t\). A turbulence model computes \(\nu_t\) from the flow.

GUST uses the one-equation k–L model of Axell and Liungman (2001), referred to below as AL01. The model needs two quantities:

  • the turbulent kinetic energy \(k\), how energetic the eddies are, from its own transport equation ((1));

  • the length scale \(L\), how large the eddies are, from an algebraic formula. Near the ground the eddies are small; stable stratification makes them smaller still.

The model’s point relations are ERF’s (extern_erf/ERF_RANSClosure.H). The inputs are in the turb namespace (Input reference).

Eddy viscosity and TKE sources

\[\nu_t = c_\mu\,k^{1/2}L, \qquad \nu_t' = c_\mu'\,k^{1/2}L, \qquad P_s = \nu_t S^2, \qquad P_b = -\nu_t' N^2, \qquad \varepsilon = C_{\mu 0}^3\,\frac{k^{3/2}}{L} .\]
  • \(S^2 = 2S_{ij}S_{ij}\): the squared strain rate.

  • \(N^2 = (g/\theta_0)\,\partial\theta/\partial z\): the squared Brunt–Väisälä frequency.

  • \(c_\mu\), \(c_\mu'\): stability functions (below). The turbulent Prandtl number is \(c_\mu/c_\mu'\), equal to 1 in neutral flow.

  • \(C_{\mu 0} = 0.5562\) (turb.Cmu0) and \(\kappa = 0.41\) (turb.kappa).

  • \(k\) is bounded below by turb.tke_floor (at least machine epsilon).

Length scale

The length scale starts from the geometric length

\[l_g = \kappa\,(d + z_0),\]

capped harmonically at turb.max_geom_lscale. Here \(\kappa\) is the von Kármán constant, \(d\) the wall distance and \(z_0\) the roughness length. Stratification modifies it:

\[\frac{1}{L^2} = \frac{1}{l_g^2} + \frac{N^2}{C_b^2 k}\quad (N^2 > 0), \qquad L = l_g\left(1 - \frac{C_{\mu 0}^6}{C_b^2}R_t\right)^{1/2}\quad (N^2 < 0),\]

with the turbulent Richardson number and the constant \(C_b\) (turb.Cb, 0.35)

\[R_t = \frac{L^2 N^2}{C_{\mu 0}^6 k} .\]

As in ERF, the unstable length is evaluated once, from \(l_g\).

Stability functions

From AL01, Eqs. 31–32:

\[c_\mu = \frac{C_{\mu 0} + 0.108\,R_t}{1 + 0.308\,R_t + 0.00837\,R_t^2}, \qquad c_\mu' = \frac{C_{\mu 0}}{1 + 0.277\,R_t} .\]

The poles of \(c_\mu\) and \(c_\mu'\) lie at \(R_t = -3.5987\) and \(-3.6101\). Below turb.Rt_crit, \(R_t\) is smoothly mapped towards turb.Rt_min (the map of Burchard and Petersen) so that it never reaches them; turb.Rt_min must therefore lie above \(-3.598\). Near the pole \(c_\mu\) grows without bound (1.5 at the default \(-3\), 7.3 at \(-3.5\), 78 at \(-3.59\)).

Neutral wall layer

Because \(\varepsilon\) contains \(C_{\mu 0}^3\), the model reproduces the neutral log law exactly when \(l_g = \kappa(z + z_0)\), that is, where the cap turb.max_geom_lscale has no effect (set it very large to remove it, as tutorial 1 does). In the wall layer

\[u = \frac{u_*}{\kappa}\ln\frac{z + z_0}{z_0}, \qquad k = \frac{u_*^2}{C_{\mu 0}^2}, \qquad P_s = \varepsilon\]

at every height, with \(u_*\) the friction velocity.

Wall distance

turb.wall_distance selects the wall distance \(d\) to the ground. With buildings and buildings.wall_tke = on the closure takes the nearer of the ground and the nearest building wall, each with its own roughness (Buildings).

  • terrain_height (default): the height of the cell centre above the ground of its column.

  • tucker: the differential wall distance of Tucker (2003),

    \[\nabla^2\phi = -1,\quad \phi = 0 \text{ on the ground}, \qquad d = -|\nabla\phi| + \sqrt{|\nabla\phi|^2 + 2\phi} .\]

    On flat ground \(d\) is the height. Over terrain it approximates the true distance; the error is largest at convex crests (Results).

Model options

  • turb.face_mean: how the cell diffusivities are averaged to the faces (Spatial discretization).

  • turb.nut_relax: under-relaxation of \(\nu_t\) between iterations.

  • turb.frozen_switch: holds at the floor, during the Newton stage, the cells whose \(k\) was at the floor when Newton started (Solution algorithm). The stable/unstable branch and the \(R_t\) smoothing are not frozen: the length and \(R_t\) are continuously differentiable across them (below).

  • turb.ri_gate: the stratification gate (below).

Smoothness at neutral

With \(y = l_g^2 N^2/(C_b^2 k)\), the stable length is \(l_g(1 + y)^{-1/2}\) and the unstable one \(l_g(1 - y)^{1/2}\) (before the \(R_t\) smoothing). Both are \(l_g(1 - y/2) + O(y^2)\), so \(L\), \(R_t\) and \(\nu_t\) have the same value and the same first derivative in \(N^2\) on both sides of \(N^2 = 0\); only the second derivative jumps. The smoothing map of \(R_t\) has slope 1 on both sides of turb.Rt_crit. The kink of the closure is the floor \(k_f = \max(k, k_\mathrm{floor})\). (The neutral band \(|N^2| \le\) machine epsilon, where \(L = l_g\), is a jump in \(L\) of relative size \(y/2\) at its edge: 8e-10 at \(k\) = 1e-3, but close to 1 at \(k\) = machine epsilon, where \(\nu_t\) is negligible.) Near the floor the closure is smooth but steep: at \(k\) = 1e-6 the \(N^2\) scale of \(L\), \(C_b^2 k / l_g^2\), is about 4e-10 s⁻², close to the change of \(N^2\) a finite-difference Jacobian makes, which then misses \(\partial L/\partial N^2\) by about 30 %.

Stratification gate

In a nearly neutral layer, under an inversion for example, \(N^2\) can be round-off or numerical noise of either sign. With turb.ri_gate \(= Ri_0 > 0\) the length \(L\) and \(R_t\) (and through \(R_t\) the stability functions and the heat diffusivity) use

\[N^2_\mathrm{eff} = N^2\,\frac{Ri^2}{Ri^2 + Ri_0^2} = N^2\,\frac{N^4}{N^4 + Ri_0^2 S^4}, \qquad Ri = \frac{N^2}{S^2},\]

with \(S^2 = 2 S_{ij}S_{ij}\) (\((\partial u/\partial z)^2\) in simple shear, so \(Ri\) is the gradient Richardson number). Where the shear dominates (\(|Ri| \ll Ri_0\)) the stratification is suppressed by \((Ri/Ri_0)^2\); in an inversion (\(|Ri| \gg Ri_0\)) it is kept to within \((Ri_0/Ri)^2\). The gate keeps the sign of \(N^2\), is monotone in \(N^2\) (its slope is at most 1.125, at \(|Ri| = \sqrt{3}\, Ri_0\)), is infinitely differentiable wherever \(S^2 > 0\) (at \(N^2 = S^2 = 0\) it is continuous but not differentiable), and is exact at \(N^2 = 0\), so a neutral run is unchanged bit for bit. The buoyancy production \(P_b = -\nu_t' N^2\) keeps the ungated \(N^2\), so the buoyancy sink of \(k\) stays that of the heat flux \(\nu_t'\,\partial\theta/\partial z\); the buoyancy of the momentum equation is not gated either.

It is a smooth, local form of the neutral switch of Kynema-SGF’s KLAxell (lengthscale_switch: below meso_sponge_start, when the deck’s surface heat flux is below 1e-5, the neutral length and \(R_t = 0\)). That switch is a jump in value and depends on a global input: with KLAxell’s defaults (Cb_stable 0.25, \(\lambda\) = 30 m) at \(N^2\) = 1e-4 s⁻², \(k\) = 0.1 m²/s² and \(z\) = 100 m it changes \(L\) from 7.2 m to 17.3 m. The gate changes stratified answers: in the stable surface layer \(Ri\) is about 0.05–0.2, so \(Ri_0\) = 0.01 lowers \(N^2\) there by 3.8 % (at \(Ri\) = 0.05) to 0.25 % (at 0.2). It is off by default (Results).

Eddy-viscosity cap for separated flow

A one-equation closure with an algebraic length keeps \(\nu_t\) large in the shear layer that leaves a crest, so the flow reattaches too soon behind steep terrain (no separation behind the Bolund escarpment or the Ishihara–Zhou ridge with the default closure). With turb.realizability \(= C_r > 0\) the new eddy viscosity is capped before the relaxation of turb.nut_relax:

\[\nu_t = w\,\min\!\Bigl(\nu_t^\mathrm{new},\ C_r\,\frac{k}{S}\Bigr) + (1 - w)\,\nu_t^\mathrm{old}, \qquad S = \sqrt{2 S_{ij} S_{ij}},\]

with \(w\) = turb.nut_relax and \(\nu_t^\mathrm{old}\) the stored value of the last iteration. The form is that of the SST limiter (Bradshaw’s \(-\overline{uw}/k = a_1 = 0.31\)). Durbin’s (1996) time-scale bound is \(\nu_t \le \alpha k/(\sqrt{6}\,|S|)\) with \(|S|^2 = S_{ij}S_{ij}\); in the \(S\) above it is \(C_r = \alpha/\sqrt{3} \approx 0.346\) for \(\alpha = 0.6\) (0.245 = \(\alpha/\sqrt{6}\) would be the same formula with Durbin’s \(|S|\) taken as this \(S\)). Unlike SST it acts everywhere, not only inside the boundary layer. With the closure’s relations, \(\nu_t S/k = C_{\mu 0}^2 \sqrt{P/\varepsilon}\) in neutral flow, so the cap acts where \(P/\varepsilon > (C_r/C_{\mu 0}^2)^2\). \(C_r = 0.309\) is 0.1 % below \(C_{\mu 0}^2 = 0.30936\) for the default \(C_{\mu 0}\): the cap is active in an equilibrium surface layer too, where it lowers \(\nu_t\) by 0–3 % (most near the wall, where \(P/\varepsilon\) is 1.04–1.05 in the first cells), and it limits \(\nu_t\) strongly where the strain far exceeds equilibrium, as in the shear layer leaving a crest. Applying the cap before the relaxation lets \(w < 1\) damp the cap’s changes between iterations: an imposed two-iteration oscillation of the cap passes with the factor \(w/(2 - w)\) (1/3 at \(w = 0.5\)) instead of 1. Without the option the cap is the largest real number and the closure is unchanged bit for bit. The derivative the Newton stage reads follows the cap (\(\mathrm{d}\,\mathrm{cap}/\mathrm{d}k = \mathrm{cap}/k\)); the column first guess (init.first_guess = column) does not apply it. Around buildings, whose edges fix their separation, the cap fades out within buildings.limiter_zone building heights (Buildings).

Near-ground blend towards upwind

With the cap, the second-order limited convection can leave a steady run at a fixed, unconverged state (the rough Ishihara–Zhou ridge stalls at a relative residual of 0.17 with van_leer and van_albada; first-order upwind converges). With convection.hybrid_sigma_max \(= \sigma_\mathrm{max} > 0\) the momentum and θ convection of the residual become

\[C = C_\mathrm{hi} + \sigma\,(C_\mathrm{up} - C_\mathrm{hi}), \qquad \sigma_t = \sigma_\mathrm{max}\,s\!\Bigl(\frac{a - 0.8}{0.2}\Bigr)\, s\!\Bigl(\frac{1.5 H_h - d}{0.5 H_h}\Bigr), \qquad a = \frac{\nu_t^\mathrm{new}}{C_r k / S},\]
  • \(C_\mathrm{hi}\): the limited scheme of convection.limiter; \(C_\mathrm{up}\): first-order upwind (the scheme of the implicit side);

  • \(s(t) = t^2(3 - 2t)\) on \([0, 1]\) (0 below, 1 above): a smooth step;

  • \(a\): the ratio of the closure’s eddy viscosity to the cap (\(a \ge 1\) where the cap acts);

  • \(d\): the height above the ground (the closure’s wall distance without buildings; with them the ground’s distance alone, Buildings); \(H_h\) = convection.hybrid_height.

\(\sigma\) is a cell field, interpolated to the faces of \(u, v, w\), updated once per iteration as \(\sigma \leftarrow \sigma + \lambda(\sigma_t - \sigma)\) with \(\lambda\) = convection.hybrid_relax, and frozen once the relative residual falls below convection.hybrid_freeze (after at least \(2/\lambda\) updates on each grid level), so a converged state satisfies one fixed scheme. The blend is of the convection operators, not of the face fluxes: it is not conservative where \(\sigma\) varies (in a 1-D test with \(\sigma\) rising from 0 to 0.1 over a few cells, a net source of 0.2–0.4 % of the flux jump; mass is not affected). \(\sigma\) is not checkpointed, so io.restart with the blend aborts.

Where it acts. Because \(C_r\) is at the equilibrium value, \(a\) is 1.00–1.03 in an equilibrium surface layer, so \(\sigma\) reaches \(\sigma_\mathrm{max}\) over most of the near-ground layer below \(H_h\), on the windward side as well as in the lee; inside a recirculation, where \(k\) is carried in (\(P < \varepsilon\)), \(a\) can fall below 0.8 and the blend switches off. With \(\sigma_\mathrm{max} = 0.1\) the added horizontal numerical diffusion near the ground is of the order of the turbulent viscosity there (about 5 m²/s at 10 m on Askervein) and changes the approach-flow speed-up by about 0.2 %. A gate that acts only above equilibrium (for example \(a > 1.05\)) is not in this version.