Skip to content

Commit

Permalink
add rho tendencies from qt diffusion
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Dec 1, 2023
1 parent d978851 commit ec783ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/prognostic_equations/edmfx_sgs_flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec783ba

Please sign in to comment.