Skip to content

Commit 291fdce

Browse files
committed
add qt and tracer tendency in viscous sponge
1 parent 7b4c3b2 commit 291fdce

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/parameterized_tendencies/sponge/viscous_sponge.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,10 @@ function viscous_sponge_cache(Y, viscous_sponge::ViscousSponge)
2525
return (; ᶜβ_viscous, ᶠβ_viscous)
2626
end
2727

28-
function add_viscous_sponge_energy_tendency!(Yₜ, Y, p, t)
29-
(; ᶜβ_viscous) = p.viscous_sponge
30-
(; ᶜh_tot) = p.precomputed
31-
ᶜρ = Y.c.ρ
32-
@. Yₜ.c.ρe_tot += ᶜβ_viscous * wdivₕ(ᶜρ * gradₕ(ᶜh_tot))
33-
end
34-
3528
function viscous_sponge_tendency!(Yₜ, Y, p, t, ::ViscousSponge)
3629
(; ᶜβ_viscous, ᶠβ_viscous) = p.viscous_sponge
30+
(; ᶜh_tot, ᶜspecific) = p.precomputed
3731
ᶜuₕ = Y.c.uₕ
38-
add_viscous_sponge_energy_tendency!(Yₜ, Y, p, t)
3932
@. Yₜ.c.uₕ +=
4033
ᶜβ_viscous * (
4134
wgradₕ(divₕ(ᶜuₕ)) - Geometry.project(
@@ -45,4 +38,11 @@ function viscous_sponge_tendency!(Yₜ, Y, p, t, ::ViscousSponge)
4538
)
4639
@. Yₜ.f.u₃.components.data.:1 +=
4740
ᶠβ_viscous * wdivₕ(gradₕ(Y.f.u₃.components.data.:1))
41+
42+
@. Yₜ.c.ρe_tot += ᶜβ_viscous * wdivₕ(Y.c.ρ * gradₕ(ᶜh_tot))
43+
for (ᶜρχₜ, ᶜχ, χ_name) in matching_subfields(Yₜ.c, ᶜspecific)
44+
χ_name == :e_tot && continue
45+
@. ᶜρχₜ += ᶜβ_viscous * wdivₕ(Y.c.ρ * gradₕ(ᶜχ))
46+
@. Yₜ.c.ρ += ᶜβ_viscous * wdivₕ(Y.c.ρ * gradₕ(ᶜχ))
47+
end
4848
end

0 commit comments

Comments
 (0)