## Abstract

We propose a three-dimensional micromagnetic model that dynamically solves the Landau-Lifshitz-Gilbert equation coupled to the full spin-diffusion equation. In contrast to previous methods, we solve for the magnetization dynamics and the electric potential in a self-consistent fashion. This treatment allows for an accurate description of magnetization dependent resistance changes. Moreover, the presented algorithm describes both spin accumulation due to smooth magnetization transitions and due to material interfaces as in multilayer structures. The model and its finite-element implementation are validated by current driven motion of a magnetic vortex structure. In a second experiment, the resistivity of a magnetic multilayer structure in dependence of the tilting angle of the magnetization in the different layers is investigated. Both examples show good agreement with reference simulations and experiments respectively.

## Introduction

Spin-tronic devices are versatile candidates for a variety of applications including sensors^{1,2}, storage devices^{3}, and frequency generators^{4,5}. Different quantum mechanical mechanisms contribute to the coupling of the electrical current to the magnetization. Simulations of spintronic systems usually apply the micromagnetic model extended by simplified coupling terms such as the model by Slonczeswki^{6} and the model by Zhang and Li^{7}. In ref. 8 it was shown that a simplified spin diffusion model incorporates these models. In all these approaches, the effects of the magnetic state of the system on the electronic transport are neglected. Indeed, the electric current density is assumed to be fixed, so that the models can be only used to investigate how the electronic transport affects the magnetization dynamics, but not vice versa. In this work, we present a three-dimensional finite-element method for the solution of the full spin diffusion model from ref. 9 which includes a bidirectional coupling of the magnetization to the electric current. In ref. 10 the model from ref. 9 is applied to a single phase magnetic nanostructure in order to predict domain wall motion. In this work we extend this model to composite structures consisting of magnetic and nonmagnetic materials which enables us to compute the magnetization-dependent resistivity caused by the GMR effect.

## The Model

According to the micromagnetic model, the magnetization dynamics in a three-dimensional magnetic domain *ω* is described by the Landau-Lifshitz-Gilbert equation (LLG)

where ** m** is the normalized magnetization,

*γ*is the gyromagnetic ratio,

*α*is the Gilbert damping, and

*h*_{eff}is the effective field that usually contains the demagnetization field, the exchange field, as well as other contributions depending on the problem setting. The effective field is complemented by a contribution from the spin accumulation

**with**

*s**J*being the exchange strength between itinerant and localized spins,

*ħ*being the reduced Planck constant, and

*M*

_{s}being the saturation magnetization. The spin accumulation itself is defined in the conducting region Ω and satisfies the equation of motion

where *τ*_{sf} is the spin-flip relaxation time, and *j*_{s} is the matrix-valued spin current. According to refs 9 and 11, the spin current *j*_{s} and the electric current *j*_{e} are defined by

where **E** is the electric field, *D*_{0} is a diffusion constant, *C*_{0} is related to electric resistivity *ρ* by *C*_{0} = 1/2*ρ*, and *β* and *β*′ are dimensionless polarization parameters. Solving (3) for ** E** and inserting this into (4) yields

which, combined with (2), gives the simplified diffusion model with prescribed electric current *j*_{e} used in refs 8,12 and 13.

However, instead of prescribing the electric current, it is possible to solve the coupled system (3) and (4). For this purpose, we consider the following simplifications: As proposed in ref. 13, we assume the spin accumulation to be in equilibrium at all times, i.e.,

This simplification is justified by the fact that the characteristic time scale of the spin accumulation dynamics is two orders of magnitude smaller than that of the magnetization dynamics. This was predicted theoretically in ref. 7 and shown by time resolved solution of (2) for typical material parameters in ref. 8. Since sample sizes are usually very small, eddy currents can be neglected^{14}. Therefore, the electric field is curl free and thus given as the gradient of a scalar potential

Moreover, it is assumed that the conducting region Ω, that is considered for the solution of the system (3) and (4), does not contain any sources of electric currents, i.e.,

Inserting these assumptions into (2)–(4) yields the overall system

that determines the electric potential *u* and the spin accumulation ** s**.

A number of boundary conditions are required in order to close the LLG (1) coupled to the spin-diffusion system for the magnetization ** m**(

*t*). The LLG itself is an initial value problem and requires the initial magnetization

If the exchange field *h*_{exchange} = 2*A*/(*μ*_{0}*M*_{s})Δ** m**, with the exchange constant

*A*and the saturation magnetization

*M*

_{s}, is included in the list of effective field contributions, an additional boundary condition for the magnetization is required. If the domain

*ω*for the solution of the LLG coincides with the magnetic region, it was shown in ref. 15 that homogeneous Neumann boundary conditions are the right choice in a physical sense

The system (9)–(10) introduces the need for further boundary conditions for the electric potential *u* and the spin accumulation ** s**. A set of mixed boundary conditions is used to prescribe the electric potential and current inflow at the boundary of the conducting region ∂Ω. The Dirichlet condition is applied directly to the potential

*u*

while the Neumann condition is applied to the electric current

A typical choice of these boundary conditions is depicted in Fig. 1(b). In an MRAM like structure, the top and bottom surfaces Γ_{1} and Γ_{2} are electric contacts. In order to prescribe the current flow through the sample, like it is usually done in experiments, one might set the potential to zero at one contact *u* = 0 on Γ_{1}. On the other contact Γ_{2} a finite current inflow is prescribed *j*_{e} · ** n** =

*g*. The rest of the sample boundary ∂Ω\(Γ

_{1}∪Γ

_{2}) is treated with homogeneous Neumann conditions

*j*_{e}·

**= 0.**

*n*The boundary conditions are completed with homogeneous Neumann conditions for the spin accumulation

This choice can be justified by considering the boundary flux of the spin current. Multiplying (5) with the boundary normal ** n** and inserting the Neumann condition yields

This expression is nonzero only at boundaries with both nonvanishing current in-/outflow and nonvanishing magnetization. Hence the homogeneous Neumann condition (15) is equivalent to the noflux condition *j*_{s} · ** n** = 0 for systems as depicted in Fig. 1, where the electric contacts are part of the nonmagnetic region. The noflux condition itself is a reasonable choice if the thickness of the electrodes is large against the diffusion length. In this case the spin accumulation and hence also the spin current is expected to be approximately zero at the contacts.

For systems where the magnetic region is contacted directly, the homogeneous Neumann condition leads to unphysical behaviour since the spin accumulation that is generated at the contact interface is neglected. This accumulation strongly depends on the material of the leads that is not known when directly contacting the magnet. However, the choice of homogeneous Neumann conditions leads to a good agreement with the predictions of the model by Zhang and Li^{7} that also neglects surface effects at the contacts.

## Validation

The presented model is implemented within the finite-element code magnum.fe^{16}. The discretization is explained in detail in Appendix A. For validation purposes, the standard problem #5 proposed by the μMAG group^{17} is computed with the self-consistent model and compared to results obtained with the model of Zhang and Li^{7} and the simplified diffusion model used in ref. 8. While this problem does not require particular features of the proposed self-consistent model, it serves as an excellent experiment for the validation of the proposed algorithm. The standard problem #5 describes the motion of a magnetic vortex in a thin square of size 100 nm × 100 nm × 10 nm under the influence of a DC current defined by *β**j*_{e} = (10^{12}, 0, 0)A/m^{2}. For our simulations we choose *β* = 1 and thus *j*_{e} = (10^{12}, 0, 0) A/m^{2}. The material parameters are chosen similar to those of permalloy, namely *M*_{
s
} = 8 × 10^{5} A/m, *A* = 1.3 × 10^{−11} J/m, and *α* = 0.1. In the original problem definition, it is proposed to apply the model of Zhang and Li that extends the LLG (1) by current dependent terms

where *b* = 72.17 × 10^{−12} m^{3}/(As) is a coupling constant and *ξ* = 0.05 the degree of nonadiabacity. As shown in ref. 8 an equivalent set of material parameters for the diffusion model can be obtained by perceiving the Zhang and Li model as diffusion model in the limit of vanishing diffusion. For the diffusion model we choose *D*_{0} = 10^{−3} m^{2}/s, *β*′ = 0.8, and *τ*_{sf} = 5 × 10^{−14} s. The remaining constant *J* = 0.263 eV is then uniquely defined by the relations given in ref. 8. In order to solve this problem with the self-consistent model the additional conductivity constant *C*_{0} = 1.2 × 10^{6} A/(Vm) is introduced. Furthermore, instead of prescribing a constant current within the magnetic material, the current is applied in terms of boundary conditions. On the left side of the sample Γ_{N} = {** r**|

*r*

_{ x }= −50 nm} current inflow is set to

*j*_{e}·

**n**=10

^{12}A/m

^{2}and on the right side of the sample Γ

_{D}= {

**|**

*r**r*

_{ x }= 50 nm} the potential is set to 0. The remaining boundary is treated with homogeneous Neumann conditions in order to simulate current in- and outflow only through the contacts.

The results for the computation of standard problem #5 with the different methods are shown in Fig. 2. While the results for the averaged *x*-component of the magnetization are in very good agreement, the results for the *y*-component show a notable offset. The offset of the results of the Zhang and Li model to the remaining models is caused by the neglected diffusion. The offset of the self-consistent model to the simple diffusion model is caused by the inhomogeneous current distribution resulting from the self-consistent treatment.

## Resistance of multilayer stack with perpendicular current

The key advantage of the presented method over the simplified diffusion model introduced in ref. 8 is the self-consistent treatment of the electric potential *u*. The potential is computed considering not only Ohm’s law *j*_{e} = 2*C*_{0}** E** but also magnetization dependent contributions. This dependence is exploited for instance in sensor applications

^{1}. Consider a magnetic multilayer stack as shown in Fig. 1 with two homogeneously magnetized layers

*ω*

_{1}and

*ω*

_{2}separated by a conducting layer. The resistivity of this structure heavily depends on the tilting angle

*θ*of the magnetization in

*ω*

_{1}and

*ω*

_{2}. Namely an antiparallel configuration is known to result in a high resistivity while a parallel configuration leads to a low resistivity. This effect is referred to as giant magnetoresistance (GMR). The anisotropic magnetoresistance (AMR), which describes the change of electrical resistance as a function of the angle between electric current and the magnetization, is not considered in the presented model. In order to calculate the electric resistivity with the diffusion model, the potential difference between the contacts Γ

_{1}and Γ

_{2}is computed for a given current inflow. Note, that due to the homogeneous magnetization configuration within the magnetic layers, the simulation is quasi one-dimensional and the results do not depend on the lateral dimension of the stack.

For numerical experiments two magnetic layers with 5 nm thickness separated by a conducting layer with 1.5 nm thickness are considered. The system is contacted with 100 nm thick leads in order to justify the homogeneous boundary conditions on the spin accumulation as described in the model section. The potential is set to *u* = 0 at the bottom contact Γ_{1} and the current inflow is set to *j*_{e} · **n** = 10^{12} A/m^{2} on the top contact Γ_{2}. Note that the cross section of the system does not have any influence on the potential computation as long as it is constant throughout the stack.

Figure 3 shows the computed potential difference for different tilting angles of the magnetization in the two layers *ω*_{1} and *ω*_{2}. The material parameters in the magnetic regions are chosen similiar to those in the preceding section. In the conducting region Ω\*ω*, a different diffusion constant of *D*_{0} = 5 × 10^{−3} m^{2}/s and a conductivity of *C*_{0} = 6.0−10^{6} A/(Vm) is applied. Moreover, in Fig. 3(a), exchange strength *J* is varied in the whole stack Ω. In Fig. 3(b), the polarization parameter *β*′ is varied. The resulting potential is compared to a sine parameterization *a* + *b* sin^{2} (*θ*/2) that is often used to describe the GMR effect in such a stack^{18} in the presence of some in-plane current. The presented simulations, however, suggest that the potential and thus the resistivity of the stack in the presence of out-of-plane currents is not well described by a sine, but has a much narrower peak for certain choices of material parameters. Specifically the sine approximation is accurate only in the case of small *β*′ and *J* as shown in Fig. 4(a), where the parameters are chosen as *β*′ = 0.1 and *J* = 0.013 eV.

The deviation of the angular dependence of the resistivity from the sine approximation for some out-of-plane current was already observed in experiment^{19}. The authors of this work suggest to include a higher order sine term in order to fit the resistivity curve. Figure 4(b) shows the result of the fit with *a* + *b* sin^{2} (*θ*/2) + *c *sin^{4} (*θ*/2) for *J *= 0.082 eV and *β*′ = 0.8 which shows a good agreement with the simulated curve. A similar effect is also predicted in ref. 6, where the authors suggest the following expression for the angular dependence of the resistivity

The parameter *χ* depends on geometry and material of the involved layers and leads to a steeper peek if positive, which, according to the reference, is the case for all investigated systems up to then. Using *χ* as a fitting parameter, the results for *J* = 0.082 eV and *β*′ = 0.8 can be described with very high precision, see Fig. 4(b).

The same effect was also predicted theoretically in ref. 20 with a model of Valet and Fert^{21} and in ref. 22 with a two-dimensional diffusion model. However, these papers do not discuss the influence of material parameters onto the narrowing of the sine response in detail.

In the context of the diffusion model, the deviation from the simple sine approximation sin^{2}(*θ*/2) has its origin in two different effects. First, the cross product term *Js* × ** m**/

*ħ*in (10) describes the torque that is exerted from the magnetization on the spin polarization of the itinerant electrons. This torque is zero for parallel and antiparallel alignment of the magnetic layers and reduces the angle of the polarization of the itinerant electrons to the magnetization for any other alignment. Hence, for large

*J*this contribution leads to a lowered resistance for all alignments other than parallel and antiparallel, which results in the narrow peak observed in the simulation.

The second effect is a bit more subtle. For vanishing *β*′ the potential *u* from (9) varies linearly. Small values of *β*′ lead to small perturbations of this linear solution. While these perturbations have a clear effect on the overall potential difference, their effect on the spin accumulation ** s** due to (10) is negligible, leading to a clean sinusoidal response of the system as shown in Fig. 4(a). With increasing

*β*′ the perturbations of

*u*gain influence on the solution of

**s**which results in a distorsion of the sinusoidal response as seen in Figs 3 and 4.

## Conclusion

We propose a three-dimensional spin-diffusion model that simultaneously solves for the spin accumulation **s** and the electric potential *u*. By coupling this model to the Landau-Lifshitz-Gilbert equation, we are able to self-consistently solve the magnetization dynamics for a given current inflow. In order to validate the model and its implementation, we simulate the standard problem #5 proposed by the μMAG group and compare the outcome to results obtained with simplified models.

In a second numerical experiment, we compute the resistivity of a magnetic multilayer structure in dependence on the tilting angle of the magnetization in the two magnetic layers. In the limit of small polarization parameter *β*′ and a small exchange strength *J*, we show that the resistivity is well approximated by a sine. For realistic choices of *β*′ and *J* the angular dependence shows a significantly narrower peak than the simple sine approximation. While existing models already predict the observed behaviour in a macro spin approach, the presented model is able to accurately describe GMR effects for both dynamically and spatially varying magnetization configurations.

While the examples in this work consider either spin-torque effects or magnetoresistance, we want to stress that the presented model is also capable of simulating the interplay of the two effects. This interplay is for instance crucial for the description of spin-torque induced noise in GMR sensors that was found to be a significant contribution to the overall noise^{23}.

## A Discretization

We solve the coupled equations (1) and (9)–(10) numerically by employing the finite-element method for spatial discretization and a preconditioned BDF scheme as described in ref. 24 for the time integration that is applied nodewise. The BDF scheme is an implicit method and hence well suited for the solution of stiff problems. This stiffness of micromagnetic problems usually originates from the exchange interaction and the additional solution of the diffusion equation does not influence the stiffness noticeably. Typical time steps for this method are 10^{−13} s to 10^{−12} s. The demagnetization field is solved by a hybrid FEM–BEM method as introduced in ref. 25.

For the discretization of (9) and (10) special care has to be taken in the treatment of the discontinuities, e.g., in the magnetization ** m** introduced by magnetic–nonmagnetic interfaces. As usual the original problem is multiplied with test functions and integration by parts is applied to avoid second derivatives. Furthermore, first derivatives of the magnetization

**are eliminated in the same way and the integration domain for terms including the magnetization is restricted to the magnetized region**

*m**ω*. This way, the proposed algorithm naturally accounts for the magnetization jumps at the magnetic–nonmagnetic interfaces without the need of discontinuous function spaces for the discretization of

**.**

*m*The solution variables ** m**,

*u*and

**s**as well as the test functions

*v*and

**ζ**are discretized by (componentwise) piecewise affine, globally continuous functions constructed on a tetrahedral mesh. The material parameters

*β*,

*β*′,

*C*

_{0},

*D*

_{0},

*τ*

_{sf}, and

*J*are discretized with piecewise constant functions. For a given magnetization

**, the weak version of (9) reads**

*m*where the current in-/outflow is given by *g* as Neumann condition. The additional Dirichlet boundary conditions on Γ_{D} are embedded in the function space of the solution *u* as usual when employing the finite-element method. The weak version of (10) reads

## Additional Information

**Publisher's note:** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## References

- 1.
Daughton, J. GMR applications.

*J. Magn. Magn. Mater.***192**, 334–342 (1999). - 2.
Freitas, P., Ferreira, R., Cardoso, S. & Cardoso, F. Magnetoresistive sensors.

*J. Phys.: Condens. Matter***19**, 165221 (2007). - 3.
Huai, Y. Spin-transfer torque MRAM (STT-MRAM): Challenges and prospects.

*AAPPS Bulletin***18**, 33–40 (2008). - 4.
Kiselev, S. I.

*et al.*Microwave oscillations of a nanomagnet driven by a spin-polarized current.*Nature***425**, 380–383 (2003). - 5.
Mistral, Q.

*et al.*Current-driven microwave oscillations in current perpendicular-to-plane spin-valve nanopillars.*Appl. Phys. Lett.***88**, 192507 (2006). - 6.
Slonczewski, J. C. Currents and torques in metallic magnetic multilayers.

*J. Magn. Magn. Mater.***247**, 324–338 (2002). - 7.
Zhang, S. & Li, Z. Roles of nonequilibrium conduction electrons on the magnetization dynamics of ferromagnets.

*Phys. Rev. Lett.***93**, 127204 (2004). - 8.
Abert, C.

*et al.*A three-dimensional spin-diffusion model for micromagnetics.*Sci. Rep.***5**(2015). - 9.
Zhang, S., Levy, P. & Fert, A. Mechanisms of spin-polarized current-driven magnetization switching.

*Phys. Rev. Lett.***88**, 236601 (2002). - 10.
Sturma, M., Toussaint, J.-C. & Gusakova, D. Geometry effects on magnetization dynamics in circular cross-section wires.

*J. Appl. Phys.***117**, 243901 (2015). - 11.
Imamura, H. & Sato, J. Spin accumulation and mistracking effects on the magnetoresistance of a ferromagnetic nano-contact.

*J. Phys. Conf. Ser.***266**, 012090 (2011). - 12.
Garca-Cervera, C. J. & Wang, X.-P. Spin-polarized currents in ferromagnetic multilayers.

*J. Comp. Phys.***224**, 699–711 (2007). - 13.
Ruggeri, M., Abert, C., Hrkac, G., Suess, D. & Praetorius, D. Coupling of dynamical micromagnetism and a stationary spin drift-diffusion equation: A step towards a fully self-consistent spintronics framework.

*Physica B: Condensed Matter***486**, 88–91 (2016). - 14.
Hrkac, G.

*et al.*Influence of eddy current on magnetization processes in submicrometer permalloy structures.*IEEE Trans. Magn.***41**, 3097–3099 (2005). - 15.
Rado, G. & Weertman, J. Spin-wave resonance in a ferromagnetic metal.

*J. Phys. Chem. Solids***11**, 315–333 (1959). - 16.
Abert, C., Exl, L., Bruckner, F., Drews, A. & Suess, D. magnum. fe: A micromagnetic finite-element simulation code based on FEniCS.

*J. Magn. Magn. Mater.***345**, 29–35 (2013). - 17.
muMAG standard problem #5. http://www.ctcms.nist.gov/rdm/std5/spec5.xhtml. Accessed: 2016-03-04.

- 18.
Dieny, B.

*et al.*Giant magnetoresistive in soft ferromagnetic multilayers.*Phys. Rev. B***43**, 1297 (1991). - 19.
Dauguet, P.

*et al.*Angular dependence of the perpendicular giant magnetoresistance of multilayers.*Phys. Rev. B***54**, 1083 (1996). - 20.
Stiles, M. D. & Zangwill, A. Noncollinear spin transfer in co/cu/co multilayers (invited).

*J. Appl. Phys.***91**, 6812–6817 (2002). - 21.
Valet, T. & Fert, A. Theory of the perpendicular magnetoresistance in magnetic multilayers.

*Phys. Rev. B***48**, 7099–7113 (1993). - 22.
Strelkov, N.

*et al.*Spin-current vortices in current-perpendicular-to-plane nanoconstricted spin valves.*Phys. Rev. B***84**, 024416 (2011). - 23.
Katada, H., Nakamoto, K., Hoshiya, H., Hoshino, K. & Yoshida, N. Spin-torque noise in cpp-gmr heads with current screen layer.

*IEEE Trans. Magn.***42**, 2450–2452 (2006). - 24.
Suess, D.

*et al.*Time resolved micromagnetics using a preconditioned time integration method.*J. Magn. Magn. Mater.***248**, 298–311 (2002). - 25.
Fredkin, D. & Koehler, T. Hybrid method for computing demagnetizing fields.

*IEEE Trans. Magn.***26**, 415–417 (1990).

## Acknowledgements

The financial support by the Austrian Federal Ministry of Science, Research and Economy and the National Foundation for Research, Technology and Development as well as the Austrian Science Fund (FWF) under grant W1245 and F4112 SFB ViCoM, the Vienna Science and Technology Fund (WWTF) under grant MA14-44, the innovative projects initiative of TU Wien is gratefully acknowledged. A.M. acknowledges financial support from the King Abdullah University of Science and Technology (KAUST).

### Author Contributions

C.A. developed the micromagnetic model, implemented the algorithm, and performed the simulations. M.R. and D.P. developed the algorithm. F.B., C.V., A.M., and D.S. developed the numerical experiments and helped developing the model. All authors contributed to the paper writing.

### Competing financial interests

The authors declare no competing financial interests.

## Author information

### Affiliations

#### Christian Doppler Laboratory of Advanced Magnetic Sensing and Materials, Institute of Solid State, Physics, TU Wien, Austria

- Claas Abert
- , Florian Bruckner
- & Dieter Suess

#### Institute for Analysis and Scientific Computing, TU Wien, Austria

- Michele Ruggeri
- & Dirk Praetorius

#### Institute of Solid State Physics, TU Wien, Austria

- Christoph Vogler

#### Physical Science and Engineering Division, King Abdullah University of Science and Technology, (KAUST), Thuwal, 23955-6900, Kingdom of Saudi Arabia

- Aurelien Manchon

### Authors

### Search for Claas Abert in:

### Search for Michele Ruggeri in:

### Search for Florian Bruckner in:

### Search for Christoph Vogler in:

### Search for Aurelien Manchon in:

### Search for Dirk Praetorius in:

### Search for Dieter Suess in:

### Corresponding author

Correspondence to Claas Abert.

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

This work is licensed under a Creative Commons Attribution 4.0 International License. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in the credit line; if the material is not included under the Creative Commons license, users will need to obtain permission from the license holder to reproduce the material. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/