Skip to content

Commit

Permalink
change entrainment dt limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Nov 23, 2023
1 parent 4a55565 commit eb057e6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/prognostic_equations/edmfx_entr_detr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function entrainment(
abs(ᶜwʲ) / (ᶜz - z_sfc) * (
-4.013288 - 0.000968 * Π₁ + 0.356974 * Π₃ - 0.403124 * Π₄ + 1.503261 * Π₆
),
1 / dt,
(1 - ᶜaʲ) / max(ᶜaʲ, eps(FT)) / dt,
),
)

Expand Down Expand Up @@ -115,9 +115,14 @@ function entrainment(
min_area_limiter =
min_area_limiter_scale *
exp(-min_area_limiter_power * (max(ᶜaʲ, 0) - a_min))
entr = min(
entr_inv_tau + entr_coeff * abs(ᶜwʲ) / (ᶜz - z_sfc) + min_area_limiter,
1 / dt,
entr = max(
0,
min(
entr_inv_tau +
entr_coeff * abs(ᶜwʲ) / (ᶜz - z_sfc) +
min_area_limiter,
(1 - ᶜaʲ) / max(ᶜaʲ, eps(FT)) / dt,
),
)
return entr
end
Expand Down Expand Up @@ -149,9 +154,14 @@ function entrainment(
min_area_limiter =
min_area_limiter_scale *
exp(-min_area_limiter_power * (max(ᶜaʲ, 0) - a_min))
entr = min(
entr_inv_tau + entr_coeff * abs(ᶜwʲ) / (ᶜz - z_sfc) + min_area_limiter,
1 / dt,
entr = max(
0,
min(
entr_inv_tau +
entr_coeff * abs(ᶜwʲ) / (ᶜz - z_sfc) +
min_area_limiter,
(1 - ᶜaʲ) / max(ᶜaʲ, eps(FT)) / dt,
),
)
return entr * FT(2) * hm_limiter(ᶜaʲ)
end
Expand Down

0 comments on commit eb057e6

Please sign in to comment.