10#include <compile_time_options.h>
14#include <deal.II/base/parameter_acceptor.h>
15#include <deal.II/base/vectorization.h>
22 template <
typename ScalarNumber =
double>
27 : ParameterAcceptor(subsection)
29 evc_factor_ = ScalarNumber(1.);
30 add_parameter(
"evc factor",
32 "Factor for scaling the entropy viscocity commuator");
38 ScalarNumber evc_factor_;
81 template <
int dim,
typename Number =
double>
132 : hyperbolic_system(hyperbolic_system)
133 , parameters(parameters)
134 , precomputed_values(precomputed_values)
150 const dealii::Tensor<1, dim, Number> &c_ij);
155 Number
alpha(
const Number h_i)
const;
169 Number rho_i_inverse = 0.;
189 template <
int dim,
typename Number>
190 DEAL_II_ALWAYS_INLINE
inline void
195 const auto view = hyperbolic_system.view<dim, Number>();
197 const auto &[p_i, gamma_min_i, s_i, new_eta_i] =
198 precomputed_values.template get_tensor<Number, precomputed_type>(i);
200 gamma_min = gamma_min_i;
202 const auto rho_i = view.density(U_i);
203 rho_i_inverse = Number(1.) / rho_i;
206 d_eta_i = view.surrogate_harten_entropy_derivative(U_i, eta_i, gamma_min);
207 d_eta_i[0] -= eta_i * rho_i_inverse;
209 const auto surrogate_p_i = view.surrogate_pressure(U_i, gamma_min);
210 f_i = view.f(U_i, surrogate_p_i);
217 template <
int dim,
typename Number>
219 const unsigned int * ,
221 const dealii::Tensor<1, dim, Number> &c_ij)
225 const auto view = hyperbolic_system.view<dim, Number>();
227 const auto eta_j = view.surrogate_harten_entropy(U_j, gamma_min);
229 const auto rho_j = view.density(U_j);
230 const auto rho_j_inverse = Number(1.) / rho_j;
232 const auto m_j = view.momentum(U_j);
234 const auto surrogate_p_j = view.surrogate_pressure(U_j, gamma_min);
235 const auto f_j = view.f(U_j, surrogate_p_j);
237 const auto entropy_flux =
238 (eta_j * rho_j_inverse - eta_i * rho_i_inverse) * (m_j * c_ij);
240 left += entropy_flux;
241 for (
unsigned int k = 0; k < problem_dimension; ++k) {
242 const auto component = (f_j[k] - f_i[k]) * c_ij;
243 right[k] += component;
248 template <
int dim,
typename Number>
249 DEAL_II_ALWAYS_INLINE
inline Number
254 Number numerator = left;
255 Number denominator = std::abs(left);
256 for (
unsigned int k = 0; k < problem_dimension; ++k) {
257 numerator -= d_eta_i[k] * right[k];
258 denominator += std::abs(d_eta_i[k] * right[k]);
262 denominator + hd_i * std::abs(eta_i));
264 return std::min(Number(1.), parameters.evc_factor() * quotient);
dealii::Tensor< 1, problem_dimension, Number > state_type
typename get_value_type< Number >::type ScalarNumber
static constexpr unsigned int problem_dimension
Vectors::MultiComponentVector< ScalarNumber, n_precomputed_values > PrecomputedVector
std::array< Number, n_precomputed_values > precomputed_type
dealii::Tensor< 1, problem_dimension, dealii::Tensor< 1, dim, Number > > flux_type
ACCESSOR_READ_ONLY(evc_factor)
IndicatorParameters(const std::string &subsection="/Indicator")
static constexpr auto problem_dimension
typename View::PrecomputedVector PrecomputedVector
typename View::flux_type flux_type
typename View::precomputed_type precomputed_type
void accumulate(const unsigned int *js, const state_type &U_j, const dealii::Tensor< 1, dim, Number > &c_ij)
typename View::state_type state_type
Number alpha(const Number h_i) const
Indicator(const HyperbolicSystem &hyperbolic_system, const Parameters ¶meters, const PrecomputedVector &precomputed_values)
void reset(const unsigned int i, const state_type &U_i)
IndicatorParameters< ScalarNumber > Parameters
typename View::ScalarNumber ScalarNumber
DEAL_II_ALWAYS_INLINE Number safe_division(const Number &numerator, const Number &denominator)