Skip to content

Commit c3272a4

Browse files
authored
Merge pull request #3714 from CliMA/zs/smag_lilly
fix boundary condition for smagorinsky lilly
2 parents 148dba7 + 07bf31e commit c3272a4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,15 @@ function vertical_smagorinsky_lilly_tendency!(Yₜ, Y, p, t, ::SmagorinskyLilly)
131131
ᶠgradᵥ = Operators.GradientC2F() # apply BCs to ᶜdivᵥ, which wraps ᶠgradᵥ
132132
ᶜdivᵥ_uₕ = Operators.DivergenceF2C(
133133
top = Operators.SetValue(C3(FT(0)) C12(FT(0), FT(0))),
134-
bottom = Operators.SetValue(ρ_flux_uₕ),
134+
bottom = Operators.SetValue(C3(FT(0)) C12(FT(0), FT(0))),
135135
)
136136
ᶠdivᵥ = Operators.DivergenceC2F(
137137
bottom = Operators.SetDivergence(FT(0)),
138138
top = Operators.SetDivergence(FT(0)),
139139
)
140-
top = Operators.SetValue(C3(FT(0)))
141140
ᶜdivᵥ_ρe_tot = Operators.DivergenceF2C(;
142-
top,
143-
bottom = Operators.SetValue(ρ_flux_h_tot),
141+
top = Operators.SetValue(C3(FT(0))),
142+
bottom = Operators.SetValue(C3(FT(0))),
144143
)
145144

146145
# Apply to tendencies
@@ -156,14 +155,13 @@ function vertical_smagorinsky_lilly_tendency!(Yₜ, Y, p, t, ::SmagorinskyLilly)
156155
@. Yₜ.c.ρe_tot -= ᶜdivᵥ_ρe_tot(-(ᶠρ * ᶠD_smag * ᶠgradᵥ(ᶜh_tot)))
157156

158157
## Tracer diffusion and associated mass changes
159-
sfc_zero = @. sfc_temp_C3 = C3(FT(0))
160158
for (ᶜρχₜ, ᶜχ, χ_name) in CA.matching_subfields(Yₜ.c, ᶜspecific)
161159
χ_name == :e_tot && continue
162160

163-
bottom = Operators.SetValue(
164-
χ_name == :q_tot ? sfc_conditions.ρ_flux_q_tot : sfc_zero,
161+
ᶜdivᵥ_ρχ = Operators.DivergenceF2C(;
162+
top = Operators.SetValue(C3(FT(0))),
163+
bottom = Operators.SetValue(C3(FT(0))),
165164
)
166-
ᶜdivᵥ_ρχ = Operators.DivergenceF2C(; top, bottom)
167165

168166
ᶜ∇ᵥρD∇χₜ = @. ᶜtemp_scalar = ᶜdivᵥ_ρχ(-(ᶠρ * ᶠD_smag * ᶠgradᵥ(ᶜχ)))
169167
@. ᶜρχₜ -= ᶜ∇ᵥρD∇χₜ

0 commit comments

Comments
 (0)