Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit area fraction in entrainment and detrainment limiter #2291

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading