Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
riemann_dust_hll.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
20
21namespace shammath {
22
34 template<DustFluidStateSpec FSpec>
35 inline constexpr typename FSpec::Tcons d_hll_flux(
36 const FSpec &fspec,
37 const typename FSpec::Tprim &prim_l,
38 const typename FSpec::Tprim &prim_r,
39 const typename FSpec::Tvec &n) {
40 using Tscal = typename FSpec::Tscal;
41 using Tcons = typename FSpec::Tcons;
42
43 const Tscal vn_l = fspec.vn(prim_l, n);
44 const Tscal vn_r = fspec.vn(prim_r, n);
45
46 // NOLINTBEGIN(readability-identifier-naming)
47 const Tscal S = sham::max(sham::abs(vn_l), sham::abs(vn_r));
48 // NOLINTEND(readability-identifier-naming)
49
50 const Tcons f_l = fspec.flux(prim_l, n, vn_l);
51 const Tcons f_r = fspec.flux(prim_r, n, vn_r);
52
53 const Tcons c_l = fspec.prim_to_cons(prim_l);
54 const Tcons c_r = fspec.prim_to_cons(prim_r);
55
56 return 0.5 * ((f_l + f_r) - S * (c_r - c_l));
57 }
58
59} // namespace shammath
namespace for math utility
Definition AABB.hpp:26
constexpr FSpec::Tcons d_hll_flux(const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n)
Dust HLL flux across a face with unit normal n.
Gas and dust conservative/primitive states and axis-transform helpers shared by every gas and dust Ri...