Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/solver/model_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions src/solver/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -248,37 +248,38 @@ 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

"""
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
Expand Down
Loading