1. Introduction
The theory of magnetic field modeling for two- and three-dimensional objects was developed and extensively covered in [
1,
2]. One of the great difficulties in magnetic field modeling is the fact that not only the external magnetic field contributes to the body magnetization, but it is also affected by the object’s self-magnetic field and by the field of other bodies. This effect is usually called “self-demagnetization”. The magnitude of this effect highly depends on the magnetic susceptibility of the modeled object and can be neglected if susceptibility is low. Self-demagnetization is an important magnetic field feature that needs to be accounted for during the interpretation of magnetometric data. In mineral explorations of the ores, one cannot disregard self-demagnetization, as it will lead to significant errors in the determination of the magnetic body position and its magnetization. At the same time, accounting for self-demagnetization is a very computationally expensive procedure. That is why new effective methods for forward and inverse magnetic modelling are needed.
In much research, the volume of the magnetic object is approximated by the set of cuboids prior to expressing its magnetic field. Such an approach is understandable from the perspective of computational effectiveness: the expression of the magnetic field of a cuboid has the well-known closed form. However, the method introduces significant restrictions, as it becomes impossible to consider complex objects that are poorly approximated by cuboids. This fact limits the applicability of the method in practical applications.
Pointing out one of the works in which the initial steps of accounting for self-demagnetization are taken, in [
3], a method is presented to compute the demagnetization tensor field for uniformly magnetized particles of an arbitrary shape. By means of a Fourier space approach, the analytic Fourier representation of the demagnetization tensor field for a given shape is derived. As an example, the demagnetization tensor field for the tetrahedron is given.
To highlight contemporary research on the topic of this phenomenon, in [
4,
5], the authors acknowledge the significant impact of the self-demagnetization to the total magnetization of complex models constructed out of cuboids. However, no insides on effective computational algorithms are presented.
In [
6,
7], the authors present a fairly complete approach to the problem of magnetic modeling for real data, but the demagnetization factor is considered to be uniform across the whole model volume, which may result in unsatisfactory accuracy, as even the simplest shapes (e.g., a cuboid) have substantially non-uniform self-demagnetization. For this reason, in our approach, we take into account self-demagnetization in every element of discretization. The task of calculating self-demagnetization for such a model has a computational complexity of
, where
is a number of discretization elements and
is a number of iterations required to numerically solve the magnetization equation with the specified accuracy. Comparing this to the magnetic field calculation, which requires no iterative solving and has linear complexity (with respect to
), it becomes apparent that highly efficient algorithms are needed to be developed and used to solve this problem. Otherwise, no computing resources would be enough to model the self-demagnetization of practical models with millions of discretization elements.
Another notable work is [
8] in which the authors claim to have developed an approach for fast self-demagnetization computation for arbitrary shaped bodies. In our opinion, the last claim is a bit of a stretch, to put it lightly. The proposed method will only work for bodies that can be sufficiently approximated with regular grid of cuboids, which is far from “arbitrary”. We use the same word in the title of this paper because unlike other approaches, our method does not impose any constrains on the discretization whatsoever.
When modelling the magnetic field of an object, the shape of which cannot be adequately approximated with cuboids (e.g., an object with a spherical surface), it is more reasonable to use polyhedron discretization as it is more universal. For this reason, in this paper we will describe a computationally effective method for calculating the magnetic field for an object that is approximated with polyhedrons. The method based on the closed-form expression for the magnetic field of a triangular plate with uniform magnetization. The expression is applied to the triangulation of the polyhedron surface and after a simple summation yields the magnetic field of the polyhedron. The algorithm was implemented in software using parallelization technologies, which made it possible to consider models with a large number of discretization elements in our numerical experiments (~106 elements for the largest example presented, though this number is nowhere near the practical limit, provided one has the access to sufficient computational power).
Note. All physical quantities in this paper are in SI (and not CGS), consecutively some of the cited expressions may differ from what was printed in the source.
2. Problem Statement
Let
be a region of the model under consideration in 3-dimensional space
with Cartesian coordinate system
. The
axis is in a down direction. The magnetic susceptibility in
is determined by
,
q . Generally speaking,
is a tensor, but in this paper, we will consider
a scalar for simplicity. All the described techniques can be applied when
is a tensor with minor modifications. The
I(q) function denotes the magnetization at the point
. Then, the total magnetic field strength
H consists of two parts [
8]:
where
is external (primary) field,
is body-generated (secondary) field,
and
are radius-vectors of points
and
, respectively,
is the point of integration, and
is the remanent magnetization. Note that, when
,
is the external field, and when
,
is the internal field.
Let us introduce
, the magnetization of the body induced by the external field. If we consider
,
and
defined, then the total magnetization
can be found from the Fredholm equation of the second kind:
or
The non-zero difference of and is called the “self-demagnetization effect”. In order to solve this equation numerically, the effective computation of the right side is of a great importance. It will be used as a primary operation in any of the iterative solving methods. From a mathematical point of view, the problem is reduced to solving the Fredholm integral equation of the second kind (2). The main problem that arises when solving this equation is the efficient calculation of the volume integral with a weak singularity. Here we propose a new original method for calculating this integral. Instead of integrating over the body volume, we first represent the original volume integral as a sum of integrals over a set of polyhedra. Then each polyhedron integral is split into integrals over triangles (that form the surface of the said polyhedron).
3. The Method of Computation for
3.1. Finite Element Method
Let’s introduce a discretization of the region
in a form of
:
. Let
denote contribution to
of the element
with the uniform magnetization
. Then,
Next, we consider a polyhedron. In almost any practical application where is not a polyhedron, it can be always approximated by one with arbitrary accuracy (at the cost of a number of faces).
3.2. Derivation of a Closed-Form Expression for
Here we will derive a closed-form expression for direct calculation of The advantages of the analytical approach over any approximation scheme in terms of precision are self-apparent. Likewise, the advantages of calculating a single-dimensional integral over three-dimensional. Moreover, in the presented method we offer a valid closed-form expression for an integral with a weak singularity.
Let
be closed and bounded region of 3-dimensional space
,
is uniform magnetization of
. In accordance with Poisson’s equation [
9] the magnetic field strength
in an arbitrary point
with radius vector
can be expressed as
or, using the divergence theorem,
where
is outer unit normal to the elementary surface of integration. Making further transformations we acquire
Here
is a polyhedron and
is a set of its faces. For every face
its outer normal
is constant, hence
In this expression , which, incidentally, is the gravity field magnitude of polygon S of uniform density numerically equal to , where is gravitational constant.
Next, we write the following expression using Lagrange’s formula for double cross product
=
, where
is an arbitrary unit vector. And substitute the integral for
Now we consider
, then the integral in the first term of the sum is a solid angle
, under which the
S face is seen from the point
. To the integral in the second term Green’s theorem can be applied:
Note that when applying this formula to a polygon
S, the enumeration order of its vertices should be counterclockwise with respect to the outer normal
. Let
N be the count of vertices of polygon
S,
is the radius-vector of the vertex
i,
, then
Here
is the gravity potential of a straight-line segment (edge
i of polygon
S) with uniform density numerically equal to
. Its closed form is well known (for example, published in [
10]):
When
S is a triangle (
N = 3), then the solid angle
can be expressed as [
11]
where
,
Substituting these expressions in (4) we acquired a closed-form solution for the gravity field magnitude of a triangle of uniform density numerically equal to
:
where
,
,
,
is unit normal to S (selected with right-handed helix rule). Hence, (3) and (5) allow us to express the magnetic field magnitude of an arbitrary polyhedron of uniform magnetization in a closed-form. Previously, the authors employed a similar approach to find closed-form expression for the gravity field of a polyhedron [
12].
3.3. Magnetic Equation for
Substituting (3) and (5) in (2) and with the described model discretizationin mind, we get a system of linear algebraic equations
where
is the center of mass of
and
is a set of triangles that forms (or approximates) the surface of
.
4. Numerical Algorithm—Iterative Solver
The most “head-on” approach one can employ for solving (6) is the fixed-point iteration method [
13]:
where
denotes the
-th iteration.
is calculated via (1) with a substitution of
. The method works reasonably good for
, but as
grows, the convergence rate will drastically decrease until, at some point, it will no longer converge at all due to the right-hand side of the equation losing its contraction property. In order to fix this problem, the authors of [
8] proposed an approach of transforming the Equation (2) to an alternative form, for which, the fixed-point iteration method is guaranteed to be convergent independent of the value of
. Here, we rewrite that equation in terms of
(instead of
H, as per original paper). The two forms are completely equivalent to one another.
The method of fixed-point iterations for this equation will be as follows:
Even though the convergence of (7) is proven for all values of
(see [
8]), the convergence rate still very much depends on it, and for the large values of
it can become unpractically slow.
For this reason, we concluded that one of the best iterative schemes that can be applied to the Equation (2) is the conjugate gradient method [
14]. For a system of linear equations
it can be written as
Appling this to the problem in question, . Strictly speaking, the convergence in this case is not guaranteed because is not necessarily a symmetric matrix, as it depends on the chosen discretization of the magnetic body. However, we have yet to encounter a setup in which the method failed to converge in practical applications. In the authors’ opinion, it is more a question of carefully and deliberately constructing such a discretization as to make the method diverge, then encountering this problem “in the wild”. The final conclusion being, it is more practical to run a numerical experiment for a particular setup and check if the method converges to the solution (by simply substituting it into the original equation), then to rigorously prove convergence in every single case. Overwhelmingly more often than not, the method will, indeed, converge to the solution.
In order to demonstrate the relative difference in the rate of convergence between (7) and (8), the two methods were applied to a numerical experiment with a cuboid (which will be described later on). The results are presented in
Table 1. The termination criterion was
.
5. Numerical Experiments
5.1. A Solid Sphere and an Ellipsoid
This example is purely synthetic and its purpose is to assure correctness and high accuracy of the proposed method.
In this experiment we will calculate the magnetization
I (taking in account self-demagnetization) of a solid sphere with uniform magnetic susceptibility K in a uniform external magnetic field and compare the result with the theoretical value. The expression for
I in this case has a well-known closed form.
where
is the demagnetizing factor;
for a solid sphere. Let us introduce a spherical coordinate system
that is placed in the center of the primary Cartesian coordinate system. A solid sphere of radius R is then placed in the center of the system. The sphere is split along each of the axis
in a uniform manner. The points of this mesh form hexahedrons that fill the inner volume of the sphere and approximate its surface. Each hexahedron is considered to have uniform magnetization
. The surface of a hexahedron is being trivially split to triangles in order to apply (6).
The initial conditions for this example are: sphere radius R = 10 m; partition elements = 64,000 (); A/m; = 2, . Precise theoretical I = (16.8, 16.8, 42) A/m. The computed I has RMS (Root Mean Square) of 2.6% (across all partition elements), the outer sphere layer has the worst RMS (~10%) due to insufficient discretization. Increasing it to 256,000 () leads to an overall RMS of 0.27% (RMS of outer layer is 1.2%). The example was calculated with conjugate gradient method. It took just one single iteration to converge (residual 8 × 10−5).
The magnetization of a solid sphere has the same direction as the external magnetic field (in cases when remnant magnetization is non-present). Let us now consider an ellipsoid of revolution, the axis of which are misaligned with the direction of the external field. The magnetization of such an ellipsoid in the same setup as for the solid sphere will be also uniform, but not necessarily collinear to the external field. An explicit expression for an arbitrary (3-dimensional) ellipsoid exists, but involves elliptic integrals. For an ellipsoid of revolution, the expression has a closed form representation, which is
where
is an element-wise division. The demagnetizing factor for an ellipsoid consists of three components, two of which are the same in case of an ellipsoid of revolution:
where
,
and
are ellipsoid semi-axis along
and
, respectively. The expressions for
were taken from [
15].
Initial conditions for this example are the same as for the solid sphere, ; partition elements = 1,024,000 (). Precise theoretical I = (15.33, 15.33, 51.96) A/m. Computed I has RMS 0.3% (across all partition elements); the outer layer has the worst RMS (~1%). The experiment took two iterations of conjugate gradient method to converge to residual 7 × 10−5.
5.2. A Cuboid
If needed, the method can also be used to effectively compute magnetic field
(without self-demagnetization) for complex-shaped bodies. We can further check correctness of the method against the formula for the magnetic field of a cuboid, which can be expressed in a closed form
We numerically checked that expressions (3) and (5) correspond to it exactly (up to a machine epsilon).
Now we will put an isolated cuboid with the uniform magnetic susceptibility
= 0.2 in the uniform magnetic field
A/m and observe its self-demagnetization. Physical dimensions of the cuboid are 1 ×
×
m. Discretization of the model is 100 × 40 × 40. In
Figure 1, the visual representation of
is presented. Even for such a simple shape, self-demagnetization is very intricate and it always arranges itself is such a way as to decrease the magnitude of the principle component of the magnetization
. The effect, however, is very weak, for the presented example
and the mean of
(which represents the principle component) is (0.019; −0.009; −0.023) A/m.
5.3. A Well
Let be a region in the Cartesian coordinate system (plane–parallel layer). The axis is in a down direction. The well is represented as a straight circular cylinder with base radius and axis of symmetry collinear to . The upper base plane is , and the lower is . The inside of the cylinder is denoted as and the outside as .
The region
D has infinite length, so in order to conduct a numerical experiment, we will have to consider a finite region
instead.
is approximated with a set of polyhedrons. By choosing the decomposition diameter we can achieve any desired accuracy for
. In order to eliminate unwanted distortions on the model boundary, when calculating
on the
Oxy plane above the model,
should be extended far beyond the boundary of the field calculation plane. To achieve this without blowing the computational complexity, we make use of irregular discretization as shown in
Figure 2 [
16].
As a concrete example, let us consider the parallelepiped in
of size 12 × 12 × 8 m
3, the axis of the cylinder (the well) of radius r = 0.25 m passes through the center of the upper and lower faces. K is set to 0.2 inside of the parallelepiped and to 0 inside of the cylinder. The external magnetic field
is uniform and set to (14; 14; 35) A/m. The model discretization is 480 × 480 × 20. The field is calculated on a plane with linear dimensions of 3.5 m × 2.5 m, located at height
h of 0.25 m above the surface of the parallelepiped and centered relative to it. Field discretization is 175 × 125 (50 points per meter).
Figure 3 shows components of the calculated field
(top row):
(min., max.: [−0.32; 0.44] A/m) and
(min., max.: [−0.03; 0.003] A/m), as well as part of the field due to the self-demagnetization (bottom row), i.e., the difference of
calculated with and without the self-demagnetization:
x-component (min., max.: [−0.084; 0.085] A/m) and
z-component (min., max.: [0.01; 0.19] A/m). The average contribution of the self-demagnetization to the field
is 24%. Computational error for the self-demagnetization was estimated with the Runge rule and is equal to 10
−3%.
6. Notes on Technical Implementation
The conjugate gradient method for solving the resulting system of Equation (6) was implemented in a program using contemporary HPC (High-Performance Computing) solutions (Nvidia CUDA and AMD ROCm) that runs computations on GPUs. In order to conduct a series of described experiments we employed five Radeon VII GPUs. Each experiment took mere minutes (we did not run benchmarks in a well-controlled environment, as it is outside of the topic of this paper; sufficient to say, it would have taken days to run on any high-end CPU). This fact leaves a lot of room to process more complex models, with a high discretization density of the model itself and/or its magnetic field.
The program source code is available on github [
17] under MIT license and allows for the recreation of the results of the described experiments.
7. Conclusions
Finding a closed-form expression for the magnetic field of a polyhedron enabled us to construct a computationally efficient method for calculating self-demagnetization of complex-shaped 3D objects as well as their magnetic field. The results were verified against a number of known simple cases (a solid sphere, an ellipsoid, and a cuboid placed in the external magnetic field), a practical example (the well model) is also presented.
In our future work we plan to develop a method of magnetic data inversion based on the presented algorithm of the forward modelling. The method will be applied for geophysical magnetic data interpretation in the fields of mineral exploration, ecological, and archeological problems.
Author Contributions
Conceptualization, P.M. and D.B.; methodology, P.M. and D.B.; software, D.B. and A.C.; validation, P.M., D.B. and A.C.; formal analysis, P.M.; investigation, P.M., A.C. and D.B.; writing original draft preparation, P.M. and A.C.; writing review and editing, P.M., D.B. and A.C.; visualization, D.B. and A.C.; supervision, P.M.; project administration, P.M.; funding acquisition, P.M. All authors have read and agreed to the published version of the manuscript.
Funding
This research was partially funded by Russian Science Foundation, grant number 20-17-00058 (Sections 4 and 5).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Conflicts of Interest
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.
References
- Martyshko, P.S. The solution of a DC electrical sounding inversion problem for arbitrary classes of potentials. Izv. Akad. Nauk. SSSR Fiz. Zemli 1986, 1, 87–92. [Google Scholar]
- Blokh, Y.I. Interpretation of magnetic-anomalies including demagnetization effects. Izv. Akad. Nauk. SSSR Fiz. Zemli 1987, 4, 56–62. [Google Scholar]
- Beleggia, M.; De Graef, M. On the computation of the demagnetization tensor field for an arbitrary particle shape using a Fourier space approach. J. Magn. Magn. Mater. 2003, 263, L1–L9. [Google Scholar] [CrossRef]
- Shuang, L.; Xiangyun, H.; Henglei, Z.; Eixia, G.; Boxin, Z. 3D Magnetization Vector Inversion of Magnetic Data: Improving and Comparing Methods. Pure Appl. Geophys. 2017, 174, 4421–4444. [Google Scholar]
- Krahenbuhl, R.A.; Li, Y. Investigation of magnetic inversion methods in highly magnetic environments under strong self-demagnetization effect. Geophysics 2017, 82, J83–J97. [Google Scholar] [CrossRef]
- Austin, J.; Geuna, S.; Clark, D.; Hillan, D. Remanence, self-demagnetization and their ramifications for magnetic modelling of iron oxide copper-gold deposits: An example from Candelaria, Chile. J. Appl. Geophys. 2014, 109, 242–255. [Google Scholar] [CrossRef]
- Liu, S.; Fedi, M.; Hu, X.; Ou, Y.; Baniamerian, J.; Zuo, B.; Liu, Y.; Zhu, R. Three-dimensional inversion of magnetic data in the simultaneous presence of significant remanent magnetization and self-demagnetization: Example from Daye iron-ore deposit, Hubei province, China. Geophys. J. Int. 2018, 215, 614–634. [Google Scholar] [CrossRef]
- Ouyang, F.; Chen, L. Iterative magnetic forward modeling for high susceptibility based on integral equation and Gauss-FFT. Geophysics 2020, 85, J1–J13. [Google Scholar] [CrossRef]
- Rothwell, J.; Cloud, M.J. Electromagnetics; Taylor & Francis: Oxfordshire, UK, 2010; 667p. [Google Scholar]
- Strakhov, V.N.; Lapina, M.I. Direct problems of gravimetry and magnetometry for arbitrary homogeneous polyhedral. Izv. Phys. Solid Earth 1982, 4, 45. [Google Scholar]
- Van Oosterom, A.; Strackee, J. The Solid Angle of a Plane Triangle. IEEE Trans. Biomed. Eng. 1983, 30, 125–126. [Google Scholar] [CrossRef] [PubMed]
- Martyshko, P.S.; Ladovskij, I.V.; Byzov, D.D.; Chernoskutov, A.I. On Solving the Forward Problem of Gravimetry in Curvilinear and Cartesian Coordinates: Krasovskii’s Ellipsoid and Plane Modeling. Izv. Phys. Solid Earth 2018, 54, 565–573. [Google Scholar] [CrossRef]
- Faddeev, D.K.; Faddeeva, V.N. Computational Methods of Linear Algebra; W.H. Freeman & Co.: San Francisco, CA, USA; London, UK, 1963; 622p. [Google Scholar]
- Vorst, H. Iterative Krylov Methods for Large Linear System; Cambridge University Press: Cambridge, UK, 2003; 221p. [Google Scholar]
- Osborn, J.A. Demagnetizing Factors of the General Ellipsoid. Phys. Rev. 1945, 67, 351–357. [Google Scholar] [CrossRef]
- Martyshko, P.S.; Byzov, D.D.; Chernoskutov, A.I. Numerical solution of the forward magnetic field problem for models with irregular polyhedron discretization taking into account the “demagnetization effect”. In Proceedings of the International Conference on Numerical Analysis and Applied Mathematics 2019, ICNAAM 2019, Rhodes, Greece, 23–28 September 2019; Volume 2293. [Google Scholar] [CrossRef]
- Chernoskutov, A.I.; Byzov, D.D. High-Performance Self-Demagnetization Modeling with GPUs. Available online: https://github.com/AlexIII/GRAFEN/tree/demag-paper-pub (accessed on 9 May 2022).
| Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).