Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Dust.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
18#include "shambase/assert.hpp"
20#include "shambackends/sycl.hpp"
21
22namespace shamphys {
23
41 template<class T>
42 inline T epstein_supersonic_correction(T delta_v, T cs) noexcept {
43
44 SHAM_ASSERT(cs > 0);
45
46 auto div = delta_v / cs;
47 return sycl::sqrt(T(1.0) + T(9.0 / 128.0) * shambase::constants::pi<T> * div * div);
48 }
49
74 template<class T>
76 T rho_grain, T s_grain, T rho, T cs, T gamma, T f = T(1.0)) noexcept {
77
78 SHAM_ASSERT(rho * cs * f > 0);
79 SHAM_ASSERT(gamma > 0);
80
81 return (rho_grain * s_grain / (rho * cs * f))
82 * sycl::sqrt(shambase::constants::pi<T> * gamma / T(8));
83 }
84
85} // namespace shamphys
T epstein_stopping_time(T rho_grain, T s_grain, T rho, T cs, T gamma, T f=T(1.0)) noexcept
Epstein drag stopping time for spherical dust grains.
Definition Dust.hpp:75
T epstein_supersonic_correction(T delta_v, T cs) noexcept
Epstein drag supersonic correction factor.
Definition Dust.hpp:42
Shamrock assertion utility.
#define SHAM_ASSERT(x)
Shorthand for SHAM_ASSERT_NAMED without a message.
Definition assert.hpp:67
Class holding the value of numerous constants generated from the following source.