![]() |
ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
|
#include <include/ryujin/shallow_water/hyperbolic_system.h>
Public Member Functions | |
Constructor and setup | |
| HyperbolicSystemView (const HyperbolicSystem &hyperbolic_system) | |
Access to runtime parameters | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber | gravity () const |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber | manning_friction_coefficient () const |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber | reference_water_depth () const |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber | dry_state_relaxation_small () const |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber | dry_state_relaxation_large () const |
Special functions for boundary states | |
| template<int component> | |
| DEAL_II_HOST_DEVICE 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 > | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE 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 > | |
| DEAL_II_HOST_DEVICE state_type | expand_state (const ST &state) const |
| template<typename ST > | |
| DEAL_II_HOST_DEVICE state_type | from_initial_state (const ST &initial_state) const |
| DEAL_II_HOST_DEVICE state_type | from_primitive_state (const state_type &primitive_state) const |
| DEAL_II_HOST_DEVICE state_type | to_primitive_state (const state_type &state) const |
| template<typename Lambda > | |
| DEAL_II_HOST_DEVICE state_type | apply_galilei_transform (const state_type &state, const Lambda &lambda) const |
Typedefs and constexpr constants | |
| using | ScalarNumber = typename get_value_type< Number >::type |
| using | state_type = dealii::Tensor< 1, problem_dimension, Number > |
| using | flux_type = dealii::Tensor< 1, problem_dimension, dealii::Tensor< 1, dim, Number > > |
| using | flux_contribution_type = std::tuple< state_type, Number, dealii::Tensor< 1, dim, Number > > |
| using | precomputed_type = std::array< Number, n_precomputed_values > |
| using | initial_precomputed_type = std::array< Number, n_initial_precomputed_values > |
| template<int n_comp> | |
| using | VectorView = MultiComponentVectorView< ScalarNumber, n_comp, MemorySpace, false > |
| using | PrecomputedVectorView = VectorView< n_precomputed_values > |
| using | InitialPrecomputedVectorView = VectorView< n_initial_precomputed_values > |
| static constexpr unsigned int | problem_dimension = 1 + dim |
| static constexpr unsigned int | n_precomputed_values = 3 |
| static constexpr unsigned int | n_initial_precomputed_values = 1 |
Flux computations | |
| static constexpr bool | have_high_order_flux = true |
| DEAL_II_HOST_DEVICE flux_type | f (const state_type &U) const |
| DEAL_II_HOST_DEVICE flux_type | g (const state_type &U) const |
| DEAL_II_HOST_DEVICE state_type | star_state (const state_type &U, const dealii::Tensor< 1, dim, Number > &V, const Number &Z_left, const Number &Z_right) const |
| DEAL_II_HOST_DEVICE std::array< state_type, 2 > | equilibrated_states (const flux_contribution_type &, const flux_contribution_type &) const |
| DEAL_II_HOST_DEVICE flux_contribution_type | flux_contribution (const PrecomputedVectorView &pv, const InitialPrecomputedVectorView &piv, const unsigned int i, const state_type &U_i) const |
| DEAL_II_HOST_DEVICE flux_contribution_type | flux_contribution (const PrecomputedVectorView &pv, const InitialPrecomputedVectorView &piv, const unsigned int *js, const state_type &U_j) const |
| DEAL_II_HOST_DEVICE 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 |
| DEAL_II_HOST_DEVICE 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 |
| DEAL_II_HOST_DEVICE state_type | affine_shift (const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij, const Number &d_ij) const |
Computing stencil source terms | |
| static constexpr bool | have_source_terms = true |
| DEAL_II_HOST_DEVICE Number | manning_friction_factor (const state_type &U) const |
| DEAL_II_HOST_DEVICE state_type | manning_friction (const state_type &U, const Number &h_star, const Number &factor, const ScalarNumber tau) const |
| DEAL_II_HOST_DEVICE state_type | nodal_source (const PrecomputedVectorView &pv, const unsigned int i, const state_type &U_i, const ScalarNumber tau) const |
| DEAL_II_HOST_DEVICE state_type | nodal_source (const PrecomputedVectorView &pv, const unsigned int *js, const state_type &U_j, const ScalarNumber tau) const |
Computing derived physical quantities | |
| DEAL_II_HOST_DEVICE Number | inverse_water_depth_mollified (const state_type &U) const |
| DEAL_II_HOST_DEVICE Number | water_depth_sharp (const state_type &U) const |
| DEAL_II_HOST_DEVICE Number | inverse_water_depth_sharp (const state_type &U) const |
| DEAL_II_HOST_DEVICE Number | filter_dry_water_depth (const Number &h) const |
| DEAL_II_HOST_DEVICE Number | kinetic_energy (const state_type &U) const |
| DEAL_II_HOST_DEVICE Number | pressure (const state_type &U) const |
| DEAL_II_HOST_DEVICE Number | speed_of_sound (const state_type &U) const |
| DEAL_II_HOST_DEVICE Number | mathematical_entropy (const state_type &U) const |
| DEAL_II_HOST_DEVICE state_type | mathematical_entropy_derivative (const state_type &U) const |
| DEAL_II_HOST_DEVICE bool | is_admissible (const state_type &U) const |
| static DEAL_II_HOST_DEVICE Number | water_depth (const state_type &U) |
| static DEAL_II_HOST_DEVICE dealii::Tensor< 1, dim, Number > | momentum (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 144 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::ScalarNumber = typename get_value_type<Number>::type |
The underlying scalar number type.
Definition at line 160 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::state_type = dealii::Tensor<1, problem_dimension, Number> |
Storage type for a (conserved) state vector \(\boldsymbol U\).
Definition at line 170 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::flux_type = dealii::Tensor<1, problem_dimension, dealii::Tensor<1, dim, Number> > |
Storage type for the flux \(\mathbf{f}\).
Definition at line 175 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::flux_contribution_type = std::tuple<state_type, Number, dealii::Tensor<1, dim, Number> > |
The storage type used for flux contributions: the state, the bathymetry, and the regularized velocity.
Definition at line 182 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::precomputed_type = std::array<Number, n_precomputed_values> |
Array type used for precomputed values.
Definition at line 193 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::initial_precomputed_type = std::array<Number, n_initial_precomputed_values> |
Array type used for precomputed initial values.
Definition at line 203 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::VectorView = MultiComponentVectorView<ScalarNumber, n_comp, MemorySpace, false> |
Definition at line 207 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::PrecomputedVectorView = VectorView<n_precomputed_values> |
MulticomponentVectorView for accessing a vector of precomputed states:
Definition at line 214 of file hyperbolic_system.h.
| using ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::InitialPrecomputedVectorView = VectorView<n_initial_precomputed_values> |
MulticomponentVectorView for accessing a vector of precomputed initial states:
Definition at line 220 of file hyperbolic_system.h.
|
inline |
Constructor taking a reference to the underlying HyperbolicSystem
Definition at line 233 of file hyperbolic_system.h.
|
inline |
Definition at line 245 of file hyperbolic_system.h.
References ryujin::ShallowWater::HyperbolicSystem::Parameters::gravity.
|
inline |
Definition at line 251 of file hyperbolic_system.h.
References ryujin::ShallowWater::HyperbolicSystem::Parameters::manning_friction_coefficient.
|
inline |
Definition at line 257 of file hyperbolic_system.h.
References ryujin::ShallowWater::HyperbolicSystem::Parameters::reference_water_depth.
|
inline |
Definition at line 263 of file hyperbolic_system.h.
References ryujin::ShallowWater::HyperbolicSystem::Parameters::dry_state_relaxation_small.
|
inline |
Definition at line 269 of file hyperbolic_system.h.
References ryujin::ShallowWater::HyperbolicSystem::Parameters::dry_state_relaxation_large.
|
static |
For a given (1+dim dimensional) state vector U, return the water depth U[0]
Definition at line 737 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::inverse_water_depth_mollified | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, return a regularized inverse of the water depth. This function returns 2h / (h^2+max(h, h_cutoff)^2), where h_cutoff is the reference water depth multiplied by eps.
Definition at line 746 of file hyperbolic_system.h.
References ryujin::positive_part().
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::water_depth_sharp | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, return the regularized water depth U[0] This function returns max(h, h_cutoff), where h_cutoff is the reference water depth multiplied by eps.
Definition at line 764 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::inverse_water_depth_sharp | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, return a regularized inverse of the water depth. This function returns 1 / max(h, h_cutoff), where h_cutoff is the reference water depth multiplied by eps.
Definition at line 780 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::filter_dry_water_depth | ( | const Number & | h | ) | const |
Given a water depth h this function returns 0 if h is in the interval [-relaxation * h_cutoff, relaxation * h_cutoff], otherwise h is returned unmodified. Here, h_cutoff is the reference water depth multiplied by eps.
Definition at line 789 of file hyperbolic_system.h.
|
static |
For a given (1+dim dimensional) state vector U, return the momentum vector [U[1], ..., U[1+dim]].
Definition at line 805 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::kinetic_energy | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, compute and return the kinetic energy.
\[ KE = 1/2 |m|^2 / h \]
Definition at line 818 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::pressure | ( | const state_type & | U | ) | const |
For a given (state dimensional) state vector U, compute and return the hydrostatic pressure \(p\):
\[ p = 1/2 g h^2 \]
Definition at line 831 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::speed_of_sound | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, compute the (physical) speed of sound:
\[ c^2 = g * h \]
Definition at line 843 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::mathematical_entropy | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, compute and return the entropy \(\eta = 1/2 g h^2 + 1/2 |m|^2 / h\).
Definition at line 853 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::mathematical_entropy_derivative | ( | const state_type & | U | ) | const |
For a given (1+dim dimensional) state vector U, compute and return the derivative \(\eta'\) of the entropy defined above.
Definition at line 864 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE bool ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::is_admissible | ( | const state_type & | U | ) | const |
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 897 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE state_type ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::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.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::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.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::f | ( | const state_type & | U | ) | const |
Given a state U compute the flux
\[ \begin{pmatrix} \textbf m \\ \textbf v\otimes \textbf m + p\mathbb{I}_d \\ \end{pmatrix}, \]
Definition at line 1056 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::g | ( | const state_type & | U | ) | const |
Given a state U compute the flux
\[ \begin{pmatrix} \textbf m \\ \textbf v\otimes \textbf m \\ \end{pmatrix}, \]
Definition at line 1076 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::star_state | ( | const state_type & | U, |
| const dealii::Tensor< 1, dim, Number > & | V, | ||
| const Number & | Z_left, | ||
| const Number & | Z_right | ||
| ) | const |
For a given (1+dim dimensional) state vector U with regularized velocity V and left/right topography states Z_left and Z_right, return the star_state U_star
Definition at line 1094 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::equilibrated_states | ( | const flux_contribution_type & | flux_i, |
| const flux_contribution_type & | flux_j | ||
| ) | const |
Given precomputed flux contributions prec_i and prec_j compute the equilibrated states \(U_i^{\ast,j}\) and \(U_j^{\ast,i}\).
Definition at line 1114 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::flux_contribution | ( | const PrecomputedVectorView & | pv, |
| const InitialPrecomputedVectorView & | piv, | ||
| const unsigned int | i, | ||
| const state_type & | U_i | ||
| ) | const |
Given a state U_i and an index i compute flux contributions.
Intended usage:
For the Shallow water equations we retrieve the bathymetry and return the state, the bathymetry, and the regularized velocity.
Definition at line 1130 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::flux_contribution | ( | const PrecomputedVectorView & | pv, |
| const InitialPrecomputedVectorView & | piv, | ||
| const unsigned int * | js, | ||
| const state_type & | U_j | ||
| ) | const |
Definition at line 1144 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::flux_divergence | ( | const flux_contribution_type & | flux_i, |
| const flux_contribution_type & | flux_j, | ||
| const dealii::Tensor< 1, dim, Number > & | c_ij | ||
| ) | const |
Given precomputed flux contributions prec_i and prec_j compute the equilibrated, low-order flux \((f(U_i^{\ast,j}) +
f(U_j^{\ast,i})\)
Definition at line 1158 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::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 |
Given precomputed flux contributions prec_i and prec_j compute the high-order flux \((f(U_i^{\ast,j}) +
f(U_j^{\ast,i})\)
Definition at line 1190 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::affine_shift | ( | const flux_contribution_type & | flux_i, |
| const flux_contribution_type & | flux_j, | ||
| const dealii::Tensor< 1, dim, Number > & | c_ij, | ||
| const Number & | d_ij | ||
| ) | const |
Given precomputed flux contributions prec_i and prec_j compute the equilibrated, low-order affine shift \( B_{ij} = -2d_ij(U^{\ast,j}_i)-2f((U^{\ast,j}_i))c_ij\).
Definition at line 1213 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::manning_friction_factor | ( | const state_type & | U | ) | const |
For a given state U return the factor \(2 g n^2 |\mathbf V|\) of the Gauckler-Manning friction.
Definition at line 1231 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::manning_friction | ( | const state_type & | U, |
| const Number & | h_star, | ||
| const Number & | factor, | ||
| const ScalarNumber | tau | ||
| ) | const |
A regularized Gauckler-Manning friction coefficient.
FIXME: details
Definition at line 1245 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::nodal_source | ( | const PrecomputedVectorView & | pv, |
| const unsigned int | i, | ||
| const state_type & | U_i, | ||
| const ScalarNumber | tau | ||
| ) | const |
Definition at line 1267 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::nodal_source | ( | const PrecomputedVectorView & | pv, |
| const unsigned int * | js, | ||
| const state_type & | U_j, | ||
| const ScalarNumber | tau | ||
| ) | const |
Definition at line 1282 of file hyperbolic_system.h.
| DEAL_II_HOST_DEVICE state_type ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::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.
| DEAL_II_HOST_DEVICE state_type ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::from_initial_state | ( | const ST & | initial_state | ) | const |
Given an initial state [h, u_1, ..., u_d] return a conserved state [h, m_1, ..., m_d].
This function simply calls from_primitive_state() and expand_state().
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::from_primitive_state | ( | const state_type & | primitive_state | ) | const |
Given a primitive state [h, u_1, ..., u_d] return a conserved state
Definition at line 1330 of file hyperbolic_system.h.
References ryujin::state.
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::to_primitive_state | ( | const state_type & | state | ) | const |
Given a conserved state return a primitive state [h, u_1, ..., u_d]
Definition at line 1346 of file hyperbolic_system.h.
References ryujin::state.
| DEAL_II_HOST_DEVICE state_type ryujin::ShallowWater::HyperbolicSystemView< dim, Number, MemorySpace >::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.
|
staticconstexpr |
The dimension of the state space.
Definition at line 165 of file hyperbolic_system.h.
|
staticconstexpr |
The number of precomputed values.
Definition at line 188 of file hyperbolic_system.h.
|
staticconstexpr |
The number of precomputed initial values.
Definition at line 198 of file hyperbolic_system.h.
|
staticconstexpr |
The low-order and high-order fluxes differ:
Definition at line 499 of file hyperbolic_system.h.
|
staticconstexpr |
We do have source terms
Definition at line 530 of file hyperbolic_system.h.