This type of analysis has essentially the same steps as a 2D static analysis:
To begin, set the analysis preference to Magnetic-Nodal and give the analysis a title. Then, use the preprocessor (PREP7) to define the items that make up the physics environment for the analysis, including element types and KEYOPT settings, material properties, and so on. For a 3D static analysis, most of these procedures are the same as those described in 2D Static Magnetic Analysis. The rest of this chapter contains information that is specific to 3D static analysis.
If you are running Mechanical APDL via the GUI, before you start building your model you should choose menu path . Then, on the dialog box that appears, select Magnetic-Nodal from the list of magnetic analysis types. Because the GUI filters the elements available to you based on the preference you choose, you must specify Magnetic-Nodal to ensure that you can use the elements needed for 3D static analysis.
Your model may have any or all of the following material regions: air, (free-space) permeable materials, current-conducting regions, and permanent magnets. Each type of material region has certain required material properties.
The material library contains definitions of several materials with magnetic properties. Instead of defining material properties from scratch, you can read these material properties into the database and, if necessary, modify them to match the materials in your analysis problem more closely.
Materials with magnetic properties defined in the Mechanical APDL material library are as follows:
| Material | Material Property File Containing Its Definition |
|---|---|
| Copper | emagCopper.SI_MPL |
| M3 steel | emagM3.SI_MPL |
| M54 steel | emagM54.SI_MPL |
| SA1010 steel | emagSa1010.SI_MPL |
| Carpenter (silicon) steel | emagSilicon.SI_MPL |
| Iron cobalt vanadium steel | emagVanad.SI_MPL |
The copper property presents temperature-dependent resistivity and relative permeability. All other properties are B-H curves.
The property definitions in the material library specify properties "typical" for the materials listed. Ansys, Inc. has extrapolated these properties to cover high saturation conditions. Your actual material values may differ from those supplied; therefore, you may need to modify the Mechanical APDL material library files you use.
The next few paragraphs explain basic procedures for reading and writing material library files. You can find a more detailed discussion of these procedures and the Mechanical APDL material library in Getting Started in the Basic Analysis Guide.
To read a material library file into the database, do the following:
If you have not already specified the system of units you are using, issue the /UNITS command or its GUI equivalent.
Note: The default system of units is MKS. The GUI lists only material library files with the currently active units.
Define the material library read path for the material of interest. (You will need to know which directory path your system administrator has used to store the material library files.) To do so, use either of the following:
GUI:Read the material library file into the database using one of the following:
GUI:
To write changes to a material library file, perform these steps:
Edit the material property definition using either the MP command or the GUI (). Make sure that your revised definition includes a material number and at least one material property value (for example, magnetic permeability or MURX).
From the PREP7 preprocessor, issue the command shown below:
GUI:
The next few paragraphs provide some guidelines for setting up physics regions for your model. In addition, you may want to consult 2D Harmonic Magnetic (AC) Analysis; it pictures and describes the regions that can exist within a 2D model.
Specify a relative permeability of 1.0. To do so, use one of the following:
Specify the B-H curve by reading from a material library or by creating your own B-H curve:
If the material is linear, all you need is the relative permeability μr (which may be isotropic or orthotropic). If you specify a B-H curve, it should meet the following requirements for the material to be represented accurately:
The B values must be unique for each H value, and must monotonically increase with H, as shown in Figure 2.1: B-H and Reluctivity vs. B Squared Curves(a). By default, the B-H curve will pass through the origin (that is, the 0.0 point is not to be explicitly defined). You can verify this by plotting B versus H using one of the methods shown below. (For more information, see the Element Reference.)
Command(s): TBPLOTGUI:The μ-H curve that Mechanical APDL calculated internally (where μ is the permeability) should be smooth and continuous. You can verify this by plotting μ versus H using TBPLOT. (See Figure 5.1: Connected Domains(b)). The B-H curve should cover the complete operating range of the material. If a point beyond the end of the curve is required, the B-H curve is extrapolated at constant slope. The constant slope should be equal to or greater than μr. You can view values in the extrapolated region by adjusting the x-axis range of your B versus H plot. To adjust the x-axis range, use one of the following:
Command(s): /XRANGEGUI:
Figure 5.2: B-H and mu-H Curves With Extrapolation

(a) B-H curve with extrapolation; (b) μ-H curve with extrapolation
For permanent magnets and nonlinear orthotropic materials, material input is the same as for 2D static analysis.
You can find most of the information you need to build a model for a 3D static scalar magnetic problem in the Modeling and Meshing Guide. For 3D scalar analyses, however, there are some special considerations for modeling current sources.
For information on modeling two contacted bodies, see Modeling Magnetic Contact. You can use contact to:
Model contact between bodies with dissimilar meshes (such as the air gap in a rotor/stator configuration)
Model the gap permeance between bodies without having to create a finite mesh of the void region between the bodies.
| Dissimilar mesh interface | DOF: MAG Contact elements: TARGE170, CONTA174, CONTA175 CONTA17x Keyoptions: KEYOPT(1)=7 (MAG), KEYOPT(2)=2 (MPC approach), KEYOPT(12)=5 |
| Contact permeance | DOF: MAG Contact elements: TARGE170, CONTA174, CONTA175 Real constant: MCC (contact permeance) (real constant number 26) CONTA17x KEYOPTS: KEYOPT(1)=7 (MAG) |
You can model current conduction regions with primitive sources, so they do not need material properties.
In a 3D scalar potential analysis, current sources are not modeled as an integral part of the geometry (as they are in a 2D analysis). Instead, you use a "dummy" finite element, SOURC36, to represent the shape and location of current sources. You can define coils, bars, or arcs at any location in the model. The amount of current and other current-source data are specified as element real constants. Figure 5.3: A Coil Source Represented by SOURC36 Elements shows an example of a coil current-source represented with SOURC36 primitives.
Note: You must model the entire current source even if the rest of the model uses half-symmetry or quarter-symmetry. Coil and arc elements cannot have a zero inside radius.
Because SOURC36 elements are not true finite elements, you can use only direct generation (not solid modeling) to define them. Direct generation uses the following menu paths or equivalent commands:
To display current source elements, use the commands or menu paths listed below (in the order shown):
The following is a command-based example of defining current sources.
/PREP7
ET,2, 36 ! Current source element
EMUNIT,MKS ! MKS units
! Define convenient parameters:
I=0.025 ! Current (amps)
N=300 ! Turns
S=0.04 ! Solenoid length
R=0.01 ! Solenoid radius
THK=0.002 ! Solenoid thickness
!
R=2,1,N*1,THK,S ! Real constant set 2: coil type, current
! thickness, length,
CSYS,1 ! Global cylindrical system
N,1001,R ! Nodes for the source element
N,1002,R,90
N,1003
TYPE,2 ! Attributes
REAL,2
E,1001,1002,1003 ! Element definition
/ESHAPE,1
/VIEW,1,2,1,.5
/VUP,1,Z
/TRIAD, LBOT
/TYPE,1,HIDP
EPLOTThe following example demonstrates the use of SOURC36 current source elements using three arcs of 120°.
/title,,,full circle coils against 3x120 and 6x60 degree arcs
/com
/com This example demonstrates the usage of SOURC36 current source elements.
/com It compares results of a full circle coils with
/com 6 arcs of 60 degrees and 3 arcs of 120 degrees
/com
/nopr
!
coil=1
arc=3
cur=10
dr=0.1 ! radius of source
dz=dr
eps=0.0005
ri=5 ! radius of the coil R >> dr,dz
step=1 ! step along Z
pi=3.1415926
n=21 ! Z = -10 to +10 by 1
*dim,hhx,array,n,3
*dim,hhy,array,n,3
*dim,hhz,array,n,4 ! to store targeted results in the center
*dim,hhs,array,n,3
/com ***** full coil (360 degrees) *****
/prep7
et,1,36
r,1,coil,cur,dr,dz,eps ! define the source
n,10001,ri, 0, 0
n,10002, 0,ri, 0
n,10003, 0, 0, 0
e,10001,10002,10003
et,2,96
mp,murx,1,1
n,1,0,0,-10*step ! define the calculated nodes
ngen,n,1,1,,,,,step
/solv
biot,new
/post1
*do,i,1,n
*get,hx,node,i,hs,x
*get,hy,node,i,hs,y
*get,hz,node,i,hs,z
hh=hx**2+hy**2+hz**2
hh=sqrt(hh)
hhx(i,1)=hx
hhy(i,1)=hy
hhz(i,1)=hz
hhs(i,1)=hh
*enddo
/com ! to check if hx=hy=0
/com********************** 360-degree coil **********************
/com Hx Hy Hz Hsum
*vwrite,hhx(1,1),hhy(1,1),hhz(1,1),hhs(1,1)
('H=',4f15.6)
/com*************************************************************
fini
/com *** arcs ***
/prep7
et,1,36
r,1,arc,cur,dr,dz,eps ! define the source
edele,all
ndele,all
n,10001,ri , 0, 0
n,10002, ri/2, ri*sqrt(3)/2, 0
n,10003,-ri/2, ri*sqrt(3)/2, 0
n,10004,-ri, 0, 0
n,10005, ri/2,-ri*sqrt(3)/2, 0
n,10006,-ri/2,-ri*sqrt(3)/2, 0
n,10007, 0, 0, 0
e,10001,10002,10007
e,10002,10003,10007
e,10003,10004,10007
e,10004,10005,10007
e,10005,10006,10007
e,10006,10001,10007
et,2,96
mp,murx,1,1
n,1,0,0,-10*step ! define the calculated nodes
ngen,n,1,1,,,,,step
/solv
biot,new
/post1
*do,i,1,n
*get,hx,node,i,hs,x
*get,hy,node,i,hs,y
*get,hz,node,i,hs,z
hh=hx**2+hy**2+hz**2
hh=sqrt(hh)
hhx(i,2)=hx
hhy(i,2)=hy
hhz(i,2)=hz
hhs(i,2)=hh
*enddo
/com
/com ****************** 6 times 60-degree arc *******************
/com Hx Hy Hz Hsum
*vwrite,hhx(1,2),hhy(1,2),hhz(1,2),hhs(1,2)
('H=',4f15.6)
/com*************************************************************
fini
/com *** 3 times 120-degree arcs ***
/prep7
et,1,36
r,1,arc,cur,dr,dz,eps ! define the source
edele,all
ndele,all
n,10001,ri , 0, 0
n,10002,-ri/2, ri*sqrt(3)/2, 0
n,10003,-ri/2,-ri*sqrt(3)/2, 0
n,10005, 0, 0, 0
e,10001,10002,10005
e,10002,10003,10005
e,10003,10001,10005
et,2,96
mp,murx,1,1
n,1,0,0,-10*step ! define the calculated nodes
ngen,n,1,1,,,,,step
/solv
biot,new
/post1
*do,i,1,n
*get,hx,node,i,hs,x
*get,hy,node,i,hs,y
*get,hz,node,i,hs,z
hh=hx**2+hy**2+hz**2
hh=sqrt(hh)
hhx(i,3)=hx
hhy(i,3)=hy
hhz(i,3)=hz
hhs(i,3)=hh
*enddo
/com
/com ***************** 3 times 120-degree arc *******************
/com Hx Hy Hz Hsum
*vwrite,hhx(1,3),hhy(1,3),hhz(1,3),hhs(1,3)
('H=',4f15.6)
/com*************************************************************
fini
! target result with Biot-Savart law
*do,i,1,n,1
hhz(i,4) = cur/2*ri**2/(ri**2+(i-11)**2)**(3/2)
*enddo
/com
/com ********************** Biot Savart *************************
/com
/com H(Z) = I/2*R^2/(R^2+Z^2)^(3/2)
/com
/com ************************************************************
/com ******************** 3 cases results ***********************
/com data
*vwrite,cur,dr,ri
(' current = ',f4.2,' Amp, radius section = ',f5.2,', coil radius = ',f5.2)
/com z= -10 to +10 by 1
/com
/com 360-degree 6*60-degree 3*120-degree target(B-S)
*vwrite,hhz(1,1),hhz(1,2),hhz(1,3),hhz(1,4)
('H=',4f15.6)
/com ************************************************************
/com
/com good approximation for radius section << coil radius
/com
/com ************************************************************
finishFor further information, see the descriptions of the following commands in the Command Reference: ET, EMUNIT, R, CSYS, N, TYPE, REAL, E, /ESHAPE, /VIEW, /VUP, /TRIAD, and /TYPE.
To help you build a 3D "racetrack" current source, Mechanical APDL provides the RACE command macro. To invoke this macro, use either of the following:
The RACE macro enables you to define a racetrack current source in the working plane coordinate system. The program generates the current source from bar and arc source primitives using the SOURC36 element (which is assigned the next available element type number). Current flows in a counterclockwise direction with respect to the working plane. See Electric and Magnetic Macros for additional details about this macro and a racetrack coil diagram.
To delete a racetrack coil, you delete individual SOURC36 elements using the EDELE command (). Before doing so, you should first review the elements to choose the appropriate elements to delete. Review elements using one of the methods shown below:
In addition to applying boundary conditions and loads, you also will need to specify load step options if you opt to step through the analysis manually, See Alternative Analysis Options and Solution Methods for details. The next few topics explain how to perform the tasks involved in a routine analysis.
The scalar potential formulation uses different boundary conditions (BCs) and loads than those for the vector potential formulation. Following are the appropriate BCs and loads and the menu paths to define them. (See Alternative Analysis Options and Solution Methods for information on applying loads or BCs via APDL commands.)
You access all loading operations through a series of cascading menus. When you choose , the program lists one BC category and three load categories. You then choose the appropriate category and the appropriate load or BC. The categories and BCs or loads you can choose for a 3D static analysis are as follows:
| -Boundary- | -Excitation- | -Flag- | -Other- |
|---|---|---|---|
| -Scalar Poten- | (none)[1] | Comp. Force | -Magnetic Flux- |
| On Keypoints | -Infinite Surf- | On Keypoints | |
| On Nodes | On Lines | On Nodes | |
| On Areas | On Areas | -Maxwell Surf- | |
| Flux Parallel | On Nodes | On Lines | |
| -Flux Normal- | On Areas | ||
| On Areas | On Nodes | ||
| On Nodes | -Virtual Disp- | ||
| On Keypoints | |||
| On Nodes |
See Excitation below.
For example, to apply the flux-normal condition on an area, choose this GUI path:
You may see other load types or BCs or loads listed on the menus. If they are grayed out, either they do not apply to 3D static analysis or the appropriate KEYOPT option on the element type has not been set. (However, the grayed-out items will be valid for other types of magnetic analysis; the Mechanical APDL GUI filters menu choices.)
Use magnetic scalar potentials (MAG) to specify flux-normal, flux-parallel, and far-field zero, and cyclic symmetry (periodic) boundary conditions, as well as an imposed external magnetic field. The following table shows the MAG values required for each type of boundary condition:
| Boundary Condition | Value of MAG |
|---|---|
| Flux-normal | MAG = 0 (Use the DSYM,SYMM command (.) |
| Flux-parallel | None required (occurs naturally) |
| Far-field | Use element INFIN47 or INFIN111 |
| Far-field zero | MAG = 0 |
| Periodic | Use Mechanical APDL's cyclic symmetry capability. |
| Imposed external field | Apply nonzero values of MAG. |
You supply current excitation via the SOURC36 element as noted previously. Invoking the RACE macro simplifies application of this type of coil arrangement.
Infinite surface flags are not actual loads, but they are used to indicate which surface of an infinite element faces toward the open (infinite) domain. Applying the INF label to an element face turns the flag on for that face.
This section describes the steps involved in solving a 3D static scalar magnetic analysis using the three solution methods available. Solution steps for the RSP method are presented first, followed by solution procedures for the DSP method and then the GSP method.
To enter the SOLUTION processor, use either of the following:
To specify the analysis type, do either of the following:
In the GUI, choose menu path and choose a Static analysis.
If this is a new analysis, issue the command ANTYPE,STATIC,NEW.
If you want to restart a previous analysis (for example, to specify additional loads), issue the command ANTYPE,STATIC,REST. You can restart an analysis only if you previously completed a 3D static magnetic analysis, and the files Jobname.emat, Jobname.esav, and Jobname.db from the previous run are available.
Next, you define which solver you want to use. You can specify any of these values:
Sparse solver (default)
Jacobi Conjugate Gradient (JCG) solver
Incomplete Cholesky Conjugate Gradient (ICCG) solver
Preconditioned Conjugate Gradient solver (PCG)
To select an equation solver, use either of the following:
Either the JCG solver or the PCG solver is recommended for 3D models.
Use the button on the Toolbar to save a backup copy of the database. This enables you to retrieve your model should your computer fail while analysis is in progress. To retrieve a model, re-enter Mechanical APDL and use one of the following:
Caution: If you use the BIOT option and issue the SAVE command () after solution or postprocessing, the Biot-Savart calculations are saved to the database, but will be overwritten upon normal exit from the program. To save this data after issuing SAVE, use the /EXIT,NOSAVE command. You can also issue the /EXIT,SOLU command to exit Mechanical APDL and save all solution data, including the Biot-Savart calculations, in the database. Otherwise, when you resume your analysis, the Biot-Savart calculation will be lost (resulting in a zero solution).
You can initiate the solution using either of the following:
To learn how to step manually through the solution sequence, see Alternative Analysis Options and Solution Methods.
To leave the SOLUTION processor, use either of the following:
The DSP method is recommended only if the model has singly connected iron regions. The DSP method uses the same procedures for building the model and reviewing results as the RSP method uses. (To see descriptions of these procedures, refer to the discussion of the RSP method.) However, for the DSP method you use different procedures to apply loads and obtain a solution.
The DSP method requires a two-step solution sequence:
You use the first load step to calculate an approximate air-only solution with iron regions internally set to a near-infinite permeability.
Using the second load step, you calculate the final solution with all regions reset to specified material properties.
Follow the steps shown below to perform the solution sequence:
Enter the SOLUTION processor, define the analysis type, define the analysis options, and apply loads according to the procedures described in the discussion of the RSP method.
Save a backup of the database to a named file, using either of the following:
Command(s): SAVEGUI:Caution: If you use the BIOT option and issue SAVE after solution or postprocessing, the Biot-Savart calculations are saved to the database, but will be overwritten upon normal exit from the program. To save this data after issuing SAVE, use the /EXIT,NOSAVE command. You can also issue the /EXIT,SOLU command to exit Mechanical APDL and save all solution data, including the Biot-Savart calculations, in the database. Otherwise, when you issue RESUME, the Biot-Savart calculation will be lost (resulting in a zero solution).
Specify magnetic solution options and initiate the two-step solution. To do so, use either of the following:
Command(s): MAGSOLV (with OPT field set to 3)GUI:Specify Main Menu> Finish or issue the FINISH command to end the solution.
The GSP method is the best method to use if the model has current sources and a multiply connected iron region. The analysis procedures are the same, except for the procedure for solving the model. The GSP method requires a three-step solution sequence where:
The first load step calculates an approximate iron-only solution.
The second load step calculates an approximate air-only solution.
The third load step calculates the final solution.
To obtain a solution for a GSP analysis, perform these steps:
Enter the SOLUTION processor, define the analysis type and options, and apply loads using the procedures described in Review Analysis Results (RSP, DSP, or GSP Method Analysis). Make sure that at least one node in the iron region has a specified scalar potential value of zero.
Save a backup of the database to a named file, using either of the following:
Command(s): SAVEGUI:Caution: If you use the BIOT option and issue SAVE after solution or postprocessing, the Biot-Savart calculations are saved to the database, but will be overwritten upon normal exit from the program. To save this data after issuing SAVE, use the /EXIT,NOSAVE command. You can also issue the /EXIT,SOLU command to exit Mechanical APDL and save all solution data, including the Biot-Savart calculations, in the database. Otherwise, when you issue RESUME, the Biot-Savart calculation will be lost (resulting in a zero solution).
Specify magnetic solution options and initiate the three-step solution. To do so, use either of the following:
Command(s): MAGSOLV (with OPT field set to 4)GUI:Specify or issue the FINISH command to end the solution process.
Results from a 3D static magnetic analysis (scalar potential formulation) consist of the following data:
Primary data: Nodal magnetic DOFs (MAG)
Derived data:
Nodal magnetic flux density (BX, BY, BZ, BSUM)
Nodal magnetic field intensity (HX, HY, HZ, HSUM)
Nodal magnetic forces (FMAG: components X, Y, Z, SUM)
Nodal reaction magnetic flux (FLUX)
etc.
Additional data also are available. See the Element Reference for details.
You can review analysis results in POST1, the general postprocessor, by choosing either of the following:
The following section, "Reading in Results Data," discusses some typical postprocessing operations for a 3D static magnetic analysis. For a complete description of all postprocessing functions, see the Basic Analysis Guide.
To review results in POST1, the database must contain the same model for which the solution was calculated. Also, the results file (Jobname.rmg) must be available.
To read the data from the results file into the database, use either of the following:
If the model is not in the database, restore it using the command or menu path listed below and then use the SET command to read in the desired set of results.
Flux lines are not readily available with the scalar potential formulation. Use vector displays of flux density to visualize flux paths.
Vector displays (not to be confused with vector mode) are an effective way to view vector quantities such as B, H, and FMAG. To produce vector displays, use either method shown below:
To produce vector listings, use one of the following:
You can contour almost any result item, including flux density and field intensity, using the following commands or menu paths:
Caution: Nodal contour plots for derived data, such as flux density and field intensity, are averaged at the nodes. In PowerGraphics mode (default), you can visualize nodal averaged contour displays which account for material discontinuities.
You can find details on how to graphically display a charged particle traveling in a magnetic field in Charged Particle Traces and Controlling Charged Particle Trace Displays in the Basic Analysis Guide. See Electromagnetic Particle Tracing in the Mechanical APDL Theory Reference for more details.
You can produce tabular listings of results data, either unsorted or sorted by node or by element. To sort data before listing it, use any of the following:
To produce tabular listings, use any of the following:
To review Maxwell or virtual work forces, use the following approach:
Maxwell forces are calculated for all elements at which the surface flag MXWF is specified as a surface "load." To list Maxwell forces, select all such elements, then select either of the following:
Command(s): PRNSOL,FMAGGUI:The sum of these forces gives the total force on the surface. To sum the forces, select all elements with the Maxwell surface and use the ETABLE command () to move the forces to the element table. Then issue the SSUM command ().
Virtual work forces are calculated for all air elements with an MVDI specification adjacent to the body of interest. One way to access virtual work forces is via the element's NMISC record. Do so by choosing either of the following:
Command(s): PRETABGUI:
In postprocessing, you can calculate many other items of interest from the data available in the database. The APDL command set supplies the following macros to perform calculations for you automatically:
See Electric and Magnetic Macros for details on these macros or the Command Reference.
