Calculations
In MagTense, a magnetostatic and a micromagnetism calculation framework is available. The basic pipeline for a magnetostatic calculation consists of three parts:
MagTiles
Evaluation points
State function
As output, the three-dimensional H-field vector in the evaluation points is returned.
Examples of how to calculate magnetostatic and micromagnetic problems can be found for Matlab and python, and the micromagnetic ones are described in Micromagnetic examples and validation.
The parameters of a micromagnetic problem are of a different kind than the MagTile properties below, and are documented separately in Micromagnetic parameter reference.
MagTile
type(MagTile),dimension(n_tiles) :: tiles
MagTiles are the basic structure of MagTense, where n_tiles is the number of given magnetic tiles. They can be specified with several parameters corresponding to the following properties:
Evaluation points
real,dimension(n_ele,3) :: pts
The three-dimensional evaluation points are defined with respect to the global coordinate system, where n_ele is the number of given points.
State function
type(MagStateFunction),dimension(n_stf) :: stateFunction
The state functions (hysteresis loops) for different materials and temperatures can be given and used if the given MagTile is representing a soft magnet, where n_stf is the number of given state functions.
Applied field
An external field that is the same at every point, such as the field of a
large electromagnet or a Helmholtz coil, is entered as a tile of type 102.
This tile is a pure field source: it needs no size, position or orientation,
and its M vector holds the applied field
\(\mathbf{H}_\mathrm{app}\) in A/m. Like the planar coil it keeps its
value throughout the iteration. It acts in two places:
it is part of the field that magnetizes every other tile in the iteration, which is what lets a soft magnet alone in space acquire a magnetization, and it enters before the self-consistent field of a soft tile is formed, so the permeability of the tile sees the total field;
it is added to the H-field returned at the evaluation points, so the returned field is the total field, applied plus that of the tiles.
The value is an H field. The source is by definition outside all tiles, where
\(\mathbf{B}/\mu_0\) and \(\mathbf{H}\) coincide, so a field known as
\(\mathbf{B}\) in tesla is divided by \(\mu_0\) before it is entered.
The field inside a magnetized body is handled by the tiles themselves: for the
cylindrical tile MagTense computes \(\mathbf{B}/\mu_0\) inside the tile
and subtracts \(\mathbf{M}\) to get \(\mathbf{H}\) there, as part of
the tile’s own field. The field of other MagTense tiles enters the problem
directly: put those tiles in the same problem, with includeInIteration set
to zero if they are permanent magnets whose magnetization should stay fixed,
and the iteration uses their field, correction included.
In Python the source is appended with tiles.add_uniform_field(H_app), in
Matlab with tile.setMagTileType('Uniformfield') and tile.M = H_app, and
in the standalone input file with tile type 102 and the field in the M
line. A soft sphere with constant permeability \(\mu_r\) in such a field is
the standard check: its magnetization is
\(\mathbf{M} = 3 (\mu_r - 1)/(\mu_r + 2)\,\mathbf{H}_\mathrm{app}\), and
soft_sphere_in_uniform_field.py
and its Matlab counterpart
Example_005_soft_sphere_in_uniform_field reproduce it.
H-field
real,dimension(n_ele,3) :: H
The three-dimensional H-field is returned in the unit \([A/m]\) and its vector is given with respect to the global coordinate system. It is the total field: the field of the tiles plus any Applied field.