Skip to content

Viscous sponge for updraft mse, q_tot and Rayleigh sponge for tke #3814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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