36 #ifndef ERF_PBL_SCALE_AWARE_BLENDING_H
37 #define ERF_PBL_SCALE_AWARE_BLENDING_H
39 #include <AMReX_REAL.H>
40 #include <AMReX_GpuQualifiers.H>
62 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
64 amrex::Real L_blend) noexcept
67 const amrex::Real L = amrex::max(L_blend, amrex::Real(0.0));
68 const amrex::Real d2 =
dx *
dx;
69 return d2 / (L * L + d2);
83 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
86 amrex::Real C_s) noexcept
88 const amrex::Real Lmix = C_s *
dx;
89 return Lmix * Lmix * std::sqrt(2.0 * amrex::max(SmnSmn, amrex::Real(0.0)));
102 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
104 amrex::Real c_max) noexcept
106 return c_max * std::pow(
dx, amrex::Real(4.0) / amrex::Real(3.0));
131 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
138 bool use_smag) noexcept
140 if (L_blend <= 0.0)
return K_h;
143 const amrex::Real K_blend = K_h * f;
146 if (use_smag && SmnSmn >= 0.0) {
151 return amrex::min(K_blend, K_max);
GpuArray< Real, AMREX_SPACEDIM > dx
Definition: ERF_ActuatorSpreading.cpp:131
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pbl_kh_blend_and_cap(amrex::Real K_h, amrex::Real dx, amrex::Real L_blend, amrex::Real C_s, amrex::Real c_max, amrex::Real SmnSmn, bool use_smag) noexcept
Apply scale-aware blending and ceiling to a single K_h value.
Definition: ERF_PBLScaleAwareBlending.H:132
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pbl_blend_factor(amrex::Real dx, amrex::Real L_blend) noexcept
Boutle et al. (2014) blending factor.
Definition: ERF_PBLScaleAwareBlending.H:63
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pbl_kh_ceiling_powerlaw(amrex::Real dx, amrex::Real c_max) noexcept
Power-law K_h ceiling (fallback when SmnSmn not available).
Definition: ERF_PBLScaleAwareBlending.H:103
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pbl_kh_ceiling_smag(amrex::Real dx, amrex::Real SmnSmn, amrex::Real C_s) noexcept
Smagorinsky-Lilly K_h ceiling.
Definition: ERF_PBLScaleAwareBlending.H:84