Skip to content

Commit 05af764

Browse files
authored
Merge pull request #4054 from CliMA/he/rft-split-h-v-smag
rft: split Smagorinsky diffusive model to horizontal and vertical components
2 parents b0c1956 + 2fbb8cf commit 05af764

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

config/default_configs/default_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ c_amd:
170170
help: "Model coefficient for AMD-LES closure (TODO: Move to parameters.toml)"
171171
value: 0.29
172172
smagorinsky_lilly:
173-
help: "Smagorinsky-Lilly diffusive closure [`nothing` (default), `UVW`]"
173+
help: "Smagorinsky-Lilly diffusive closure [`nothing` (default), `UVW`, `UV`, `W`, `UV_W_decoupled`]"
174174
value: ~
175175
bubble:
176176
help: "Enable bubble correction for more accurate surface areas"

src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ function set_smagorinsky_lilly_precomputed_quantities!(Y, p, model)
7575
ᶜfb = lilly_stratification_correction(p, ᶜS)
7676
if is_smagorinsky_UVW_coupled(model)
7777
ᶜL_h = ᶜL_v = @. lazy(c_smag * cbrt(Δx * Δy * ᶜΔz) * ᶜfb)
78+
else
79+
ᶜL_h = @. lazy(c_smag * Δx)
80+
ᶜL_v = @. lazy(c_smag * ᶜΔz * ᶜfb)
7881
end
7982

8083
# Cache strain rate norms for diagnostics

src/solver/model_getters.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,15 @@ Get the Smagorinsky-Lilly turbulence model based on `parsed_args["smagorinsky_li
176176
177177
The possible model configurations flags are:
178178
- `UVW`: Applies the model to all spatial directions.
179+
- `UV`: Applies the model to the horizontal direction only.
180+
- `W`: Applies the model to the vertical direction only.
181+
- `UV_W`: Applies the model to the horizontal and vertical directions separately.
179182
"""
180183
function get_smagorinsky_lilly_model(parsed_args)
181184
smag = parsed_args["smagorinsky_lilly"]
182185
isnothing(smag) && return nothing
183186
smag_symbol = Symbol(smag)
184-
@assert smag_symbol in (:UVW,)
187+
@assert smag_symbol in (:UVW, :UV, :W, :UV_W)
185188
return SmagorinskyLilly{smag_symbol}()
186189
end
187190

src/solver/types.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,37 +248,38 @@ Smagorinsky-Lilly eddy viscosity model.
248248
- `:UVW` (all axes)
249249
- `:UV` (horizontal axes)
250250
- `:W` (vertical axis)
251+
- `:UV_W` (horizontal and vertical axes treated separately).
251252
"""
252253
struct SmagorinskyLilly{AXES} <: AbstractEddyViscosityModel end
253254

254255
"""
255256
is_smagorinsky_UVW_coupled(model)
256257
257-
Check if the Smagorinsky model is coupled in all directions.
258+
Check if the Smagorinsky model is coupled along all axes.
258259
"""
259260
is_smagorinsky_UVW_coupled(::SmagorinskyLilly{AXES}) where {AXES} = AXES == :UVW
260261
is_smagorinsky_UVW_coupled(::Nothing) = false
261262

262263
"""
263264
is_smagorinsky_vertical(model)
264265
265-
Check if the Smagorinsky model is applied in the vertical direction.
266+
Check if the Smagorinsky model is applied along the vertical axis.
266267
267268
See also [`is_smagorinsky_horizontal`](@ref).
268269
"""
269270
is_smagorinsky_vertical(::SmagorinskyLilly{AXES}) where {AXES} =
270-
AXES == :UVW
271+
AXES == :UVW || AXES == :W || AXES == :UV_W
271272
is_smagorinsky_vertical(::Nothing) = false
272273

273274
"""
274275
is_smagorinsky_horizontal(model)
275276
276-
Check if the Smagorinsky model is applied in the horizontal directions.
277+
Check if the Smagorinsky model is applied along the horizontal axes.
277278
278279
See also [`is_smagorinsky_vertical`](@ref).
279280
"""
280281
is_smagorinsky_horizontal(::SmagorinskyLilly{AXES}) where {AXES} =
281-
AXES == :UVW
282+
AXES == :UVW || AXES == :UV || AXES == :UV_W
282283
is_smagorinsky_horizontal(::Nothing) = false
283284

284285
struct AnisotropicMinimumDissipation{FT} <: AbstractEddyViscosityModel

0 commit comments

Comments
 (0)