From ec783ba5c4d08067ddf1b4a1c1456f0011da8ad0 Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:15:10 -0800 Subject: [PATCH] add rho tendencies from qt diffusion --- src/prognostic_equations/edmfx_sgs_flux.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/prognostic_equations/edmfx_sgs_flux.jl b/src/prognostic_equations/edmfx_sgs_flux.jl index f1a37d5ea6..48a585c937 100644 --- a/src/prognostic_equations/edmfx_sgs_flux.jl +++ b/src/prognostic_equations/edmfx_sgs_flux.jl @@ -188,14 +188,17 @@ function edmfx_sgs_diffusive_flux_tendency!( if !(p.atmos.moisture_model isa DryModel) # specific humidity + ᶜρχₜ_diffusion = p.scratch.ᶜtemp_scalar ᶜdivᵥ_ρq_tot = Operators.DivergenceF2C( top = Operators.SetValue(C3(FT(0))), bottom = Operators.SetValue( sfc_conditions.ρ_flux_q_tot[colidx], ), ) - @. Yₜ.c.ρq_tot[colidx] -= + @. ᶜρχₜ_diffusion[colidx] = ᶜdivᵥ_ρq_tot(-(ᶠρaK_h[colidx] * ᶠgradᵥ(ᶜq_tot⁰[colidx]))) + @. Yₜ.c.ρq_tot[colidx] -= ᶜρχₜ_diffusion[colidx] + @. Yₜ.c.ρ[colidx] -= ᶜρχₜ_diffusion[colidx] end # momentum @@ -249,15 +252,18 @@ function edmfx_sgs_diffusive_flux_tendency!( if !(p.atmos.moisture_model isa DryModel) # specific humidity + ᶜρχₜ_diffusion = p.scratch.ᶜtemp_scalar ᶜdivᵥ_ρq_tot = Operators.DivergenceF2C( top = Operators.SetValue(C3(FT(0))), bottom = Operators.SetValue( sfc_conditions.ρ_flux_q_tot[colidx], ), ) - @. Yₜ.c.ρq_tot[colidx] -= ᶜdivᵥ_ρq_tot( + @. ᶜρχₜ_diffusion[colidx] = ᶜdivᵥ_ρq_tot( -(ᶠρaK_h[colidx] * ᶠgradᵥ(ᶜspecific.q_tot[colidx])), ) + @. Yₜ.c.ρq_tot[colidx] -= ᶜρχₜ_diffusion[colidx] + @. Yₜ.c.ρ[colidx] -= ᶜρχₜ_diffusion[colidx] end # momentum