13 namespace EulerInitialStates
25 template <
typename Description,
int dim,
typename Number>
35 const std::string subsection)
38 , hyperbolic_system_(hyperbolic_system)
41 if constexpr (!View::have_gamma) {
42 this->add_parameter(
"gamma", gamma_,
"The ratio of specific heats");
47 "mach number", mach_number_,
"Mach number of isentropic vortex");
50 this->add_parameter(
"beta", beta_,
"vortex strength beta");
55 const auto view = hyperbolic_system_.template view<dim, Number>();
57 if constexpr (View::have_gamma) {
58 gamma_ = view.gamma();
62 dealii::Point<2> point_bar;
63 point_bar[0] = point[0] - mach_number_ * t;
64 point_bar[1] = point[1];
66 const Number r_square = Number(point_bar.norm_square());
68 const Number factor = beta_ / Number(2. * M_PI) *
69 exp(Number(0.5) - Number(0.5) * r_square);
71 const Number T = Number(1.) - (gamma_ - Number(1.)) /
72 (Number(2.) * gamma_) * factor *
75 const Number u = mach_number_ - factor * Number(point_bar[1]);
76 const Number v = factor * Number(point_bar[0]);
78 const Number rho =
ryujin::pow(T, Number(1.) / (Number(gamma_ - 1.)));
81 p / (gamma_ - Number(1.)) + Number(0.5) * rho * (u * u + v * v);
83 if constexpr (dim == 2)
85 else if constexpr (dim == 3)
86 return state_type({rho, rho * u, rho * v, Number(0.), E});
88 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