ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
initial_state_circular_dam_break.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0
3// [LANL Copyright Statement]
4// Copyright (C) 2022 - 2024 by the ryujin authors
5// Copyright (C) 2023 - 2024 by Triad National Security, LLC
6//
7
8#pragma once
9
10#include "hyperbolic_system.h"
12
13namespace ryujin
14{
15 namespace ShallowWater
16 {
17 struct Description;
18
24 template <int dim, typename Number>
25 class CircularDamBreak : public InitialState<Description, dim, Number>
26 {
27 public:
29 using state_type = typename View::state_type;
30
31 CircularDamBreak(const HyperbolicSystem &hyperbolic_system,
32 const std::string sub)
33 : InitialState<Description, dim, Number>("circular dam break", sub)
34 , hyperbolic_system(hyperbolic_system)
35 {
36 still_water_depth_ = 0.5;
37 this->add_parameter("still water depth",
38 still_water_depth_,
39 "Depth of still water outside circular dam");
40 radius_ = 2.5;
41 this->add_parameter("radius", radius_, "Radius of circular dam ");
42
43 dam_amplitude_ = 2.5;
44 this->add_parameter(
45 "dam amplitude", dam_amplitude_, "Amplitude of circular dam");
46 }
47
48 state_type compute(const dealii::Point<dim> &point, Number /*t*/) final
49 {
50 const Number r = point.norm_square();
51 const Number h = (r <= radius_ ? dam_amplitude_ : still_water_depth_);
52
53 return state_type{{h, 0.}};
54 }
55
56 /* Default bathymetry of 0 */
57
58 private:
59 const HyperbolicSystem &hyperbolic_system;
60
61 Number still_water_depth_;
62 Number radius_;
63 Number dam_amplitude_;
64 };
65
66 } // namespace ShallowWater
67} // namespace ryujin
CircularDamBreak(const HyperbolicSystem &hyperbolic_system, const std::string sub)
state_type compute(const dealii::Point< dim > &point, Number) final
dealii::Tensor< 1, problem_dimension, Number > state_type
Euler::Description Description