14 namespace ShallowWaterInitialStates
21 template <
typename Description,
int dim,
typename Number>
31 const std::string subsection)
33 , hyperbolic_system_(hyperbolic_system)
37 "still water depth", depth_,
"Depth of still water");
40 this->add_parameter(
"amplitude", amplitude_,
"Amplitude of soliton");
45 const auto view = hyperbolic_system_.template view<dim, Number>();
46 const Number g = view.gravity();
48 const auto &x = point[0];
50 const Number celerity = std::sqrt(g * (amplitude_ + depth_));
51 const Number width = std::sqrt(
52 3. * amplitude_ / (4. * depth_ * depth_ * (amplitude_ + depth_)));
53 const Number sechSqd =
54 1. /
std::pow(cosh(width * (x - celerity * t)), 2);
57 const Number profile = depth_ + amplitude_ * sechSqd;
58 const Number h = std::max(profile, Number(0.));
60 const Number v = celerity * (profile - depth_) / profile;
typename View::state_type state_type
state_type compute(const dealii::Point< dim > &point, Number t) final
typename Description::template HyperbolicSystemView< dim, Number > View
Soliton(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
typename Description::HyperbolicSystem HyperbolicSystem
T pow(const T x, const T b)
Euler::HyperbolicSystem HyperbolicSystem