Skip to content

Commit

Permalink
fix for Rayleigh sponge
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne authored and charleskawczynski committed Oct 3, 2023
1 parent fab2f3c commit 432a7dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parameterized_tendencies/sponge/rayleigh_sponge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function rayleigh_sponge_cache(rs::RayleighSponge, Y)
(; zd, α_uₕ, α_w) = rs
ᶜz = Fields.coordinate_field(Y.c).z
ᶠz = Fields.coordinate_field(Y.f).z
ᶜαₘ_uₕ = @. ifelse(ᶜz > zd, α_uₕ, FT(0))
ᶠαₘ_w = @. ifelse(ᶠz > zd, α_w, FT(0))
ᶜαₘ_uₕ = @. ifelse(ᶜz > zd, α_uₕ, $(FT(0)))
ᶠαₘ_w = @. ifelse(ᶠz > zd, α_w, $(FT(0)))
zmax = maximum(ᶠz)
ᶜβ_rayleigh_uₕ = @. ᶜαₘ_uₕ * sin(FT(π) / 2 * (ᶜz - zd) / (zmax - zd))^2
ᶠβ_rayleigh_w = @. ᶠαₘ_w * sin(FT(π) / 2 * (ᶠz - zd) / (zmax - zd))^2
Expand Down

0 comments on commit 432a7dd

Please sign in to comment.