因项目需要,近日正在学习ANSYS磁场分析基础知识,有幸在论坛找到mybq多年前发表的一段命令流,对新人非常有益,在此表示感谢。看到论坛依然有朋友在寻找永磁体静态磁场模拟的入门实例,因此,本人对命令流进行了适当调整并添加了一些说明,与大家分享,欢迎大家讨论学习,共同进步。
实例说明:
永磁体直径为2cm,高度为3cm,材料为N35钕铁硼磁铁,磁极在沿Z轴线方向。永磁体、空气用SOLID96建模,远场用INFIN47建模,计算永磁体的静态磁场分布。
命令流如下:
finish
/clear, nostart
/filname, Example_N35
/title,
/prep7
! ---------------------------------------
! parametric define
! ---------------------------------------
*set, all, , ! clear all parameters
R1 = 0.01 ! radius of EMAG material
R2 = 0.10 ! air radius
! ---------------------------------------
! element and material property
! ---------------------------------------
emunit, mks ! specifies the system of units for magnetic filed problems
et, 1, solid96 ! 3-D magnetic scalar solid
et, 2, infin47
mp, murx, 1, 1 ! magnetic relative permeabilities
mp, murx, 2, 1.05
mp, mgzz, 2, 883000 ! magnetic coercive forces
! ---------------------------------------
! geometry modeling and meshing
! ---------------------------------------
csys, 0
wpcsys, -1, 0
cyl4, , , 0, 0, R1, 360
cyl4, , , 0, 0, R2, 360
allsel
aovlap, all
vext, all, , , , , 0.1
asel, s, loc, z, 0.1
vext, all, , , , , 0.03
asel, s, loc, z, 0.13
vext, all, , , , , 0.1
allsel, all
mat, 1
esize, 0.005
vsweep, all
vsel, s, , , 3
eslv, s
emodif, all, mat, 2
! ---------------------------------------
! boundary
! ---------------------------------------
type, 2
mat, 1
csys, 1
nsel, s, loc, z, 0
nsel, a, loc, z, 0.23
nsel, a, loc, x, R2-0.01, R2+0.01
esurf, all
csys, 0
allsel
modmsh, detach ! release all associativity between the current solid model and finite element model
vdele, all
adele, all
ldele, all
kdele, all
save
! ---------------------------------------
! solve
! ---------------------------------------
/solu
allsel, all
solve
save
! ---------------------------------------
! post
! ---------------------------------------
/post1
set, last
esel, s, mat, , 2
plnsol, b, z ! component magnetic flux density or vector sum
plvect, h, , , , vect, elem, on, 0 ! magnetic field intensity vector
plvect, b, , , , vect, elem, on, 0 ! magnetic flux density vector
分析结果:
|
磁通密度 
磁场强度矢量图 
|
|