diff --git a/config/default_configs/default_edmf_config.yml b/config/default_configs/default_edmf_config.yml index 84017424134..7fee4cd6f59 100644 --- a/config/default_configs/default_edmf_config.yml +++ b/config/default_configs/default_edmf_config.yml @@ -27,7 +27,7 @@ edmfx_entr_model: help: "EDMFX entrainment closure. [`nothing` (default), `PiGroups`, `ConstantCoefficent`, `ConstantTimescale`]" value: ~ edmfx_detr_model: - help: "EDMFX detrainment closure. [`nothing` (default), `PiGroups`, `ConstantCoefficent`]" + help: "EDMFX detrainment closure. [`nothing` (default), `PiGroups`, `ConstantCoefficent`, `ConstantTimescale`]" value: ~ edmfx_upwinding: help: "EDMFX upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`]" diff --git a/src/parameters/Parameters.jl b/src/parameters/Parameters.jl index 86056e63a7f..851513c8b2e 100644 --- a/src/parameters/Parameters.jl +++ b/src/parameters/Parameters.jl @@ -22,6 +22,7 @@ Base.@kwdef struct ClimaAtmosParameters{FT, TP, RP, IP, MPP, SFP, TCP} <: ACAP planet_radius::FT astro_unit::FT entr_tau::FT + detr_tau::FT entr_coeff::FT detr_coeff::FT C_E::FT diff --git a/src/prognostic_equations/edmfx_entr_detr.jl b/src/prognostic_equations/edmfx_entr_detr.jl index 2e6ade147cc..df0d0582709 100644 --- a/src/prognostic_equations/edmfx_entr_detr.jl +++ b/src/prognostic_equations/edmfx_entr_detr.jl @@ -314,3 +314,25 @@ function edmfx_entr_detr_tendency!(Yₜ, Y, p, t, colidx, turbconv_model::EDMFX) end return nothing end + +function detrainment( + params, + ᶜz::FT, + z_sfc::FT, + ᶜp::FT, + ᶜρ::FT, + buoy_flux_surface::FT, + ᶜaʲ::FT, + ᶜwʲ::FT, + ᶜRHʲ::FT, + ᶜbuoyʲ::FT, + ᶜw⁰::FT, + ᶜRH⁰::FT, + ᶜbuoy⁰::FT, + dt::FT, + ::ConstantTimescaleDetrainment, +) where {FT} + detr_tau = CAP.detr_tau(params) + detr = min(1 / detr_tau, 1 / dt) + return detr +end \ No newline at end of file diff --git a/src/solver/model_getters.jl b/src/solver/model_getters.jl index b29b455a37a..ca0600dfb28 100644 --- a/src/solver/model_getters.jl +++ b/src/solver/model_getters.jl @@ -391,6 +391,8 @@ function get_detrainment_model(parsed_args) ConstantCoefficientDetrainment() elseif detr_model == "ConstantCoefficientHarmonics" ConstantCoefficientHarmonicsDetrainment() + elseif detr_model == "ConstantTimescale" + ConstantTimescaleDetrainment() else error("Invalid entr_model $(entr_model)") end diff --git a/src/solver/types.jl b/src/solver/types.jl index ded82230459..9673374188e 100644 --- a/src/solver/types.jl +++ b/src/solver/types.jl @@ -188,6 +188,7 @@ struct NoDetrainment <: AbstractDetrainmentModel end struct PiGroupsDetrainment <: AbstractDetrainmentModel end struct ConstantCoefficientDetrainment <: AbstractDetrainmentModel end struct ConstantCoefficientHarmonicsDetrainment <: AbstractDetrainmentModel end +struct ConstantTimescaleDetrainment <: AbstractDetrainmentModel end abstract type AbstractQuadratureType end struct LogNormalQuad <: AbstractQuadratureType end