ryujin 2.1.1 revision d0a94ad2ccc0c4c2e8c2485c52b06b90e2fc9853
|
#include <source/euler/hyperbolic_system.h>
Public Types | |
using | ScalarNumber = typename get_value_type< Number >::type |
Public Member Functions | |
HyperbolicSystemView (const HyperbolicSystem &hyperbolic_system) | |
template<int dim2, typename Number2 > | |
auto | view () const |
template<typename DISPATCH , typename SPARSITY > | |
DEAL_II_ALWAYS_INLINE void | precomputation_loop (unsigned int cycle, const DISPATCH &dispatch_check, precomputed_vector_type &precomputed_values, const SPARSITY &sparsity_simd, const vector_type &U, unsigned int left, unsigned int right) const |
template<int component> | |
DEAL_II_ALWAYS_INLINE auto | linearized_eigenvector (const state_type &U, const dealii::Tensor< 1, dim, Number > &normal) const -> std::array< state_type, 2 > |
template<int component> | |
DEAL_II_ALWAYS_INLINE auto | prescribe_riemann_characteristic (const state_type &U, const state_type &U_bar, const dealii::Tensor< 1, dim, Number > &normal) const -> state_type |
template<typename Lambda > | |
DEAL_II_ALWAYS_INLINE auto | apply_boundary_conditions (dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &normal, const Lambda &get_dirichlet_data) const -> state_type |
template<typename ST > | |
auto | expand_state (const ST &state) const -> state_type |
template<typename ST > | |
DEAL_II_ALWAYS_INLINE auto | from_initial_state (const ST &initial_state) const -> state_type |
template<typename Lambda > | |
auto | apply_galilei_transform (const state_type &state, const Lambda &lambda) const -> state_type |
template<typename DISPATCH , typename SPARSITY > | |
DEAL_II_ALWAYS_INLINE void | precomputation_loop (unsigned int cycle, const DISPATCH &dispatch_check, precomputed_vector_type &precomputed_values, const SPARSITY &sparsity_simd, const vector_type &U, unsigned int left, unsigned int right) const |
template<int component> | |
DEAL_II_ALWAYS_INLINE auto | prescribe_riemann_characteristic (const state_type &U, const state_type &U_bar, const dealii::Tensor< 1, dim, Number > &normal) const -> state_type |
template<typename Lambda > | |
DEAL_II_ALWAYS_INLINE auto | apply_boundary_conditions (dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &normal, const Lambda &get_dirichlet_data) const -> state_type |
template<typename ST > | |
auto | expand_state (const ST &state) const -> state_type |
template<typename ST > | |
DEAL_II_ALWAYS_INLINE auto | from_initial_state (const ST &initial_state) const -> state_type |
template<typename Lambda > | |
auto | apply_galilei_transform (const state_type &state, const Lambda &lambda) const -> state_type |
template<typename DISPATCH , typename SPARSITY > | |
DEAL_II_ALWAYS_INLINE void | precomputation_loop (unsigned int cycle, const DISPATCH &dispatch_check, precomputed_vector_type &precomputed_values, const SPARSITY &sparsity_simd, const vector_type &U, unsigned int left, unsigned int right) const |
template<typename Lambda > | |
DEAL_II_ALWAYS_INLINE auto | apply_boundary_conditions (dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &, const Lambda &get_dirichlet_data) const -> state_type |
template<typename DISPATCH , typename SPARSITY > | |
DEAL_II_ALWAYS_INLINE void | precomputation_loop (unsigned int cycle, const DISPATCH &dispatch_check, precomputed_vector_type &precomputed_values, const SPARSITY &sparsity_simd, const vector_type &U, unsigned int left, unsigned int right) const |
template<int component> | |
DEAL_II_ALWAYS_INLINE auto | prescribe_riemann_characteristic (const state_type &U, const state_type &U_bar, const dealii::Tensor< 1, dim, Number > &normal) const -> state_type |
template<typename Lambda > | |
DEAL_II_ALWAYS_INLINE auto | apply_boundary_conditions (const dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &normal, const Lambda &get_dirichlet_data) const -> state_type |
template<typename ST > | |
DEAL_II_ALWAYS_INLINE auto | expand_state (const ST &state) const -> state_type |
template<typename ST > | |
DEAL_II_ALWAYS_INLINE auto | from_initial_state (const ST &initial_state) const -> state_type |
template<typename Lambda > | |
DEAL_II_ALWAYS_INLINE auto | apply_galilei_transform (const state_type &state, const Lambda &lambda) const -> state_type |
Access to runtime parameters | |
DEAL_II_ALWAYS_INLINE ScalarNumber | gamma () const |
DEAL_II_ALWAYS_INLINE ScalarNumber | reference_density () const |
DEAL_II_ALWAYS_INLINE ScalarNumber | vacuum_state_relaxation_small () const |
DEAL_II_ALWAYS_INLINE ScalarNumber | vacuum_state_relaxation_large () const |
Special functions for boundary states | |
template<int component> | |
std::array< state_type, 2 > | linearized_eigenvector (const state_type &U, const dealii::Tensor< 1, dim, Number > &normal) const |
template<int component> | |
state_type | prescribe_riemann_characteristic (const state_type &U, const state_type &U_bar, const dealii::Tensor< 1, dim, Number > &normal) const |
template<typename Lambda > | |
state_type | apply_boundary_conditions (const dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &normal, const Lambda &get_dirichlet_data) const |
State transformations | |
template<typename ST > | |
state_type | expand_state (const ST &state) const |
template<typename ST > | |
state_type | from_initial_state (const ST &initial_state) const |
state_type | from_primitive_state (const state_type &primitive_state) const |
state_type | to_primitive_state (const state_type &state) const |
template<typename Lambda > | |
state_type | apply_galilei_transform (const state_type &state, const Lambda &lambda) const |
Types and compile time constants | |
using | state_type = dealii::Tensor< 1, problem_dimension, Number > |
using | vector_type = MultiComponentVector< ScalarNumber, problem_dimension > |
using | flux_type = dealii::Tensor< 1, problem_dimension, dealii::Tensor< 1, dim, Number > > |
using | flux_contribution_type = flux_type |
static constexpr unsigned int | problem_dimension = 2 + dim |
static const auto | component_names |
static const auto | primitive_component_names |
Precomputed quantities | |
using | precomputed_initial_state_type = std::array< Number, n_precomputed_initial_values > |
using | precomputed_initial_vector_type = MultiComponentVector< ScalarNumber, n_precomputed_initial_values > |
using | precomputed_state_type = std::array< Number, n_precomputed_values > |
using | precomputed_vector_type = MultiComponentVector< ScalarNumber, n_precomputed_values > |
static constexpr unsigned int | n_precomputed_initial_values = 0 |
static const auto | precomputed_initial_names |
static constexpr unsigned int | n_precomputed_values = 2 |
static const auto | precomputed_names |
static constexpr unsigned int | n_precomputation_cycles = 1 |
template<typename DISPATCH , typename SPARSITY > | |
void | precomputation_loop (unsigned int cycle, const DISPATCH &dispatch_check, precomputed_vector_type &precomputed_values, const SPARSITY &sparsity_simd, const vector_type &U, unsigned int left, unsigned int right) const |
Access to cached inverses | |
A collection of commonly used expressions with gamma that would otherwise need to be recomputed many times putting unnecessary pressure on the div/sqrt ALU unit. | |
static constexpr bool | have_gamma = true |
static constexpr bool | have_eos_interpolation_b = false |
DEAL_II_ALWAYS_INLINE ScalarNumber | gamma_inverse () const |
DEAL_II_ALWAYS_INLINE ScalarNumber | gamma_plus_one_inverse () const |
DEAL_II_ALWAYS_INLINE ScalarNumber | gamma_minus_one_inverse () const |
DEAL_II_ALWAYS_INLINE ScalarNumber | gamma_minus_one_over_gamma_plus_one () const |
Flux computations | |
static constexpr bool | have_high_order_flux = false |
flux_type | f (const state_type &U) const |
flux_contribution_type | flux_contribution (const precomputed_vector_type &pv, const precomputed_initial_vector_type &piv, const unsigned int i, const state_type &U_i) const |
flux_contribution_type | flux_contribution (const precomputed_vector_type &pv, const precomputed_initial_vector_type &piv, const unsigned int *js, const state_type &U_j) const |
state_type | flux_divergence (const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij) const |
state_type | high_order_flux_divergence (const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij) const =delete |
Computing stencil source terms | |
static constexpr bool | have_source_terms = false |
state_type | nodal_source (const precomputed_vector_type &pv, const unsigned int i, const state_type &U_i, const ScalarNumber tau) const =delete |
state_type | nodal_source (const precomputed_vector_type &pv, const unsigned int *js, const state_type &U_j, const ScalarNumber tau) const =delete |
Computing derived physical quantities | |
Number | filter_vacuum_density (const Number &rho) const |
Number | pressure (const state_type &U) const |
Number | speed_of_sound (const state_type &U) const |
Number | specific_entropy (const state_type &U) const |
Number | harten_entropy (const state_type &U) const |
state_type | harten_entropy_derivative (const state_type &U) const |
Number | mathematical_entropy (const state_type &U) const |
state_type | mathematical_entropy_derivative (const state_type &U) const |
bool | is_admissible (const state_type &U) const |
static Number | density (const state_type &U) |
static dealii::Tensor< 1, dim, Number > | momentum (const state_type &U) |
static Number | total_energy (const state_type &U) |
static Number | internal_energy (const state_type &U) |
static state_type | internal_energy_derivative (const state_type &U) |
A view of the HyperbolicSystem that makes methods available for a given dimension dim
and choice of number type Number
(which can be a scalar float, or double, as well as a VectorizedArray holding packed scalars.
Intended usage:
Definition at line 103 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::ScalarNumber = typename get_value_type<Number>::type |
The underlying scalar number type.
Definition at line 127 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::state_type = dealii::Tensor<1, problem_dimension, Number> |
The storage type used for a (conserved) state \(\boldsymbol U\).
Definition at line 222 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::vector_type = MultiComponentVector<ScalarNumber, problem_dimension> |
MulticomponentVector for storing a vector of conserved states:
Definition at line 227 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::flux_type = dealii::Tensor<1, problem_dimension, dealii::Tensor<1, dim, Number> > |
The storage type used for the flux \(\mathbf{f}\).
Definition at line 262 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::flux_contribution_type = flux_type |
The storage type used for flux contributions.
Definition at line 268 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::precomputed_initial_state_type = std::array<Number, n_precomputed_initial_values> |
Array type used for precomputed initial values.
Definition at line 284 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::precomputed_initial_vector_type = MultiComponentVector<ScalarNumber, n_precomputed_initial_values> |
MulticomponentVector for storing a vector of precomputed initial states:
Definition at line 291 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::precomputed_state_type = std::array<Number, n_precomputed_values> |
Array type used for precomputed values.
Definition at line 308 of file hyperbolic_system.h.
using ryujin::Euler::HyperbolicSystemView< dim, Number >::precomputed_vector_type = MultiComponentVector<ScalarNumber, n_precomputed_values> |
MulticomponentVector for storing a vector of precomputed states:
Definition at line 313 of file hyperbolic_system.h.
|
inline |
Constructor taking a reference to the underlying HyperbolicSystem
Definition at line 110 of file hyperbolic_system.h.
|
inline |
Create a modified view from the current one:
Definition at line 119 of file hyperbolic_system.h.
|
inline |
Definition at line 134 of file hyperbolic_system.h.
|
inline |
Definition at line 139 of file hyperbolic_system.h.
|
inline |
Definition at line 145 of file hyperbolic_system.h.
|
inline |
Definition at line 151 of file hyperbolic_system.h.
|
inline |
Definition at line 166 of file hyperbolic_system.h.
|
inline |
Definition at line 171 of file hyperbolic_system.h.
|
inline |
Definition at line 176 of file hyperbolic_system.h.
|
inline |
Definition at line 182 of file hyperbolic_system.h.
void ryujin::Euler::HyperbolicSystemView< dim, Number >::precomputation_loop | ( | unsigned int | cycle, |
const DISPATCH & | dispatch_check, | ||
precomputed_vector_type & | precomputed_values, | ||
const SPARSITY & | sparsity_simd, | ||
const vector_type & | U, | ||
unsigned int | left, | ||
unsigned int | right | ||
) | const |
Step 0: precompute values for hyperbolic update. This routine is called within our usual loop() idiom in HyperbolicModule
|
inlinestatic |
For a given (2+dim dimensional) state vector U
, return the density U[0]
Definition at line 732 of file hyperbolic_system.h.
|
inline |
Given a density rho
this function returns 0 if the magniatude of rho is smaller or equal than relaxation_large * rho_cutoff. Otherwise rho is returned unmodified. Here, rho_cutoff is the reference density multiplied by eps.
Definition at line 740 of file hyperbolic_system.h.
|
inlinestatic |
For a given (2+dim dimensional) state vector U
, return the momentum vector [U[1], ..., U[1+dim]]
.
Definition at line 754 of file hyperbolic_system.h.
|
inlinestatic |
For a given (2+dim dimensional) state vector U
, return the total energy U[1+dim]
Definition at line 765 of file hyperbolic_system.h.
|
inlinestatic |
For a given (2+dim dimensional) state vector U
, compute and return the internal energy \(\varepsilon = (\rho e)\).
Definition at line 773 of file hyperbolic_system.h.
|
inlinestatic |
For a given (2+dim dimensional) state vector U
, compute and return the derivative of the internal energy \(\varepsilon = (\rho e)\).
Definition at line 787 of file hyperbolic_system.h.
|
inline |
For a given (2+dim dimensional) state vector U
, compute and return the pressure \(p\).
We assume that the pressure is given by a polytropic equation of state, i.e.,
\[ p = (\gamma - 1)\;(\rho e) \]
Definition at line 814 of file hyperbolic_system.h.
|
inline |
For a given (2+dim dimensional) state vector U
, compute the (physical) speed of sound:
\[ c^2 = \frac{\gamma\,p}{\rho} \]
Definition at line 823 of file hyperbolic_system.h.
|
inline |
For a given (2+dim dimensional) state vector U
, compute and return the (scaled) specific entropy
\[ e^{(\gamma-1)s} = \frac{\rho\,e}{\rho^\gamma}. \]
Definition at line 834 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
For a given (2+dim dimensional) state vector U
, compute and return the Harten-type entropy
\[ \eta = (\rho^2 e) ^ {1 / (\gamma + 1)}. \]
Definition at line 845 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
For a given (2+dim dimensional) state vector U
, compute and return the derivative \(\eta'\) of the Harten-type entropy
\[ \eta = (\rho^2 e) ^ {1 / (\gamma + 1)}. \]
Definition at line 860 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
For a given (2+dim dimensional) state vector U
, compute and return the entropy \(\eta = p^{1/\gamma}\).
Definition at line 897 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
For a given (2+dim dimensional) state vector U
, compute and return the derivative \(\eta'\) of the entropy \(\eta =
p^{1/\gamma}\).
Definition at line 908 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
Returns whether the state U
is admissible. If U
is a vectorized state then U
is admissible if all vectorized values are admissible.
Definition at line 945 of file hyperbolic_system.h.
std::array< state_type, 2 > ryujin::Euler::HyperbolicSystemView< dim, Number >::linearized_eigenvector | ( | const state_type & | U, |
const dealii::Tensor< 1, dim, Number > & | normal | ||
) | const |
For a given state U
and normal direction normal
returns the n-th pair of left and right eigenvectors of the linearized normal flux.
state_type ryujin::Euler::HyperbolicSystemView< dim, Number >::prescribe_riemann_characteristic | ( | const state_type & | U, |
const state_type & | U_bar, | ||
const dealii::Tensor< 1, dim, Number > & | normal | ||
) | const |
Decomposes a given state U
into Riemann invariants and then replaces the first or second Riemann characteristic from the one taken from U_bar
state. Note that the U_bar
state is just the prescribed dirichlet values.
state_type ryujin::Euler::HyperbolicSystemView< dim, Number >::apply_boundary_conditions | ( | const dealii::types::boundary_id | id, |
const state_type & | U, | ||
const dealii::Tensor< 1, dim, Number > & | normal, | ||
const Lambda & | get_dirichlet_data | ||
) | const |
Apply boundary conditions.
For the compressible Euler equations we have:
|
inline |
Given a state U
compute the flux
\[ \begin{pmatrix} \textbf m \\ \textbf v\otimes \textbf m + p\mathbb{I}_d \\ \textbf v(E+p) \end{pmatrix}, \]
Definition at line 1154 of file hyperbolic_system.h.
|
inline |
Given a state U_i
and an index i
compute flux contributions.
Intended usage:
For the Euler equations we simply compute f(U_i)
.
Definition at line 1176 of file hyperbolic_system.h.
|
inline |
Definition at line 1188 of file hyperbolic_system.h.
|
inline |
Given flux contributions flux_i
and flux_j
compute the flux (-f(U_i) - f(U_j)
Definition at line 1200 of file hyperbolic_system.h.
References ryujin::add(), and ryujin::contract().
|
delete |
|
delete |
|
delete |
state_type ryujin::Euler::HyperbolicSystemView< dim, Number >::expand_state | ( | const ST & | state | ) | const |
Given a state vector associated with a different spatial dimensions than the current one, return an "expanded" version of the state vector associated with dim spatial dimensions where the momentum vector of the conserved state state
is expaned with zeros to a total length of dim entries.
state_type ryujin::Euler::HyperbolicSystemView< dim, Number >::from_initial_state | ( | const ST & | initial_state | ) | const |
Given an initial state [rho, u_1, ..., u_?, p] return a conserved state [rho, m_1, ..., m_d, E].
This function simply calls from_primitive_state() and expand_state().
|
inline |
Given a primitive state [rho, u_1, ..., u_d, p] return a conserved state
Definition at line 1245 of file hyperbolic_system.h.
|
inline |
Given a conserved state return a primitive state [rho, u_1, ..., u_d, p]
Definition at line 1267 of file hyperbolic_system.h.
state_type ryujin::Euler::HyperbolicSystemView< dim, Number >::apply_galilei_transform | ( | const state_type & | state, |
const Lambda & | lambda | ||
) | const |
Transform the current state according to a given operator lambda
acting on a dim dimensional momentum (or velocity) vector.
|
inline |
Definition at line 697 of file hyperbolic_system.h.
References RYUJIN_OMP_FOR.
|
inline |
Definition at line 975 of file hyperbolic_system.h.
|
inline |
Definition at line 1030 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
Definition at line 1089 of file hyperbolic_system.h.
References ryujin::dirichlet, ryujin::dynamic, ryujin::no_slip, and ryujin::slip.
auto ryujin::Euler::HyperbolicSystemView< dim, Number >::expand_state | ( | const ST & | state | ) | const -> state_type |
Definition at line 1211 of file hyperbolic_system.h.
|
inline |
Definition at line 1235 of file hyperbolic_system.h.
auto ryujin::Euler::HyperbolicSystemView< dim, Number >::apply_galilei_transform | ( | const state_type & | state, |
const Lambda & | lambda | ||
) | const -> state_type |
Definition at line 1287 of file hyperbolic_system.h.
|
inline |
Definition at line 809 of file hyperbolic_system.h.
References RYUJIN_OMP_FOR, and RYUJIN_OMP_SINGLE.
|
inline |
Definition at line 1166 of file hyperbolic_system.h.
References ryujin::pow().
|
inline |
Definition at line 1239 of file hyperbolic_system.h.
References ryujin::dirichlet, ryujin::dynamic, ryujin::no_slip, and ryujin::slip.
auto ryujin::Euler::HyperbolicSystemView< dim, Number >::expand_state | ( | const ST & | state | ) | const -> state_type |
Definition at line 1368 of file hyperbolic_system.h.
|
inline |
Definition at line 1392 of file hyperbolic_system.h.
auto ryujin::Euler::HyperbolicSystemView< dim, Number >::apply_galilei_transform | ( | const state_type & | state, |
const Lambda & | lambda | ||
) | const -> state_type |
Definition at line 1452 of file hyperbolic_system.h.
|
inline |
Definition at line 592 of file hyperbolic_system.h.
References RYUJIN_OMP_FOR.
|
inline |
Definition at line 683 of file hyperbolic_system.h.
References ryujin::dirichlet, ryujin::dynamic, ryujin::no_slip, and ryujin::slip.
|
inline |
Definition at line 672 of file hyperbolic_system.h.
References ryujin::pow(), and RYUJIN_OMP_FOR.
|
inline |
Definition at line 891 of file hyperbolic_system.h.
|
inline |
Definition at line 940 of file hyperbolic_system.h.
References ryujin::dirichlet, ryujin::dirichlet_momentum, ryujin::dynamic, ryujin::no_slip, and ryujin::slip.
|
inline |
Definition at line 1245 of file hyperbolic_system.h.
|
inline |
Definition at line 1267 of file hyperbolic_system.h.
|
inline |
Definition at line 1310 of file hyperbolic_system.h.
|
staticconstexpr |
constexpr boolean used in the EulerInitialStates namespace
Definition at line 191 of file hyperbolic_system.h.
|
staticconstexpr |
constexpr boolean used in the EulerInitialStates namespace
Definition at line 196 of file hyperbolic_system.h.
|
staticconstexpr |
The dimension of the state space.
Definition at line 217 of file hyperbolic_system.h.
|
inlinestatic |
An array holding all component names of the conserved state as a string.
Definition at line 233 of file hyperbolic_system.h.
|
inlinestatic |
An array holding all component names of the primitive state as a string.
Definition at line 248 of file hyperbolic_system.h.
|
staticconstexpr |
The number of precomputed initial values.
Definition at line 279 of file hyperbolic_system.h.
|
inlinestatic |
An array holding all component names of the precomputed values.
Definition at line 297 of file hyperbolic_system.h.
|
staticconstexpr |
The number of precomputed values.
Definition at line 303 of file hyperbolic_system.h.
|
inlinestatic |
An array holding all component names of the precomputed values.
Definition at line 319 of file hyperbolic_system.h.
|
staticconstexpr |
The number of precomputation cycles.
Definition at line 325 of file hyperbolic_system.h.
|
staticconstexpr |
The low-order and high-order fluxes are the same
Definition at line 565 of file hyperbolic_system.h.
|
staticconstexpr |
We do not have source terms:
Definition at line 579 of file hyperbolic_system.h.