a147258 发表于 2011-9-1 16:41

大家帮我看看lmatrix应用的一段程序吧,谢谢!

本帖最后由 a147258 于 2011-9-1 16:47 编辑

rt。当执行到lmatrix,symfac,'wind','cur','mmyind', 时候就出现错误,说要选用frontal solver,可是这不是默认就是这个求解器吗
顺带请问,大家都是如何计算电机中的电感的?不胜感激!

/title, Two-coil inductor with a permanent magnet
/nopr

!geometry data
n=1            ! meshing parameter
x=0.1         ! width (x size) of core
y=0.1      ! hight of core, y size of window
z=1          ! thickness of iron in z direction
x1=0.1   ! width (x size) of coil 1
x2=0.1      ! width (x size) of coil 2
Hcy=25   ! coercive magnetic field in y direction
n1=10       ! number of turns in coil1
n2=20      ! number of turns in coil2

!excitation data used by LMATRIX.MAC
symfac=1               ! symmetric factor for inductance computation
nc=2                      ! number of coils
*dim,cur,array,nc   ! nominal currents of coils
*dim,coils,char,nc   ! names of coil components
cur(1)=0.25            ! nominal current of 1st coil
coils(1)='wind1'      ! name of coil 1 component
cur(2)=-0.125         ! nominal current of 2nd coil
coils(2)='wind2'       ! name of coil 2 component

!auxiliary parameters
mu0=3.1415926*4.0e-7
x3=x1+x2          ! x coordinate right to coil2 left
x4=x3+2*x      ! x coordinate right to core
x5=x4+x2      ! x coordinate right to coil2 right
x6=x5+x1      ! x coordinate right to coil1 right
js1=cur(1)*n1/(x1*y)          ! nominal current density of coil1
js2=cur(2)*n2/(x2*y)         ! nominal current density of coil2
/prep7
et,1,53
mp,murx,1,1               ! air/coil
mp,mgyy,2,Hcy         ! coercive term
Bs=2                        ! saturation flux density
Hs=100                  ! saturation magnetic field
TB,BH,2               ! core: H = Hs (B/Bs)^2; BS=2T;HS=100A/m
*do,qqq,1,20
B=qqq/10*Bs
tbpt,,Hs*(B/Bs)**2,B
*enddo
tbplot

rect, 0,x1,0,y         ! coil1 left
rect,x1,x3,0,y      ! coil2 left
rect,x3,x4,0,y      ! core
rect,x4,x5,0,y         ! coil2 right
rect,x5,x6,0,y          ! coil1 right
aglue,all
asel,s,loc,x,x1/2         ! coil 1 volume attribute
aatt,1,1,1
asel,s,loc,x,x5+x1/2
aatt,1,2,1
asel,s,loc,x,x1+x2/2      ! coil 2 volume attribute
aatt,1,3,1
asel,s,loc,x,x4+x2/2
aatt,1,4,1
asel,s,loc,x,x3+x            ! iron volume attribute
aatt,2,5,1
asel,all
esize,,n
amesh,all
nsel,s,loc,x,x6            ! flux parallel Dirichlet at symmetry plain, x=x6
                            !! homogeneous Neumann flux normal at yoke, x=0
d,all,az,0
nsel,all
esel,s,real,,1               ! coil 1 left component
bfe,all,JS,,,,js1             !unite current density in coil 1
esel,s,real,,2               ! coil 1 right component
bfe,all,JS,,,,-js1         ! return unite current density in coil 1
esel,s,real,,1,2
cm,coils(1),elem
esel,s,real,,3             ! coil 2 left component
bfe,all,JS,,,,js2            ! unite current density in coil 2
esel,s,real,,4            ! coil 2 right component
bfe,all,JS,,,,-js2             ! return unite current density in coil 2
esel,s,real,,3,4
cm,coils(2),elem
allsel
fini
/solu
cnvtol,csg,,1.0e-6
solve
fini
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/post1
senergy,         ! Stored electromagnetic energy
savelen=mmyS_ENG
senergy,1          ! Co-energy
savelce=mmyC_ENG
fini
! compute inductance
lmatrix,symfac,'wind','cur','mmyind',                ! compute inductance matrix and flux
finish

senergy,         ! Stored electromagnetic energy
savelen=mmyS_ENG
senergy,1          ! Co-energy
savelce=mmyC_ENG
fini

zengxiaodong 发表于 2014-8-25 18:58

那就用一个命令,指定波前求解器!

eqslv,front
页: [1]
查看完整版本: 大家帮我看看lmatrix应用的一段程序吧,谢谢!