Logbook  (07-04-2025)
Static problems
1.2.6 Axisymmetric - thick spherical coil with magnetic core (ssol-iii-axi/)

Classes:

1) BatchSSOLIIIAXI
2) SolverSSOLIIIAXI
4) ExactSolutionSSOLIIIAXI_H
5) ExactSolutionSSOLIIIAXI_B
6) SettingsSSOLIIIAXI

Files:

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

List of all shared classes


Introduction

In the most general case, a three-dimensional problem formulated in terms of the vector magnetic potential, \(\vec{A}\), is described by the curl-curl partial differential equation,

\[ \vec{\nabla} \times \bigg( \frac{1}{\mu} \vec{\nabla} \times \vec{A} \bigg) = \vec{J}_f. \]

If, however, a problem exhibits a rotation symmetry and the magnetic vector potential is expected to have the following form in the cylindrical coordinate system:

\[ \vec{A}(r,z) = 0\hat{r} + A(r,z) \hat{\phi} + 0 \hat{z}, \]

the curl-curl equation can be replaced by the following div-grad equation:

\[ - \vec{\nabla} \cdot \bigg(\frac{1}{\mu'} \vec{\nabla} A' \bigg) = J_f, \]

where

\[ \mu' = r \mu \]

and

\[ A' = r A, \]

see Section 3.4.2 Scalar axisymmetric problem.

This numerical experiment illustrates the application of the StaticScalarSolver::Solver to a problem formulated in terms of the scaled magnetic vector potential, \(A'\). To this end, we will obtain numerical solutions to a problem on a set of progressively refined meshes and compare the result to the closed-form analytical solution.

Implementation

The problem

In this numerical experiment the problem of the ssol-iii numerical experiment is reused. This time, however, we do not use the three-dimensional problem domain and construct a two-dimensional axisymmetric domain as shown in the figure below.

We would like to calculate the scaled magnetic vector potential, \(A'\), scaled auxiliary field \(\vec{H}'\), and scaled magnetic field, \(\vec{B}'\).

To derive a closed-form analytical expression for the scaled magnetic field we make the following substitution into the analytical solution to the problem of ssol-iii numerical experiment:

\[ r \rightarrow s \]

and multiply the result by the distance to the axis of rotation symmetry, \(r\),

\[ \vec{B}' = r \vec{B}(s,\theta). \]

Then the scaled auxiliary H-field can be expressed as

\[ \vec{H}' = \frac{1}{\mu} \vec{B}'. \]

Unfortunately, the exact solution to the problem of ssol-iii numerical experiment is a bit bulky. Converting it into a closed-form analytical expressions for \(A'\) and \(\vec{\nabla} A'\) is somewhat difficult... For this reason, this time we will not compute the error norms for \(A'\). We will evaluate the computed \(A'\) indirectly by evaluating the error norms for \(\vec{B}'\).

The mesh

The figure below illustrates the mesh.

The half-circle of a radius of \(d_2\) delineates the local mesh. The error norms are computed within the local mesh.

The boundary value problem

The following boundary value problem is solved in this numerical experiment:

\begin{equation} \begin{array}{lrcll} \text{ }&- \vec{\nabla} \cdot \bigg(\dfrac{1}{\mu'} \vec{\nabla} A' \bigg)= J_f & \text{in} & \Omega & \text{(i)},\\ \text{(e)} & A' = 0 & \text{on} & \Gamma_{D1} & \text{(ii)},\\ \text{(n)} & \dfrac{1}{\mu'} \hat{n} \cdot \bigg( \vec{\nabla} A' \bigg)+ \dfrac{1}{\mu' d_3} A'\ = 0 & \text{on} & \Gamma_{R1} & \text{(iii)},\\ \text{(e)} & A_{+} = A_{-} & \text{on} & \Gamma_{I1} & \text{(iv)},\\ \text{(n)}&\dfrac{1}{\mu'_+}\hat{n}\cdot\bigg(\vec{\nabla} A'_{+}\bigg) -\dfrac{1}{\mu'_-}\hat{n}\cdot\bigg(\vec{\nabla}A'_{-}\bigg)=0 &\text{on}&\Gamma_{I1}&\text{(v)},\\ \text{(e)} & A_{+} = A_{-} & \text{on} & \Gamma_{I2} & \text{(vi)},\\ \text{(n)}&\dfrac{1}{\mu'_+}\hat{n}\cdot\bigg(\vec{\nabla} A'_{+}\bigg) -\dfrac{1}{\mu'_-}\hat{n}\cdot\bigg(\vec{\nabla}A'_{-}\bigg)=0 &\text{on}&\Gamma_{I2}&\text{(vii)}, \end{array} \end{equation}

where

\begin{equation} \mu' = r \mu. \end{equation}

We set up the homogeneous Dirichlet boundary condition on the axis of rotation symmetry, \(\Gamma_{D1}\), and ABC on the boundary segment that represents infinity, \(\Gamma_{R1}\).

First, a class template (SolverSSOLIIIAXI) derived from StaticScalarSolver::Solver is used to obtain the numerical solution, \(A'\). After that, the numerical solution is fed to objects derived from the class templates StaticScalarSolver::ProjectAphiToHrz and StaticScalarSolver::ProjectAphiToBrz to calculate the scaled auxiliary vector field \(\vec{H}'\) and magnetic field \(\vec{B}'\) as

\[ \vec{H}' = - \frac{1}{\mu} \vec{\nabla}\overset{V}{\times} A' \]

and

\[ \vec{B}' = - \vec{\nabla}\overset{V}{\times} A', \]

respectively.

The program

The SSOLIIIAXI experiment is implemented in accordance with the base code structure. The build process generates one executable file: ssol-iii-axi-circle. To rebuild it change into ssol-iii-axi/build/Release directory and execute the following:

user@computer .../ssol-iii-axi/build/Release$ ./clean
user@computer .../ssol-iii-axi/build/Release$ ./build

Then the executable file must be executed again. This can be done by changing into the ssol-iii-axi/bin/Release directory and executing ssol-iii-axi-circle,

user@computer .../ssol-iii-axi/build/Release$ cd ../../bin/Release
user@computer .../ssol-iii-axi/bin/Release$ ./ssol-iii-axi-circle

This will generate various files in the ssol-iii-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. The ssol-iii-axi/bin/Release directory also contains circle.gpi file. It can be used to visualize the calculated potential along the \(r\) axis.

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

user@computer .../ssol-iii-axi/gmsh$ ./clean
user@computer .../ssol-iii-axi/gmsh$ ./build

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

The SettingsSSOLIIIAXI 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.

Simulation results

The experiment was executed under the following conditions: \(a_1 = 0.3[m]\), \(b_1=0.6[m]\), \(a_2 = 0.9[m]\), \(b_2=1.2[m]\), \(d_2 = 1.5[m]\), \(d_3=3.0[m]\), \(K_0 = 1.0[A \cdot m^{-1}]\), and \(\mu_r = 4.0\).

Scaled magnetic vector potential

The figure below illustrates a plot of the scaled magnetic vector potential, \(A'\), the output of an object of the SolverSSOLIIIAXI type.

There are no convergence tables this time as we do not have closed-form analytical expressions for \(A'\) and \(\vec{\nabla}A'\).

Scaled auxiliary H-field

The figure below illustrates a plot of the calculated scaled auxiliary H-field, \(\vec{H}'\), the output of an object of the StaticScalarSolver::ProjectAphiToHrz type.

The corresponding convergence table is presented below.

p r cells dofs \(\|e\|_{L^2}\) \(\alpha_{L^2}\)
1 15 5936 12013 2.26e-03 -
1 16 6810 13771 2.10e-03 1.08
1 17 7744 15649 1.96e-03 1.07
1 18 8738 17647 1.84e-03 1.07
2 15 5936 47770 5.73e-05 -
2 16 6810 54782 4.99e-05 2.00
2 17 7744 62274 4.39e-05 2.00
2 18 8738 70246 3.89e-05 2.00
3 15 5936 107271 2.46e-07 -
3 16 6810 123033 2.00e-07 3.01
3 17 7744 139875 1.65e-07 3.01
3 18 8738 157797 1.37e-07 3.01

The following notations were used in the table header:

  • p - the degree of the FE_Q finite elements that were used to model the scaled magnetic vector potential, \(A'\). The degree of the FE_Nedelec finite elements that were used to model \(\vec{H}'\) field equals \(p-1\).
  • 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.
  • \(\alpha_{L^2}\) - the order of convergence of the \(L^2\) error norm.

Scaled magnetic field

The figure below illustrates a plot of the calculated scaled magnetic field, \(\vec{B}'\), the output of an object of the StaticScalarSolver::ProjectAphiToBrz type.

The corresponding convergence table is presented below.

p r cells dofs \(\|e\|_{L^2}/\mu_0\) \(\alpha_{L^2}\)
1 15 5936 12013 5.75e-03 -
1 16 6810 13771 5.36e-03 1.01
1 17 7744 15649 5.02e-03 1.01
1 18 8738 17647 4.73e-03 1.01
2 15 5936 47770 5.36e-05 -
2 16 6810 54782 4.67e-05 2.01
2 17 7744 62274 4.11e-05 2.01
2 18 8738 70246 3.64e-05 2.01
3 15 5936 107271 2.76e-07 -
3 16 6810 123033 2.24e-07 3.01
3 17 7744 139875 1.85e-07 3.01
3 18 8738 157797 1.54e-07 3.01

The following notations were used in the table header:

  • p - the degree of the FE_Q finite elements that were used to model the scaled magnetic vector potential, \(A'\). The degree of the FE_RaviartThomas finite elements that were used to model the scaled magnetic field, \(\vec{B}'\), equals \(p-1\).
  • 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} / \mu_0\) - the normalized \(L^2\) error norm.
  • \(\alpha_{L^2}\) - the order of convergence of the normalized \(L^2\) error norm.

The convergence tables above suggest that the order of convergence of the \(L^2\) error norms computed for the scaled H-field, \(\vec{H}'\), and for the scaled magnetic field, \(\vec{B}'\) equals

\[ \alpha_{L^2} \approx p. \]

This is a reasonable result as the convergence order of the \(L^2\) error norm computed for \(A'\) is expected to be

\[ \alpha_{L^2} \approx p + 1 \]

and the two vector fields, \(\vec{H}'\) and \(\vec{B}'\), are derived from \(A'\) by a first-order derivative.