Logbook  (07-04-2025)
Static problems
exact_solution.cpp
1 /******************************************************************************
2  * Copyright (C) Siarhei Uzunbajakau, 2023.
3  *
4  * This program is free software. You can use, modify, and redistribute it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation, either version 3 or (at your option) any later version.
7  * This program is distributed without any warranty.
8  *
9  * Refer to COPYING.LESSER for more details.
10  ******************************************************************************/
11 
12 #include "exact_solution.hpp"
13 #include <cmath>
14 
15 #pragma GCC diagnostic push
16 #pragma GCC diagnostic ignored "-Wunused-parameter"
17 
18 using namespace dealii;
19 using namespace std;
20 
21 template<>
23 {
24  alpha = 1.0 / (ep_1 * log(b / d_2) + ep_2 * log(d_1 / a));
25  beta = (ep_1 / ep_2) * log(b / d_2);
26  phi_d = alpha * ep_1 * log(b / d_2);
27 }
28 
29 template<>
30 double
31 ExactSolutionFLCAXI_PHI<true>::value(const Point<2>& p,
32  const unsigned int component) const
33 {
34  Point<2> r;
35  r[0] = p[0];
36  r[1] = 0.0;
37 
38  if (r.norm() < d_1)
39  return (-alpha * ep_2 * (log(r.norm() / d_1) - beta));
40 
41  if (r.norm() > d_2)
42  return (-alpha * ep_1 * (log(r.norm() / b)));
43 
44  return phi_d;
45 }
46 
47 template<>
48 Tensor<1, 2>
50  const unsigned int component) const
51 {
52  Point<2> r;
53  r[0] = p[0];
54  r[1] = 0.0;
55 
56  if (r.norm() < d_1)
57  return -alpha * ep_2 * (1 / r.square()) * r;
58 
59  if (r.norm() > d_2)
60  return -alpha * ep_1 * (1 / r.square()) * r;
61 
62  return Point<2>();
63 }
64 
65 template<>
67 {
68  alpha = 1.0 / (ep_1 * (1.0 / b - 1.0 / d_2) + ep_2 * (1.0 / d_1 - 1.0 / a));
69  beta = 1.0 / d_1 + (ep_1 / ep_2) * (1.0 / b - 1.0 / d_2);
70  phi_d = alpha * ep_1 * (1.0 / b - 1.0 / d_2);
71 }
72 
73 template<>
74 double
76  const unsigned int component) const
77 {
78  Point<2> r;
79  r[0] = p[0];
80  r[1] = p[1];
81 
82  if (r.norm() < d_1)
83  return (-alpha * ep_2 * (1.0 / r.norm() - beta));
84 
85  if (r.norm() > d_2)
86  return (-alpha * ep_1 * (1.0 / r.norm() - 1.0 / b));
87 
88  return phi_d;
89 }
90 
91 template<>
92 Tensor<1, 2>
94  const unsigned int component) const
95 {
96  Point<2> r;
97  r[0] = p[0];
98  r[1] = p[1];
99 
100  if (r.norm() < d_1)
101  return alpha * ep_2 * r / pow(r.norm(), 3);
102 
103  if (r.norm() > d_2)
104  return alpha * ep_1 * r / pow(r.norm(), 3);
105 
106  return Point<2>();
107 }
108 
109 #pragma GCC diagnostic pop
Describes the exact solution, , of the Axisymmetric - floating conductor (flc-axi/) numerical experim...