25namespace shamrock::sph {
37 inline constexpr Tscal
q_av(
const Tscal &rho,
const Tscal &vsig,
const Tscal &v_scal_rhat) {
38 return sham::max(-Tscal(0.5) * rho * vsig * v_scal_rhat, Tscal(0));
42 inline constexpr Tscal q_av_disc(
46 const Tscal &alpha_av,
49 const Tscal &v_scal_rhat) {
51 Tscal rho1 = 1. / rho;
54 Tscal prefact = -Tscal(0.5) * rho * sham::abs(rabinv) * h;
56 Tscal vsig_disc = (v_scal_rhat < Tscal(0)) ? vsig : (alpha_av * cs);
58 q_av_d = prefact * vsig_disc * v_scal_rhat;
T inv_sat_positive(T v, T minvsat=T{1e-9}, T satval=T{0.}) noexcept
inverse saturated (positive numbers only)
constexpr Tscal q_av(const Tscal &rho, const Tscal &vsig, const Tscal &v_scal_rhat)
eq.40