Skip to content
Closed
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
7 changes: 7 additions & 0 deletions src/parameterized_tendencies/sponge/viscous_sponge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ function viscous_sponge_tendency_tracer(ᶜρ, ᶜχ, s)
zmax = z_max(axes(ᶠz))
return @. lazy(β_viscous(s, ᶜz, zmax) * wdivₕ(ᶜρ * gradₕ(ᶜχ)))
end

function viscous_sponge_tendency_sgs(ᶜχ, s)
s isa Nothing && return NullBroadcasted()
(; ᶜz, ᶠz) = z_coordinate_fields(axes(ᶜχ))
zmax = z_max(axes(ᶠz))
return @. lazy(β_viscous(s, ᶜz, zmax) * wdivₕ(gradₕ(ᶜχ)))
end
14 changes: 14 additions & 0 deletions src/prognostic_equations/remaining_tendency.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ NVTX.@annotate function additional_tendency!(Yₜ, Y, p, t)
end
end

if p.atmos.turbconv_model isa PrognosticEDMFX
n = n_mass_flux_subdomains(p.atmos.turbconv_model)
for j in 1:n
vst_mse =
viscous_sponge_tendency_sgs(Y.c.sgsʲs.:($j).mse, viscous_sponge)
vst_q_tot = viscous_sponge_tendency_sgs(
Y.c.sgsʲs.:($j).q_tot,
viscous_sponge,
)
@. Yₜ.c.sgsʲs.:($$j).mse += vst_mse
@. Yₜ.c.sgsʲs.:($$j).q_tot += vst_q_tot
end
end

# Held Suarez tendencies
@. Yₜ.c.uₕ += hs_tendency_uₕ
@. Yₜ.c.ρe_tot += hs_tendency_ρe_tot
Expand Down
Loading