From 13a6b04ec476d1bae9a0cc48217faa3bc25b3c95 Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:37:36 -0700 Subject: [PATCH] use constant entrainment --- config/default_configs/default_edmf_config.yml | 3 +++ src/cache/diagnostic_edmf_precomputed_quantities.jl | 2 +- src/parameters/Parameters.jl | 2 ++ src/parameters/create_parameters.jl | 1 + src/prognostic_equations/edmfx_closures.jl | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/default_configs/default_edmf_config.yml b/config/default_configs/default_edmf_config.yml index 9bcaf37d0b..3a28253697 100644 --- a/config/default_configs/default_edmf_config.yml +++ b/config/default_configs/default_edmf_config.yml @@ -35,6 +35,9 @@ debugging_tc: entr_coeff: help: "Entrainment coefficient" value: 1.0 +entr_tau: + help: "Entrainment timescale" + value: 900.0 detr_coeff: help: "Detrainment coefficient" value: 0.001 diff --git a/src/cache/diagnostic_edmf_precomputed_quantities.jl b/src/cache/diagnostic_edmf_precomputed_quantities.jl index 59fde5d328..44318d4d9e 100644 --- a/src/cache/diagnostic_edmf_precomputed_quantities.jl +++ b/src/cache/diagnostic_edmf_precomputed_quantities.jl @@ -205,7 +205,7 @@ function set_diagnostic_edmf_precomputed_quantities!(Y, p, t) ρʲ_int_level = Fields.field_values(Fields.level(ᶜρʲ, 1)) @. u³ʲ_int_halflevel = CT3( - Geometry.WVector($(FT(0.01)), local_geometry_int_halflevel), + Geometry.WVector($(FT(0)), local_geometry_int_halflevel), local_geometry_int_halflevel, ) @. h_totʲ_int_level = sgs_scalar_first_interior_bc( diff --git a/src/parameters/Parameters.jl b/src/parameters/Parameters.jl index 022bffe333..46802b2434 100644 --- a/src/parameters/Parameters.jl +++ b/src/parameters/Parameters.jl @@ -29,6 +29,7 @@ Base.@kwdef struct ClimaAtmosParameters{FT, TP, RP, IP, MPP, SFP, TCP, SP} <: turbconv_params::TCP sponge_params::SP entr_coeff::FT = 1 + entr_tau::FT = 900 detr_coeff::FT = 0.001 # TODO: Figure out a better place for these held-suarez parameters ΔT_y_dry::FT @@ -80,6 +81,7 @@ f(ps::ACAP) = ps.f Cd(ps::ACAP) = ps.Cd uh_g(ps::ACAP) = CC.Geometry.UVVector(ps.ug, ps.vg) entr_coeff(ps::ACAP) = ps.entr_coeff +entr_tau(ps::ACAP) = ps.entr_tau detr_coeff(ps::ACAP) = ps.detr_coeff ΔT_y_dry(ps::ACAP) = ps.ΔT_y_dry ΔT_y_wet(ps::ACAP) = ps.ΔT_y_wet diff --git a/src/parameters/create_parameters.jl b/src/parameters/create_parameters.jl index 03e2b66871..b5041c2bc0 100644 --- a/src/parameters/create_parameters.jl +++ b/src/parameters/create_parameters.jl @@ -143,6 +143,7 @@ function create_climaatmos_parameter_set( surfacefluxes_params = surf_flux_params, turbconv_params = tc_params, entr_coeff = FTD(parsed_args["entr_coeff"]), + entr_tau = FTD(parsed_args["entr_tau"]), detr_coeff = FTD(parsed_args["detr_coeff"]), ΔT_y_dry = FTD(pairs.ΔT_y_dry), ΔT_y_wet = FTD(pairs.ΔT_y_wet), diff --git a/src/prognostic_equations/edmfx_closures.jl b/src/prognostic_equations/edmfx_closures.jl index 87b3468069..eb88423cc0 100644 --- a/src/prognostic_equations/edmfx_closures.jl +++ b/src/prognostic_equations/edmfx_closures.jl @@ -152,6 +152,7 @@ function pi_groups_entr_detr( g = CAP.grav(params) entr_coeff = CAP.entr_coeff(params) + entr_tau = CAP.entr_tau(params) detr_coeff = CAP.detr_coeff(params) turbconv_params = CAP.turbconv_params(params) @@ -189,7 +190,7 @@ function pi_groups_entr_detr( # TODO - Temporary: Switch to Π groups after simple tests are done # (kinematic, bubble, Bomex) # and/or we can calibrate things in ClimaAtmos - entr = max(0, min(entr_coeff * ᶜwʲ / (ᶜz - z_sfc), 1 / dt)) + entr = max(0, min(1 / entr_tau, 1 / dt)) detr = max(0, min(detr_coeff * ᶜwʲ, 1 / dt)) return (; entr, detr)