@@ -139,9 +139,11 @@ function entrainment(
139139 :: PiGroupsEntrainment ,
140140)
141141 FT = eltype (thermo_params)
142- # Entrainment is not well-defined or should be zero if updraft area is negligible.
142+ entr_inv_tau = CAP. entr_inv_tau (turbconv_params)
143+ # Entrainment is not well-defined if updraft area is negligible.
144+ # Fix at entr_inv_tau to ensure some mixing with the environment.
143145 if ᶜaʲ <= eps (FT)
144- return 0
146+ return entr_inv_tau
145147 end
146148
147149 elev_above_sfc = ᶜz - z_sfc
@@ -168,7 +170,6 @@ function entrainment(
168170 )
169171
170172 entr_param_vec = CAP. entr_param_vec (turbconv_params)
171- entr_inv_tau = CAP. entr_inv_tau (turbconv_params)
172173 pi_sum =
173174 entr_param_vec[1 ] * abs (Π₁) +
174175 entr_param_vec[2 ] * abs (Π₂) +
@@ -212,10 +213,10 @@ function entrainment(
212213 min_area_limiter_power = CAP. min_area_limiter_power (turbconv_params)
213214 a_min = CAP. min_area (turbconv_params)
214215
215- # Entrainment is not well-defined or should be zero if updraft area is negligible,
216+ # Entrainment is not well-defined if updraft area is negligible,
216217 # as some limiters depend on ᶜaʲ.
217218 if ᶜaʲ <= eps (FT) && min_area_limiter_scale == FT (0 ) # If no area and no base min_area_limiter
218- return 0
219+ return entr_inv_tau
219220 end
220221
221222 min_area_limiter =
@@ -386,12 +387,13 @@ function detrainment(
386387 :: PiGroupsDetrainment ,
387388)
388389 FT = eltype (thermo_params)
390+ detr_inv_tau = CAP. detr_inv_tau (turbconv_params)
389391
390- # If ᶜρaʲ (updraft effective density) is zero or negligible,
391- # detrainment is considered zero . This also protects division by ᶜρaʲ later.
392+ # If ᶜρaʲ (updraft effective density) is zero or negligible, detrainment is
393+ # considered to be fixed at detr_inv_tau . This also protects division by ᶜρaʲ later.
392394 # This condition implies the updraft area (ᶜaʲ) is also likely negligible.
393395 if ᶜρaʲ <= eps (FT)
394- return 0
396+ return detr_inv_tau
395397 end
396398
397399 elev_above_sfc = ᶜz - z_sfc
@@ -466,9 +468,10 @@ function detrainment(
466468 max_area_limiter_power = CAP. max_area_limiter_power (turbconv_params)
467469 a_max = CAP. max_area (turbconv_params)
468470
469- # If ᶜρaʲ (updraft effective density) is zero or negligible, detrainment is zero.
470- if ᶜρaʲ <= eps (FT) # Consistent check
471- return 0
471+ # If ᶜρaʲ (updraft effective density) is zero or negligible, detrainment is not well defined.
472+ # Fix at detr_inv_tau to ensure some mixing with the environment.
473+ if ᶜρaʲ <= eps (FT)
474+ return detr_inv_tau
472475 end
473476
474477 max_area_limiter =
@@ -508,8 +511,12 @@ function detrainment(
508511 :: SmoothAreaDetrainment ,
509512)
510513 FT = eltype (thermo_params)
511- # If ᶜρaʲ is negligible or vertical velocity divergence term is non-negative, detrainment is zero.
512- if (ᶜρaʲ <= eps (FT)) || (ᶜw_vert_div >= 0 ) # Consistent check for ᶜρaʲ
514+ detr_inv_tau = CAP. detr_inv_tau (turbconv_params)
515+ # If ᶜρaʲ is negligible detrainment is fixed at detr_inv_tau.
516+ if (ᶜρaʲ <= eps (FT)) # Consistent check for ᶜρaʲ
517+ detr = detr_inv_tau
518+ # If vertical velocity divergence term is non-negative detrainment is zero.
519+ elseif (ᶜw_vert_div >= 0 )
513520 detr = FT (0 )
514521 else
515522 detr = ᶜentr - ᶜw_vert_div
0 commit comments