Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
riemann_dust_huang_bai.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 huang_bai_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 const Tcons f_l = fspec.flux(prim_l, n, vn_l);
47 const Tcons f_r = fspec.flux(prim_r, n, vn_r);
48
49 Tcons flux{};
50
51 if (vn_l > 0 && vn_r > 0)
52 flux = f_l;
53 else if (vn_l < 0 && vn_r < 0)
54 flux = f_r;
55 else if (vn_l < 0 && vn_r > 0)
56 flux *= 0;
57 else if (vn_l > 0 && vn_r < 0)
58 flux = (f_l + f_r);
59
60 return flux;
61 }
62
63} // namespace shammath
namespace for math utility
Definition AABB.hpp:26
constexpr FSpec::Tcons huang_bai_flux(const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n)
Huang & Bai dust 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...