14 namespace ShallowWaterInitialStates
22 template <
typename Description,
int dim,
typename Number>
32 const std::string subsection)
35 , hyperbolic_system_(hyperbolic_system)
37 dealii::ParameterAcceptor::parse_parameters_call_back.connect(
41 this->add_parameter(
"time initial",
43 "Time at which initial state is prescribed");
46 this->add_parameter(
"left water depth",
48 "Depth of water to the left of pseudo-dam (x<0)");
53 AssertThrow(t_initial_ > 0.,
54 dealii::ExcMessage(
"Expansion must be computed at an "
55 "initial time greater than 0."));
60 const auto view = hyperbolic_system_.template view<dim, Number>();
61 const auto g = view.gravity();
63 const auto x = point[0];
65 const Number aL = std::sqrt(g * left_depth);
66 const Number xA = -(t + t_initial_) * aL;
67 const Number xB = Number(2.) * (t + t_initial_) * aL;
69 const Number tmp = aL - x / (2. * (t + t_initial_));
71 const Number h_expansion = 4. / (9. * g) * tmp * tmp;
72 const Number v_expansion = 2. / 3. * (x / (t + t_initial_) + aL);
77 return state_type{{h_expansion, h_expansion * v_expansion}};
typename Description::template HyperbolicSystemView< dim, Number > View
state_type compute(const dealii::Point< dim > &point, Number t) final
typename View::state_type state_type
void parse_parameters_callback()
typename Description::HyperbolicSystem HyperbolicSystem
RitterDamBreak(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
Euler::HyperbolicSystem HyperbolicSystem