Skip to content

Magnetism A-formulation

This page derives the weak formulation for magnetostatics using the magnetic vector potential A\boldsymbol{A} and describes the available interactions and couplings in Allsolve.

Our starting points along with the material relation are

B=0×H=JB=μH.\begin{align*} \nabla \cdot \boldsymbol{B} &= 0 \tag{1} \\[5pt] \nabla \times \boldsymbol{H} &= \boldsymbol{J} \tag{2} \\[5pt] \boldsymbol{B} &= \mu \boldsymbol{H}. \tag{3} \end{align*}

Since the magnetic field is divergence-free, we can use the identity for divergence of a curl and write the magnetic field as a curl of some vector A\boldsymbol{A}

B=×A.\begin{align*} \boldsymbol{B} = \nabla \times \boldsymbol{A}. \tag{4} \end{align*}

Vector A\boldsymbol{A} is called a magnetic vector potential. By substituting (4)\text{(4)} into (3)\text{(3)} and rearranging, the material relation becomes

H=1μB=1μ(×A).\begin{align*} \boldsymbol{H} = \frac{1}{\mu} \boldsymbol{B} = \frac{1}{\mu} \left( \nabla \times \boldsymbol{A} \right). \tag{5} \end{align*}

Substituting (5)\text{(5)} into (2)\text{(2)}, the strong form becomes

×H=1μ(×A)=J.\begin{align*} \nabla \times \boldsymbol{H} = \frac{1}{\mu} \left( \nabla \times \boldsymbol{A} \right) = \boldsymbol{J}. \tag{6} \end{align*}

To obtain the weak form, multiply (2)\text{(2)} by the test function A\boldsymbol{A}^\prime and integrate over the domain Ω\Omega:

Ω (×HJ)A dΩ=0Ω (×H)A dΩΩ JA dΩ=0.\begin{align*} \int_{\Omega}\ (\nabla \times \boldsymbol{H} - \boldsymbol{J}) \cdot \boldsymbol{A^\prime}\ d \Omega = 0 \tag{7} \\[5pt] \int_{\Omega}\ (\nabla \times \boldsymbol{H}) \cdot \boldsymbol{A^\prime}\ d \Omega - \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega = 0. \tag{8} \end{align*}

Using the identity for divergence of a cross product on the first term we get

Ω (H×A) dΩ+Ω H(×A) dΩΩ JA dΩ=0.\begin{align*} \int_{\Omega}\ \nabla \cdot (\boldsymbol{H} \times \boldsymbol{A^\prime})\ d \Omega + \int_{\Omega}\ \boldsymbol{H} \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega - \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega = 0. \tag{9} \end{align*}

Applying the divergence theorem on the first term we obtain

Γ (H×A)n dΓ+Ω H(×A) dΩΩ JA dΩ=0.\begin{align*} \int_{\Gamma}\ (\boldsymbol{H} \times \boldsymbol{A^\prime}) \cdot \boldsymbol{n}\ d \Gamma + \int_{\Omega}\ \boldsymbol{H} \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega - \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega = 0. \tag{10} \end{align*}

Using the scalar triple product rule on the boundary term we get

Γ (n×H)A dΓ+Ω H(×A) dΩΩ JA dΩ=0.\begin{align*} \int_{\Gamma}\ (\boldsymbol{n} \times \boldsymbol{H}) \cdot \boldsymbol{A^\prime}\ d \Gamma + \int_{\Omega}\ \boldsymbol{H} \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega - \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega = 0. \tag{11} \end{align*}

Substituting (5)\text{(5)} in the second term and by rearranging we get the final weak form as

Ω 1μ (×A)(×A) dΩ+Ω  JA dΩ+Γ (n×H)A dΓ=0.\begin{align*} \int_{\Omega}\ \frac{1}{\mu}\ (\nabla \times \boldsymbol{A}) \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega + \int_{\Omega}\ -\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega + \int_{\Gamma}\ (\boldsymbol{n} \times \boldsymbol{H}) \cdot \boldsymbol{A^\prime}\ d \Gamma = 0. \tag{12} \end{align*}

Imposes a zero tangential magnetic field n×H=0\boldsymbol{n} \times \boldsymbol{H} = 0 on the boundary, equivalent to a perfect magnetic conductor (PMC). In the A-formulation, this is a natural boundary condition, meaning it is satisfied automatically if no other condition is applied.

Defines a remanent magnetization Br\boldsymbol{B_r} for permanent magnets. Can be specified as a constant vector or as a vector valued function.

How to useYou can use either the matrix editor or the expression editor. With the matrix editor, provide a 3×1 matrix for a 3D problem (2×1 for 2D, etc.) with remanence field vector values for each dimension. In the expression editor, write the direct expression.
Example[1; 5; 0] applies a 3D remanence field of Br,x=1TB_{r,x} = 1\:T, Br,y=5TB_{r,y} = 5\:T and Br,z=0TB_{r,z} = 0\:T to the specified region. Same principles apply for 2D. See also Adding spatially varying remanence field to permanent magnets.
UnitRemanence magnetic field in Teslas (T)

Imposes periodic boundary conditions on the magnetic vector potential field A\boldsymbol{A} between two boundaries. Reduces the computational domain size for geometrically symmetric or antisymmetric problems, avoiding the need to model the full geometry.

ExamplePeriodicity follows the same principles, regardless of which physics module it belongs to. See how periodicity is used in magnetism as a reference: Periodicity in electric motors

This formulation supports the following couplings:

  • A-v coupling
    • Current flow