10#include <compile_time_options.h>
16 namespace ShallowWaterInitialStates
26 template <
typename Description,
int dim,
typename Number>
36 const std::string subsection)
38 , hyperbolic_system_(hyperbolic_system)
40 with_bathymetry =
false;
41 this->add_parameter(
"with bathymetry",
43 "If set to true then the initial profile includes "
44 "the bathymetry for the steady vortex. ");
47 this->add_parameter(
"reference depth", depth_,
"Reference water depth");
51 "mach number", mach_number_,
"Mach number of unsteady vortex");
54 this->add_parameter(
"beta", beta_,
"vortex strength beta");
59 const auto view = hyperbolic_system_.template view<dim, Number>();
60 const auto gravity = view.gravity();
62 dealii::Point<2> point_bar;
63 point_bar[0] = point[0] - mach_number_ * t;
64 point_bar[1] = point[1];
66 const Number r_square = Number(point_bar.norm_square());
70 beta_ / Number(2. * M_PI) *
71 exp(Number(0.5) - Number(0.5) * r_square );
74 depth_ - Number(1. / (2. * gravity )) * factor * factor;
77 h -= compute_bathymetry(point);
79 const Number u = mach_number_ - factor * Number(point_bar[1]);
80 const Number v = factor * Number(point_bar[0]);
82 if constexpr (dim == 2)
86 AssertThrow(
false, dealii::ExcNotImplemented());
93 initial_precomputed_type
final
96 return {compute_bathymetry(point)};
102 DEAL_II_ALWAYS_INLINE
inline Number
103 compute_bathymetry(
const dealii::Point<dim> &point)
const
105 const Number r_square = Number(point.norm_square());
108 const Number factor =
109 beta_ / Number(2. * M_PI) *
110 exp(Number(0.5) - Number(0.5) * r_square );
114 bath = depth_ / 4. * factor;
119 bool with_bathymetry;
typename Description::HyperbolicSystem HyperbolicSystem
auto initial_precomputations(const dealii::Point< dim > &point) -> typename InitialState< Description, dim, Number >::initial_precomputed_type final
typename Description::template HyperbolicSystemView< dim, Number > View
state_type compute(const dealii::Point< dim > &point, Number t) final
typename View::state_type state_type
SmoothVortex(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
Euler::HyperbolicSystem HyperbolicSystem