32 const std::string subsection)
33 :
InitialState<Description, dim, Number>(
"three bumps dam break",
35 , hyperbolic_system_(hyperbolic_system)
37 well_balancing_validation =
false;
39 "well balancing validation",
40 well_balancing_validation,
41 "If set to true then the initial profile is returned for all "
43 "(t>0); otherwise a constant inflow is computed for t>0 suitable "
44 "for prescribing Dirichlet conditions at the inflow boundary.");
48 this->add_parameter(
"left water depth",
50 "Depth of water to the left of pseudo-dam");
52 this->add_parameter(
"right water depth",
54 "Depth of water to the right of pseudo-dam");
57 this->add_parameter(
"cone magnitude",
59 "To modify magnitude of cone heights");
64 const auto view = hyperbolic_system_.template view<dim, Number>();
66 const Number x = point[0];
70 if (t <= 1.e-10 || well_balancing_validation) {
71 Number h = x < 16. ? left_depth : right_depth;
72 h = std::max(h - compute_bathymetry(point), Number(0.));
78 const auto &h = left_depth;
79 const auto a = view.speed_of_sound(
state_type{{h, Number(0.)}});
85 initial_precomputed_type
final
88 return {compute_bathymetry(point)};
94 DEAL_II_ALWAYS_INLINE
inline Number
95 compute_bathymetry(
const dealii::Point<dim> &point)
const
97 if constexpr (dim == 1) {
99 const Number &x = point[0];
101 Number z3 = 3. - 3. / 10. * std::sqrt(std::pow(x - 47.5, 2));
102 return cone_magnitude * std::max({z3, Number(0.)});
105 const Number &x = point[0];
106 const Number &y = point[1];
110 1. / 8. * std::sqrt(std::pow(x - 30., 2) + std::pow(y - 6., 2));
114 1. / 8. * std::sqrt(std::pow(x - 30., 2) + std::pow(y - 24., 2));
118 3. / 10. * std::sqrt(std::pow(x - 47.5, 2) + std::pow(y - 15., 2));
120 return cone_magnitude * std::max({z1, z2, z3, Number(0.)});
123 bool well_balancing_validation;
126 Number cone_magnitude;