Simulation Modes: DNS and LES

DNS

When running in Direct Numerical Simulation (DNS) mode, it is assumed that the mesh is fine enough to resolve the Kolmogorov scales of turbulence. Therefore, in DNS mode the previously described equations are solved directly with no additional models being required. The transport coefficients correspond to the molecular transport coefficients, with one of these assumptions:

  • constant transport coefficients \(\mu\), \(\rho\alpha_C\), and \(\rho\alpha_T\), or

  • constant \(\nu = \mu / \rho\), \(\alpha_T\) and constant \(\alpha_C\),

    each of which is then multiplied by \(\rho\) in the construction of the diffusive terms.

Note that scaling arguments from simple kinetic theory indicate that the quantities \(\mu\), \(\rho\alpha_C\), and \(\rho\alpha_T\) are all independent of density and pressure but weakly dependent on temperature (\(T^{1/2}\) scaling), justifying use of constant parameters over the range of conditions of interest.

LES

When running in Large Eddy Simulation (LES) mode, it is assumed that the Kolmogorov scales are not resolved. As a result, the numerical discretization acts as a filter on the governing equations, resulting in the following set of filtered equations:

\[ \begin{align}\begin{aligned}\frac{\partial \overline{\rho}}{\partial t} &= - \nabla \cdot (\overline{\rho} \mathbf{\tilde{u}}),\\\frac{\partial (\overline{\rho} \mathbf{\tilde{u}})}{\partial t} &= - \nabla \cdot (\overline{\rho} \mathbf{\tilde{u}} \mathbf{\tilde{u}}) - \nabla \overline{p} + \overline{\rho} \mathbf{g} - \nabla \cdot \overline{\tau} + \mathbf{\overline{F}} &- \nabla \cdot (\overline{\rho} \mathbf{\widetilde{u u}} - \overline{\rho}\mathbf{\tilde{u}\tilde{u}} ) ,\\\frac{\partial (\overline{\rho} \tilde{\theta})}{\partial t} &= - \nabla \cdot (\overline{\rho} \mathbf{\tilde{u}} \tilde{\theta}) + \nabla \cdot \left( \overline{\rho} \alpha_{T} \nabla \tilde{\theta} \right) &- \nabla \cdot (\overline{\rho} {\widetilde{\mathbf{u} \theta}} - \overline{\rho}\mathbf{\tilde{u}}\tilde{\theta} ) ,\\\frac{\partial (\overline{\rho} \tilde{C})}{\partial t} &= - \nabla \cdot (\overline{\rho} \mathbf{\tilde{u}} \tilde{C}) + \nabla \cdot \left( \overline{\rho} \alpha_{C} \nabla \tilde{C} \right) &- \nabla \cdot (\overline{\rho} \widetilde{\mathbf{u} C} - \overline{\rho}\mathbf{\tilde{u}}\tilde{C} ) ,\end{aligned}\end{align} \]

where overbars indicate filtering and tildes indicate density-weighted (Favre) filtering (e.g., \(\tilde{\theta} = \overline{\rho \theta} / \overline{\rho}\)). When the code is run in LES mode, all variables correspond to their appropriate filtered version.

In the above equations, the final term in each of the momentum, potential temperature, and scalar equations is unclosed due to containing a filtered nonlinear function of the state quantities. These terms represent the effect of turbulent transport at unresolved scales. LES models attempt to account for these terms by invoking a gradient transport hypothesis, which assumes that turbulent transport acts similarly to molecular transport in that quantities are transported down their resolved gradients:

\[ \begin{align}\begin{aligned}\overline{\rho} {\widetilde{\mathbf{u} \theta}} - \overline{\rho}\mathbf{\tilde{u}}\tilde{\theta} &= -\frac{\mu_t}{Pr_t} \nabla \tilde{\theta}\\\overline{\rho} \widetilde{\mathbf{u} C} - \overline{\rho}\mathbf{\tilde{u}}\tilde{C} &= -\frac{\mu_t}{Sc_t} \nabla \tilde{C}\\\overline{\rho} \mathbf{\widetilde{u u}} - \overline{\rho}\mathbf{\tilde{u}\tilde{u}} &= \tau^{sfs}\end{aligned}\end{align} \]
\[ \begin{align}\begin{aligned}\tau^{sfs}_{ij} - \frac{\delta_{ij}}{3} \tau^{sfs}_{kk} = -2 \mu_t \tilde{\sigma}_{ij}\\\tau^{sfs}_{kk} = 2 \mu_t \frac{C_I}{C_s^2} (2 \tilde{S}_{ij} \tilde{S}_{ij})^{1/2}.\end{aligned}\end{align} \]

The model coefficients \(C_s, C_I, Pr_t, Sc_t\) have nominal values of 0.16, 0.09, 0.7, and 0.7, respectively (Martin et al., Theoret. Comput. Fluid Dynamics (2000)).

Note

Presently, we assume \(C_I =0\). This term is similar to the bulk viscosity term for molecular transport and should be added if the bulk viscosity term is added. It is believed to be small for low-Mach number flows, but there is some discussion in the literature about this topic. See Moin et al., “A dynamic subgrid-scale model for compressible turbulence and scalar transport”, PoF (1991); Martin et al., Subgrid-scale models for compressible large-eddy simulations”, Theoret. Comput. Fluid Dynamics (2000).

When substituted back into the filtered equations, the gradient transport LES models take exactly the same form as the molecular transport terms, but with the constant molecular transport coefficients replaced by turbulent equivalents (e.g. \(\mu\) becomes the turbulent viscosity, \(\mu_{t}\)). Therefore, when the code is run in LES mode, the equation set remains the same, but all variables are interpereted as the appropriate filtered version and the turbulent transport coefficients are used. Molecular transport is omitted by default in the present LES implementation because the molecular transport coefficients are insignificant compared to turbulent transport for most LES grids. However, for fine LES grids, molecular transport and LES models may both be activated, with the effective transport coefficient being the sum of the molecular and turbulent coefficients.

It should also be noted that filtering affects the computation of pressure from density and potential temperature, but the nonlinearity in the equation of state is weak for \(\gamma = 1.4\), so the subfilter contribution is neglected:

\[\overline{p} = \overline{ \left( \frac{\rho R_d \theta}{p_0^{R_d / c_p}} \right)^\gamma} \approx \left( \frac{\overline{\rho} R_d \tilde{\theta}}{p_0^{R_d / c_p}} \right)^\gamma.\]

ERF offers two LES options: Smagorinsky and Deardorff models, which differ in how \(\mu_{t}\) is computed.

Smagorinsky Model

\[\mu_{t} = (C_s \Delta)^2 (\sqrt{2 \tilde{S} \tilde{S}}) \overline{\rho}\]

\(C_s\) is the Smagorinsky constant and \(\Delta\) is the cube root of cell volume, the representative grid spacing.

On a domain with only one cell in a lateral direction (an x-z or y-z slice), the cell size in that direction is arbitrary, so it is replaced by the cell size in the other lateral direction: \(\Delta = (\Delta x^2 \Delta z)^{1/3}\) on an x-z slice. The same substitution is made wherever ERF uses a lateral cell size as a length scale rather than to take a difference: the Deardorff and anisotropic filter widths, the SHOC mixing-length cap, the MRF scale-aware blending, the surface-layer subgrid velocity, the immersed-forcing drag rates and building cutoff, the wind-farm and mass-source normalizations, and the super-droplet ground accumulation. A single column (one cell in both lateral directions) keeps the \(\Delta x\) and \(\Delta y\) of the inputs as its nominal column size.

\[\tau_{ij} = -2\mu_{t} \tilde{\sigma}_{ij} = -K \tilde{\sigma}_{ij}\]

where \(K = 2\mu_{t}\)

In the Smagorinsky model, modeling of \(\mu_{t}\) does not account for the turbulent kinetic energy (TKE) corresponding to unresolved scales and no extra equation for TKE is solved.

Richardson-Number Correction

The standard Smagorinsky model mixes at the same rate whatever the stratification. In stably stratified regions, where buoyancy suppresses turbulence, this mixes too much. ERF therefore multiplies the Smagorinsky viscosity by a stability factor that depends on the local gradient Richardson number:

\[\begin{split}\mu_{t} = (C_s \Delta)^2 (\sqrt{2 \tilde{S} \tilde{S}}) \, \overline{\rho} \, f(Ri), \qquad f(Ri) = \begin{cases} 1 & Ri \leq 0 \\ \sqrt{1 - Ri/Ri_{crit}} & 0 < Ri < Ri_{crit} \\ 0 & Ri \geq Ri_{crit} \end{cases}\end{split}\]

so neutral and unstable cells recover the standard model, and mixing switches off at the critical Richardson number \(Ri_{crit}\). The scalar diffusivities follow from \(\mu_t\) through \(Pr_t\) and \(Sc_t\), so they are damped by the same factor. With erf.mix_isotropic = true (the default) the factor multiplies both the horizontal and the vertical viscosity. With an anisotropic mixing length it multiplies only the vertical viscosity.

The Richardson number is

\[Ri = \frac{N^2}{\max\left(S^2_{vert},\, 10^{-10}\right)}, \qquad S^2_{vert} = \left(\frac{\partial u}{\partial z}\right)^2 + \left(\frac{\partial v}{\partial z}\right)^2,\]

with both derivatives taken as centered differences at the cell center. The Brunt-Väisälä frequency uses the potential temperature appropriate to the cell:

\[\begin{split}N^2 = \frac{g}{\theta_*} \frac{\partial \theta_*}{\partial z}, \qquad \theta_* = \begin{cases} \theta_l & \text{saturated cells, } q_c > 10^{-8}\ \text{kg/kg} \\ \theta_v & \text{other cells, when water vapor is present} \\ \theta & \text{dry runs} \end{cases}\end{split}\]

The liquid-ice water potential temperature \(\theta_l\) and the virtual potential temperature \(\theta_v\) are defined in Moist Potential Temperatures. Inside a cloud, latent heating keeps \(\theta_l\) nearly constant through well-mixed layers. In a cloudy updraft \(\partial\theta_l/\partial z\) can be negative, which gives \(N^2 < 0\) and leaves mixing undamped. This choice of potential temperature is fixed: erf.thermal_stratification does not change it.

Next to an embedded boundary, the vertical derivatives use one-sided differences where a neighbor cell is covered. If no usable shear stencil exists, the factor is left at 1.

Implementation Control

erf.use_Ri_correction = true   # Apply the Richardson-number correction (default)
erf.use_Ri_correction = false  # Standard Smagorinsky
erf.Ri_crit           = 0.25   # Critical Richardson number (default)

Both inputs can be set per level. When the correction is disabled, \(f = 1\) and the model is the standard Smagorinsky formulation.

Deardorff Model

Unlike the Smagorinsky model, the Deardorff model accounts for the contribution of TKE in modeling \(\mu_{t}\) and a prognostic equation for TKE is solved. The turbulent viscosity is computed as:

\[\mu_t = \overline{\rho} C_k \ell (e^{sfs})^{1/2},\]

where the mixing length \(\ell = \Delta\) for unstable (or neutral) stratification, otherwise the mixing length is reduced as per Deardorff 1980:

\[\ell = \frac{0.76 (e^{sfs})^{1/2}}{\left(\frac{g}{\theta_0}\frac{\partial\theta}{\partial z}\right)^{1/2}}.\]

The potential temperature gradient in the denominator dictates the stratification, which is scaled by a reference virtual potential temperature \(\theta_0\). The mixing length is set to a maximum of \(\Delta\) to prevent unbounded behavior under weakly stable conditions.

Then the equation solved to determine \(e^{sfs}\), the subfilter contribution to TKE, is:

\[\frac{\partial \overline{\rho} e^{sfs}}{\partial t} = - \nabla \cdot (\overline{\rho} \mathbf{\tilde{u}} \tilde{e}^{sfs}) - \tau_{ij} \frac{\partial \tilde{u}_i}{\partial x_j} + \frac{g}{\theta_0} \tau_{\theta w} + \nabla \cdot \left( \frac{\mu_t}{\sigma_k} \nabla e^{sfs} \right) - \overline{\rho} C_\epsilon \frac{(e^{sfs})^{3/2}}{\overline{\Delta}}.\]

where \(\sigma_k\) is a constant model coefficient representing the ratio of turbulent viscosity to turbulent diffusivity of TKE that should be order unity (e.g., Moeng 1984 uses TKE diffusivity of \(2 \mu_t\)), we have used the downgradient diffusion assumption

\[\frac{\partial\left\langle \left( u_{n}^{'}\rho e + u_{n}^{'}p^{'} \right) \right\rangle}{\partial x_{n}} = -\nabla \cdot \left( \frac{\mu_t}{\sigma_k} \nabla e^{sfs} \right),\]

the eddy diffusivity of heat is

\[K_H = \left(1 + \frac{2\ell}{\Delta}\right) \mu_t,\]

and the SFS heat flux is

\[\tau_{\theta i} = -K_H \frac{\partial\theta}{\partial x_i}.\]

The RHS terms of the TKE transport equation correspond to advection, shear production, buoyant production, diffusion, and dissipation. In the buoyant production the vertical flux \(\tau_{\theta w}\) at the cell center is the average of the fluxes of the \(\theta\) diffusion at the two vertical faces of the cell, in every cell; at the bottom of the domain the face flux is the surface-layer flux when a surface layer is used. These face fluxes carry the stretched-mesh spacing and are the full fluxes whether the vertical diffusion of \(\theta\) is explicit or implicit, so the source does not depend on that choice. On a terrain-fitted mesh the stored face flux is the component along the \(\zeta\) coordinate only, because the slope corrections and the Jacobian are applied later, where the fluxes enter the right-hand side.