×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Export results from ANSYS into other files!

Export results from ANSYS into other files!

Export results from ANSYS into other files!

(OP)
Hi,

I am modeling a 2D Magnet in ANSYS and I want to export the results of the magnetic flux intensity around the magnet to some .txt or .xl file, so that I can use them in Matlab for further analysis. I tried to export the ANSYS results into some array but keep getting warning "Requested data is not stored for node" and "*GET command is ignored". Has anybody encountered the same problem before? Or any suggestion on how to export specific results from ANSYS?

I put my ANSYS command below. Hopefully someone can help! Thanks!

!********************************************
permanent magnet(use infin9)
!********************************************
/TITLE, Test for Permanent Magnet
*go,:start
:start              ! Ask Ansys to read file optionally
!JPGPRF,500,100,1   ! MACRO TO SET PREFS FOR JPEG PLOTS
/PREP7
emunit,mks          ! Set Unit: µ0=4 Pi e-7 henries/meter


!********************************************
! Define Element Type
!********************************************
ET,53,PLANE53                  ! Define PLANE 53 as element type
ET,9,INFIN9        ! Use infi9


!********************************************
! Define Material
!********************************************
MP,MURX,1,1         ! Define material properties (permeability)   !Air=1
HC=895000           ! Coercive force
TB,BH,2,,30
TBPT,, 130.000000 , 0.100000000
TBPT,, 170.000000 , 0.200000000
TBPT,, 197.000000 , 0.300000000
TBPT,, 218.000000 , 0.400000000
TBPT,, 250.000000 , 0.500000000
TBPT,, 290.000000 , 0.600000000
TBPT,, 338.000000 , 0.700000000
TBPT,, 400.000000 , 0.800000000
TBPT,, 472.000000 , 0.900000000
TBPT,, 570.000000 , 1.00000000
TBPT,, 682.000000 , 1.10000000
TBPT,, 810.000000 , 1.20000000
TBPT,, 975.000000 , 1.30000000
TBPT,, 1600.00000 , 1.40000000
TBPT,, 2520.00000 , 1.50000000
TBPT,, 3520.00000 , 1.60000000
TBPT,, 4760.00000 , 1.70000000
TBPT,, 8300.00000 , 1.80000000
TBPT,, 12000.0000 , 1.90000000
TBPT,, 17000.0000 , 2.00000000
TBPT,, 23000.0000 , 2.10000000
TBPT,, 32000.0000 , 2.20000000
TBPT,, 42500.0000 , 2.30000000
TBPT,, 44500.0000 , 2.32000000
TBPT,, 48200.0000 , 2.35000000
TBPT,, 52200.0000 , 2.37000000
TBPLOT,BH,2,,,
/IMAGE,SAVE,BH2,JPEG       ! Save B-H curve of material 2 as bh2.jpg
mp,mgxx,2,hc          ! Set mgxx (or mgyy) for permanent magnet
mp,mgyy,2,0


!********************************************
! Build Model
!********************************************
/PNUM,AREA,1          ! Define display mode

wall=20
hall=10
w1=4
h1=2
!x1=(wall-w1)/2
!x2=x1+w1
!y1=(hall-h1)/2
!y2=y1+h1
!rectng,0,wall,0,hall
!rectng,x1,x2,y1,y2
rectng,-wall/2,wall/2,-hall/2,hall/2
rectng,-w1/2,w1/2,-h1/2,h1/2
aovlap,all
numcmp,area          ! Re-numbering area
/PNUM,AREA,1         !Turns area numbering on
aplot

!/eof                ! In accordance with "start" command


!********************************************
! Define Material Attribute
!********************************************
asel,s,area,,1    ! Select permanent magnet
aatt,2
asel,s,area,,2    ! Select air
aatt,1      


!********************************************
! Meshing
!********************************************
asel,all
type,53
lsel,s,line,,1,4        ! Select all infinite boundary
type,9          ! set as infin9
lesize,all,,,30        ! mesh to 30 parts
lmesh,all          ! start meshing
lsel,s,line,,5,8    
lesize,all,,,20      !mesh the boundary of magnet into 20 parts
asel,all
amesh,all


!********************************************
! Define load
!********************************************
ESEL,ALL
NSEL,EXT
D,ALL,AZ,0


!********************************************
! Solve & Postproc & Export
!********************************************
asel,s,area,,1
nsla,s,1
cm,outnodes,node

/sol
outres,all,all                        ! compute results for all entities
allsel                                ! select all entities
magsolve
/post1
nsel,s,node,,outnodes                 ! select the output nodes!
set,last                              ! read it the last results set (for example)
*get,nmin,node,,num,min               !defining minimum node number on area
*get,ncount,node,,count               !counted all nodes on area

*dim,results,array,ncount,2           !dimensioned results array

*do,row,1,ncount                      !interating column for all nodes on area
*get,results(row,1),node,nmin,B,Y
*get,results(row,2),node,nmin,loc,X
nmin=ndnext(nmin)
*enddo

*mwrite,results,'c:\Result\magresults',dat
(3F10.6)
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources