Module TurbulenceClosures.jl
currently supports
pointwise models of the eddy viscosity/eddy diffusivity type.
Supported constructors include are:
[ConstantDynamicViscosity
](@ref constant-viscosity)
[SmagorinskyLilly
](@ref smagorinsky-lilly)
[Vreman
](@ref vreman)
[AnisoMinDiss
](@ref aniso-min-diss)\
!!! note
Usage: This is a quick-ref guide to using turbulence models as a
subcomponent of AtmosModel
turbulence=ConstantDynamicViscosity(ν)
- turbulence=SmagorinskyLilly(C_smag)
- turbulence=Vreman(C_smag)
- turbulence=AnisoMinDiss(C_poincare)
using DocStringExtensions
using CLIMAParameters.Atmos.SubgridScale: inv_Pr_turb
export ConstantDynamicViscosity, SmagorinskyLilly, Vreman, AnisoMinDiss
export turbulence_tensors
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(::TurbulenceClosure, ::AbstractStateType, 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(::TurbulenceClosure, ::Prognostic, FT) = @vars()
function atmos_nodal_update_auxiliary_state!(
::TurbulenceClosure,
::AtmosModel,
state::Vars,
aux::Vars,
t::Real,
) end
The following function provides an example of a stub for an eddy-viscosity model. Currently, scalar and diagonal tensor viscosities and diffusivities are supported.
Generic math functions for use within the turbulence closures such as the [principal tensor invariants](@ref tensor-invariants), [symmetric tensors](@ref symmetric-tensors) and [tensor norms](@ref tensor-norms) have been included.
Given a tensor X, return the tensor dot product
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.
"""
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
ConstantDynamicViscosity
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.
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.
with the stratification correction term
Here, src/Mesh/Geometry.jl
), and modify the vertical
lengthscale by the stratification correction factor $\mathrm{f}{b}$
so that
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.
where ($i,j, m = (1,2,3)$)
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.