Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Planets.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 "shambackends/sycl.hpp"
21
22namespace shamphys {
23
24 template<class T>
25 T hill_radius(T R, T m, T M) {
26 return R * sycl::cbrt(m / (3 * M));
27 }
28
29 template<class T>
30 T keplerian_speed(T G, T M, T R) {
31 return sycl::sqrt(G * M / R);
32 }
33
34 template<class T, class Tu>
35 T keplerian_speed(T M, T R, const shamunits::UnitSystem<Tu> usys = {}) {
36 return keplerian_speed(shamunits::Constants{usys}.G(), M, R);
37 }
38
39} // namespace shamphys
Defines a unit system.
Physical constants.
constexpr T G()
get the value of G in the current unit system units