Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

[APDL] Getting multiple components' results in ASCII format with ETABLE and VGET.

Status
Not open for further replies.

Helio C Bortolon

Mechanical
Sep 1, 2016
4
Dear colleagues,

I am trying to circumvent a problem with a custom UDR in Mechanical by using APDL commands in the output section to generate ASCII file for posterior treatment of standards criteria.

The question is that when I put the following code:

______________________________________________________________________________________________________________________________________________________
! Commands inserted into this file will be executed immediately after the ANSYS /POST1 command.
! Active UNIT system in Workbench when this object was created: Metric (m, kg, N, s, V, A)
! NOTE: Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.
! See Solving Units in the help system for more information.
FINISH
/POST1
SET,LAST

alls !Select all

!*******************
! PIPES
!*******************
CMSEL,S,PIPES

etable, pfxI, smisc, 1
etable, pfxJ, smisc, 14
etable, pmyI, smisc, 2
etable, pmyJ, smisc, 15
etable, pmzI, smisc, 3
etable, pmzj, smisc, 16
etable, hs1, LS, 2
etable, hs2, LS, 8

*get,num_elem_,ELEM,0,COUNT
*GET,elem_,ELEM,0,NUM,MIN

*dim,resPIPES, array, num_elem_, 10

*do,i,1,num_elem_,1
resPIPES(i,1) = elem_
resPIPES(i,2) = NELEM(elem_, 1)
elem_ = elnext(elem_)
*enddo

*GET,elem_,ELEM,0,NUM,MIN
*vget, resPIPES(1,3), elem, 1, etab, hs1
*vget, resPIPES(1,4), elem, 1, etab, hs2
*vget, resPIPES(1,5), elem, 1, etab, pfxI
*vget, resPIPES(1,6), elem, 1, etab, pfxJ
*vget, resPIPES(1,7), elem, 1, etab, pmyI
*vget, resPIPES(1,8), elem, 1, etab, pmyJ
*vget, resPIPES(1,9), elem, 1, etab, pmzI
*vget, resPIPES(1,10), elem, 1, etab, pmzJ

*mwrite, resPIPES, PIPES, txt
(2(F8.0,', '),8(E10.3,', '))


!*******************
! SUPPORTS
!*******************

CMSEL,S,SUPPORTS

etable, supfxI, smisc, 1
etable, supfxJ, smisc, 14
etable, supmyI, smisc, 2
etable, supmyJ, smisc, 15
etable, supmzI, smisc, 3
etable, supmzJ, smisc, 16

*get,num_elem_,ELEM,0,COUNT
*GET,elem_,ELEM,0,NUM,MIN

*dim,resSUPS, array, num_elem_, 8

*do,i,1,num_elem_,1
resSUPS(i,1) = elem_
resSUPS(i,2) = NELEM(elem_, 1)
elem_ = elnext(elem_)
*enddo

*GET,elem_,ELEM,0,NUM,MIN
*vget, resSUPS(1,3), elem, 1, etab, supfxI
*vget, resSUPS(1,4), elem, 1, etab, supfxJ
*vget, resSUPS(1,5), elem, 1, etab, supmyI
*vget, resSUPS(1,6), elem, 1, etab, supmyJ
*vget, resSUPS(1,7), elem, 1, etab, supmzI
*vget, resSUPS(1,8), elem, 1, etab, supmzJ

*mwrite, resSUPS, SUPPORTS, txt
(2(F8.0,', '),6(E10.3,', '))
______________________________________________________________________________________________________________________________________________________

the results for the PIPES component got correctly retrieved, when compared to the BEAM_AXIAL_FX, BEAM_BENDING_MY and BEAM_BENDING_MZ default UDR, but for the SUPPORTS component, both being defined via Named Selections, I get what seems to be memory garbage (e.g., many XX.XXe-310 and XX.XXe+155 values) and this doesn't match what the predefined UDR gives.

I already tried to change the names of the tables, as you can see, the order of the groups of commands and separating them in two blocks of "Commands APDL". Nothing worked so far.

Could anyone point me what I am doing wrong?

Thank you very much in advance for any advice.

------------------------------------------------------------------------------
Hélio Carlos Bortolon
e-mail: heliocb@petrobras.com.br
------------------------------------------------------------------------------
 
Replies continue below

Recommended for you

Hi

A bit late but here goes.

I have made a small test in ansys workbench and as you found out I can get the results in a text file for a CM called PIPES (basically beam elements).

For the support it works if we change the name say to SUP, so CMSEL,S,SUP and use the same name in WB of course (see image below).

Not sure what is going on.

Capture_pzbdpk.png
 
Dear Kostson,

The problem, as I checked out with the ANSYS local support team, was that the second block of "vget" was pointing to the position '1'

*vget, resSUPS(1,3), elem, 1, etab, supfxI​

when they should point to the first element of the selected component.

Turning the second block of lines to

*vget, resSUPS(1,3), elem, elem_, etab, supfxI​

put me back to the right position of the SMISC columns and the results are now just fine. Now the 'vget' command begins in the right position of each column of the ETABLE. Actually, the code has been reshaped to

Code:
!*******************
! Profile W150x24:
!*******************
CMSEL,S,W150x24 ! W150x24 is the named selection referencing to the structural members of interest.
etable, sdirI, smisc, 31
etable, sdirJ, smisc, 36
etable, sbytI, smisc, 32
etable, sbytJ, smisc, 37
etable, sbybI, smisc, 33
etable, sbybJ, smisc, 38
etable, sbztI, smisc, 34
etable, sbztJ, smisc, 39
etable, sbzbI, smisc, 35
etable, sbzbJ, smisc, 40

! Creating the results array.
*get,num_elem_,ELEM,0,COUNT
*dim,resuW150x24, array, num_elem_, 12

! Element number and reference node to the first two columns.
*GET,elem_,ELEM,0,NUM,MIN ! Points elem_ to the first element of the selection.
*do,i,1,num_elem_,1
	resuW150x24(i,1) = elem_
	resuW150x24(i,2) = NELEM(elem_, 1)
	elem_ = elnext(elem_)
*enddo
! Results to be recorded.
*GET,elem_,ELEM,0,NUM,MIN ! Points elem_ to the first element of the selection, again.
*vget, resuW150x24(1,3), elem, elem_, etab, sdirI
*vget, resuW150x24(1,4), elem, elem_, etab, sdirJ
*vget, resuW150x24(1,5), elem, elem_, etab, sbytI
*vget, resuW150x24(1,6), elem, elem_, etab, sbytJ
*vget, resuW150x24(1,7), elem, elem_, etab, sbybI
*vget, resuW150x24(1,8), elem, elem_, etab, sbybJ
*vget, resuW150x24(1,9), elem, elem_, etab, sbztI
*vget, resuW150x24(1,10), elem, elem_, etab, sbztJ
*vget, resuW150x24(1,11), elem, elem_, etab, sbzbI
*vget, resuW150x24(1,12), elem, elem_, etab, sbzbJ

! Printing to file.
*mwrite, resuW150x24, W150x24, txt
(2(F8.0,', '),10(E10.3,', '))

Repeating blocks like this one for each group of structural profiles solved my problem.

Thank you very much for your time, I hope this solution may be useful.

Helio C. Bortolon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor