ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
riemann_solver.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2023 - 2024 by the ryujin authors
4//
5
6#pragma once
7
8#include "hyperbolic_system.h"
9
10#include <simd.h>
11
12#include <deal.II/base/point.h>
13#include <deal.II/base/tensor.h>
14
15namespace ryujin
16{
17 namespace ScalarConservation
18 {
19 template <typename ScalarNumber = double>
20 class RiemannSolverParameters : public dealii::ParameterAcceptor
21 {
22 public:
23 RiemannSolverParameters(const std::string &subsection = "/RiemannSolver")
24 : ParameterAcceptor(subsection)
25 {
26 use_greedy_wavespeed_ = false;
27 add_parameter("use greedy wavespeed",
28 use_greedy_wavespeed_,
29 "Use a greedy wavespeed estimate instead of a guaranteed "
30 "upper bound "
31 "on the maximal wavespeed (for convex fluxes).");
32
33 use_averaged_entropy_ = false;
34 add_parameter("use averaged entropy",
35 use_averaged_entropy_,
36 "In addition to the wavespeed estimate based on the Roe "
37 "average and "
38 "flux gradients of the left and right state also enforce "
39 "an entropy "
40 "inequality on the averaged Krŭzkov entropy.");
41
42 random_entropies_ = 0;
43 add_parameter(
44 "random entropies",
45 random_entropies_,
46 "In addition to the wavespeed estimate based on the Roe average "
47 "and "
48 "flux gradients of the left and right state also enforce an "
49 "entropy "
50 "inequality on the prescribed number of random Krŭzkov entropies.");
51 }
52
53 ACCESSOR_READ_ONLY(use_greedy_wavespeed);
54 ACCESSOR_READ_ONLY(use_averaged_entropy);
55 ACCESSOR_READ_ONLY(random_entropies);
56
57 private:
58 bool use_greedy_wavespeed_;
59 bool use_averaged_entropy_;
60 unsigned int random_entropies_;
61 };
62
63
74 template <int dim, typename Number = double>
76 {
77 public:
82
84
86
88
89 using state_type = typename View::state_type;
90
92
94
96
98
103
107 RiemannSolver(const HyperbolicSystem &hyperbolic_system,
108 const Parameters &parameters,
109 const PrecomputedVector &precomputed_values)
110 : hyperbolic_system(hyperbolic_system)
111 , parameters(parameters)
112 , precomputed_values(precomputed_values)
113 {
114 }
115
121 Number compute(const Number &u_i,
122 const Number &u_j,
123 const precomputed_type &prec_i,
124 const precomputed_type &prec_j,
125 const dealii::Tensor<1, dim, Number> &n_ij) const;
126
131 Number compute(const state_type &U_i,
132 const state_type &U_j,
133 const unsigned int i,
134 const unsigned int *js,
135 const dealii::Tensor<1, dim, Number> &n_ij) const;
136
137 private:
138 const HyperbolicSystem &hyperbolic_system;
139 const Parameters &parameters;
140 const PrecomputedVector &precomputed_values;
142 };
143 } // namespace ScalarConservation
144} // namespace ryujin
std::array< Number, n_precomputed_values > precomputed_type
Vectors::MultiComponentVector< ScalarNumber, n_precomputed_values > PrecomputedVector
typename get_value_type< Number >::type ScalarNumber
dealii::Tensor< 1, problem_dimension, Number > state_type
RiemannSolverParameters(const std::string &subsection="/RiemannSolver")
typename View::state_type state_type
typename View::ScalarNumber ScalarNumber
Number compute(const Number &u_i, const Number &u_j, const precomputed_type &prec_i, const precomputed_type &prec_j, const dealii::Tensor< 1, dim, Number > &n_ij) const
typename View::PrecomputedVector PrecomputedVector
RiemannSolver(const HyperbolicSystem &hyperbolic_system, const Parameters &parameters, const PrecomputedVector &precomputed_values)
typename View::precomputed_type precomputed_type
RiemannSolverParameters< ScalarNumber > Parameters