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!

Determine the area of a region with stress greater than the predetermined value

Status
Not open for further replies.

AnPham

Mechanical
Mar 14, 2019
23
Hi everyone,

After completing the solution, I can exploit the results on the body.
But how can I determine the area of a region with stress (or any result) greater than the predetermined value?
For example, the figure below is the stress result of one face, I want to calculate the area of the region with stress greater than 80MPa.
Is this possible?
stress_face_gbppyu.png


Thank you.
 
Replies continue below

Recommended for you

Not sure, but for sure one can write a script for this.

Pseudo code:

1. Loop through all elements and get stresses
If it is above certain stress get node number and get area of the element and add it to total area, if not then do not do anything and go to the next Element until loop is complete.

This works in apdl (so could be a command snippet in solution in WB)

Code:
/POST1

*get,ncount2,elem,,count

*dim,scrap2,array,ncount2,7 ! temporary array, length = ncount2
*dim,arlart,array,ncount2,3 ! temporary array, length = ncount2

! getting component stresses for all the elements and writing them in txt file
alls
SET,LAST
*VGET,scrap2(1,1),elem, , elist
etable,seq,s,eqv
*vget,scrap2(1,2),elem,,etab,seq

totarea=0
b=1

*do,i,1,ncount2,1


*if,scrap2(i,2),GT,4,THEN ! change this to the stress criteria needed (GT means greater then)

*get,arel,elem,i,AREA
totarea=totarea+arel

arlart(b,2)=i
arlart(b,3)=arel

b=b+1

*endif


*enddo


 
Hi,

Thank you for your reply.
I tried that code but the result was not satisfactory.
I understand in that code that the elements with stress greater than the predetermined value and the surface area of the elements are calculated.
In the case I am trying to achieve, it is the area on a surface. That means, there is only one side of an element on that surface.
I think this will be very difficult.

Anyway, thank you for your help.
 
Though you used shell element so I tried that on them and it was OK.

If you need the surface area on a 3d part then this should work.

We can add membrane element on that surface to get surface stresses something that is common and often used, then filter in the *do loop for elements only of type 2 say which are membrane elements (surface).

Below is an example (1x1x0.2 m block with applied pressure on one end) where the membrane elements are placed on top surface of the block to get accurate surface stresses, thus their total area is 1m2, so if we set the GT condition to 0, then we should get 1, and if we set it to high stresses say 100E6 Pa, then we should get zero area (since the applied stress is 1E6 Pa), so it works here - so perhaps something like this could be used:
Code:
/clear
/prep7

W=1	! Width	
L=1	! Length	
TH=0.2	! Thickness

ET,1,SOLID185
ET,2,SHELL181   
!*  
KEYOPT,2,1,1
KEYOPT,2,3,0
KEYOPT,2,5,0
KEYOPT,2,8,0
KEYOPT,2,9,0
KEYOPT,2,10,0   
KEYOPT,2,11,0
sect,1,shell,,  
secdata, 0.0000005,1,0.0,3
secoffset,MID   
seccontrol,,,, , , ,   

MPTEMP,,,,,,,,  ! Material prop.
MPTEMP,1,0  
MPDATA,EX,1,,200E9  
MPDATA,PRXY,1,,0.3 
MPDATA,KXX,1,,51
MPDATA,ALPX,1,,0.0000115

BLOCK,0,W,0,L,0,TH,	!Define a block

ASEL,S,AREA,,4
SFA,ALL,1,PRES,1E6
ALLSEL,ALL

ASEL,S,AREA,,3
DA,ALL,ALL,0
ALLSEL,ALL

ESIZE,0.05,0	! Mesh
VMESH,ALL

type,2
nsel,s,loc,Z,0.2
esln,s,,,,
     
esurf   
allsel,all  


/SOL
!*  
ANTYPE,0
TREF,0	! Ref temp is 0 here
/STATUS,SOLU
SOLVE   
FINISH 

/POST1

allsel,all

*get,ncount2,elem,,count

*dim,scrap2,array,ncount2,7 ! temporary array, length = ncount2
*dim,arlart,array,ncount2,3 ! temporary array, length = ncount2
*dim,eltyp,array,1,1 ! temporary array, length = ncount2

SET,LAST
*VGET,scrap2(1,1),elem, , elist
etable,seq,s,eqv
*vget,scrap2(1,2),elem,,etab,seq


totarea=0
b=1

*do,i,1,ncount2,1
*vget,eltyp(1),elem,i,ATTR,TYPE

*if,scrap2(i,2),GT,0,AND,eltyp(1),EQ,2,THEN ! change this to the stress criteria needed (GT means greater then)

*get,arel,elem,i,AREA
totarea=totarea+arel

arlart(b,2)=i
arlart(b,3)=arel

b=b+1

*endif


*enddo
 
Thank you very much
I have understood and applied successfully.
 
No worries AnPham, glad I could help. You have helped a lot here but also in the ansys student community site - it is much appreciated that you continue doing that.

Thank you
Erik (jj77) :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor