# Simulation of Real Defect Geometry and Its Detection Using Passive Magnetic Inspection (PMI) Method
## 2 Theoretical Background and Methodology  
The Earth's internal magnetic field is caused by liquid iron motions in the planetary core [38; 39], plus contributions from other sources such as mantle movements, the nature of the lithosphere, etc. [40]. The magnetic field is a three-dimensional vector [41] with a harmonic pattern due to the globe's rotational movement [42]. The vector originates from the surface of the Earth and extends beyond the atmosphere, and its magnitude and orientation are functions of location [41] and time [40]. Natural magnetic fields and other influential local magnetic sources [37], combined with internal and external stresses, can change the scattered stray magnetic field of ferromagnetic materials [43]. Internal domain walls' displacement and magnetic-moment rotation in ferromagnetic materials happen under the influence of external magnetic fields [44], and there are relationships between the micro-magnetic characteristics of these materials and their mechanical responses [45]. For example, if the steel is deformed significantly in the presence of a magnetic field, the magnetization of the domains and their orientation within the steel are affected. Self-magnetic flux leakage (SMFL) is assumed to take place in the stress concentration areas of ferromagnetic materials affected by mechanical load under the Earth's magnetic field [46], and this condition can remain even after removing the load, creating detectable magnetic leakage at the material surface [47]. Measuring SMFL at the surface of the materials helps in estimating their stress-strain states (SSSs), which is an important parameter in determining a structure's reliability [48]. Therefore, the relation between localized stress and oriented magnetic domains is useful for detecting defects in ferromagnetic materials within the background magnetic field of the Earth [49]. Magnetic field parameters at a point in space are represented by magnetic flux density (B) and an external magnetic field (H). B and H are vectors with a proportional magnitude and parallel directions. Magnetic flux density (B) represents the closeness of the magnetic field lines, and shows the strength of the magnetic field [50]. Also, [PERSON]'s magnetic field law states that \(\
abla\)B = 0 [51]. H and B may have a complex relationship in magnetic materials [52], but engineers usually invoke the relation established by [PERSON] and [PERSON], which demonstrates that B is produced in a magnetizable material due to the existence of a primary magnetic field (H) [53]. Numerical simulation of the PMI method is performed based on the stray magnetic field (\(H_{d}\)) and the stray magnetic field energy (\(E_{d}\)) [37]. [PERSON] and [PERSON] in 1998 [54] presented the relation for calculating the stray magnetic field (Equation (1)), based on summarizing [PERSON]'s magnetic field law. In Equation (1), magnetic polarization (J) is the product of \"volume-normalized magnetization\" M, multiplied by \"vacuum magnetic permeability of free space\" \(\mu_{0}\). Additionally, a relation suggested for estimating the stray magnetic field energy uses the balance of the magnetic charges as well as their integration over the volume of the ferromagnetic material (Equation (2)).