diff --git a/integration_tests/utils/parameter_set.jl b/integration_tests/utils/parameter_set.jl index d45649161..ee6018782 100644 --- a/integration_tests/utils/parameter_set.jl +++ b/integration_tests/utils/parameter_set.jl @@ -10,6 +10,10 @@ end CLIMAParameters.Planet.MSLP(ps::EarthParameterSet) = ps.nt.MSLP CLIMAParameters.Atmos.Microphysics.τ_cond_evap(ps::EarthParameterSet) = ps.nt.τ_cond_evap CLIMAParameters.Atmos.EDMF.c_ε(ps::EarthParameterSet) = ps.nt.c_ε +CLIMAParameters.Atmos.EDMF.α_b(ps::EarthParameterSet) = ps.nt.α_b +CLIMAParameters.Atmos.EDMF.α_a(ps::EarthParameterSet) = ps.nt.α_a +CLIMAParameters.Atmos.EDMF.α_d(ps::EarthParameterSet) = ps.nt.α_d +CLIMAParameters.Atmos.EDMF.H_up_min(ps::EarthParameterSet) = ps.nt.H_up_min #! format: off function create_parameter_set(namelist) @@ -18,6 +22,10 @@ function create_parameter_set(namelist) MSLP = 100000.0, # or grab from, e.g., namelist[""][...] τ_cond_evap = TC.parse_namelist(namelist, "microphysics", "τ_cond_evap"; default = 10.0), c_ε = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "entrainment_factor"), + α_b = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "pressure_normalmode_buoy_coeff1"), + α_a = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "pressure_normalmode_adv_coeff"), + α_d = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "pressure_normalmode_drag_coeff"), + H_up_min = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "min_updraft_top"), ) return EarthParameterSet(nt) end diff --git a/src/Turbulence_PrognosticTKE.jl b/src/Turbulence_PrognosticTKE.jl index 4018ce58b..6a6be5013 100755 --- a/src/Turbulence_PrognosticTKE.jl +++ b/src/Turbulence_PrognosticTKE.jl @@ -964,15 +964,11 @@ function compute_updraft_closures(self::EDMF_PrognosticTKE, GMV::GridMeanVariabl asp_ratio = 1.0 self.nh_pressure_b[i, k], self.nh_pressure_adv[i, k], self.nh_pressure_drag[i, k] = perturbation_pressure( + param_set, self.UpdVar.updraft_top[i], - 500.0, a_kfull, b_kfull, ref_state.rho0[k], - self.pressure_normalmode_buoy_coeff1, - self.pressure_normalmode_buoy_coeff2, - self.pressure_normalmode_adv_coeff, - self.pressure_normalmode_drag_coeff, self.UpdVar.W.values[i, k], ∇w_up, self.EnvVar.W.values[k], @@ -991,9 +987,11 @@ end function compute_pressure_plume_spacing(self::EDMF_PrognosticTKE, GMV::GridMeanVariables, Case::CasesBase) + param_set = parameter_set(self) + H_up_min = CPEDMF.H_up_min(param_set) @inbounds for i in xrange(self.n_updrafts) self.pressure_plume_spacing[i] = - max(self.aspect_ratio * self.UpdVar.updraft_top[i], self.min_updraft_top * self.aspect_ratio) + max(self.aspect_ratio * self.UpdVar.updraft_top[i], H_up_min * self.aspect_ratio) end return end diff --git a/src/closures/perturbation_pressure.jl b/src/closures/perturbation_pressure.jl index 7507046eb..6b6a113a3 100644 --- a/src/closures/perturbation_pressure.jl +++ b/src/closures/perturbation_pressure.jl @@ -1,14 +1,10 @@ """ perturbation_pressure( + param_set, updraft_top, - min_updraft_top, a_up, b_up, ρ0_k, - α₁, - α₂, - β₁, - β₂, w_up, ∇w_up, w_en, @@ -17,40 +13,27 @@ Returns the value of perturbation pressure gradient for updraft i following He et al. (JAMES, 2020), given: - `updraft_top`: the height of the updraft in the previous timestep - - `min_updraft_top`: the minimal height of the updraft to avoid zero devision - `a_up`: updraft area - `b_up`: updraft buoyancy - `ρ0_k`: reference density - - `α₁`: pressure closure free parameter - - `α₂`: pressure closure free parameter - - `β₁`: pressure closure free parameter - - `β₂`: pressure closure free parameter - `w_up`: updraft vertical velocity - `∇w_up`: updraft divergence of vertical velocity - `w_en`: environment vertical velocity - esp_ratio`: the specific aspect ratio of the updraft """ -function perturbation_pressure( - updraft_top, - min_updraft_top, - a_up, - b_up, - ρ0_k, - α₁, - α₂, - β₁, - β₂, - w_up, - ∇w_up, - w_en, - asp_ratio, -) +function perturbation_pressure(param_set, updraft_top, a_up, b_up, ρ0_k, w_up, ∇w_up, w_en, asp_ratio) - nh_press_buoy = -α₁ / (1 + α₂ * asp_ratio^2) * ρ0_k * a_up * b_up + α_b = CPEDMF.α_b(param_set) + α_a = CPEDMF.α_a(param_set) + α_d = CPEDMF.α_d(param_set) + H_up_min = CPEDMF.H_up_min(param_set) + α₂ = 0.0 - nh_pressure_adv = ρ0_k * a_up * β₁ * w_up * ∇w_up + nh_press_buoy = -α_b / (1 + α₂ * asp_ratio^2) * ρ0_k * a_up * b_up + + nh_pressure_adv = ρ0_k * a_up * α_a * w_up * ∇w_up # drag as w_dif and account for downdrafts - nh_pressure_drag = -1.0 * ρ0_k * a_up * β₂ * (w_up - w_en) * abs(w_up - w_en) / max(updraft_top, min_updraft_top) + nh_pressure_drag = -1.0 * ρ0_k * a_up * α_d * (w_up - w_en) * abs(w_up - w_en) / max(updraft_top, H_up_min) return nh_press_buoy, nh_pressure_adv, nh_pressure_drag end; diff --git a/src/types.jl b/src/types.jl index b27ef4f21..fe227042f 100644 --- a/src/types.jl +++ b/src/types.jl @@ -732,7 +732,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2} Ri_bulk_crit::Float64 zi::Float64 n_updrafts::Int - min_updraft_top::Float64 drag_sign::Int asp_label extrapolate_buoyancy::Bool @@ -747,10 +746,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2} sorting_power::Float64 turbulent_entrainment_factor::Float64 aspect_ratio::Float64 - pressure_normalmode_buoy_coeff1::Float64 - pressure_normalmode_buoy_coeff2::Float64 - pressure_normalmode_adv_coeff::Float64 - pressure_normalmode_drag_coeff::Float64 tke_ed_coeff::Float64 tke_diss_coeff::Float64 static_stab_coeff::Float64 @@ -858,13 +853,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2} turbulent_entrainment_factor = namelist["turbulence"]["EDMF_PrognosticTKE"]["turbulent_entrainment_factor"] # pressure parameters aspect_ratio = namelist["turbulence"]["EDMF_PrognosticTKE"]["aspect_ratio"] - pressure_normalmode_buoy_coeff1 = - namelist["turbulence"]["EDMF_PrognosticTKE"]["pressure_normalmode_buoy_coeff1"] - pressure_normalmode_buoy_coeff2 = - namelist["turbulence"]["EDMF_PrognosticTKE"]["pressure_normalmode_buoy_coeff2"] - pressure_normalmode_adv_coeff = namelist["turbulence"]["EDMF_PrognosticTKE"]["pressure_normalmode_adv_coeff"] - pressure_normalmode_drag_coeff = namelist["turbulence"]["EDMF_PrognosticTKE"]["pressure_normalmode_drag_coeff"] - min_updraft_top = namelist["turbulence"]["EDMF_PrognosticTKE"]["min_updraft_top"] # mixing length parameters tke_ed_coeff = namelist["turbulence"]["EDMF_PrognosticTKE"]["tke_ed_coeff"] @@ -967,7 +955,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2} Ri_bulk_crit, zi, n_updrafts, - min_updraft_top, drag_sign, asp_label, extrapolate_buoyancy, @@ -982,10 +969,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2} sorting_power, turbulent_entrainment_factor, aspect_ratio, - pressure_normalmode_buoy_coeff1, - pressure_normalmode_buoy_coeff2, - pressure_normalmode_adv_coeff, - pressure_normalmode_drag_coeff, tke_ed_coeff, tke_diss_coeff, static_stab_coeff,