Introduction:
short description of the 3D algorithm
In [1] we have proposed a
numerical method of calculating harmonic threedimensional electromagnetic
field in the metallic pipes with local defects. The goal of the present paper
is to describe the modifications of the algorithm which allows computing fields
around relatively small or complex defects.
In this section we give short
description of the initial algorithm.
We consider one or several
coaxial cylindrical pipes that can have defects like pits or holes. For the
simplicity we will consider the case of a single pipe, although the algorithm
permits to compute the case of several coaxial pipes. The cylindrical system of
coordinates with the same axes _{} as the pipe(s) is
used. It is supposed that the defects can be approximated by a set of
hexahedral cells.
In order to avoid solution of
a full external problem we subdivide it onto two stages. First the unperturbed
twodimensional field in the domain
_{}
is calculated for the clean
pipes (without defects) or for the pipes with 2D defects (which do not depend
on the azimuth angle) with a given geometry and excitation conditions. Then a
smaller threedimensional subdomain (box)
_{}
with the given defect is
considered, and the threedimensional problem for Maxwell equations with
Dirichlet boundary conditions of the electrical field on the external
boundaries is solved, see Figure
1 and Figure
2.
Figure 1. Computational domain, crosssection at θ=const
The twodimensional
unperturbed problem is solved by the algorithm described in [2]; so we
have the solution for the azimuth component _{} of the vector
potential of an axissymmetric background solution. For the threedimensional
problem the electrical field _{} is represented in the
box by sum of vector and scalar potentials
_{}
with the boundary
values
_{}.
It is supposed that the box is
big enough to believe that the Dirichlet conditions from unperturbed problem
can provide a required accuracy of modeling.
Figure 2. Computational domain, crosssection at z=const
The threedimensional problem
in the box is solved by the multigrid iteration method starting from the
twodimensional solution as an initial guess.
In order to overcome the known
difficulties with kernel of the Maxwell equations, see, for example, [3], we
use the following modified Maxwell equations written for the fixed frequency (_{}) in media with a nonconstant magnetic permeability _{}, conductivity _{}, and electrical permittivity
_{}:
_{}
where _{} is a given source
current density, _{} is an auxiliary
function, and _{} is an auxiliary
constant, see details in the cited paper.
This system is not the final
one. It is possible to reduce the system to the secondorder equations with 4
unknown scalar functions: three components of the vector potential _{} and the scalar
potential _{}:
_{
}
_{}
_{}
_{}
_{}
_{}
_{}
We write the system
of the algebraic equations in matrix form for the vector of unknowns
_{} ,
where
_{}
as
follows:
_{}
or
_{}
where _{} is a number of the
unknown function (corresponds to the superscript of _{}), _{} is the equation vector
number (number of the matrix row).
The system has a large
conditional number because of a nonuniform grid and discontinuous coefficients
on the metalair boundaries. That is why finding of solution to this system is
another difficult problem. We have observed that the multigrid algorithm is a
most effective one in both computational time and memory. In [1] we described
our implementation of the multigrid method applying to the problem. In
particular, we decided to make additional smoother iterations in the “singular”
subdomains just after the prolongation operator. The correction function is
changed locally in these subdomains (having several points width), and it becomes
sharper near the air/metal boundary. Evidently this procedure is sufficiently
computationally cheap, and it can be treated as a special kind of the
interpolation correspondent to the solution structure. The procedure can be
called the local smoother.
The rest of the paper we
devote to computing electromagnetic fields in cases of small, multiple, or
complex defects. Namely, we discuss ways to safe required computational
resources: some “technical” tricks and so called embedded grids approach.
2 Increase of grid volume of solving problems
There exists a limitation to
the grid volume for the Windows PC (2 GB application memory). That is why we
made additional efforts to increase the possible grid volume which can be
processed using PCs.
A variant of modifying matrix _{} by eliminating the
unknowns at the boundary points from the vector _{} has been examined.
Such elimination is possible because the values _{} are explicitly defined
at the boundary points (Dirichlet conditions). So the corresponding entries are
put to the righthandside. One of the advantages of such modification is a
noticeable reduction of the number of unknowns, especially for the coarse grids
of the multigrid algorithm. For instance, in case of _{} grid cells in each
direction, the number of difference equations is _{}, the number of the boundary entries is about _{} (the condition of
periodicity was taken into account earlier).
The following renormalization
of matrix _{} rows gives an
additional advantage while eliminating the boundary points: we multiply
by _{},
by _{},
by _{}, and
by _{}. Thus the solution of the system remains the same but the
matrix _{} becomes symmetrical
(the factor _{} provides independency
of the matrix norms on the coarse/fine grid). The matrix symmetry property
permits to double reduce the memory for matrix elements keeping.
One of the possible ways of
computer’s memory saving is also taking into account a structure of the
coefficient matrix _{} for our difference
equations. From formulas
– it is clear, that
overwhelming number of coefficients are either purely imaginary, or purely
real, and only coefficients for some unknowns have nonzero both imaginary and
real parts. At the same time, to store a complex number we need 2 times more
main memory, than for a real number. Therefore, from the point of view of
memory’s saving, it is natural to store coefficients of difference equations
not as complex numbers, but as pair of independent real numbers. Using of a
standard storage method for sparse matrices allows not storing zero which
correspond to nonzero real or imaginary parts of coefficients of a matrix _{}. Although we must form two arrays of indices: for real and
imaginary parts separately.
Formally it is
expressed as follows: let’s expand complex matrix _{} into a sum of real
matrices _{} and _{}:
_{}.
To save each matrix
we need 3 arrays which can be described as follows:
real*8 A(M_Re), B(M_Im)
integer col_A(M_Re),col_B(M_Im)
integer addr_row_A(N+1), addr_row_B(N+1)
where
N is a number of difference equations (rows
of matrix _{}),
M_Re is a number of elements with a nonzero
real part in a matrix _{} (number of nonzero
elements in a matrix _{}),
M_Im is number of elements with a nonzero
imaginary part in a matrix _{} (number of nonzero
elements in a matrix _{}),
A and B
are
arrays of nonzero elements in matrices _{} and _{} which are stored
rowwisely,
addr_row_A is an array of addresses which point out
to the beginning of nonzero coefficients of a corresponding line of a matrix _{},
col_A is an array of matrix _{} columns numbers which
correspond to nonzero elements of a matrix _{}.
If we want to apply for a coefficient of
the matrix _{}, the number addr_row_A(i) specifies
the address of the beginning of information about nonzero elements in the ith
row of _{}. This information is stored in arrays A and col_A. And the
number addr_row_A(i+1) specifies the address of the beginning
of information about nonzero elements in the (i+1)th row. Nonzero elements of
the ith row of a matrix _{} are stored in a subarray A(addr_row_A(i):addr_row_A(i+1)1). Numbers of
columns, they belong to, are stored in a subarray col_A(addr_row_A(i):addr_row_A(i+1)1) on positions
with the same index. Therefore, to learn a value of the coefficient _{}, it is necessary to try to find a number _{} such, that col_A(k)=j. If k
exists then _{}= A(k). Otherwise _{}=0.
The matrix _{} is similarly stored
and processed.
To reduce number of arrays (and
parameters of subroutines) it is possible to unite pairs of arrays: A and B in AiB, col_A and col_B in col_AiB. Also all
elements of an array addr_row_B must be increased by
value M_Re.
In process of iterations of
the multigrid algorithm it is necessary to calculate the vector _{} many times; every jth
vector’s element is computed from the formula
_{}
We can write _{}, _{}. Therefore
_{}.
But in most cases either _{} or _{}. Therefore either
_{},
or
_{},
and it is advantageous to
transfer vector’s multiplication by a matrix _{} to real arithmetic.
For the vector _{} with elements _{} this procedure is
carried out by the following fragment of the Fortran code:
do i=1,N
u(i)=0
v(i)=0
do
j=addr_row_A(i),addr_row_A(i+1)1
u(i)=u(i)+AiB(j)*x(col_AiB(j))
v(i)=v(i)+AiB(j)*y(col_AiB(j))
enddo
do
j=addr_row_B(i),addr_row_B(i+1)1
u(i)=u(i)AiB(j)*y(col(j))
v(i)=v(i)+AiB(j)*x(col(j))
enddo
enddo
As the result of tricks
described above one can use comparably large grid. For illustration properties
we present two examples.
2.1 Modeling of the conical
defect
In this example we consider
the outer conical defect having 50% depth, 16mm top diameter (on the
wall surface) and 2.7mm bottom diameter. This defect is located inside
the uniform grid box of 8 rcells, 16 _{}cells, and 16 zcells. Each cell is considered as the
“metal” one if it lies strongly outside the cone. The box is a part of the whole nonuniform
(r, _{} ,z) grid having the
volume 56´80´80 cells. In Figure 3 the component
_{} of EM field inside the
pipe (with 6mm standoff) near the box (black frame) with defect is
shown.
Figure 3. Conical defect: Top and bottom
cone circles are drawn by the dark gray color and white color correspondingly;
uniform grid box is drawn by the black color. The component _{} of EM field inside the
pipe is mapped also.
Figure 4. Conical defect: component _{} of EM field inside the
pipe is mapped
In Figure 4 the same field _{} as in Figure is
presented but as a 3D graph.
In this example we use four
grid levels. The graph of the residual history is shown in Figure 5. We stop
the iterations after 15 MG cycles. Each MG cycle requires about 50
multiplications of the “main” matrix on the finest grid. One can observe that the convergence rate is
sharply drops after 11th cycle. This is a typical behavior and we can not
still overcome this effect. Note that already 10 MG cycles are enough in this example to obtain the
solution with required accuracy.
Figure 5. Convergence history for 4 grid levels,
the finest grid is 56´80´80
2.2 Modeling of two defects
Here we model the situations
with two “square” defects which are rectangular
parallelepipeds in coordinates (r,θ,z). Both defects have 50% depth
and 16mm side. We consider two cases of location of the defects, the
sequential and the diagonal location, see the scheme in Figure 6. The
coordinate _{} is shown by the dashed
line. The grid has 60´56´72 cells.
Figure 6. Two 16mm´16mm defects located in the sequential (left) and diagonal
(right) order. Top view on the pipe wall, _{}
Figure 7. Amplitude of the _{}component of the magnetic field;
sequential (top) and diagonal (bottom) defects
Figure 8. Phase of the _{}component of the magnetic field;
sequential (top) and diagonal (bottom) defects
Figure 9. Amplitude of the _{}component of the magnetic field;
sequential (top) and diagonal (bottom) defects
Figure 10. Phase of the _{}component of the magnetic field;
sequential (top) and diagonal (bottom) defects
Figure 7 – Figure 10 show
amplitude and phase fields of _{} and _{}components of the magnetic field for two cases of
location of the defects mentioned above.
In our structured
computational grid the smallest cells are located near a defect. Far from
defect the cells are increased in direction of changing of the correspondent
index, i.e. nonuniformly. Therefore there are regions with very thin cells up
to the borders of the computational domain. Superfluous computational points
essentially increase resources which are necessary to solve tasks (memory and
time). But these points do not increase the accuracy of the result. To get over
this issue it is proposed to use a zoom method which consists in the following.
First, instead of solving original
problem
_{}
on a sufficiently fine grid,
we consider and solve a problem
_{}
on a coarser grid. It is
selected so that global properties of the solution are kept (in particular, on
periphery of a computational domain), but cellsize of this grid is not enough
to accurately describe the solution in vicinity of defects. Then the second problem
_{}
is solved for refinement of the solution in vicinity of defects on a fine grid but in smaller domain
, see sketch in
Figure 11.
Figure 11. Small 3D computational domain,
crosssection at z=const
Dirichlet boundary conditions
for this problem are taken from the solution of the first problem. The boundary
should be chosen far enough from the defect to be sure that solution of the
first problem is accurate enough there.
It is clear that it is
possible to make next step and solve a problem
_{}
having applied the zoom method
to the solution _{}. However, we restrict us by two steps in this paper.
Almost all necessary
information for the solution of a problem using the multigrid method is
organized as an array of pointers to structures. Each structure describes one
multigrid level. It includes geometrical information, environment properties,
arrays of unknown quantities (_{}), coefficients of difference equations, righthandsides and
some additional information as well as auxiliary arrays.
In particular, in order to
implement the MG method for discontinuous coefficients we use additional
iterations in the vicinity of coefficients’ contrasts after procedure of
correction prolongation from the coarse grid on the fine one of the previous
MGlevel. Technically it is carried out as follows. Regions of coefficients’
contrasts "are covered" by subregions which form 3dimensional
rectangles in the index space _{}. For each subdomain _{} all interior unknowns _{} are additionally
iterated in the smoother, i.e. the corresponding subproblems
_{}
are solved more accurately.
The subproblem _{} is formed by those
difference equations of the main problem which are corresponded to internal
points of the domain_{}. Those unknowns corresponded to an exterior of _{} or its border are not
changed during iterative solution and transferred to the righthandside.
Data structure of the problem _{} for the embedded grid
is practically the same as described above. This fact prompts us to use the
same solver for solving of the embedded problem, as for host one. But
recurrence procedure of the MG solver imposes certain limitations on the
structure and use of data. Besides, there are some distinctions in setups of
embedded and host problems. And it is necessary to take into account these
distinctions and to modify procedures of the ÌG solver to treat both host and embedded problems.
Note three main distinctions:
1) unlike the host problem which is periodic for the angle _{}, embedded problem can be both periodic and nonperiodic; 2)
borders of the embedded problem should match grid lines of the host problem; 3)
different number and structure of regions along _{} in the embedded and
host problems.
We shall give results of two
tests to demonstrate zoom method’s efficiency.
In the first test
the electromagnetic field is calculated for 50% depth outer circular pit having
24 mm diameter. The pipe has internal radius 62.1 mm and 7.7 mm
thickness. The results of two computations are compared. The results of the
first computation are obtained for a maximal possible singlegrid problem (_{} cells). The results of the second computation are obtained
with the help of zoom method when the host problem of _{} cells and embedded
problem of _{} cells covering defect
are solved. Both modeling computations have the same grid in the vicinity of
the pit. In Figure
3 the isolines of the absolute value of the function _{} are drawn on the plane _{} at radius _{}. The close neighbor lines correspond to first and
second computations, respectively.
Figure
3. Isolines of the _{} at _{} for two calculations: single _{} grid and _{} host + _{} embedded grids. Grid lines are also shown.
Comparison shows a good
coincidence of results. But the volume of the matrix is 8 times less for the
second computation, and CPU time is almost 4 times less (since it was necessary
to solve two problems).
A problem with 87.5% depth
outer circular pit having diameter 6 mm is solved in the second test. The wall
thickness is 8mm (i.e. the remaining wall thickness is 1mm). First the defect
is resolved on the single grid of _{} cells volume.
Amplitude of the function _{} near the defect at the
section _{} is shown in Figure 4. This is the minimal possible resolution because only
four grid cells put on the pit diameter and rest wall (i.e. solution will be
too inaccurate if we put less than four grid cells on these thin structures).
It is difficult to estimate
the accuracy of the solution since the resources of PC are not enough to double
resolution of the grid. However, with the help of an embedded grid it became
possible to calculate the defect on a smaller domain for a grid _{} which has 2 times less
step size in each direction. Solutions obtained on the coarse and fine
(embedded) grids are shown in Figure
5.
Figure
4. Isolines of _{} for the single _{} grid solution at the section _{}. Mesh (grey), pipe (vertical solid) and defect (dashed) are
shown as well.
We also present graph of _{} along zline at _{}, see Figure
6. One can observe that both solutions are close to
each other, although finer grid provides a better resolution of course. More
precisely, the relative difference of curves is about 4%. For first and second
derivatives (which model differential sensors) the relative difference achieves
10% to 20%. Believing that the algorithm has the second order of accuracy, we may
conclude that accuracy of the solution on the embedded grid is four times
better, i.e. 1% for function and 3% to 5% derivatives. Note that a good
agreement of both solutions nearby the defects prompts us to use a smaller
domain for the embedded grid, and, therefore, a smaller volume of the latter.
The problem is model, of
course, but it illustrates possibilities.
Figure 5. Isolines of _{} for the single _{} grid solution and embedded grid at the section _{}. Embedded mesh (grey), pipe (vertical solid) and defect
(dashed) are shown as well.
Figure 6. Function _{} for the single _{} grid solution and
embedded grid at _{}, _{}.
4
Selfconsistent zoom method
In the previous section we
have described the following problem formulation of solution refinement in
zones of large gradients (regions with defects, sources). Let us have the
solution _{} of electromagnetic
problem
_{}
on a grid _{} in domain _{}. Dirichlet boundary conditions for _{} are imposed using
solution of 2D problem in a larger domain_{}, _{}.
Then the solution in a
subregion _{} with defect is refined
by introduction of a finer grid _{} (see Figure 7). The solution _{} satisfies the equation
_{}
with Dirichlet boundary
conditions obtained by restriction of the solution _{} onto the boundary of _{}. The problem
looks like
, but it can be yet either
periodical or nonperiodical with respect to _{}.
Figure 7. _{}grids near a pit: _{}(gray) and _{}(black)
The algorithm is successfully
implemented and it is shown that a more accurate solution can be obtained on
two grids _{} or it can be obtained
faster than on a single finer grid, see the section above.
Figure 8. Two embedded grids, _{}plain section: _{} (fat gray), _{} (thin solid), and _{} (thin dashed)
One can consider, in
principle, three and more grids: if, for instance, the casing has two defects
the embedded grids _{} and _{} could be constructed
independently with possible intersection, see Figure
8.
Another option with two
embedded grids is the nesting structure: _{} with finer and finer
grids _{}, _{}.
An evident
drawback of the above approach is absence of influence of solution _{} on solution _{}, what contradicts the elliptical nature of considered
problems. That is why we must take large enough size of _{} in order to diminish
this influence on solution near the defect.
A more “intelligent” possible
way to reduce the drawback could be consist in organization of the following
iterative process:
§
step #1 is the inconsistent algorithm described above:
we find _{} and _{} and denote _{}, _{};
§
step #n (n=2,3,…) solves:
1. The problem
_{}
in _{} with a nonzero RHS
defined everywhere inside _{} where the formula
_{}
can be calculated; _{} is an interpolation
operator of _{}onto grid points of _{}.
2. The problem
_{}
with the Dirichlet boundary
conditions obtained by restriction operation _{} of the solution _{} onto the boundary of _{}:
_{}.
If the iterations converge
then one can believe that this the limit solution _{} is actually the
solution of above an “ideal” problem with the grid adaptive refinement (by
neglecting influence of a small neighborhood of the boundary of domain _{}: one grid level of _{}for both sides of the boundary).
Therefore one can take a
smaller domain _{} comparing the case of
an inconsistent problem.
However our first results did
not give the expected enhance of the algorithm efficiency. Moreover the
iterations diverge sometimes. There are several reasons of the failure, e.g.: a
possible bad construction of the operators _{} and/or _{} (the cubic Cartesian
interpolation); wrong choice of sizes of the embedded domain, etc. We plan to
investigate and overcome the failure in oncoming paper.
References
