From bac57defa03c64a2088355d1616ed0dcdf12000d Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:18:52 -0700 Subject: [PATCH] cleanup --- src/cache/advective_edmf_precomputed_quantities.jl | 2 +- src/prognostic_equations/hyperdiffusion.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cache/advective_edmf_precomputed_quantities.jl b/src/cache/advective_edmf_precomputed_quantities.jl index e87bf1d37af..b47f81e0359 100644 --- a/src/cache/advective_edmf_precomputed_quantities.jl +++ b/src/cache/advective_edmf_precomputed_quantities.jl @@ -73,7 +73,7 @@ function set_advective_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t) # which in turn introduces an error to ᶠu³ʲ, which then increases # the error in ᶜρʲ. For now, we will filter ᶜρʲ to fix this. Note # that this will no longer be necessary after we add diffusion. - @. ᶜρʲ = ifelse(abs(ᶜρʲ - Y.c.ρ) <= 2 * eps(Y.c.ρ), Y.c.ρ, ᶜρʲ) + # @. ᶜρʲ = ifelse(abs(ᶜρʲ - Y.c.ρ) <= 2 * eps(Y.c.ρ), Y.c.ρ, ᶜρʲ) # EDMFX boundary condition: diff --git a/src/prognostic_equations/hyperdiffusion.jl b/src/prognostic_equations/hyperdiffusion.jl index b7a1af78f89..5ff7aca7dab 100644 --- a/src/prognostic_equations/hyperdiffusion.jl +++ b/src/prognostic_equations/hyperdiffusion.jl @@ -217,6 +217,7 @@ NVTX.@annotate function hyperdiffusion_tendency!(Yₜ, Y, p, t) @. Yₜ.f.sgsʲs.:($$j).u₃ += κ₄ * ᶠwinterp(ᶜJ * Y.c.ρ, ᶜ∇²uᵥʲs.:($$j)) end + # Note: It is more correct to have ρa inside and outside the divergence @. Yₜ.c.sgsʲs.:($$j).h_tot -= κ₄ * wdivₕ(gradₕ(ᶜ∇²h_totʲs.:($$j))) end end @@ -258,6 +259,7 @@ NVTX.@annotate function tracer_hyperdiffusion_tendency!(Yₜ, Y, p, t) if turbconv_model isa AdvectiveEDMFX for j in 1:n + # Note: It is more correct to have ρa inside and outside the divergence @. ᶜ∇²q_totʲs.:($$j) = wdivₕ(gradₕ(Y.c.sgsʲs.:($$j).q_tot)) end end