Magnetostatic

Magnetostatics is used when information of the magnetic field that surrounds a conductor is needed. In this context, a DC Conduction Steady Steate analysis is sometimes used as a preprocessing step, and the resulting currents are used as input to a subsequent magnetostatics analysis. This would be the case, for example, when analysing electromagnets. The fundamental material property for performing magnetostatics analysis’ is the relative magnetic permeability \(\mu_{r}\). For nonlinear magnetostatics analyses, a more general material relationship may be needed, such as a functional relationship between the magnetic field and the magnetic flux density: a so-called B-H curve. The ultimate goal of a magnetostatics analysis is, in many cases, to compute the forces and torques in a system of magnetic components.

Analysis of permanent magnets constitutes an important, special case of magnetostatics analysis. In this case, a permanent magnetization is the source of the magnetic field instead of an electrical current. In such cases, the magnetic flux strength and direction as well as forces are important analysis results.

Core and Inductor (Beginner)

In this example it is shown how to build up and analyse simple models in 2D or axial-symmetric situations. An electric coil is positioned near a magnetic core. The electric current in the coil creates a rotating magnetic field (ampere law), that affects the magnetic core material. We want to calculate for the magnetic field strength and flux density in the core. Also, we want to find the mechanical forces acting on the core.
The picture below left shows a sketch representing the model. In the 2D case, we assume an extruded geometry that is simulated by flat 2D elements and an applied thickness (150 mm.) On the right side, there is shown how this would look like in an axial-symmetric case (an angular piece is shown).
The coil is loaded with electric current of 5 Ampere DC and 36 winding-turns.
Following to this 2D analysis (with thickness) we will use the same model to analyse for the axial-symmetric situation.

image

Estimated time: 45 min. Follow the steps in Simcenter:

Preparations

  1. download the model files for this tutorial from the following link:
    https://www.magnetics.de/downloads/Tutorials/3.MagSta/3.1CoreInductor.zip

  2. unzip the archive. There will be one folder ’start’ and one ’complete’.

  3. Start the Program Simcenter image (or NX). Use Version 10 or higher.

  4. In Simcenter, click Open image and navigate to folder ’start’. Select the file ’CoreInductor.prt’ and click OK. (Maybe you must set the file filter to ’prt’)

  5. From toolbar Application click on ’Pre/Post’ image and the system switches into the simulation application.

  6. Hints: All information describing the Simcenter simulation is managed in basically three files (picture below): The Sim, the Fem and the Idealized file. The Sim file contains the solution, boundary conditions, loads. The Fem file contains the finite-element meshes, material properties and other physical properties. The Idealized file is optionally and can be used for simplifications or modifications of the CAD geometry without changing the original CAD file.
    image

Fem and Sim File Creation

Following, we will first create the Fem and Sim file structure and then we will fill it up with data. We will create the Fem and Sim files in two separate steps, which has the advantage that we can choose a Fem-file-template. The template already contains basic material properties. The ’Simulation Navigator’ will allow us navigating in the file-structure.

  1. Click on ’New FEM’ image.
    (’New FEM’ is also found at RMB on the master part in Simulation-Navigator)
    image

  2. In window ’New Part File’, select the MAGNETICS-template, check file name and folder (use work part location for all parts) and click ’OK’.
    image image
    (Messages ’Unsecure Solver Language File’ may appear and can be accepted)

  3. The window ’New FEM’ appears.
    imageimage

  4. Click on ’New Simulation’ image (or find this RMB on the Fem file).
    image

  5. A window ’New Part File’ appears in which you again select the MAGNETICS-template and check for the new name and folder. Click ’OK’. In a further window ’New Simulation’, also click ’OK’.
    imageimageimage
    The Sim file is now also created.

  6. Following, a window ’Solution’ appears
    (if this does not automatically appear, click on ’Create Solution’) image)

Fem File Steps

  1. We are now going to create finite element meshes. Therefore, use the Simulation Navigator to set the Fem file to ’Open in Window’.
    image

  2. Mesh the Coil

  3. Assign Properties to the Coil

  4. Mesh the core:

  5. Assign Properties to the Core

  6. Mesh the inner air
    Hint: In most cases air meshes are created as the last meshing step.

  7. Meshing the Infinity Air:

  8. Assign Properties to the Infinity Air

  9. As the final step in the Fem file, click on the button ’Auto Rename’ image from the Magnetics toolbar. That utility renames all meshes and Physicals depending on the collector-names. It is a useful feature, especially with larger models and many meshes. Post processing becomes easier, thus we recommend this always to run after the meshing is done.
    image image image
    The picture above left side shows prior, right after the auto-rename.

Sim File Steps

  1. We are now going to create boundary conditions. Therefore, set the Sim file to the displayed part. (The meshes are blanked here for easier visibility)
    image

  2. Create a load for the electric current on the coil:

  3. Understanding constraints

  4. Creating constraints.
    According to such needs, now we will create two tangent and one normal constraint.

  5. Solve the solution:

  6. Post Processing Force Results

  7. Post Processing Magnetic Flux Density

Axisymmetric Analysis of Core and Conductor

To analyze in an axial symmetric way (axis is Y) using the same geometry follow these steps:

  1. Clone the solution and

  2. Rename the new solution to ’Axisym1’.
    image

  3. Choose ’Edit Solution’ on the new ’Axisym1’ and switch to register ’2D’. Activate ’Axisymmetric’ and click OK.
    Hint: To use axis symmetric analysis, it is necessary to place all elements on the x/y plane for positive x. The axis must be Y.
    image

  4. Solve the solution image and post process the results:

  5. Check the force sum in Y direction again. It should be about 0.08 N. The axisymmetric effect (2*Pi) is already taken into account.

  6. The tutorial is complete. Save your files and close them.

Static Force on Solenoid (TEAM 20) (Beginner)

This example is a convenient training for all those who want to do electromagnetic analysis with complex 3D geometries, because it contains most necessary skills for dealing with this.

The Team20 benchmark is a test example for electromagnetic analysis software tools. There are measured force-results available that we will use for comparison with the simulation-results. We will use a nonlinear B-H curve that includes saturation effects for the core and iron parts.

image

For meshing, we want to exploit the ’Non-Manifold’ strategy, which automatically finds adjacent face pairs and creates conformal meshes (e.g. coincident nodes) at those interfaces. Thus, no Mesh-Mating conditions are needed any more. Unfortunately, this must be done differently in the different NX/Simcenter versions. Prior to NX 1953 (2021.1) this approach is not possible at all and must be replaced by the conventional Mesh-Mating method.

Necessary time: 1 h.

Preparations

  1. download the model files for this tutorial from the following link:
    https://www.magnetics.de/downloads/Tutorials/3.MagSta/3.2Team20.zip

  2. unzip the archive. There will be one folder ’start’ and one ’complete’.

  3. Start the Program NX image or Simcenter image. Use Version 12 or higher.

  4. In NX/Simcenter, click Open image and navigate to folder ’start’. Select the file ’Team20.prt’ and click OK. (Maybe you must set the file filter to ’prt’)

  5. From toolbar ’Application’, click on ’Pre/Post’ image.
    The system switches into the simulation application.

  6. Hint 1: All information describing the simulation is managed in basically three files (see below): The Sim, the Fem and the Idealized file. The Sim file contains the solution, boundary conditions, loads. The Fem file contains the meshes, material properties and other physical properties. The Idealized file is optionally and can be used for simplifications or modifications of the geometry without changing the original CAD file.
    image
    Following, we will first create this file structure and then we will fill it up. The ’Simulation Navigator’ will allow us navigating through the structure.

  7. Hint 2: Notice, in the CAD Model, there is a spline curve extracted from the outside edges of the coil (see highlighted in below picture). This spline will be used to define the winding directions. It is necessary, that this spline is one single curve. In case there are multiple curve segments, there must be done a ’Join Curve’ operation to make one spline out of them. We will later have to activate one special button to transfer this spline into the Fem file.
    image

  8. Hint 3: A spherical air volume is placed around the solid geometry and an additional spherical shell is placed around the sphere. This sphere is necessary to model the magnetic (and in other cases also the electric) field in air. The shell additionally models the infinity air. We could solve without the infinity air, but in that case the air volume would have to be large enough to model the field. In case it would be too small, the simulation would model that field too much ‘compressed’ and results would become inaccurate. To decide about the size of such an air volume, it should also be considered whether the field ‘wants’ to leave the solid geometry (flux leakage): If there is a closed iron path, holding the magnetic flux like in our case, there is no need for a big sphere. In other cases, there may appear more flux leakage and the air volume should be larger. Instead of using a large air volume, we rather want to use infinity elements just like we already did in the previous tutorial ‘Core and Inductor’. In this example, we use a sphere, but alternatively box geometries would work as well. Advantage of a sphere is that it is kind of natural for the field lines. Also this makes it simple using infinity elements.
    imageimage

Create Fem and Sim Files

This step must be done differently in the different NX/Simcenter versions because of the non-manifold feature we want to use. For more details, see chapter ’Recommended System Settings’.

  1. Version 2212: In toolbar Magnetics, click ’New Fem and Sim (Non Manifold)’. This runs a script to create the Fem and Sim files from templates with non-manifold feature.
    image

  2. Version 2007 (2022.1) and 2206 (2022.2):

  3. Version 1953:

Create the Solution

  1. In toolbar ’Home’, click on ’Create Solution’ image

  2. Accept the Solver ’MAGNETICS’ and the Analysis Type ’3D Electromagnetics’,

  3. Accept the default Solution Type ’Magnetostatic’.

  4. Click ’Create Solution’.

  5. In register ’Output Requests’, ’Table’, activate ’Total Force - entire (virtual)’ to enable the system calculate forces by the virtual energy method.

  6. to see these forces in the plots and also the applied currents, also activate in ’Plot’ ’Current Density’ and ’Nodal Forces - entire (virtual)’.
    imageimage

  7. Click OK to finish the Solution window.

Parametric Meshing

Following, we will create all element-sizes using one control-parameter ’MeshFactor’. This makes it simple later to do studies with different mesh-sizes and therefore, we recommend this approach.

  1. Do a ’Open in Window’ to the Fem part.
    image

  2. Mesh the CORE: Start the mesher ’3D Tetrahedral’ image, select the core body (either in the graphics window or in the Polygon Geometry list) and activate ’Automatic Element Size’. In the field ’Element Size’, key in ’MeshFactor=1’ to create and initialize the parametric expression. Check, that ’Destination Collector’ is ’Automatically Creation’ and click ’Apply’. The mesh is created.
    image

  3. Mesh the remaining parts with nearly the same settings as follows:

    Hint: the order of creation of meshes is quite important: Following meshes must always connect to the existing nodes of prior meshes. Thus, we should always start with the most important parts.

  4. The meshes are still quite coarse, because of the MeshFactor=1. We want to globally reduce the mesh size to the half. Thus, change the expression ’MeshFactor’ to 0.5. This is done in the ’Expressions’ window (Menu, Tools, Utilities, Expressions).
    image
    After the new value is set, click the ’Update’ button and all elements will become smaller. The picture below shows left the old and right the new meshes of core, iron and coil.
    imageimage

Define Core/Iron Material with Nonlinear B-H Curve

In this chapter, we define a typical steel material that is used for the core and iron bodies. This material shows a nonlinear relationship between magnetic flux-density (B) and magnetic field-strength (H). Such a relation is often the case for steel and iron. Many material properties are already available in the material library, but often, we must insert individual data and define a individual material. The data points with H-B pairs are stored in a csv file (Team20MaterialCurve.csv) in the ’start’ folder of this tutorial. Proceed as follows to create a new material with these:

Define Stranded Coil Properties

Following, we will define the properties of the coil. Even though the CAD model is a simple solid, in the simulation we want to define the electric current as flowing through individual turns.

  1. Edit the Physical of the coil mesh.
    image image

  2. In the box ’Conductor Model’, set the options as follows:

  3. Set ’Model’ to ’Stranded, Vectors defined in Mesh Associated Data’. This allows forcing all electric currents flowing in directions of the winding. Using this stranded method you will get a homogeneous distribution of the current over the face. In a following step we will define these directions using a spline curve.

  4. At ’Material’, choose the copper from the list. (There are already some basic materials in the list because of the template that was used at creation)

  5. Set ’Number of Turns’ to 1000,

  6. Accept ’Fillfactor’ is 1, This setting influences the ohm resistance of the coil.

  7. Set ’Coil Section Area’ to 1738.8 mm\(^{2}\). See next picture (right) for an explanation how this area is computed.
    imageimage

  8. Define the winding directions. We first have to add the spline curve into the Fem file, which in CAD was extracted from the coil edges. To do this: edit the Fem file, click ’Geometry Options’ and activate ’Splines’ in the following window. Click OK, OK.
    imageimage image

  9. Now, do RMB on the mesh of the coil, Choose ’Edit Mesh Associated Data’.
    image

  10. In the next window, set the option ’Material Orientation’ to ’Tangent Curve’ and select the spline curve for the stranded winding direction. (Blank the meshes and air volumes for easier selection)
    imageimage

  11. Hint: Maybe, the spline curve is not visible. In that case, you have to fully load the CAD file of the coil. Therefore, simply make the coil the work part once.

  12. Hint: You can activate ’Preview’ to see the arrows pointing in positive direction. If later, current is defined on this coil, it will be forced in this direction.
    imageimage

  13. Click OK, OK to finish the coil definition.

Define Infinity Properties

  1. First, delete the existing Physical named ’AIR_INF’, because it has been automatically created with type ’SolidPhysical’, but we need one with type ’Infinity3D’: From toolbar ’Home’, ’Properties’, choose ’Physical Properties’ image, select the ’AIR_INF’, which is of SolidPhysical type and click ’Delete’ and ’Close’.
    image

  2. Now, create a correct Physical: Edit the mesh collector ’AIR_INF’, set the ’Type’ to ’Infinity3D’, select ’Open Manager’, accept the default type ’Spherical Shell’ and key in the two values for ’Inner Radius at Shell’ and ’Shell Thickness’ as shown below. Click OK, OK.
    image image
    Hint: The value ’Inner Radius at Shell’ is slightly reduced (3 mm, and the thickness value adds 3 mm to compensate) to avoid error messages like ’Bad parameters for transformation Jacobian’ that may appear from the solver. The reason for that error is that all elements of AIR_INF must be inside the two radii. But if the mesh is coarse, there may some element-edges crossing the radius value. To allow also these elements, we do that reduction.

Finish Fem File

This step is not necessary if in customer defaults, the setting ’Use Polygon Body Names for Meshes and Physicals’ is activated, see chapter ’Recommended System Settings’.

Define Load and Constraint

  1. Switch to the Sim file.
    image

  2. To keep the magnetic flux inside the air sphere, it is necessary to use a constraint ’Flux tangent’. To do so, click on ’Constraints\(\rightarrow\)’New Constraint’\(\rightarrow\)’Flux tangent (zero a-Pot)’ image. Select all 8 outside faces of the air volume. Click OK.
    image
    imageimage

  3. To create an electric current load for the coil:

Solve and Post Processing

  1. Solve the solution: Click on image and OK. The solver will run about 20 sec.

  2. Post processing

  3. Variants with 3A, 4.5A and 5A
    We want to compute two other electric currents and compare them with reference measurements. Solve using the following values for the current and compare the results against measurement data (Reference data is from [TakahashiNakataMorishige]).

Loss of Accuracy

Loss of accuracy normally results mainly from the mesh because of the approximation of finite elements. Thus, finer meshes or using higher order shape functions will help. On the other side, if there is an nonlinear material included, there also results some loss of accuracy from the nonlinear scheme what can be controlled by the residual tolerances. We will use both in the following.

Increasing Accuracy by Reducing Nonlinear Residuals

Because we us a nonlinear BH curve in one of the materials, there runs a Newton-Raphson-Iteration-loop in the solver. Tolerances control how tight our solution will be to the given BH curve. Thus, the first thing we do is reduce this tolerance by one order. Proceed as follows:

  1. RMB on the solution, click ’Edit Solver Parameters’. In register ’Numeric’, box ’Nonlinear Magnetic Material’, set ’Newton-Raphson-Method’ to ’Advanced Scheme (Default)’.

  2. reduce the two tolerances by one order, thus, from 5e-5 to 5e-6.
    image

  3. Solve again for the three currents and compare the force results. You may also notice in the logfile that the number of required iterations to converge increases.

  4. now we reduce the two tolerances again by one order to 5e-7. Solve again and find: results are the same as before. Thus, the prior tolerance 5e-6 worked already well.

  5. Set the two tolerances back to 5e-6.

Increasing Accuracy by global higher Order Shape Functions

The shape functions define the approximation of the main result in the finite elements. we can increase the order without changing the mesh. We use so called hierarchical shape functions, that means, no midnode elements are necessary. Increasing the order strongly increases the number of degrees of freedom (DOFs or unknowns) in the equation system. This results in more solve time and much more necessary memory (RAM). The number of DOFs is shown in the solution monitor quite at the beginning. There are several systems shown. The relevant one is simply the largest one. The picture below shows the DOFs with the origin (first order) left and a solve with third order on the right. Notice, that the number has increased by a factor of nearly 5.
image image
To test with third instead of first order, do this:

  1. switch to the Fem file,

  2. edit the physicals of Core, Iron, Air (if you want, also the coil) and for each of them

  3. in box ’Electromagnetic Solutions’, set the ’Shape Functions’ to ’Third Order’.
    image

  4. solve again for the three currents. The solve time will increase a lot. Compare the results:

Increasing Accuracy by local higher Order Shape Functions

Because the globally increased order of shape functions strongly increases the number of DOFs, there exists a feature for increasing that order on elements being connected to edges or faces. This is often a good compromise because the DOFs increase only slightly but the accurate shape functions are installed. For good efficiency, we should select faces or edges with sharp corners. Or simply those, where the magnetic fluxdensity changes rapidly. Proceed as follows for a test:

  1. switch back to the Fem file and set all physical shape functions back to ’First Order’

  2. switch to the Sim file.

  3. Create a ’Simulation Object’ of type ’Locally increased Order’
    image

  4. Accept the default type ’on Edges’ and select the 6 sharp corner edges at the upper side, where we have already seen the magnetic fluxdensity changing rapidly. These are shown in the picture.
    image image

  5. In ’Electromagnetic 3D Order’, set the ’Shape Function’ to ’Third Order’

  6. Create another ’Locally increased Order’, now set the type to ’on Faces’ and select the two faces at the lower side, where the flux jumps over the air-gap between the core and iron. Set the order to 3 here too.
    image image

  7. solve again for the three currents. Notice, that we now have 53345 DOFs, only a little more than with full first order.

Increasing Accuracy by Adaptive Meshing

To increase the result accuracy, one can also use adaptive meshing.

  1. Remove the two ’Locally increased Order’ features from the model first.

  2. set the core, iron and air physicals to ’Third Order’.

  3. Activate the button ’Perform Adaptive Meshing’ in the edit solution dialogue at register ’Adaptive Mesh’ as shown in the below picture. All default settings, as seen below, can stay in many cases.
    image

  4. The feature adaptive meshing takes more time to solve because it reflects the results and changes the mesh to find an optimal mesh. Therefore, it should be used only with one electric current value. For the other values, it should be switched off, so the system will use the already adapted mesh. Using this, we get the final result values as shown below.

    The mesh, as it comes out of the adaptive meshing process, is demonstrated in the below picture.
    image

This tutorial is complete. Save your files and close them.

Force on Magnet (TEAM 23)

In this tutorial forces between a coil and core are computed in 2D at different positions. A parameter sweep is performed to vary different CAD positions of the magnet. The model is already set up, we just have to create a second solution with a parameter sweep.

image

  1. download the model files for this tutorial from the following link:
    https://www.magnetics.de/downloads/Tutorials/3.MagSta/3.3ForceMagnetTeam23.zip

  2. unzip the archive. There will be one folder ’start’ and one ’complete’.

  3. Start the Program Simcenter image (or NX).

  4. In Simcenter, click Open image and navigate to folder ’complete’. Select the file ’Team23_sim1.sim’ and click OK. (Maybe you must set the file filter to ’.sim’) This file already contains the meshes, physical properties, loads and constraints.

  5. Create a new Solution image.

  6. click RMB on the solution ’2nd_Order_VarDis’ and click ’Edit Solver Parameters’.

    imageimage

  7. Explanation:

  8. Solve the ’VarDis’ solution.

  9. Open the ’.VarDis.Force.txt’ file or export the table in EXEL.
    Following two plotted graphs of the forces in the Y-direction.
    image
    One can see that the force becomes smaller with greater distance. This is because of the magnetic effect.