13 namespace EulerInitialStates
27 template <
typename Description,
int dim,
typename Number>
39 const std::string subsection)
41 , hyperbolic_system_(hyperbolic_system)
52 using state_type_1d = std::array<Number, 3>;
53 constexpr state_type_1d primitive_left{1., 0., Number(2. / 3. * 1.e-1)};
54 constexpr state_type_1d primitive_right{
55 1.e-3, 0., Number(2. / 3. * 1.e-10)};
58 constexpr Number rarefaction_speed = 0.49578489518897934;
59 constexpr Number contact_velocity = 0.62183867139173454;
60 constexpr Number right_shock_speed = 0.82911836253346982;
66 constexpr Number pre_contact_density = 5.4079335349316249e-02;
67 constexpr Number post_contact_density = 3.9999980604299963e-03;
68 constexpr Number contact_pressure = 0.51557792765096996e-03;
70 state_type_1d primitive_state;
71 const double &x = point[0];
73 if (x <= -1.0 / 3.0 * t) {
75 primitive_state = primitive_left;
77 }
else if (x < rarefaction_speed * t) {
79 const double chi = x / t;
80 primitive_state[0] =
std::pow(0.75 - 0.75 * chi, 3.0);
81 primitive_state[1] = 0.75 * (1.0 / 3.0 + chi);
82 primitive_state[2] = (1.0 / 15.0) *
std::pow(0.75 - 0.75 * chi, 5.0);
84 }
else if (x < contact_velocity * t) {
85 primitive_state[0] = pre_contact_density;
86 primitive_state[1] = contact_velocity;
87 primitive_state[2] = contact_pressure;
89 }
else if (x < right_shock_speed * t) {
91 primitive_state[0] = post_contact_density;
92 primitive_state[1] = contact_velocity;
93 primitive_state[2] = contact_pressure;
97 primitive_state = primitive_right;
102 const auto &[rho, u, p] = primitive_state;
103 conserved_state[0] = rho;
104 conserved_state[1] = rho * u;
105 conserved_state[dim + 1] =
109 return conserved_state;
typename Description::template HyperbolicSystemView< dim, Number > View
LeBlanc(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
typename View::state_type state_type
typename View::ScalarNumber ScalarNumber
typename Description::HyperbolicSystem HyperbolicSystem
state_type compute(const dealii::Point< dim > &point, Number t) final
T pow(const T x, const T b)
Euler::HyperbolicSystem HyperbolicSystem