12 namespace EulerInitialStates
25 template <
typename Description,
int dim,
typename Number>
35 const std::string &subsection)
37 , hyperbolic_system_(hyperbolic_system)
40 if constexpr (!View::have_gamma) {
41 this->add_parameter(
"gamma", gamma_,
"The ratio of specific heats");
46 "reference density", rho0_,
"The reference density");
53 this->add_parameter(
"reference velocity magnitude",
55 "The reference velocity magnitude");
60 "reference pressure", p0_,
"The reference pressure");
62 this->parse_parameters_call_back.connect([&]() {
63 if constexpr (View::have_gamma) {
64 const auto view = hyperbolic_system_.template view<dim, Number>();
65 gamma_ = view.gamma();
71 auto compute(
const dealii::Point<dim> &point, Number t)
74 const auto view = hyperbolic_system_.template view<dim, Number>();
76 const auto norm = point.norm();
77 const auto min = 10. * std::numeric_limits<Number>::min();
81 auto vel = -u0_ * point / (norm +
min);
85 const auto D = u0_ * (gamma_ - 1.) / 2.;
86 const bool in_interior = t == Number(0.) ? false : norm / t < D;
89 rho = rho0_ *
std::pow((gamma_ + 1.) / (gamma_ - 1.), dim);
91 p = 0.5 * rho0_ * u0_ * u0_;
94 rho = rho0_ *
std::pow(1. + t / (norm +
min), dim - 1);
98 if constexpr (dim == 1)
99 return view.from_initial_state(
state_type{{rho, Number(vel[0]), p}});
100 else if constexpr (dim == 2)
101 return view.from_initial_state(
102 state_type{{rho, Number(vel[0]), Number(vel[1]), p}});
104 return view.from_initial_state(state_type{
105 {rho, Number(vel[0]), Number(vel[1]), Number(vel[2]), p}});
Noh(const HyperbolicSystem &hyperbolic_system, const std::string &subsection)
typename View::state_type state_type
typename Description::template HyperbolicSystemView< dim, Number > View
auto compute(const dealii::Point< dim > &point, Number t) -> state_type final
typename Description::HyperbolicSystem HyperbolicSystem
T pow(const T x, const T b)
Euler::HyperbolicSystem HyperbolicSystem
Euler::HyperbolicSystem HyperbolicSystem