Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions src/prognostic_equations/eddy_diffusion_closures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,22 @@ function buoyancy_gradients(
error("Unsupported moisture model")
end

t_sat = get_t_sat(thermo_params, bg_model)
phase_part = TD.PhasePartition(thermo_params, ts_sat)
lh = TD.latent_heat_liq_ice(thermo_params, phase_part)

# TODO - add here also precipiotation once the code is simplifies
# and we don't rely on thermo state to get the condensed species.
lh =
(
get_ql_sat(thermo_params, bg_model) *
TD.latent_heat_vapor(thermo_params, t_sat) +
get_qi_sat(thermo_params, bg_model) *
TD.latent_heat_sublim(thermo_params, t_sat)
) /
(get_ql_sat(thermo_params, bg_model) + get_qi_sat(thermo_params, bg_model))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an eps to make sure this is not divided by zero?

#lh = TD.latent_heat_liq_ice(thermo_params, phase_part)

cp_m = TD.cp_m(thermo_params, ts_sat)
t_sat = get_t_sat(thermo_params, bg_model)
qv_sat = get_qv_sat(thermo_params, bg_model)
∂b∂θli_sat = (
∂b∂θv *
Expand Down Expand Up @@ -257,8 +269,8 @@ end
Calculates the surface flux of TKE, a C3 vector used by
ClimaAtmos operator boundary conditions.

The flux magnitude is modeled as
c_k * ρa_sfc * ustar^3`,
The flux magnitude is modeled as
c_k * ρa_sfc * ustar^3`,
directed along the surface upward normal.

Details:
Expand Down Expand Up @@ -323,12 +335,12 @@ where:
- `scale_blending_method`: The method to use for blending physical scales.

Point-wise calculation of the turbulent mixing length, limited by physical constraints (wall distance,
TKE balance, stability) and grid resolution. Based on
Lopez‐Gomez, I., Cohen, Y., He, J., Jaruga, A., & Schneider, T. (2020).
A generalized mixing length closure for eddy‐diffusivity mass‐flux schemes of turbulence and convection.
TKE balance, stability) and grid resolution. Based on
Lopez‐Gomez, I., Cohen, Y., He, J., Jaruga, A., & Schneider, T. (2020).
A generalized mixing length closure for eddy‐diffusivity mass‐flux schemes of turbulence and convection.
Journal of Advances in Modeling Earth Systems, 12, e2020MS002161. https://doi.org/ 10.1029/2020MS002161

Returns a `MixingLength{FT}` struct containing the final blended mixing length (`master`)
Returns a `MixingLength{FT}` struct containing the final blended mixing length (`master`)
and its constituent physical scales.
"""

Expand Down Expand Up @@ -370,8 +382,8 @@ function mixing_length_lopez_gomez_2020(
# Ensure l_z is non-negative when ᶜz is numerically smaller than z_sfc.
l_z = max(l_z, FT(0))

# l_W: Wall-constrained length scale (near-surface limit, to match
# Monin-Obukhov Similarity Theory in the surface layer, with Businger-Dyer
# l_W: Wall-constrained length scale (near-surface limit, to match
# Monin-Obukhov Similarity Theory in the surface layer, with Businger-Dyer
# type stability functions)
tke_sfc_safe = max(sfc_tke, eps_FT)
ustar_sq_safe = max(ustar * ustar, eps_FT) # ustar^2 may vanish in certain LES setups
Expand Down
Loading