Skip to content

Commit

Permalink
remove some limiter for simple entrainment and detrainment
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Sep 20, 2023
1 parent 651314c commit 46c2b61
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions src/prognostic_equations/edmfx_entr_detr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ function entrainment(
return FT(0)
else
g = CAP.grav(params)
turbconv_params = CAP.turbconv_params(params)
ᶜaʲ_max = TCP.max_area(turbconv_params)

# pressure scale height (height where pressure drops by 1/e)
ref_H = ᶜp / (ᶜρ * g)
Expand Down Expand Up @@ -104,13 +102,9 @@ function entrainment(
dt::FT,
::ConstantCoefficientEntrainment,
) where {FT}
if ᶜaʲ <= FT(0)
return FT(0)
else
entr_coeff = CAP.entr_coeff(params)
entr = max(0, min(entr_coeff * abs(ᶜwʲ) / (ᶜz - z_sfc), 1 / dt))
return entr
end
entr_coeff = CAP.entr_coeff(params)
entr = min(entr_coeff * abs(ᶜwʲ) / (ᶜz - z_sfc), 1 / dt)
return entr
end

function entrainment(
Expand All @@ -130,13 +124,9 @@ function entrainment(
dt::FT,
::ConstantTimescaleEntrainment,
) where {FT}
if ᶜaʲ <= FT(0)
return FT(0)
else
entr_tau = CAP.entr_tau(params)
entr = max(0, min(1 / entr_tau, 1 / dt))
return entr
end
entr_tau = CAP.entr_tau(params)
entr = min(1 / entr_tau, 1 / dt)
return entr
end

"""
Expand Down Expand Up @@ -241,14 +231,9 @@ function detrainment(
dt::FT,
::ConstantCoefficientDetrainment,
) where {FT}

if ᶜaʲ <= FT(0)
return FT(0)
else
detr_coeff = CAP.detr_coeff(params)
detr = max(0, min(detr_coeff * abs(ᶜwʲ), 1 / dt))
return detr
end
detr_coeff = CAP.detr_coeff(params)
detr = min(detr_coeff * abs(ᶜwʲ), 1 / dt)
return detr
end

edmfx_entr_detr_tendency!(Yₜ, Y, p, t, colidx, turbconv_model) = nothing
Expand Down

0 comments on commit 46c2b61

Please sign in to comment.