37 const std::string subsection)
39 , hyperbolic_system_(hyperbolic_system)
42 if constexpr (!View::have_gamma) {
43 this->add_parameter(
"gamma", gamma_,
"The ratio of specific heats");
46 primitive_right_[0] = 1.4;
47 primitive_right_[1] = 0.0;
48 primitive_right_[2] = 1.;
52 "1d primitive state [rho, u, p] (for the Noble-Abel gas EOS) "
53 "before the shock (to the right)");
59 "Mach number of shock front (S1, S3 = mach * a_L/R)");
61 const auto compute_and_convert_states = [&]() {
62 const auto view = hyperbolic_system_.template view<dim, Number>();
64 if constexpr (View::have_gamma) {
65 gamma_ = view.gamma();
71 if constexpr (View::have_covolume_constant)
72 b = view.eos_covolume_constant();
74 const auto &rho_R = primitive_right_[0];
75 const auto &u_R = primitive_right_[1];
76 const auto &p_R = primitive_right_[2];
78 const Number a_R = std::sqrt(gamma_ * p_R / rho_R / (1 - b * rho_R));
79 const Number mach_R = u_R / a_R;
81 S3_ = mach_number_ * a_R;
82 const Number delta_mach = mach_R - mach_number_;
85 rho_R * (gamma_ + Number(1.)) * delta_mach * delta_mach /
86 ((gamma_ - Number(1.)) * delta_mach * delta_mach + Number(2.));
88 (Number(1.) - rho_R / rho_L) * S3_ + rho_R / rho_L * u_R;
89 const Number p_L = p_R *
90 (Number(2.) * gamma_ * delta_mach * delta_mach -
91 (gamma_ - Number(1.))) /
92 (gamma_ + Number(1.));
97 if constexpr (View::have_energy_equation) {
99 view.from_initial_state(state_type_1d{{rho_L, u_L, p_L}});
101 view.from_initial_state(state_type_1d{{rho_R, u_R, p_R}});
103 state_left_ = view.from_initial_state(state_type_1d{{rho_L, u_L}});
104 state_right_ = view.from_initial_state(state_type_1d{{rho_R, u_R}});
108 this->parse_parameters_call_back.connect(compute_and_convert_states);
109 compute_and_convert_states();