hey Alex,
The above code worked out great but i just have one further question! For some reason Ansys has given back a value of 0 for flux density in the Y direction for alot but not all of the nodes when it exports them into that separate file! Is there a reason for this? I believe that i have defined the magnet appropriately and also when you do a nodal solution it appears that there is a value of flux density at every point on Area 10 which is an air layer a few mm's above the surface of the magnet.
Thanks for all your help by the way, it is much appreciated
Shane
I have posted the code below,just place it in a text or dat file and import it into ansys if you wish to run it:
/prep7
et,1,117
!*
EMUNIT,MKS
!*
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDATA,MURX,1,,300
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDATA,MGXX,1,,0
MPDATA,MGYY,1,,994712.5007
MPDATA,MGZZ,1,,0
MPDE,MURX,1
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDATA,MURX,1,,300
*CSET,1,2, 1,2,
MPCOPY, ,1,2
TBCOPY,ALL,1,2
!*
MPDE,MGXX,2
MPDE,MGYY,2
MPDE,MGZZ,2
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDE,MURX,2
MPDATA,MURX,2,,1
/VIEW,1,1,1,1
/ANG,1
/REP,FAST
BLOCK,0,+0.049657,0,0.01699,0,+0.049657,
allsel
*get,xmx,kp,,mxloc,x
*get,xmn,kp,,mnloc,x
*get,ymx,kp,,mxloc,y
*get,ymn,kp,,mnloc,y
*get,zmx,kp,,mxloc,z
*get,zmn,kp,,mnloc,z
block,xmn-0.0014986,xmx+0.0014986,ymn-0.0014986,ymx+0.0014986,zmn-0.0014986,zmx+0.0014986
allsel
*get,xmx,kp,,mxloc,x
*get,xmn,kp,,mnloc,x
*get,ymx,kp,,mxloc,y
*get,ymn,kp,,mnloc,y
*get,zmx,kp,,mxloc,z
*get,zmn,kp,,mnloc,z
block,xmn-0.1,xmx+0.1,-3*ymx,3*ymx,zmn-ymx,zmx+ymx
vovlap,all
/REPLOT,RESIZE
!*
*CSET,1,2, 2,3,
MPCOPY, ,2,3
TBCOPY,ALL,2,3
!*
LPLOT
CM,_Y,VOLU
VSEL, , , , 1
CM,_Y1,VOLU
CMSEL,S,_Y
!*
CMSEL,S,_Y1
VATT, 1, , 1, 0
CMSEL,S,_Y
CMDELE,_Y
CMDELE,_Y1
!*
CM,_Y,VOLU
VSEL, , , , 4
CM,_Y1,VOLU
CMSEL,S,_Y
!*
CMSEL,S,_Y1
VATT, 2, , 1, 0
CMSEL,S,_Y
CMDELE,_Y
CMDELE,_Y1
!*
CM,_Y,VOLU
VSEL, , , , 5
CM,_Y1,VOLU
CMSEL,S,_Y
!*
CMSEL,S,_Y1
VATT, 3, , 1, 0
CMSEL,S,_Y
CMDELE,_Y
CMDELE,_Y1
!*
/UI,MESH,OFF
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/USER, 1
/VIEW, 1, 0.203979337162 , 0.960828475521 , 0.187619483633
/ANG, 1, 2.32539772697
/REPLO
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/VIEW, 1, 0.644786474421E-01, 0.977050326931 , 0.203015178416
/ANG, 1, -26.4146248625
/REPLO
/VIEW, 1, 0.298484510976 , 0.208504836719 , 0.931360687259
/ANG, 1, -11.1346283405
/REPLO
FLST,5,12,4,ORDE,2
FITEM,5,13
FITEM,5,-24
CM,_Y,LINE
LSEL, , , ,P51X
CM,_Y1,LINE
CMSEL,,_Y
!*
LESIZE,_Y1,0.00175514, , , , , , ,1
!*
FLST,5,12,4,ORDE,2
FITEM,5,1
FITEM,5,-12
CM,_Y,LINE
LSEL, , , ,P51X
CM,_Y1,LINE
CMSEL,,_Y
!*
LESIZE,_Y1,0.0015, , , , , , ,1
!*
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
FLST,5,12,4,ORDE,2
FITEM,5,25
FITEM,5,-36
CM,_Y,LINE
LSEL, , , ,P51X
CM,_Y1,LINE
CMSEL,,_Y
!*
LESIZE,_Y1,0.01, , , , , , ,1
!*
MSHAPE,1,3D
MSHKEY,0
!*
FLST,5,3,6,ORDE,3
FITEM,5,1
FITEM,5,4
FITEM,5,-5
CM,_Y,VOLU
VSEL, , , ,P51X
CM,_Y1,VOLU
CHKMSH,'VOLU'
CMSEL,S,_Y
!*
VMESH,_Y1
!*
CMDELE,_Y
CMDELE,_Y1
CMDELE,_Y2
!*
LPLOT
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/DIST,1,0.924021086472,1
/REP,FAST
/VIEW, 1, 0.355617124484 , 0.923795276594E-01, 0.930055097101
/ANG, 1, -10.5575101749
/REPLO
/PNUM,KP,0
/PNUM,LINE,0
/PNUM,AREA,1
/PNUM,VOLU,0
/PNUM,NODE,0
/PNUM,TABN,0
/PNUM,SVAL,0
/NUMBER,0
!*
/PNUM,ELEM,0
/REPLOT
!*
/PNUM,KP,0
/PNUM,LINE,0
/PNUM,AREA,1
/PNUM,VOLU,0
/PNUM,NODE,0
/PNUM,TABN,0
/PNUM,SVAL,0
/NUMBER,0
!*
/PNUM,ELEM,0
/REPLOT
!*
/UI,MESH,OFF
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/DIST,1,1.08222638492,1
/REP,FAST
/VIEW,1,1,1,1
/ANG,1
/REP,FAST
APLOT
LPLOT
ALLSEL,ALL
APLOT
asel,all
asel,all
APLOT
FLST,2,1,5,ORDE,1
FITEM,2,17
DA,P51X,AZ,0,0
FLST,2,1,5,ORDE,1
FITEM,2,18
DA,P51X,AZ,0,0
FLST,2,1,5,ORDE,1
FITEM,2,14
DA,P51X,AZ,0,0
FLST,2,1,5,ORDE,1
FITEM,2,13
DA,P51X,AZ,0,0
FLST,2,1,5,ORDE,1
FITEM,2,16
DA,P51X,AZ,0,0
/VIEW, 1, 0.168960754392 , -0.714252330648 , 0.679187655688
/ANG, 1, 6.10913720025
/REPLO
FLST,2,1,5,ORDE,1
FITEM,2,15
DA,P51X,AZ,0,0
/VIEW,1,1,1,1
/ANG,1
/REP,FAST
asel,s,area,,10
nsla,s,1
cm,outnodes,node
/sol
outres,all,all
allsel
magsolv
/post1
nsel,s,node,,outnodes
set,last
*get,nmin,node,,num,min
*get,ncount,node,,count
*dim,results,array,ncount,3
*do,row,1,ncount
*get,results(row,1),node,nmin,B,Y
*get,results(row,2),node,nmin,loc,X
*get,results(row,3),node,nmin,loc,Z
nmin=ndnext(nmin)
*enddo
*mwrite,results,'c:\Result\emagresults2',dat
(3F10.6)