Skip to content

Commit

Permalink
Merge #2291
Browse files Browse the repository at this point in the history
2291: limit area fraction in entrainment and detrainment limiter r=szy21 a=szy21



Co-authored-by: Zhaoyi Shen <11598433+szy21@users.noreply.github.com>
  • Loading branch information
bors[bot] and szy21 authored Oct 25, 2023
2 parents a1ca826 + 250845c commit e340533
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/model_configs/diagnostic_edmfx_dycoms_rf01_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ y_elem: 2
z_elem: 30
z_max: 1500
z_stretch: false
dt: 6secs
dt: 10secs
t_end: 4hours
dt_save_to_disk: 2mins
toml: [toml/diagnostic_edmfx_box.toml]
16 changes: 10 additions & 6 deletions src/prognostic_equations/edmfx_entr_detr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ function entrainment(
turbconv_params = CAP.turbconv_params(params)
a_min = TCP.min_area(turbconv_params)
min_area_limiter =
min_area_limiter_scale * exp(-min_area_limiter_power * (ᶜaʲ - a_min))
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,
Expand Down Expand Up @@ -144,7 +145,8 @@ function entrainment(
turbconv_params = CAP.turbconv_params(params)
a_min = TCP.min_area(turbconv_params)
min_area_limiter =
min_area_limiter_scale * exp(-min_area_limiter_power * (ᶜaʲ - a_min))
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,
Expand Down Expand Up @@ -262,12 +264,13 @@ function detrainment(
turbconv_params = CAP.turbconv_params(params)
a_max = TCP.max_area(turbconv_params)
max_area_limiter =
max_area_limiter_scale * exp(-max_area_limiter_power * (a_max - ᶜaʲ))
max_area_limiter_scale *
exp(-max_area_limiter_power * (a_max - min(ᶜaʲ, 1)))
detr = min(
detr_inv_tau +
detr_coeff * abs(ᶜwʲ) +
detr_buoy_coeff * abs(min(ᶜbuoyʲ - ᶜbuoy⁰, 0)) /
max(eps(FT), abs((ᶜwʲ - ᶜw⁰))) +
max(eps(FT), abs(ᶜwʲ - ᶜw⁰)) +
max_area_limiter,
1 / dt,
)
Expand Down Expand Up @@ -299,12 +302,13 @@ function detrainment(
turbconv_params = CAP.turbconv_params(params)
a_max = TCP.max_area(turbconv_params)
max_area_limiter =
max_area_limiter_scale * exp(-max_area_limiter_power * (a_max - ᶜaʲ))
max_area_limiter_scale *
exp(-max_area_limiter_power * (a_max - min(ᶜaʲ, 1)))
detr = min(
detr_inv_tau +
detr_coeff * abs(ᶜwʲ) +
detr_buoy_coeff * abs(min(ᶜbuoyʲ - ᶜbuoy⁰, 0)) /
max(eps(FT), abs((ᶜwʲ - ᶜw⁰))) +
max(eps(FT), abs(ᶜwʲ - ᶜw⁰)) +
max_area_limiter,
1 / dt,
)
Expand Down

0 comments on commit e340533

Please sign in to comment.