10#include <compile_time_options.h>
16 namespace ShallowWaterInitialStates
24 template <
typename Description,
int dim,
typename Number>
34 const std::string subsection)
37 , hyperbolic_system_(hyperbolic_system)
39 dealii::ParameterAcceptor::parse_parameters_call_back.connect(
43 this->add_parameter(
"time initial",
45 "Time at which initial state is prescribed");
48 this->add_parameter(
"left water depth",
50 "Depth of water to the left of pseudo-dam (x<0)");
55 AssertThrow(t_initial_ > 0.,
56 dealii::ExcMessage(
"Expansion must be computed at an "
57 "initial time greater than 0."));
62 const auto view = hyperbolic_system_.template view<dim, Number>();
63 const auto g = view.gravity();
65 const auto x = point[0];
67 const Number aL = std::sqrt(g * left_depth);
68 const Number xA = -(t + t_initial_) * aL;
69 const Number xB = Number(2.) * (t + t_initial_) * aL;
71 const Number tmp = aL - x / (2. * (t + t_initial_));
73 const Number h_expansion = 4. / (9. * g) * tmp * tmp;
74 const Number v_expansion = 2. / 3. * (x / (t + t_initial_) + aL);
79 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