Skip to content

Commit

Permalink
limit entrainment
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Sep 25, 2023
1 parent 2962706 commit c4ec75e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/prognostic_equations/edmfx_entr_detr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,16 @@ function entrainment(
dt::FT,
::ConstantTimescaleEntrainment,
) where {FT}
entr_tau = CAP.entr_tau(params)
entr = min(1 / entr_tau, 1 / dt)
return entr
if ᶜaʲ >= FT(1)
return FT(0)
else
entr_tau = CAP.entr_tau(params)
entr = min(1 / entr_tau, 1 / dt)
n = 8
damp_coeff = 2^(1 / n + 1) / ((1 / ᶜaʲ)^(1 / n) + (1 / (1 - ᶜaʲ))^(1 / n))
entr = entr * damp_coeff
return entr
end
end

"""
Expand Down

0 comments on commit c4ec75e

Please sign in to comment.