8#include <compile_time_options.h>
15 namespace EulerInitialStates
27 template <
typename Description,
int dim,
typename Number>
37 const std::string subsection)
40 , hyperbolic_system_(hyperbolic_system)
43 if constexpr (!View::have_gamma) {
44 this->add_parameter(
"gamma", gamma_,
"The ratio of specific heats");
49 "mach number", mach_number_,
"Mach number of isentropic vortex");
52 this->add_parameter(
"beta", beta_,
"vortex strength beta");
57 const auto view = hyperbolic_system_.template view<dim, Number>();
59 if constexpr (View::have_gamma) {
60 gamma_ = view.gamma();
64 dealii::Point<2> point_bar;
65 point_bar[0] = point[0] - mach_number_ * t;
66 point_bar[1] = point[1];
68 const Number r_square = Number(point_bar.norm_square());
70 const Number factor = beta_ / Number(2. * M_PI) *
71 exp(Number(0.5) - Number(0.5) * r_square);
73 const Number T = Number(1.) - (gamma_ - Number(1.)) /
74 (Number(2.) * gamma_) * factor *
77 const Number u = mach_number_ - factor * Number(point_bar[1]);
78 const Number v = factor * Number(point_bar[0]);
80 const Number rho =
ryujin::pow(T, Number(1.) / (Number(gamma_ - 1.)));
83 p / (gamma_ - Number(1.)) + Number(0.5) * rho * (u * u + v * v);
85 if constexpr (dim == 2)
87 else if constexpr (dim == 3)
88 return state_type({rho, rho * u, rho * v, Number(0.), E});
90 AssertThrow(
false, dealii::ExcNotImplemented());
IsentropicVortex(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
typename View::state_type state_type
typename Description::HyperbolicSystem HyperbolicSystem
state_type compute(const dealii::Point< dim > &point, Number t) final
typename Description::template HyperbolicSystemView< dim, Number > View
T pow(const T x, const T b)
Euler::HyperbolicSystem HyperbolicSystem