Skip to content

Commit

Permalink
Merge #1363
Browse files Browse the repository at this point in the history
1363: Use exponential detrainment limiter and apply to all entr function types r=costachris a=costachris

Use exponential detrainment limiter instead of the currently-used logistic function and apply to all entr function types. 

## Original 

$$ \left(2 - \frac{1}{{1 + \exp(-\gamma_{lim} \times (a_{max} - a\_{up}))}}\right)^{\beta\_{lim}} - 1$$


## Exponential 

$$ \gamma_{lim}  \exp(-\beta\_{lim} \times (a_{max} - a\_{up}))$$ 

A comparison of the two formulations is provided below (one on a log scale)


![combined_max_area_limiter_plot](https://github.com/CliMA/TurbulenceConvection.jl/assets/17075545/0af88b78-f608-44fb-8f44-1927d79e7182)
![combined_max_area_limiter_logistic_plot_logscale](https://github.com/CliMA/TurbulenceConvection.jl/assets/17075545/8fbe748f-cfa1-4e01-a4d1-9135f4fa20fe)


Co-authored-by: costachris <[email protected]>
  • Loading branch information
bors[bot] and costachris authored Oct 26, 2023
2 parents 44571f8 + 6b5be0c commit d51fc6f
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 87 deletions.
4 changes: 2 additions & 2 deletions driver/generate_namelist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ function default_namelist(
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["turbulent_entrainment_factor"] = 0.075
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["entrainment_smin_tke_coeff"] = 0.3
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["updraft_mixing_frac"] = 0.25
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["area_limiter_scale"] = 10.0
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["area_limiter_power"] = 4.0
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["area_limiter_scale"] = 4.0
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["area_limiter_power"] = 10.0
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["entrainment_scale"] = 0.0004
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["sorting_power"] = 2.0
namelist_defaults["turbulence"]["EDMF_PrognosticTKE"]["min_upd_velocity"] = 0.001
Expand Down
154 changes: 77 additions & 77 deletions post_processing/mse_tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ all_best_mse["ARM_SGP"]["Hvar_mean"] = 1942.2737057522902
all_best_mse["ARM_SGP"]["QTvar_mean"] = 1143.7711037862375
#
all_best_mse["Bomex"] = OrderedCollections.OrderedDict()
all_best_mse["Bomex"]["qt_mean"] = 0.10157331566138902
all_best_mse["Bomex"]["updraft_area"] = 127.44299823127066
all_best_mse["Bomex"]["updraft_w"] = 18.233636741614422
all_best_mse["Bomex"]["updraft_qt"] = 7.123787193061912
all_best_mse["Bomex"]["updraft_thetal"] = 69.79765732523673
all_best_mse["Bomex"]["v_mean"] = 64.98135800329213
all_best_mse["Bomex"]["u_mean"] = 0.2658630768662204
all_best_mse["Bomex"]["tke_mean"] = 70.5510687118454
all_best_mse["Bomex"]["temperature_mean"] = 4.1161336468191777e-5
all_best_mse["Bomex"]["ql_mean"] = 9.46316268402059
all_best_mse["Bomex"]["qt_mean"] = 0.09811104477070465
all_best_mse["Bomex"]["updraft_area"] = 127.52646116888195
all_best_mse["Bomex"]["updraft_w"] = 17.480564668884448
all_best_mse["Bomex"]["updraft_qt"] = 7.102456350531833
all_best_mse["Bomex"]["updraft_thetal"] = 69.79451791946437
all_best_mse["Bomex"]["v_mean"] = 64.97390154544397
all_best_mse["Bomex"]["u_mean"] = 0.2659632443361422
all_best_mse["Bomex"]["tke_mean"] = 70.44980303343306
all_best_mse["Bomex"]["temperature_mean"] = 3.9508287833912895e-5
all_best_mse["Bomex"]["ql_mean"] = 8.197428845893032
all_best_mse["Bomex"]["qi_mean"] = "NA"
all_best_mse["Bomex"]["thetal_mean"] = 4.1853922159779575e-5
all_best_mse["Bomex"]["Hvar_mean"] = 6678.365065720167
all_best_mse["Bomex"]["QTvar_mean"] = 2382.5665908436968
all_best_mse["Bomex"]["thetal_mean"] = 4.010826899041727e-5
all_best_mse["Bomex"]["Hvar_mean"] = 3159.7800594011524
all_best_mse["Bomex"]["QTvar_mean"] = 1124.2526774816963
#
all_best_mse["DryBubble"] = OrderedCollections.OrderedDict()
all_best_mse["DryBubble"]["updraft_area"] = 2202.8250933477757
Expand All @@ -46,19 +46,19 @@ all_best_mse["DryBubble"]["thetal_mean"] = 4.2309956577682094e-5
all_best_mse["DryBubble"]["Hvar_mean"] = 121.33184191421392
#
all_best_mse["DYCOMS_RF01"] = OrderedCollections.OrderedDict()
all_best_mse["DYCOMS_RF01"]["qt_mean"] = 0.032229255895329864
all_best_mse["DYCOMS_RF01"]["ql_mean"] = 35.243647357548525
all_best_mse["DYCOMS_RF01"]["updraft_area"] = 29.91829029932124
all_best_mse["DYCOMS_RF01"]["updraft_w"] = 6.115951794339556
all_best_mse["DYCOMS_RF01"]["updraft_qt"] = 1.8880859388771338
all_best_mse["DYCOMS_RF01"]["updraft_thetal"] = 46.187665219910876
all_best_mse["DYCOMS_RF01"]["v_mean"] = 0.010541289127793787
all_best_mse["DYCOMS_RF01"]["u_mean"] = 0.1033957911184203
all_best_mse["DYCOMS_RF01"]["tke_mean"] = 17.14995401970597
all_best_mse["DYCOMS_RF01"]["temperature_mean"] = 9.952420261758244e-5
all_best_mse["DYCOMS_RF01"]["thetal_mean"] = 9.872170460699519e-5
all_best_mse["DYCOMS_RF01"]["Hvar_mean"] = 1280.436879173232
all_best_mse["DYCOMS_RF01"]["QTvar_mean"] = 514.69273017744
all_best_mse["DYCOMS_RF01"]["qt_mean"] = 0.032229266919466225
all_best_mse["DYCOMS_RF01"]["ql_mean"] = 35.24367587802814
all_best_mse["DYCOMS_RF01"]["updraft_area"] = 29.918284685521208
all_best_mse["DYCOMS_RF01"]["updraft_w"] = 6.115951172262932
all_best_mse["DYCOMS_RF01"]["updraft_qt"] = 1.8880856402079553
all_best_mse["DYCOMS_RF01"]["updraft_thetal"] = 46.18766521884257
all_best_mse["DYCOMS_RF01"]["v_mean"] = 0.01054128704894003
all_best_mse["DYCOMS_RF01"]["u_mean"] = 0.10339578822385861
all_best_mse["DYCOMS_RF01"]["tke_mean"] = 17.149948426949422
all_best_mse["DYCOMS_RF01"]["temperature_mean"] = 9.952426566556289e-5
all_best_mse["DYCOMS_RF01"]["thetal_mean"] = 9.872177053048469e-5
all_best_mse["DYCOMS_RF01"]["Hvar_mean"] = 1280.4368756952708
all_best_mse["DYCOMS_RF01"]["QTvar_mean"] = 514.6927662355838
#
all_best_mse["DYCOMS_RF02"] = OrderedCollections.OrderedDict()
all_best_mse["DYCOMS_RF02"]["qt_mean"] = 0.05056590150581544
Expand Down Expand Up @@ -101,69 +101,69 @@ all_best_mse["life_cycle_Tan2018"]["Hvar_mean"] = 1295.718719387864
all_best_mse["life_cycle_Tan2018"]["QTvar_mean"] = 464.46621701576004
#
all_best_mse["Nieuwstadt"] = OrderedCollections.OrderedDict()
all_best_mse["Nieuwstadt"]["updraft_area"] = 98.82438073624243
all_best_mse["Nieuwstadt"]["updraft_w"] = 14.184549215881864
all_best_mse["Nieuwstadt"]["updraft_thetal"] = 117.60593879769183
all_best_mse["Nieuwstadt"]["u_mean"] = 13.553703165321764
all_best_mse["Nieuwstadt"]["tke_mean"] = 283.63802647813674
all_best_mse["Nieuwstadt"]["temperature_mean"] = 1.1368165357620285e-5
all_best_mse["Nieuwstadt"]["thetal_mean"] = 1.1156242497038137e-5
all_best_mse["Nieuwstadt"]["Hvar_mean"] = 718.0134425316717
all_best_mse["Nieuwstadt"]["updraft_area"] = 98.88939550400438
all_best_mse["Nieuwstadt"]["updraft_w"] = 14.18844868379456
all_best_mse["Nieuwstadt"]["updraft_thetal"] = 117.60593865198229
all_best_mse["Nieuwstadt"]["u_mean"] = 13.553474251428796
all_best_mse["Nieuwstadt"]["tke_mean"] = 283.6256560613786
all_best_mse["Nieuwstadt"]["temperature_mean"] = 1.1368533295612513e-5
all_best_mse["Nieuwstadt"]["thetal_mean"] = 1.1156555761368827e-5
all_best_mse["Nieuwstadt"]["Hvar_mean"] = 717.9986421476253
#
all_best_mse["Rico"] = OrderedCollections.OrderedDict()
all_best_mse["Rico"]["qt_mean"] = 0.9956437997945158
all_best_mse["Rico"]["updraft_area"] = 478.45478779753364
all_best_mse["Rico"]["updraft_w"] = 78.46631591113119
all_best_mse["Rico"]["updraft_qt"] = 16.56655199793935
all_best_mse["Rico"]["updraft_thetal"] = 133.87264978425864
all_best_mse["Rico"]["v_mean"] = 0.5076560633853294
all_best_mse["Rico"]["u_mean"] = 0.415025244455877
all_best_mse["Rico"]["tke_mean"] = 152.48163387106877
all_best_mse["Rico"]["temperature_mean"] = 0.0005212655187986156
all_best_mse["Rico"]["ql_mean"] = 8662.82416613595
all_best_mse["Rico"]["qt_mean"] = 1.148361614558268
all_best_mse["Rico"]["updraft_area"] = 479.5473352612418
all_best_mse["Rico"]["updraft_w"] = 82.670213352702
all_best_mse["Rico"]["updraft_qt"] = 17.228276064932476
all_best_mse["Rico"]["updraft_thetal"] = 133.87369324443438
all_best_mse["Rico"]["v_mean"] = 0.5100232407862202
all_best_mse["Rico"]["u_mean"] = 0.4236283814752767
all_best_mse["Rico"]["tke_mean"] = 154.94828856593267
all_best_mse["Rico"]["temperature_mean"] = 0.0005448065434597075
all_best_mse["Rico"]["ql_mean"] = 29736.34815326026
all_best_mse["Rico"]["qi_mean"] = "NA"
all_best_mse["Rico"]["qr_mean"] = 668.8838527685555
all_best_mse["Rico"]["thetal_mean"] = 0.0005247024824042198
all_best_mse["Rico"]["Hvar_mean"] = 45693.03995753859
all_best_mse["Rico"]["QTvar_mean"] = 10080.326260589663
all_best_mse["Rico"]["qr_mean"] = 668.5113333480476
all_best_mse["Rico"]["thetal_mean"] = 0.0005798423549005548
all_best_mse["Rico"]["Hvar_mean"] = 146080.9905513204
all_best_mse["Rico"]["QTvar_mean"] = 34789.82147560855
#
all_best_mse["Soares"] = OrderedCollections.OrderedDict()
all_best_mse["Soares"]["qt_mean"] = 0.1420076518869515
all_best_mse["Soares"]["updraft_area"] = 94.21977192883931
all_best_mse["Soares"]["updraft_w"] = 13.03913221200125
all_best_mse["Soares"]["updraft_qt"] = 23.63550205946076
all_best_mse["Soares"]["updraft_thetal"] = 65.72137564637998
all_best_mse["Soares"]["u_mean"] = 93.89460884871347
all_best_mse["Soares"]["tke_mean"] = 216.49719912029474
all_best_mse["Soares"]["temperature_mean"] = 1.3120119525400506e-5
all_best_mse["Soares"]["thetal_mean"] = 1.2043908006663236e-5
all_best_mse["Soares"]["Hvar_mean"] = 677.8953724552542
all_best_mse["Soares"]["qt_mean"] = 0.142280632665005
all_best_mse["Soares"]["updraft_area"] = 94.30518488450016
all_best_mse["Soares"]["updraft_w"] = 13.04117345064018
all_best_mse["Soares"]["updraft_qt"] = 23.634389966362473
all_best_mse["Soares"]["updraft_thetal"] = 65.72137582642573
all_best_mse["Soares"]["u_mean"] = 93.90053767068466
all_best_mse["Soares"]["tke_mean"] = 216.81644150059344
all_best_mse["Soares"]["temperature_mean"] = 1.3126483783491774e-5
all_best_mse["Soares"]["thetal_mean"] = 1.2051266758347125e-5
all_best_mse["Soares"]["Hvar_mean"] = 678.4111250018458
#
all_best_mse["TRMM_LBA"] = OrderedCollections.OrderedDict()
all_best_mse["TRMM_LBA"]["qt_mean"] = 2.1407478838265956
all_best_mse["TRMM_LBA"]["updraft_area"] = 1254.2130753001322
all_best_mse["TRMM_LBA"]["updraft_w"] = 9839.471862983079
all_best_mse["TRMM_LBA"]["updraft_qt"] = 263.6565679234658
all_best_mse["TRMM_LBA"]["updraft_thetal"] = 541.3712826267116
all_best_mse["TRMM_LBA"]["v_mean"] = 71.05972959986892
all_best_mse["TRMM_LBA"]["u_mean"] = 30.399638690315765
all_best_mse["TRMM_LBA"]["tke_mean"] = 48610.35575816921
all_best_mse["TRMM_LBA"]["temperature_mean"] = 0.0005688868688824585
all_best_mse["TRMM_LBA"]["ql_mean"] = 248042.01224048136
all_best_mse["TRMM_LBA"]["qt_mean"] = 2.1407483216101886
all_best_mse["TRMM_LBA"]["updraft_area"] = 1254.2030410826526
all_best_mse["TRMM_LBA"]["updraft_w"] = 9839.438142805242
all_best_mse["TRMM_LBA"]["updraft_qt"] = 263.65651619424244
all_best_mse["TRMM_LBA"]["updraft_thetal"] = 541.3706668528961
all_best_mse["TRMM_LBA"]["v_mean"] = 71.06040571570847
all_best_mse["TRMM_LBA"]["u_mean"] = 30.399741076429066
all_best_mse["TRMM_LBA"]["tke_mean"] = 48605.30351976951
all_best_mse["TRMM_LBA"]["temperature_mean"] = 0.000568889806329039
all_best_mse["TRMM_LBA"]["ql_mean"] = 248042.12933542198
all_best_mse["TRMM_LBA"]["qi_mean"] = "NA"
all_best_mse["TRMM_LBA"]["qr_mean"] = "NA"
all_best_mse["TRMM_LBA"]["qs_mean"] = "NA"
all_best_mse["TRMM_LBA"]["thetal_mean"] = 0.0005009945658552307
all_best_mse["TRMM_LBA"]["Hvar_mean"] = 446332.29960805096
all_best_mse["TRMM_LBA"]["QTvar_mean"] = 6279.987008045119
all_best_mse["TRMM_LBA"]["thetal_mean"] = 0.0005009943303753257
all_best_mse["TRMM_LBA"]["Hvar_mean"] = 446334.4571983643
all_best_mse["TRMM_LBA"]["QTvar_mean"] = 6279.991172736763
#
all_best_mse["LES_driven_SCM"] = OrderedCollections.OrderedDict()
all_best_mse["LES_driven_SCM"]["qt_mean"] = 0.1816324057400173
all_best_mse["LES_driven_SCM"]["v_mean"] = 0.32293581806860794
all_best_mse["LES_driven_SCM"]["u_mean"] = 0.07547494635765321
all_best_mse["LES_driven_SCM"]["temperature_mean"] = 5.497077391865199e-5
all_best_mse["LES_driven_SCM"]["ql_mean"] = 27662.597548577323
all_best_mse["LES_driven_SCM"]["thetal_mean"] = 6.008525349326801e-5
all_best_mse["LES_driven_SCM"]["qt_mean"] = 0.18120985929824446
all_best_mse["LES_driven_SCM"]["v_mean"] = 0.32300454969676684
all_best_mse["LES_driven_SCM"]["u_mean"] = 0.0755050984362397
all_best_mse["LES_driven_SCM"]["temperature_mean"] = 5.493450606740618e-5
all_best_mse["LES_driven_SCM"]["ql_mean"] = 27470.026298802994
all_best_mse["LES_driven_SCM"]["thetal_mean"] = 5.9887641720678635e-5
#
#################################
#################################
Expand Down
9 changes: 7 additions & 2 deletions src/closures/entr_detr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ function εδ_dyn(εδ_model, εδ_vars, entr_dim_scale, detr_dim_scale, ε_nond
ε_dim_scale = entrainment_inv_length_scale(εδ_model, εδ_vars, entr_dim_scale)
δ_dim_scale = entrainment_inv_length_scale(εδ_model, εδ_vars, detr_dim_scale)

area_limiter = max_area_limiter(εδ_model, εδ_vars.max_area, εδ_vars.a_up)

# fractional dynamical entrainment / detrainment [1 / m]
ε_dyn = ε_dim_scale * ε_nondim
δ_dyn = δ_dim_scale * δ_nondim
δ_dyn = δ_dim_scale * (δ_nondim + area_limiter)

return ε_dyn, δ_dyn
end
Expand Down Expand Up @@ -602,8 +604,11 @@ function compute_ml_entr_detr!(
aux_tc.∂lnM∂z[k],
edmf.detr_dim_scale,
)

area_limiter = max_area_limiter(εδ_model, max_area, aux_up[i].area[k])

aux_up[i].entr_ml[k] = ε_dim_scale * aux_up[i].ε_ml_nondim[k]
aux_up[i].detr_ml[k] = δ_dim_scale * aux_up[i].δ_ml_nondim[k]
aux_up[i].detr_ml[k] = δ_dim_scale * (aux_up[i].δ_ml_nondim[k] + area_limiter)
end

@. aux_up[i].ε_ml_nondim = ifelse(aux_up[i].area > 0, aux_up[i].ε_ml_nondim, 0)
Expand Down
11 changes: 5 additions & 6 deletions src/closures/nondimensional_exchange_functions.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#### Non-dimensional Entrainment-Detrainment functions

function max_area_limiter(εδ_model, max_area, a_up)
FT = eltype(a_up)
γ_lim = εδ_params(εδ_model).γ_lim
β_lim = εδ_params(εδ_model).β_lim
logistic_term = (2 - 1 / (1 + exp(-γ_lim * (max_area - a_up))))
return (logistic_term)^β_lim - 1
A = εδ_params(εδ_model).γ_lim
k = εδ_params(εδ_model).β_lim
return A * exp(-k * (max_area - a_up))
end

function non_dimensional_groups(εδ_model, εδ_model_vars)
Expand Down Expand Up @@ -45,7 +45,6 @@ function non_dimensional_function(εδ_model::MDEntr, εδ_model_vars)
εδ_model.params.c_δ
end

area_limiter = max_area_limiter(εδ_model, εδ_model_vars.max_area, εδ_model_vars.a_up)
Δb = εδ_model_vars.b_up - εδ_model_vars.b_en
μ_ij =- εδ_model_vars.a_up / (εδ_model_vars.a_up + εδ_model_vars.a_en)) * Δb / Δw
exp_arg = μ_ij / μ_0
Expand All @@ -56,7 +55,7 @@ function non_dimensional_function(εδ_model::MDEntr, εδ_model_vars)
M_ε = (max((εδ_model_vars.RH_en)^β - (εδ_model_vars.RH_up)^β, 0))^(1 / β)

nondim_ε = (c_ε * D_ε + c_δ * M_ε)
nondim_δ = (c_ε * D_δ + c_δ * M_δ) + area_limiter
nondim_δ = (c_ε * D_δ + c_δ * M_δ)
return nondim_ε, nondim_δ
end

Expand Down

0 comments on commit d51fc6f

Please sign in to comment.