Skip to content

Commit

Permalink
add entraiment and detrainment options
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Sep 18, 2023
1 parent 2eace80 commit b7b4601
Show file tree
Hide file tree
Showing 18 changed files with 201 additions and 46 deletions.
9 changes: 6 additions & 3 deletions config/default_configs/default_edmf_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ edmfx_nh_pressure:
turbconv_case:
help: "The case run by Turbulence convection scheme [`Bomex` (default), `Bomex`, `DYCOMS_RF01`, `TRMM_LBA`, `GABLS`]"
value: ~
edmfx_entr_detr:
help: "If set to true, it switches on EDMFX entrainment/detrainment closure. [`true`, `false` (default)]"
value: false
edmfx_entr_model:
help: "EDMFX entrainment closure. [`nothing` (default), `PiGroups`, `ConstantCoefficent`, `ConstantTimescale`]"
value: ~
edmfx_detr_model:
help: "EDMFX detrainment closure. [`nothing` (default), `PiGroups`, `ConstantCoefficent`]"
value: ~
edmfx_upwinding:
help: "EDMFX upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`]"
value: none
Expand Down
3 changes: 2 additions & 1 deletion config/longrun_configs/longrun_aquaplanet_amip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ surface_setup: "DefaultMoninObukhov"
turbconv: "diagnostic_edmfx"
prognostic_tke: true
edmfx_upwinding: "first_order"
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
rayleigh_sponge: true
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/diagnostic_edmfx_aquaplanet_tke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ rad: gray
turbconv: diagnostic_edmfx
prognostic_tke: true
edmfx_upwinding: first_order
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: equil
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/diagnostic_edmfx_bomex_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ surface_setup: "Bomex"
turbconv: "diagnostic_edmfx"
prognostic_tke: true
edmfx_upwinding: "first_order"
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: "equil"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ surface_setup: "Bomex"
turbconv: "diagnostic_edmfx"
prognostic_tke: true
edmfx_upwinding: "first_order"
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: "equil"
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/diagnostic_edmfx_dycoms_rf01_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ surface_setup: DYCOMS_RF01
turbconv: diagnostic_edmfx
prognostic_tke: true
edmfx_upwinding: first_order
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: equil
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/diagnostic_edmfx_gabls_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ surface_setup: GABLS
turbconv: diagnostic_edmfx
prognostic_tke: true
edmfx_upwinding: first_order
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: equil
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/diagnostic_edmfx_rico_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ surface_setup: Rico
turbconv: diagnostic_edmfx
prognostic_tke: true
edmfx_upwinding: first_order
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: equil
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/diagnostic_edmfx_trmm_box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ surface_setup: TRMM_LBA
turbconv: diagnostic_edmfx
prognostic_tke: true
edmfx_upwinding: first_order
edmfx_entr_detr: true
edmfx_entr_model: "ConstantTimesale"
edmfx_detr_model: "ConstantCoefficient"
edmfx_nh_pressure: true
edmfx_sgs_flux: true
moist: equil
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/edmfx_bomex_box_v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ dt: "1secs"
edmfx_upwinding: first_order
surface_setup: "Bomex"
perturb_initstate: false
edmfx_entr_detr: true
edmfx_entr_model: "ConstantCoefficient"
edmfx_detr_model: "ConstantCoefficient"
t_end: "10800secs"
y_max: 100000.0
y_elem: 2
Expand Down
3 changes: 2 additions & 1 deletion config/model_configs/edmfx_bomex_box_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ dt: "1secs"
edmfx_upwinding: first_order
surface_setup: "Bomex"
perturb_initstate: false
edmfx_entr_detr: true
edmfx_entr_model: "ConstantCoefficient"
edmfx_detr_model: "ConstantCoefficient"
t_end: "10800secs"
y_max: 100000.0
y_elem: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dt_save_to_disk: "30secs"
initial_condition: "MoistBaroclinicWaveWithEDMF"
dt: "1secs"
edmfx_entr_detr: true
edmfx_entr_model: "ConstantCoefficient"
edmfx_detr_model: "ConstantCoefficient"
t_end: "6mins"
turbconv: "edmfx"
ode_algo: "SSP33ShuOsher"
Expand Down
4 changes: 2 additions & 2 deletions src/cache/diagnostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ function set_diagnostic_edmf_precomputed_quantities!(Y, p, t)

@. entrʲ_prev_level = pi_groups_entr(
params,
p.atmos.edmfx_entr_detr,
z_prev_level,
z_sfc_halflevel,
p_prev_level,
Expand All @@ -376,11 +375,11 @@ function set_diagnostic_edmf_precomputed_quantities!(Y, p, t)
TD.relative_humidity(thermo_params, ts_prev_level),
ᶜphysical_buoyancy(params, ρ_ref_prev_level, ρ_prev_level),
dt,
p.atmos.edmfx_entr_model,
)

@. detrʲ_prev_level = pi_groups_detr(
params,
p.atmos.edmfx_entr_detr,
z_prev_level,
z_sfc_halflevel,
p_prev_level,
Expand All @@ -400,6 +399,7 @@ function set_diagnostic_edmf_precomputed_quantities!(Y, p, t)
TD.relative_humidity(thermo_params, ts_prev_level),
ᶜphysical_buoyancy(params, ρ_ref_prev_level, ρ_prev_level),
dt,
p.atmos.edmfx_detr_model,
)

# TODO: use updraft top instead of scale height
Expand Down
4 changes: 2 additions & 2 deletions src/cache/edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ function set_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t)
for j in 1:n
@. ᶜentrʲs.:($$j) = pi_groups_entr(
params,
p.atmos.edmfx_entr_detr,
ᶜz,
z_sfc,
ᶜp,
Expand All @@ -176,10 +175,10 @@ function set_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t)
TD.relative_humidity(thermo_params, ᶜts⁰),
ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρ⁰),
dt,
p.atmos.edmfx_entr_model,
)
@. ᶜdetrʲs.:($$j) = pi_groups_detr(
params,
p.atmos.edmfx_entr_detr,
ᶜz,
z_sfc,
ᶜp,
Expand All @@ -193,6 +192,7 @@ function set_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t)
TD.relative_humidity(thermo_params, ᶜts⁰),
ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρ⁰),
dt,
p.atmos.edmfx_detr_model,
)
end

Expand Down
Loading

0 comments on commit b7b4601

Please sign in to comment.