1#ifndef TATOOINE_ANALYTICAL_NUMERICAL_CYLINDER_FLOW_H
2#define TATOOINE_ANALYTICAL_NUMERICAL_CYLINDER_FLOW_H
8template <
typename Real>
28 auto const xn = x - eps;
29 auto const xp = x + eps;
30 auto const yn = y - eps;
31 auto const yp = y + eps;
33 auto const b_xn = std::sqrt(xn * xn + y * y) - 1;
34 auto const b_xp = std::sqrt(xp * xp + y * y) - 1;
35 auto const b_yn = std::sqrt(x * x + yn * yn) - 1;
36 auto const b_yp = std::sqrt(x * x + yp * yp) - 1;
38 auto const f_xn = 1 - std::exp(-
a * b_xn * b_xn);
39 auto const f_xp = 1 - std::exp(-
a * b_xp * b_xp);
40 auto const f_yn = 1 - std::exp(-
a * b_yn * b_yn);
41 auto const f_yp = 1 - std::exp(-
a * b_yp * b_yp);
43 auto const h1 = std::abs(std::sin(M_PI * t /
Tc));
44 auto const h2 = std::abs(std::sin(M_PI * (t -
Tc / 2) /
Tc));
46 auto const x1 = 1 +
L * ((t /
Tc) % 1);
47 auto const x2 = 1 +
L * (((t -
Tc / 2) /
Tc) % 1);
48 auto const g1 = std::exp(
50 auto const g2 = std::exp(
54 1 - std::exp(-(xn - 1) * (xn - 1) / (
alpha *
alpha - y * y));
56 1 - std::exp(-(xp - 1) * (xp - 1) / (
alpha *
alpha - y * y));
58 1 - std::exp(-(x - 1) * (x - 1) / (
alpha *
alpha - yn * yn));
60 1 - std::exp(-(x - 1) * (x - 1) / (
alpha *
alpha - yp * yp));
62 auto const g_xn = -w * h1 * g1 + w * h2 * h2 * g2 + u0 * y * s_xn;
63 auto const g_xp = -w * h1 * g1 + w * h2 * h2 * g2 + u0 * y * s_xp;
64 auto const g_yn = -w * h1 * g1 + w * h2 * h2 * g2 + u0 * yn * s_yn;
65 auto const g_yp = -w * h1 * g1 + w * h2 * h2 * g2 + u0 * yp * s_yp;
66 auto const psi_xn = f_xn * g_xn;
67 auto const psi_xp = f_xp * g_xp;
68 auto const psi_yn = f_yn * g_yn;
69 auto const psi_yp = f_yp * g_yp;
72 -(psi_xp - psi_xn) / (2 * eps)};
76 if (sqr_length(x) <= 1) {
return false; }
Definition: cylinder_flow.h:6
Real real_type
Definition: field.h:17
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
Definition: cylinder_flow.h:9
real_type a
Definition: cylinder_flow.h:17
auto in_domain(pos_type const &x, real_type t) const -> bool
Definition: cylinder_flow.h:75
real_type R0
Definition: cylinder_flow.h:20
real_type L
Definition: cylinder_flow.h:19
auto evaluate(pos_type const &p, real_type t) const -> tensor_type
Definition: cylinder_flow.h:24
real_type alpha
Definition: cylinder_flow.h:22
real_type y0
Definition: cylinder_flow.h:21
real_type Tc
Definition: cylinder_flow.h:18