Turbulence Closures
In turbulence.jl
we specify turbulence closures. Currently, pointwise models of the eddy viscosity/eddy diffusivity type are supported for turbulent shear and tracer diffusivity. Methods currently supported are:ConstantViscosityWithDivergence
SmagorinskyLilly
Vreman
AnisoMinDiss
Usage: This is a quick-ref guide to using turbulence models as a subcomponent of AtmosModel
$\nu$ is the kinematic viscosity, $C_smag$ is the Smagorinsky Model coefficient,
turbulence=ConstantViscosityWithDivergence(ν)
turbulence=SmagorinskyLilly(C_smag)
turbulence=Vreman(C_smag)
turbulence=AnisoMinDiss(C_poincare)
using DocStringExtensions
using CLIMAParameters.Atmos.SubgridScale: inv_Pr_turb
export ConstantViscosityWithDivergence, SmagorinskyLilly, Vreman, AnisoMinDiss
export turbulence_tensors
Abstract Type
We define a TurbulenceClosure
abstract type and default functions for the generic turbulence closure which will be overloaded with model specific functions. Minimally, overloaded functions for the following stubs must be defined for a turbulence model.
abstract type TurbulenceClosure end
vars_state_gradient((::TurbulenceClosure, FT) = @vars()
vars_state_gradient_flux(::TurbulenceClosure, FT) = @vars()
vars_state_auxiliary(::TurbulenceClosure, FT) = @vars()
function atmos_init_aux!(
::TurbulenceClosure,
::AtmosModel,
aux::Vars,
geom::LocalGeometry,
) end
function compute_gradient_argument!(
::TurbulenceClosure,
transform::Vars,
state::Vars,
aux::Vars,
t::Real,
) end
function compute_gradient_flux!(
::TurbulenceClosure,
::Orientation,
diffusive,
∇transform,
state,
aux,
t,
) end
The following may need to be addressed if turbulence models require additional state variables or auxiliary variable updates (e.g. TKE based models)
vars_state_conservative(::TurbulenceClosure, FT) = @vars()
function atmos_nodal_update_auxiliary_state!(
::TurbulenceClosure,
::AtmosModel,
state::Vars,
aux::Vars,
t::Real,
) end
Eddy-viscosity Models
The following function provides an example of a stub for an eddy-viscosity model. Currently, scalar and diagonal tensor viscosities and diffusivities are supported.
ClimateMachine.Atmos.turbulence_tensors
— Functionν, D_t, τ = turbulence_tensors(
::TurbulenceClosure,
orientation::Orientation,
param_set::AbstractParameterSet,
state::Vars,
diffusive::Vars,
aux::Vars,
t::Real
)
Compute the kinematic viscosity (ν
), the diffusivity (D_t
) and SGS momentum flux tensor (τ
) for a given turbulence closure. Each closure overloads this method with the appropriate calculations for the returned quantities.
Arguments
::TurbulenceClosure
= Struct identifier for turbulence closure modelorientation
=AtmosModel.orientation
param_set
=AtmosModel.param_set
state
= Array of prognostic (state) variables. Seevars_state_conservative
inAtmosModel
diffusive
= Array of diffusive variablesaux
= Array of auxiliary variablest
= time
Generic math functions for use within the turbulence closures such as the principal tensor invariants, symmetric tensors and tensor norms have been included.
Pricipal Invariants
ClimateMachine.Atmos.principal_invariants
— Functionprincipal_invariants(X)
Calculates principal invariants of a tensor X
. Returns 3 element tuple containing the invariants.
Symmetrize
ClimateMachine.Atmos.symmetrize
— Functionsymmetrize(X)
Given a (3,3) second rank tensor X, compute (X + X')/2
, returning a symmetric SHermitianCompact
object.
2-Norm
Given a tensor X, return the tensor dot product
ClimateMachine.Atmos.norm2
— Functionnorm2(X)
Given a tensor X
, computes its tensor dot product.
Strain-rate Magnitude
By definition, the strain-rate magnitude, as defined in standard turbulence modelling is computed such that
where
\mathrm{S} is the rate-of-strain tensor. (Symmetric component of the velocity gradient). Note that the skew symmetric component (rate-of-rotation) is not currently computed.
ClimateMachine.Atmos.strain_rate_magnitude
— Functionstrain_rate_magnitude(S)
Given the rate-of-strain tensor S
, computes its magnitude.
"""
strain_rate_magnitude(S)
Given the rate-of-strain tensor `S`, computes its magnitude.
"""
function strain_rate_magnitude(S::SHermitianCompact{3, FT, 6}) where {FT}
return sqrt(2 * norm2(S))
end
Constant Viscosity Model
ConstantViscosityWithDivergence
requires a user to specify the constant viscosity (kinematic) and appropriately computes the turbulent stress tensor based on this term. Diffusivity can be computed using the turbulent Prandtl number for the appropriate problem regime.
ClimateMachine.Atmos.ConstantViscosityWithDivergence
— TypeConstantViscosityWithDivergence <: TurbulenceClosure
Turbulence with constant dynamic viscosity (ρν
). Divergence terms are included in the momentum flux tensor.
Fields
ρν
Dynamic Viscosity [kg/m/s]
Smagorinsky-Lilly
The Smagorinsky turbulence model, with Lilly's correction to stratified atmospheric flows, is included in ClimateMachine. The input parameter to this model is the Smagorinsky coefficient. For atmospheric flows, the coefficient C_smag
typically takes values between 0.15 and 0.23. Flow dependent C_smag
are currently not supported (e.g. Germano's extension). The Smagorinsky-Lilly model does not contain explicit filtered terms.
Equations
with the stratification correction term
Here, $\mathrm{Ri}$ and $\mathrm{Pr}_{t}$ are the Richardson and turbulent Prandtl numbers respectively. $\Delta$ is the mixing length in the relevant coordinate direction. We use the DG metric terms to determine the local effective resolution (see src/Mesh/Geometry.jl
), and modify the vertical lengthscale by the stratification correction factor $\mathrm{f}_{b}$ so that $\Delta_{vert} = \Delta z f_b$.
ClimateMachine.Atmos.SmagorinskyLilly
— TypeSmagorinskyLilly <: TurbulenceClosure
Fields
C_smag
Smagorinsky Coefficient [dimensionless]
Smagorinsky Model Reference
article{doi:10.1175/1520-0493(1963)091<0099:GCEWTP>2.3.CO;2,
author = {Smagorinksy, J.},
title = {General circulation experiments with the primitive equations},
journal = {Monthly Weather Review},
volume = {91},
number = {3},
pages = {99-164},
year = {1963},
doi = {10.1175/1520-0493(1963)091<0099:GCEWTP>2.3.CO;2},
URL = {https://doi.org/10.1175/1520-0493(1963)091<0099:GCEWTP>2.3.CO;2},
eprint = {https://doi.org/10.1175/1520-0493(1963)091<0099:GCEWTP>2.3.CO;2}
}
Lilly Model Reference
article{doi:10.1111/j.2153-3490.1962.tb00128.x,
author = {LILLY, D. K.},
title = {On the numerical simulation of buoyant convection},
journal = {Tellus},
volume = {14},
number = {2},
pages = {148-172},
doi = {10.1111/j.2153-3490.1962.tb00128.x},
url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.2153-3490.1962.tb00128.x},
eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.2153-3490.1962.tb00128.x},
year = {1962}
}
Brunt-Väisälä Frequency Reference
Brunt-Vaisala frequency N² defined as in equation (1b) in
Durran, D.R. and J.B. Klemp, 1982:
On the Effects of Moisture on the Brunt-Väisälä Frequency.
J. Atmos. Sci., 39, 2152–2158,
https://doi.org/10.1175/1520-0469(1982)039<2152:OTEOMO>2.0.CO;2
Vreman Model
Vreman's turbulence model for anisotropic flows, which provides a less dissipative solution (specifically in the near-wall and transitional regions) than the Smagorinsky-Lilly method. This model relies of first derivatives of the velocity vector (i.e., the gradient tensor). By design, the Vreman model handles transitional as well as fully turbulent flows adequately. The input parameter to this model is the Smagorinsky coefficient - the coefficient is modified within the model functions to account for differences in model construction.
Equations
where ($i,j, m = (1,2,3)$)
ClimateMachine.Atmos.Vreman
— TypeVreman{FT} <: TurbulenceClosure
Filter width Δ is the local grid resolution calculated from the mesh metric tensor. A Smagorinsky coefficient is specified and used to compute the equivalent Vreman coefficient.
- ν_e = √(Bᵦ/(αᵢⱼαᵢⱼ)) where αᵢⱼ = ∂uⱼ∂uᵢ with uᵢ the resolved scale velocity component.
- βij = Δ²αₘᵢαₘⱼ
- Bᵦ = β₁₁β₂₂ + β₂₂β₃₃ + β₁₁β₃₃ - β₁₂² - β₁₃² - β₂₃²
βᵢⱼ is symmetric, positive-definite. If Δᵢ = Δ, then β = Δ²αᵀα
Fields
C_smag
Smagorinsky Coefficient [dimensionless]
Reference
@article{Vreman2004,
title={An eddy-viscosity subgrid-scale model for turbulent shear flow: Algebraic theory and applications},
author={Vreman, AW},
journal={Physics of fluids},
volume={16},
number={10},
pages={3670--3681},
year={2004},
publisher={AIP}
}
Anisotropic Minimum Dissipation
This method is based Vreugdenhil and Taylor's minimum-dissipation eddy-viscosity model. The principles of the Rayleigh quotient minimizer are applied to the energy dissipation terms in the conservation equations, resulting in a maximum dissipation bound, and a model for eddy viscosity and eddy diffusivity.
ClimateMachine.Atmos.AnisoMinDiss
— TypeAnisoMinDiss{FT} <: TurbulenceClosure
Filter width Δ is the local grid resolution calculated from the mesh metric tensor. A Poincare coefficient is specified and used to compute the equivalent AnisoMinDiss coefficient (computed as the solution to the eigenvalue problem for the Laplacian operator).
Fields
C_poincare
Reference
@article{
doi:10.1063/1.5037039,
author = {Vreugdenhil,Catherine A. and Taylor,John R. },
title = {Large-eddy simulations of stratified plane Couette flow using the anisotropic minimum-dissipation model},
journal = {Physics of Fluids},
volume = {30},
number = {8},
pages = {085104},
year = {2018},
doi = {10.1063/1.5037039},
URL = {https://doi.org/10.1063/1.5037039}
}