6 const Float D_cgs = 100._f * D;
7 const Float rho_cgs = 1.e-3_f * rho;
9 constexpr
Float Q_0 = 9.e7_f;
10 constexpr
Float B = 0.5_f;
11 constexpr
Float a = -0.36_f;
12 constexpr
Float b = 1.36_f;
14 const Float Q_cgs = Q_0 *
pow(D_cgs / 2._f, a) + B * rho_cgs *
pow(D_cgs / 2._f, b);
15 return 1.e-4_f * Q_cgs;
30 0.5_f *
sqrt((R + r - d) * (d + r - R) * (d - r + R) * (d + r + R));
31 return area / (
PI *
sqr(r));
38 const Float Q = QOverQ_D * Q_D;
45 const Float Q_effOverQ_D,
58 const Float eps = 1.e-4_f * r;
59 while (
abs(r - lastR) > eps) {
INLINE bool almostEqual(const AffineMatrix &m1, const AffineMatrix &m2, const Float eps=EPS)
#define SPH_ASSERT(x,...)
Float getImpactEnergy(const Float R, const Float r, const Float v)
Computes the impact energy Q from impact parameters.
Float getEffectiveImpactArea(const Float R, const Float r, const Float phi)
Returns the the ratio of the cross-sectional area of the impact and the total area of the impactor.
Float getImpactorRadius(const Float R_pb, const Float v_imp, const Float QOverQ_D, const Float rho)
Calculates the impactor radius to satisfy required impact parameters.
NAMESPACE_SPH_BEGIN Float evalBenzAsphaugScalingLaw(const Float D, const Float rho)
Returns the critical energy Q_D^* as a function of body diameter.
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE T sqrt(const T f)
Return a squared root of a value.
constexpr INLINE Float pow(const Float v)
Power for floats.
constexpr INLINE Float sphereVolume(const Float radius)
Computes a volume of a sphere given its radius.
INLINE Float root< 3 >(const Float f)
INLINE auto abs(const T &f)
constexpr Float PI
Mathematical constants.
#define NAMESPACE_SPH_END