Logbook  (07-04-2025)
Static problems
1.1.11 Axisymmetric - surface charge (sch-axi/)

Classes:

1) BatchSCHAXI
2) SolverSCHAXI
3) ExactSolutionSCHAXI_PHI
4) SettingsSCHAXI

Files:

1) sch-axi/src/main.cpp
2) sch-axi/include/solver.hpp
3) sch-axi/src/solver.cpp
4) sch-axi/include/exact_solution.hpp
5) sch-axi/src/exact_solution.cpp
6) sch-axi/src/static_scalar_input.cpp
7) sch-axi/include/settings.hpp

List of all shared classes


Introduction

In the preceding numerical experiments that deal with axisymmetric problems the surface free-charge density, \(\kappa_f\), was set to zero. In this numerical experiment we will test if the StaticScalarSolver::Solver class template can solve axisymmetric problems in which the surface free-current density is present on an interface. To do so, we will solve the two problems of the Surface charge (sch/) numerical experiment on axisymmetric domains. We expect that the electrostatic potential calculated in this numerical experiment will be identical to the electrostatic potential calculated in Surface charge (sch/) numerical experiment.

Implementation

In this numerical experiment we will reuse the two textbook problems of the Surface charge (sch/) numerical experiment. This time, however, these two textbook problems will be solved on two-dimensional axisymmetric domains.

The first problem

We convert the first problem into an axisymmetric problem domain as shown in the figure below.

We remove the conducting tube from the problem domain and model it by setting up a Dirichlet boundary condition, \(\Phi = 0\), on the boundary that delineate the tube, \(\Gamma_{D1} \). Due to the cylindrical symmetry in the initial three-dimensional problem we can predict that the electrostatic field will be directed radially from the axis of rotation, i.e., will be aligned with the vertical boundaries of the axisymmetric domain. For this reason, we apply the homogeneous Neumann boundary conditions on the two vertical boundaries. We can invoke the Gauss's law to argue that the electric field equals zero in the volume enclosed by the interface \(\Gamma_{I1}\). Consequently, the electric field on the axis of rotation equals zero. Thus, the normal component of the electric field on the axis of rotation equals zero. Therefore, we can set up homogeneous Neumann boundary condition on the axis of rotation, i.e., on the \(z\) axis. Recall that the homogeneous Neumann boundary condition can be applied to the axis of rotation symmetry in all axisymmetric problems.

The second problem

We convert the second problem into an axisymmetric problem domain as shown in the figure below.

We remove the conducting sphere from the problem domain and model it by setting up a Dirichlet boundary condition, \(\Phi = 0\), on the boundary that delineate the sphere, \(\Gamma_{D1} \). Due to the spherical symmetry in the initial three-dimensional problem we can predict that the electrostatic field will be directed radially from the center of the sphere, i.e., will be aligned with the vertical boundaries of the axisymmetric domain. For this reason, we apply the homogeneous Neumann boundary conditions on the two segments of the vertical boundaries, \( a \le z \le b\) and \( -b \le z \le -a\). We can invoke the Gauss's law to argue that the electric field equals zero in the volume enclosed by the interface \(\Gamma_{I1}\). Consequently, the electric field on the segment \( -a \le z \le a\) of the vertical boundary equals zero. Thus, the normal component of the electric field on this segment equals zero. Therefore, we can set up homogeneous Neumann boundary condition on this segment as well. That is, we apply the homogeneous Neumann boundary condition on the entire vertical boundary. Recall that the homogeneous Neumann boundary condition can be applied to the axis of rotation symmetry in all axisymmetric problems.

The boundary value problem

This numerical experiment solves the following boundary value problem.

\begin{equation} \begin{array}{lrcll} \text{ }&- \vec{\nabla} \cdot \big( \epsilon_0 \vec{\nabla} \Phi \big)= 0 & \text{in} & \Omega & \text{(i)},\\ \text{(e)} &\Phi = 0 & \text{on} & \Gamma_{D1} & \text{(ii)},\\ \text{(n)} & \epsilon \hat{n} \cdot \vec{\nabla} \Phi = 0 & \text{on} & \Gamma_{R1} & \text{(iii)},\\ \text{(e)} &\Phi_{+} = \Phi_{-} & \text{on} & \Gamma_{I1} & \text{(iv)},\\ \text{(n)}&\epsilon_{0}\hat{n}\cdot\vec{\nabla}\Phi_{+}-\epsilon_{0}\hat{n}\cdot\vec{\nabla}\Phi_{-}=-k_f&\text{on}&\Gamma_{I1}&\text{(v)}. \end{array} \end{equation}

This boundary value problem is a special case of the general static scalar boundary value problem.

The program

This experiment is implemented in accordance with the base code structure. The build process generates two executable files: sch-axi-cylinder and sch-axi-sphere. That is, one executable file for the first problem above and one for the second. To rebuild them change into sch-axi/build/Release directory and execute the following:

user@computer .../sch-axi/build/Release$ ./clean
user@computer .../sch-axi/build/Release$ ./build

Then all executable files must be executed again. This can be done by changing into the sch-axi/bin/Release directory and executing run-all script there,

user@computer .../sch-axi/build/Release$ cd ../../bin/Release
user@computer .../sch-axi/bin/Release$ ./run-all

This will generate various files in the sch-axi/bin/Release/Data directory. Among the generated files there are vtu files that can be viewed with a help of ParaView software package of the Kitware, Inc. The data files in tex and txt format contain the convergence tables.

Note that executable files require a set of meshes to be present in the sch-axi/gmsh/data directory. If they are missing, they can be generated anew. This can be done by changing into sch-axi/gmsh directory and executing the following:

user@computer .../sch-axi/gmsh$ ./clean
user@computer .../sch-axi/gmsh$ ./build

This will generate a set of globally refined meshes in sch-axi/gmsh/data.

The SettingsSCHAXI class allows switching on three useful features: printing time tables on the computer screen, logging convergence data of the conjugate gradient solver, and saving the exact solution into the vtu files next to the numerical solution.

The program invokes first- and second-order mapping of the FE_Q finite elements when solving the first and the second problems, respectively.

Simulation results

Both problems above were solved numerically with the following settings (see SettingsSCHAXI): \(a=0.5[m]\) and \(b=1.0[m]\).

Electrostatic scalar potential

The first problem

The figures below illustrate the numerically calculated electrostatic potential. The plot on the right allows a comparison between the results obtained on the two-dimensional planar domain (sch/ numerical experiment) and on the two-dimensional axisymmetric domain (sch-axi/ numerical experiment).

The corresponding convergence table is shown below.

p r cells dofs \(\|e\|_{L^2}\) \(\alpha_{L^2}\) \(\|e\|_{H^1}\) \(\alpha_{H^1}\)
1 7 72 91 9.81e-04 - 3.74e-02 -
1 8 98 120 7.22e-04 1.99 3.20e-02 0.99
1 9 128 153 5.54e-04 1.99 2.81e-02 1.00
1 10 162 190 4.38e-04 1.99 2.50e-02 1.00
2 7 72 325 1.67e-05 - 1.30e-03 -
2 8 98 435 1.05e-05 2.98 9.58e-04 1.98
2 9 128 561 7.08e-06 2.98 7.35e-04 1.98
2 10 162 703 4.98e-06 2.99 5.81e-04 1.99
3 7 72 703 4.07e-07 - 4.64e-05 -
3 8 98 946 2.21e-07 3.96 2.94e-05 2.96
3 9 128 1225 1.30e-07 3.97 1.98e-05 2.97
3 10 162 1540 8.15e-08 3.97 1.39e-05 2.98

The following notations were used in the table header:

  • p - the degree of the interpolating Lagrange polynomials that constitute the shape functions.
  • r - the number of nodes on transfinite lines, see discussion in here.
  • cells - the total amount of active cells.
  • dofs - the amount of degrees of freedom in the active cells.
  • \(\|e\|_{L^2}\) - the \(L^2\) error norm.
  • \(\|e\|_{H^1}\) - the \(H^1\) error norm.
  • \(\alpha_{L^2}\) - the order of convergence of the \(L^2\) error norm.
  • \(\alpha_{H^1}\) - the order of convergence of the \(H^1\) error norm.

The second problem

The figures below illustrate the numerically calculated electrostatic potential. The plot on the right allows a comparison between the results obtained in the three-dimensional domain (sch/ numerical experiment) and in the two-dimensional axisymmetric domain (sch-axi/ numerical experiment).

The corresponding convergence table is shown below.

p r cells dofs \(\|e\|_{L^2}\) \(\alpha_{L^2}\) \(\|e\|_{H^1}\) \(\alpha_{H^1}\)
1 7 360 391 4.30e-03 - 1.64e-01 -
1 8 490 526 3.17e-03 1.98 1.41e-01 0.99
1 9 640 681 2.43e-03 1.98 1.23e-01 0.99
1 10 810 856 1.92e-03 1.99 1.10e-01 0.99
2 7 360 1501 1.13e-04 - 8.77e-03 -
2 8 490 2031 7.12e-05 2.97 6.47e-03 1.97
2 9 640 2641 4.79e-05 2.98 4.97e-03 1.98
2 10 810 3331 3.37e-05 2.98 3.93e-03 1.98
3 7 360 3331 3.79e-06 - 4.27e-04 -
3 8 490 4516 2.06e-06 3.94 2.71e-04 2.95
3 9 640 5881 1.22e-06 3.96 1.82e-04 2.96
3 10 810 7426 7.62e-07 3.97 1.29e-04 2.97

The following notations were used in the table header:

  • p - the degree of the interpolating Lagrange polynomials that constitute the shape functions.
  • r - the number of nodes on transfinite lines, see discussion in here.
  • cells - the total amount of active cells.
  • dofs - the amount of degrees of freedom in the active cells.
  • \(\|e\|_{L^2}\) - the \(L^2\) error norm.
  • \(\|e\|_{H^1}\) - the \(H^1\) error norm.
  • \(\alpha_{L^2}\) - the order of convergence of the \(L^2\) error norm.
  • \(\alpha_{H^1}\) - the order of convergence of the \(H^1\) error norm.