diff --git a/config/default_configs/default_config.yml b/config/default_configs/default_config.yml index bcf8c07a0a..1c77d4d96d 100644 --- a/config/default_configs/default_config.yml +++ b/config/default_configs/default_config.yml @@ -170,7 +170,7 @@ c_amd: help: "Model coefficient for AMD-LES closure (TODO: Move to parameters.toml)" value: 0.29 smagorinsky_lilly: - help: "Smagorinsky-Lilly diffusive closure [`nothing` (default), `UVW`]" + help: "Smagorinsky-Lilly diffusive closure [`nothing` (default), `UVW`, `UV`, `W`, `UV_W_decoupled`]" value: ~ bubble: help: "Enable bubble correction for more accurate surface areas" diff --git a/src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl b/src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl index acd2d6e572..a4c9623279 100644 --- a/src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl +++ b/src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl @@ -75,6 +75,9 @@ function set_smagorinsky_lilly_precomputed_quantities!(Y, p, model) ᶜfb = lilly_stratification_correction(p, ᶜS) if is_smagorinsky_UVW_coupled(model) ᶜL_h = ᶜL_v = @. lazy(c_smag * cbrt(Δx * Δy * ᶜΔz) * ᶜfb) + else + ᶜL_h = @. lazy(c_smag * Δx) + ᶜL_v = @. lazy(c_smag * ᶜΔz * ᶜfb) end # Cache strain rate norms for diagnostics diff --git a/src/solver/model_getters.jl b/src/solver/model_getters.jl index ac454ae987..2859889ce6 100644 --- a/src/solver/model_getters.jl +++ b/src/solver/model_getters.jl @@ -176,12 +176,15 @@ Get the Smagorinsky-Lilly turbulence model based on `parsed_args["smagorinsky_li The possible model configurations flags are: - `UVW`: Applies the model to all spatial directions. +- `UV`: Applies the model to the horizontal direction only. +- `W`: Applies the model to the vertical direction only. +- `UV_W`: Applies the model to the horizontal and vertical directions separately. """ function get_smagorinsky_lilly_model(parsed_args) smag = parsed_args["smagorinsky_lilly"] isnothing(smag) && return nothing smag_symbol = Symbol(smag) - @assert smag_symbol in (:UVW,) + @assert smag_symbol in (:UVW, :UV, :W, :UV_W) return SmagorinskyLilly{smag_symbol}() end diff --git a/src/solver/types.jl b/src/solver/types.jl index 998833e94c..74d3bc76fb 100644 --- a/src/solver/types.jl +++ b/src/solver/types.jl @@ -248,13 +248,14 @@ Smagorinsky-Lilly eddy viscosity model. - `:UVW` (all axes) - `:UV` (horizontal axes) - `:W` (vertical axis) +- `:UV_W` (horizontal and vertical axes treated separately). """ struct SmagorinskyLilly{AXES} <: AbstractEddyViscosityModel end """ is_smagorinsky_UVW_coupled(model) -Check if the Smagorinsky model is coupled in all directions. +Check if the Smagorinsky model is coupled along all axes. """ is_smagorinsky_UVW_coupled(::SmagorinskyLilly{AXES}) where {AXES} = AXES == :UVW is_smagorinsky_UVW_coupled(::Nothing) = false @@ -262,23 +263,23 @@ is_smagorinsky_UVW_coupled(::Nothing) = false """ is_smagorinsky_vertical(model) -Check if the Smagorinsky model is applied in the vertical direction. +Check if the Smagorinsky model is applied along the vertical axis. See also [`is_smagorinsky_horizontal`](@ref). """ is_smagorinsky_vertical(::SmagorinskyLilly{AXES}) where {AXES} = - AXES == :UVW + AXES == :UVW || AXES == :W || AXES == :UV_W is_smagorinsky_vertical(::Nothing) = false """ is_smagorinsky_horizontal(model) -Check if the Smagorinsky model is applied in the horizontal directions. +Check if the Smagorinsky model is applied along the horizontal axes. See also [`is_smagorinsky_vertical`](@ref). """ is_smagorinsky_horizontal(::SmagorinskyLilly{AXES}) where {AXES} = - AXES == :UVW + AXES == :UVW || AXES == :UV || AXES == :UV_W is_smagorinsky_horizontal(::Nothing) = false struct AnisotropicMinimumDissipation{FT} <: AbstractEddyViscosityModel