Skip to content

Commit 7a654c3

Browse files
committed
Add (1 - a)^c limiter to PiGroups and Generalized entrainment functions
1 parent 3d99876 commit 7a654c3

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/parameters/Parameters.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Base.@kwdef struct TurbulenceConvectionParameters{FT, VFT1, VFT2} <: ATCP
4444
detr_vertdiv_coeff::FT
4545
entr_param_vec::VFT1
4646
turb_entr_param_vec::VFT2
47+
entr_mult_limiter_coeff::FT
4748
detr_massflux_vertdiv_coeff::FT
4849
min_area_limiter_scale::FT
4950
min_area_limiter_power::FT

src/parameters/create_parameters.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ function TurbulenceConvectionParameters(
177177
:EDMF_surface_area => :surface_area,
178178
:entr_param_vec => :entr_param_vec,
179179
:turb_entr_param_vec => :turb_entr_param_vec,
180+
:entr_mult_limiter_coeff => :entr_mult_limiter_coeff,
180181
:minimum_updraft_top => :min_updraft_top,
181182
:mixing_length_eddy_viscosity_coefficient => :tke_ed_coeff,
182183
:mixing_length_smin_ub => :smin_ub,

src/prognostic_equations/edmfx_entr_detr.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ function entrainment(
5757
::PiGroupsEntrainment,
5858
)
5959
FT = eltype(thermo_params)
60+
entr_mult_limiter_coeff = CAP.entr_mult_limiter_coeff(turbconv_params)
61+
6062
if ᶜaʲ <= FT(0)
6163
return FT(0)
6264
else
@@ -68,14 +70,15 @@ function entrainment(
6870
# non-dimensional pi-groups
6971
Π₁ = (ᶜz - z_sfc) * (ᶜbuoyʲ - ᶜbuoy⁰) / ((ᶜwʲ - ᶜw⁰)^2 + eps(FT)) / 100
7072
Π₂ = max(ᶜtke⁰, 0) / ((ᶜwʲ - ᶜw⁰)^2 + eps(FT)) / 2
71-
Π₃ = sqrt(ᶜaʲ)
73+
Π₃ = sqrt(max(ᶜaʲ, 0))
7274
Π₄ = ᶜRHʲ - ᶜRH⁰
7375
Π₅ = (ᶜz - z_sfc) / ref_H
7476
# Π₁, Π₂ are unbounded, so clip values that blow up
7577
Π₁ = min(max(Π₁, -1), 1)
7678
Π₂ = min(max(Π₂, -1), 1)
7779

7880
entr =
81+
((FT(1) - min(ᶜaʲ, FT(1)))^entr_mult_limiter_coeff) *
7982
abs(ᶜwʲ - ᶜw⁰) / (ᶜz - z_sfc) * (
8083
entr_param_vec[1] * abs(Π₁) +
8184
entr_param_vec[2] * abs(Π₂) +
@@ -107,6 +110,7 @@ function entrainment(
107110
::GeneralizedEntrainment,
108111
)
109112
FT = eltype(thermo_params)
113+
entr_mult_limiter_coeff = CAP.entr_mult_limiter_coeff(turbconv_params)
110114
entr_inv_tau = CAP.entr_tau(turbconv_params)
111115
entr_coeff = CAP.entr_coeff(turbconv_params)
112116
min_area_limiter_scale = CAP.min_area_limiter_scale(turbconv_params)
@@ -117,9 +121,11 @@ function entrainment(
117121
min_area_limiter_scale *
118122
exp(-min_area_limiter_power * (max(ᶜaʲ, 0) - a_min))
119123
entr =
120-
entr_inv_tau +
121-
entr_coeff * abs(ᶜwʲ - ᶜw⁰) / (ᶜz - z_sfc) +
122-
min_area_limiter
124+
((FT(1) - min(ᶜaʲ, FT(1)))^entr_mult_limiter_coeff) * (
125+
entr_inv_tau +
126+
entr_coeff * abs(ᶜwʲ - ᶜw⁰) / (ᶜz - z_sfc) +
127+
min_area_limiter
128+
)
123129

124130
return max(entr, 0)
125131
end
@@ -245,7 +251,7 @@ function detrainment(
245251
# non-dimensional pi-groups
246252
Π₁ = (ᶜz - z_sfc) * (ᶜbuoyʲ - ᶜbuoy⁰) / ((ᶜwʲ - ᶜw⁰)^2 + eps(FT)) / 100
247253
Π₂ = max(ᶜtke⁰, 0) / ((ᶜwʲ - ᶜw⁰)^2 + eps(FT)) / 2
248-
Π₃ = sqrt(ᶜaʲ)
254+
Π₃ = sqrt(max(ᶜaʲ, 0))
249255
Π₄ = ᶜRHʲ - ᶜRH⁰
250256
Π₅ = (ᶜz - z_sfc) / ref_H
251257
# Π₁, Π₂ are unbounded, so clip values that blow up

0 commit comments

Comments
 (0)