!! This ANSYS file models a permanent magnet in 3D. !! It is not very parameterised, but it should show the basics. !! 2004 Will Robertson /TITLE,3D single magnet static analysis ! Filter out unneeded options in the GUI: KEYW,PR_SET,1 KEYW,PR_ELMAG,1 KEYW,MAGNOD,1 ! Preprocessor: /PREP7 EMUNITS,MKS wx = 0.01 wy = 0.01 wz = 0.01 ! Dimensions of the magnet cx = 2 cy = 2 cz = 2 ! Scale constants for surrounding air lx = cx*wx ly = cy*wy lz = cz*wz ! Distances between magnet and surrounding air boundary Tx = 2*lx+wx Ty = 2*ly+wy Tz = 2*lz+wz ! Total air dimensions !! Material properties: ET,1,SOLID97 ! Air: Element #1 MP,MURX,1,1 ! Air: Material #1 (Permeability = 1) ET,2,SOLID97 ! Magnet: Element #2 MP,MURX,2,1 ! Magnet: Material #2 (Permeability = 1) MP,MGZZ,2,1E6 ! (Coercive force component, Z direction) !! Geometries: BLOCK,0,Tx,0,Ty,0,Tz ! Air volume BLOCK,lx,lx+wx,ly,ly+wy,lz,lz+wz ! Magnet volume VATT,2,,2 ! Assign magnet volume material & element #2 ALLSEL ! Select all VSBV,1,2,,,KEEP ! Subtract magnet volume (and keep it) from ! the air volume (don't keep it) to create ! the air volume with magnet-shaped hole VSEL,U,MAT,,2 ! UNselect objects with material #2 (ie magnet) VATT,1,,1 ! Set the air to material & element #1 !! Annotate: (display magnetisation direction with arrow) /LSPEC,15,0,4 ! color: 15 = white, type: 0 = solid line, scaling: 4 /AN3D,arrow,2,lx+wx/2,ly+wy/2,lz,lx+wx/2,lz+wy/2,lz+wz ! 2: arrowhead scaling ALLSEL ASEL,S,EXT ! Select all EXTerior areas DA,ALL,,AZ,0 ! Assign a flux parallel boundary condition !! Mesh: ALLSEL SMRTSIZE,10 ! Minimum number of elements; quick solve MSHKEY,0 ! Use free, not mapped, meshing MSHAPE,1,3D ! Use tetrahedral shaped elements VMESH,ALL !! Solve and plot magnetic field vectors: FINISH /SOLU MAGSOLV FINISH /POST1 PLVECT,B, , , ,VECT,ELEM,ON,0