ryujin 2.1.1 revision 9dcb748690310d6a540ebb8b066d1a0834fc7604
initial_state_circular_dam_break.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: MIT
3// Copyright (C) 2020 - 2023 by the ryujin authors
4//
5
6#pragma once
7
8#include "hyperbolic_system.h"
9#include <initial_state.h>
10
11namespace ryujin
12{
13 namespace ShallowWater
14 {
20 template <int dim, typename Number, typename state_type>
21 class CircularDamBreak : public InitialState<dim, Number, state_type, 1>
22 {
23 public:
24 CircularDamBreak(const HyperbolicSystem &hyperbolic_system,
25 const std::string sub)
26 : InitialState<dim, Number, state_type, 1>("circular dam break", sub)
27 , hyperbolic_system(hyperbolic_system)
28 {
29 still_water_depth_ = 0.5;
30 this->add_parameter("still water depth",
31 still_water_depth_,
32 "Depth of still water outside circular dam");
33 radius_ = 2.5;
34 this->add_parameter("radius", radius_, "Radius of circular dam ");
35
36 dam_amplitude_ = 2.5;
37 this->add_parameter(
38 "dam amplitude", dam_amplitude_, "Amplitude of circular dam");
39 }
40
41 state_type compute(const dealii::Point<dim> &point, Number /*t*/) final
42 {
43 const Number r = point.norm_square();
44 const Number h = (r <= radius_ ? dam_amplitude_ : still_water_depth_);
45
46 return hyperbolic_system.template expand_state<dim>(
48 }
49
50 /* Default bathymetry of 0 */
51
52 private:
53 const HyperbolicSystem &hyperbolic_system;
54
55 Number still_water_depth_;
56 Number radius_;
57 Number dam_amplitude_;
58 };
59
60 } // namespace ShallowWater
61} // namespace ryujin
typename HyperbolicSystemView::state_type state_type
CircularDamBreak(const HyperbolicSystem &hyperbolic_system, const std::string sub)
state_type compute(const dealii::Point< dim > &point, Number) final
dealii::Tensor< 1, problem_dimension< dim >, Number > state_type