XANSYS Forum Index
    Register    

FAQ    Search    Memberlist    Usergroups    SmartFeedSmartFeed    Profile    Log in
[apdl] how to check within group of elements !!
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
Author Message
debabrata.podder
User


Joined: 21 Feb 2013
Posts: 51
Location: NIT Meghalaya, India

PostPosted: Sun Oct 06, 2013 6:56 pm  Reply with quote

Dear experts.
I am doing a welding structural analysis. For this I am importing the nodal temperatures as body loads. Now I want to check the average nodal temperatures of a group of elements within a certain range, and if that is greater than that, I want to kill those elements for a while. Now again I want to give a condition if temperature becomes less than a certain range, those killed elements should come to alive again ! For this I am using the following loop, where *GET has been used.

*GET,NUMBER,ELEM,,NUM,MIN
ESEL,S,,,NUMBER
NSLE,S,ALL
*GET,N1,NODE,,NUM,MIN !get minimum node no
*GET,T1,NODE,N1,NTEMP !get temp of node
*GET,N2,NODE,N1,NXTH !get next higher node
*GET,T2,NODE,N2,NTEMP !get temp of node
*GET,N3,NODE,N2,NXTH !get next higher node
*GET,T3,NODE,N3,NTEMP !get temp of node
*GET,N4,NODE,N3,NXTH !get next higher node
*GET,T4,NODE,N4,NTEMP !get temp of node
*GET,N5,NODE,N4,NXTH !get next higher node
*GET,T5,NODE,N5,NTEMP !get temp of node
*GET,N6,NODE,N5,NXTH !get next higher node
*GET,T6,NODE,N6,NTEMP !get temp of node
*GET,N7,NODE,N6,NXTH !get next higher node
*GET,T7,NODE,N7,NTEMP !get temp of node
*GET,N8,NODE,N7,NXTH !get next higher node
*GET,T8,NODE,N8,NTEMP !get temp of node

*IF,((T1+T2+T3+T4+T5+T6+T7+T8)/8),GE,1500,THEN
ESEL,R,,,number !select element whose temp greater than 1000
EKILL,number !kill element
*ELSEIF,((T1+T2+T3+T4+T5+T6+T7+T8)/8),LE,1000,THEN
NSEL,S,LOC,Z,-3E-3,3e-3
NSEL,R,LOC,Y,0.0001,.0016
NSEL,R,LOC,X,-.01,SOURCE_XLOC ! SOURCE_XLOC =current position of torch
ESLN,S,0
EALIVE,ALL
ALLSEL,ALL
*ENDIF

But in the above loop, only one element (element which has minimum no.)is getting selected and is being operated. But I want to check this whole thing in a bunch of weld zone elements. And also the *elseif portion is not working !!! How to fix this !! Thanks in advance. This situation is giving me a real panic !!

Regards-
_________________
Debabrata Podder(PhD)
Assistant Professor
NIT Meghalaya
India
Back to top
View user's profile Send private message
mark.tate
User


Joined: 01 Aug 2013
Posts: 43

PostPosted: Mon Oct 07, 2013 9:29 am  Reply with quote

Debabrata,

There are a couple of problems with your macro. First, THEN is not needed on the *ELSEIF command. Secondly, you need to loop through all of the selected elements.
Try something like this (Notice: I have not vetted this macro for bugs)

enum_=0
enum_=elnext(enum_) ! get next higher element from selected set
*dowhile,enum_
temp_=0
*do,i_,1,8
N%i_%=nelem(enum_,i_)
temp_=temp_+TEMP(N%i_%)
*enddo
*IF,(temp_/8),GE,1500,THEN
EKILL,enum_ !kill element
*ELSEIF,(temp_/8),LE,1000 ! THEN not needed here
NSEL,S,LOC,Z,-3E-3,3e-3
NSEL,R,LOC,Y,0.0001,.0016
NSEL,R,LOC,X,-.01,SOURCE_XLOC ! SOURCE_XLOC =current position of torch
ESLN,S,0
EALIVE,ALL
ALLSEL,ALL
*ENDIF
enum_=elnext(enum_) ! get next higher element
*enddo


Good luck.

Mark Tate
Solar Turbines, Inc.
San Diego, CA




From: "debabrata.podder" <debabrata.podder@iitkgp.ac.in>
To: xansys@xansys.org
Date: 10/07/2013 02:40 AM
Subject: [Xansys] [apdl] how to check within group of elements !!
Sent by: xansys-bounces@xansys.org



Dear experts.
I am doing a welding structural analysis. For this I am importing the nodal temperatures as body loads. Now I want to check the average nodal temperatures of a group of elements within a certain range, and if that is greater than that, I want to kill those elements for a while. Now again I want to give a condition if temperature becomes less than a certain range, those killed elements should come to alive again ! For this I am using the following loop, where *GET has been used.

*GET,NUMBER,ELEM,,NUM,MIN
ESEL,S,,,NUMBER
NSLE,S,ALL
*GET,N1,NODE,,NUM,MIN !get minimum node no
*GET,T1,NODE,N1,NTEMP !get temp of node
*GET,N2,NODE,N1,NXTH !get next higher node
*GET,T2,NODE,N2,NTEMP !get temp of node
*GET,N3,NODE,N2,NXTH !get next higher node
*GET,T3,NODE,N3,NTEMP !get temp of node
*GET,N4,NODE,N3,NXTH !get next higher node
*GET,T4,NODE,N4,NTEMP !get temp of node
*GET,N5,NODE,N4,NXTH !get next higher node
*GET,T5,NODE,N5,NTEMP !get temp of node
*GET,N6,NODE,N5,NXTH !get next higher node
*GET,T6,NODE,N6,NTEMP !get temp of node
*GET,N7,NODE,N6,NXTH !get next higher node
*GET,T7,NODE,N7,NTEMP !get temp of node
*GET,N8,NODE,N7,NXTH !get next higher node
*GET,T8,NODE,N8,NTEMP !get temp of node

*IF,((T1+T2+T3+T4+T5+T6+T7+T8)/8),GE,1500,THEN
ESEL,R,,,number !select element whose temp greater than 1000
EKILL,number !kill element
*ELSEIF,((T1+T2+T3+T4+T5+T6+T7+T8)/8),LE,1000,THEN
NSEL,S,LOC,Z,-3E-3,3e-3
NSEL,R,LOC,Y,0.0001,.0016
NSEL,R,LOC,X,-.01,SOURCE_XLOC ! SOURCE_XLOC =current position of torch
ESLN,S,0
EALIVE,ALL
ALLSEL,ALL
*ENDIF

But in the above loop, only one element (element which has minimum no.)is getting selected and is being operated. But I want to check this whole thing in a bunch of weld zone elements. And also the *elseif portion is not working !!! How to fix this !! Thanks in advance. This situation is giving me a real panic !!

Regards-

------------------------
Debabrata Podder
Research Scholar
IIT Kharagpur
PIN NO.: 721302
India






+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
mark.tate
User


Joined: 01 Aug 2013
Posts: 43

PostPosted: Mon Oct 07, 2013 10:15 am  Reply with quote

Debabrata,

Oops. You will obviously need to remove the ALLSEL,ALL command from my unvetted macro!

Mark Tate
Solar Turbines Inc.
San Diego, CA




From: Mark C Tate <Tate_Mark_C@solarturbines.com>
To: ANSYS User Discussion List <xansys@xansys.org>
Date: 10/07/2013 09:29 AM
Subject: Re: [Xansys] [apdl] how to check within group of elements !!
Sent by: xansys-bounces@xansys.org



Debabrata,

There are a couple of problems with your macro. First, THEN is not needed
on the *ELSEIF command. Secondly, you need to loop through all of the
selected elements.
Try something like this (Notice: I have not vetted this macro for bugs)

enum_=0
enum_=elnext(enum_) ! get next higher element from selected set
*dowhile,enum_
temp_=0
*do,i_,1,8
N%i_%=nelem(enum_,i_)
temp_=temp_+TEMP(N%i_%)
*enddo
*IF,(temp_/8),GE,1500,THEN
EKILL,enum_ !kill element
*ELSEIF,(temp_/8),LE,1000 ! THEN not needed here
NSEL,S,LOC,Z,-3E-3,3e-3
NSEL,R,LOC,Y,0.0001,.0016
NSEL,R,LOC,X,-.01,SOURCE_XLOC ! SOURCE_XLOC =current position of
torch
ESLN,S,0
EALIVE,ALL
ALLSEL,ALL
*ENDIF
enum_=elnext(enum_) ! get next higher element
*enddo


Good luck.

Mark Tate
Solar Turbines, Inc.
San Diego, CA




From: "debabrata.podder" <debabrata.podder@iitkgp.ac.in>
To: xansys@xansys.org
Date: 10/07/2013 02:40 AM
Subject: [Xansys] [apdl] how to check within group of elements !!
Sent by: xansys-bounces@xansys.org



Dear experts.
I am doing a welding structural analysis. For this I am importing the
nodal temperatures as body loads. Now I want to check the average nodal
temperatures of a group of elements within a certain range, and if that is
greater than that, I want to kill those elements for a while. Now again I
want to give a condition if temperature becomes less than a certain range,
those killed elements should come to alive again ! For this I am using the
following loop, where *GET has been used.

*GET,NUMBER,ELEM,,NUM,MIN
ESEL,S,,,NUMBER
NSLE,S,ALL
*GET,N1,NODE,,NUM,MIN !get minimum node no
*GET,T1,NODE,N1,NTEMP !get temp of node
*GET,N2,NODE,N1,NXTH !get next higher node
*GET,T2,NODE,N2,NTEMP !get temp of node
*GET,N3,NODE,N2,NXTH !get next higher node
*GET,T3,NODE,N3,NTEMP !get temp of node
*GET,N4,NODE,N3,NXTH !get next higher node
*GET,T4,NODE,N4,NTEMP !get temp of node
*GET,N5,NODE,N4,NXTH !get next higher node
*GET,T5,NODE,N5,NTEMP !get temp of node
*GET,N6,NODE,N5,NXTH !get next higher node
*GET,T6,NODE,N6,NTEMP !get temp of node
*GET,N7,NODE,N6,NXTH !get next higher node
*GET,T7,NODE,N7,NTEMP !get temp of node
*GET,N8,NODE,N7,NXTH !get next higher node
*GET,T8,NODE,N8,NTEMP !get temp of node

*IF,((T1+T2+T3+T4+T5+T6+T7+T8)/8),GE,1500,THEN
ESEL,R,,,number !select element whose temp greater than
1000
EKILL,number !kill element
*ELSEIF,((T1+T2+T3+T4+T5+T6+T7+T8)/8),LE,1000,THEN
NSEL,S,LOC,Z,-3E-3,3e-3
NSEL,R,LOC,Y,0.0001,.0016
NSEL,R,LOC,X,-.01,SOURCE_XLOC ! SOURCE_XLOC =current position of torch
ESLN,S,0
EALIVE,ALL
ALLSEL,ALL
*ENDIF

But in the above loop, only one element (element which has minimum no.)is
getting selected and is being operated. But I want to check this whole
thing in a bunch of weld zone elements. And also the *elseif portion is
not working !!! How to fix this !! Thanks in advance. This situation is
giving me a real panic !!

Regards-

------------------------
Debabrata Podder
Research Scholar
IIT Kharagpur
PIN NO.: 721302
India






+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+


+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
debabrata.podder
User


Joined: 21 Feb 2013
Posts: 51
Location: NIT Meghalaya, India

PostPosted: Mon Oct 07, 2013 7:41 pm  Reply with quote

Thanks for your time Mark, I will check that out. Why you have taken underscores though ! If some tetrahedral, prism or pyramid shaped elements are mixed with 8 - noded elements, then how to do the element temperature averaging !! There will be 4,6 and 8 nodes then !!!

Regards-
_________________
Debabrata Podder(PhD)
Assistant Professor
NIT Meghalaya
India
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

sleek template created by Andrew Charron