Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

ANSYS Workbench commands

Status
Not open for further replies.

Francesco La

Mechanical
Jul 4, 2019
5
0
0
FR
Hi guys,
i'm new to ANSYS and i have some difficulties with APDL commands on Workbench.
I have a component with some named selections and i need to find the surface area of some areas. I need to use it in another command so i need to store it in a variable. I think i should use this *GET, Par, AREA, 0, Item1, IT1NUM, Item2, IT2NUM , but previously i think i should use ASEL and ASUM but i obtain errors. This is my code but surely is wrong.
ASEL,s,contact
ASUM,DEFAULT
*GET, my_area, AREA,0,AREA
Do you know how to do it?
thank you very much.
 
Replies continue below

Recommended for you

Not sure if you can use asum and then how do you know the area number, since there are not areas like in the sense of apdl where yo define them usin A command. Not sure:

This is an alternative, it just needs for your to know the type number of the contacts:
Code:
totarea=0
arel=0

*dim,eltyp,array,1,1 ! temporary array, length = ncount2


*get,ncount2,elem,,count


*do,i,1,ncount2,1
*vget,eltyp(1),elem,i,ATTR,TYPE
*if,eltyp(1),EQ,1,THEN ! change this to type number you need for the contacts
*get,arel,elem,i,AREA
totarea=totarea+arel
*endif
*enddo 

hh=totarea
 
Ho Eric, thank you for your Answer.
The problem is that i have the same elements for all the areas of the component. Is not possibile to select the area through the name adopted in the named selections?
Thank you!
 
As we said Areas (A) lines (L) volumes (V) and key points (KP) are geometrical entities in ansys apdl, not in workbench where geometry is defined via DM or SC and probably has a different description than apdl, so selecting using ASEL is OK in apdl classic, but not in WB.

here is a workaround where the area is calculated based on a nodal named selection (surfarean), which is easy to generate from a face name selection (just right click on the named selection for the face and choose create a nodal named selection). Dummy elements are then created there (on that face), and their total area is calculated (totarea) - finally these elements are deleted so they are not used in the solution.

Code:
/prep7
ET,200,SHELL181   
!*  
KEYOPT,200,1,1
sect,200,shell,,  
secdata, 0.0000001,1,0.0,3
secoffset,MID   
seccontrol,,,, , , , 

type,200
secnum,200
cmsel,s,surfarean

     
esurf   
allsel,all  


totarea=0
arel=0

NUMCP,ELEM

*dim,eltyp,array,1,1 ! temporary array, length = ncount2
*get,ncount2,elem,,count

*do,i,1,ncount2,1
*vget,eltyp(1),elem,i,ATTR,TYPE
*if,eltyp(1),EQ,200,THEN ! 
*get,arel,elem,i,AREA
totarea=totarea+arel
*endif
*enddo 

!hiha=totarea 
esel,s,type,,200
edele,all
allsel,all

/solu

Alternatively you can look on scripting things and adding an extension - I do not have so much experience in that field so I do not know much, except that there is a guide for all api calls, say to get the area of face is .Area which is a member of the IBaseGeoFace interface I believe
 
Status
Not open for further replies.
Back
Top