diff --git a/config/model_configs/edmfx_bomex_box.yml b/config/model_configs/edmfx_bomex_box.yml index 97b1602b693..8aed4c6a7c3 100644 --- a/config/model_configs/edmfx_bomex_box.yml +++ b/config/model_configs/edmfx_bomex_box.yml @@ -10,7 +10,7 @@ edmfx_entr_model: "ConstantCoefficient" edmfx_detr_model: "ConstantCoefficient" edmfx_sgs_mass_flux: true edmfx_sgs_diffusive_flux: true -edmfx_nh_pressure: false +edmfx_nh_pressure: true prognostic_tke: false moist: "equil" config: "box" @@ -24,7 +24,7 @@ y_elem: 2 z_elem: 60 z_stretch: false perturb_initstate: false -dt: "1secs" -t_end: "10800secs" +dt: "2secs" +t_end: "3hours" dt_save_to_disk: "10secs" toml: [toml/edmfx_box.toml] diff --git a/config/model_configs/edmfx_dycoms_rf01_box.yml b/config/model_configs/edmfx_dycoms_rf01_box.yml index cb03f62a171..c59a9f7158b 100644 --- a/config/model_configs/edmfx_dycoms_rf01_box.yml +++ b/config/model_configs/edmfx_dycoms_rf01_box.yml @@ -10,7 +10,7 @@ edmfx_entr_model: "ConstantCoefficient" edmfx_detr_model: "ConstantCoefficient" edmfx_sgs_mass_flux: true edmfx_sgs_diffusive_flux: true -edmfx_nh_pressure: false +edmfx_nh_pressure: true prognostic_tke: false moist: equil config: box @@ -23,7 +23,7 @@ x_elem: 2 y_elem: 2 z_elem: 30 z_stretch: false -dt: 1secs -t_end: 2400secs -dt_save_to_disk: 2secs +dt: 2secs +t_end: 4hours +dt_save_to_disk: 10secs toml: [toml/edmfx_box.toml] diff --git a/config/model_configs/edmfx_gabls_box.yml b/config/model_configs/edmfx_gabls_box.yml index 09faa71aef0..c61d11f7b14 100644 --- a/config/model_configs/edmfx_gabls_box.yml +++ b/config/model_configs/edmfx_gabls_box.yml @@ -8,7 +8,7 @@ edmfx_entr_model: "ConstantCoefficient" edmfx_detr_model: "ConstantCoefficient" edmfx_sgs_mass_flux: true edmfx_sgs_diffusive_flux: true -edmfx_nh_pressure: false +edmfx_nh_pressure: true prognostic_tke: false moist: "equil" config: "box" diff --git a/config/model_configs/edmfx_rico_box.yml b/config/model_configs/edmfx_rico_box.yml index 4d9ea5c4744..af02f49bb3b 100644 --- a/config/model_configs/edmfx_rico_box.yml +++ b/config/model_configs/edmfx_rico_box.yml @@ -9,7 +9,7 @@ edmfx_entr_model: "ConstantCoefficient" edmfx_detr_model: "ConstantCoefficient" edmfx_sgs_mass_flux: true edmfx_sgs_diffusive_flux: true -edmfx_nh_pressure: false +edmfx_nh_pressure: true prognostic_tke: false moist: "equil" #precip_model: "0M" diff --git a/config/model_configs/edmfx_trmm_box.yml b/config/model_configs/edmfx_trmm_box.yml index d61f1c670b5..3720fec2f38 100644 --- a/config/model_configs/edmfx_trmm_box.yml +++ b/config/model_configs/edmfx_trmm_box.yml @@ -8,7 +8,7 @@ edmfx_entr_model: "ConstantCoefficient" edmfx_detr_model: "ConstantCoefficient" edmfx_sgs_mass_flux: true edmfx_sgs_diffusive_flux: true -edmfx_nh_pressure: false +edmfx_nh_pressure: true prognostic_tke: false moist: equil apply_limiter: false diff --git a/regression_tests/ref_counter.jl b/regression_tests/ref_counter.jl index 94361d49fd9..6a4573e8050 100644 --- a/regression_tests/ref_counter.jl +++ b/regression_tests/ref_counter.jl @@ -1 +1 @@ -132 +133 diff --git a/src/cache/precomputed_quantities.jl b/src/cache/precomputed_quantities.jl index 2be28412bcd..b3be3719ead 100644 --- a/src/cache/precomputed_quantities.jl +++ b/src/cache/precomputed_quantities.jl @@ -149,6 +149,29 @@ function set_velocity_at_surface!(Y, ᶠuₕ³, turbconv_model) return nothing end +""" + set_velocity_at_top!(Y, turbconv_model) + +Modifies `Y.f.u₃` so that `u₃` is 0 at the model top. +""" +function set_velocity_at_top!(Y, turbconv_model) + top_u₃ = Fields.level( + Y.f.u₃.components.data.:1, + Spaces.nlevels(axes(Y.c)) + half, + ) + @. top_u₃ = 0 + if turbconv_model isa EDMFX + for j in 1:n_mass_flux_subdomains(turbconv_model) + top_u₃ʲ = Fields.level( + Y.f.sgsʲs.:($j).u₃.components.data.:1, + Spaces.nlevels(axes(Y.c)) + half, + ) + @. top_u₃ʲ = top_u₃ + end + end + return nothing +end + # This is used to set the grid-scale velocity quantities ᶜu, ᶠu³, ᶜK based on # ᶠu₃, and it is also used to set the SGS quantities based on ᶠu₃⁰ and ᶠu₃ʲ. function set_velocity_quantities!(ᶜu, ᶠu³, ᶜK, ᶠu₃, ᶜuₕ, ᶠuₕ³) @@ -285,6 +308,7 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t) # TODO: We might want to move this to dss! (and rename dss! to something # like enforce_constraints!). set_velocity_at_surface!(Y, ᶠuₕ³, turbconv_model) + set_velocity_at_top!(Y, turbconv_model) set_velocity_quantities!(ᶜu, ᶠu³, ᶜK, Y.f.u₃, Y.c.uₕ, ᶠuₕ³) if n > 0 diff --git a/src/prognostic_equations/edmfx_closures.jl b/src/prognostic_equations/edmfx_closures.jl index ef8c612a778..31d332414b7 100644 --- a/src/prognostic_equations/edmfx_closures.jl +++ b/src/prognostic_equations/edmfx_closures.jl @@ -79,7 +79,7 @@ edmfx_nh_pressure_tendency!(Yₜ, Y, p, t, colidx, turbconv_model) = nothing function edmfx_nh_pressure_tendency!(Yₜ, Y, p, t, colidx, turbconv_model::EDMFX) n = n_mass_flux_subdomains(turbconv_model) - (; params, ᶜρʲs, ᶜρ_ref, ᶠgradᵥ_ᶜΦ, ᶜuʲs, ᶜu⁰, ᶠu₃⁰) = p + (; params, ᶜρʲs, ᶜρ_ref, ᶜp, ᶜp_ref, ᶠgradᵥ_ᶜΦ, ᶠu₃⁰) = p FT = eltype(Y) ᶜz = Fields.coordinate_field(Y.c).z z_sfc = Fields.level(Fields.coordinate_field(Y.f).z, Fields.half) @@ -107,7 +107,7 @@ function edmfx_nh_pressure_tendency!(Yₜ, Y, p, t, colidx, turbconv_model::EDMF p.atmos.edmfx_nh_pressure, ᶠlg[colidx], ᶠbuoyancy( - ᶠinterp(ᶜρ_ref[colidx]), + ᶠinterp(Y.c.ρ[colidx]), ᶠinterp(ᶜρʲs.:($$j)[colidx]), ᶠgradᵥ_ᶜΦ[colidx], ), diff --git a/toml/edmfx_box.toml b/toml/edmfx_box.toml index 4f58178f41d..81f07f39217 100644 --- a/toml/edmfx_box.toml +++ b/toml/edmfx_box.toml @@ -13,3 +13,8 @@ alias = "min_area" value = 1.0e-3 type = "float" description = "Minimum area fraction per updraft. Parameter not described in the literature." + +[entr_coeff] +alias = "entr_coeff" +value = 0.1 +type = "float"