November 4, 2020 at 1:24 amhelen.durandSubscriberHello,nI have a Transient Thermal simulation where I inserted a command object. As part of my code, I want to select an element and determine its temperature.nThis command always gives a value of zero (selElem is the number of a single element):nTEMP(selElem)nHow to I determine the temperature of an element (say, at the centroid)? nThank you,nKip Niema
November 4, 2020 at 9:48 amErik KostsonAnsys EmployeeHinnIn thermal analysis the temp. is the main dof, so that is what we solve for and get on our nodes (so temp is a nodal result).nnTo get nodal temperatures we must use a *get command (see help manual for more info): an example,nn*GET, mytemp, NODE, 1, TEMP, nnThank younnErikn
November 4, 2020 at 3:01 pmhelen.durandSubscriberThank you for the reply!nI think I failed to give enough detail in the first post (my apologies).nI have a section of my code (shown below) that is adding elements associated with a material 6 (that I previously defined) to a text file. I want to exclude elements of this material 6 that are above a certain temperature. nALLSELnESEL,S,MAT,,6,6 ! Select all elements that are material type 6n*GET,numOfElem,ELEM,0,COUNT ! Find the number of elements in the selectionn*CFOPEN,elements,txt ! Create a text file called elements.txt nselElem=0n*DO,iter,1,numOfElem,1nselElem=ELNEXT(selElem) ! Advances to the next highest element in the selectionn! I wanted to find the element temperature at this point, and store this temperature as 'A.' Is there a way to select a single node associated with the element and find its temperature? Or perhaps a way to find the highest temperature among all of the nodes of the element?n*IF,A,LT,1600,THEN n*VWRITE,selElem n(ES20.5) n*ENDIFn*ENDDOn*CFCLOSnALLSELnn
November 5, 2020 at 9:41 amAniketAnsys Employeehttps://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v201/en/ans_cmd/Hlp_C_NSLE.html NSLE command can select all nodes attached to an element.n-AniketnHow to access Ansys help linksnGuidelines for Posting on Ansys Learning Forumn
November 6, 2020 at 2:43 amhelen.durandSubscriberThank you for the reply. I have tried using the NSLE command but I am still having issues. The code I tried is below. I let this run for a couple hours and it was not making any progress (it remained at 1% for solving the mathematical model for nearly the entire time), so I suspect I have done something wrong. The parts I added to the previous code are bolded. I would appreciate any help on fixing this. Thank you very much for your time.nALLSELnESEL,S,MAT,,6,6 ! Select all elements that are material type 6nCM,selectedElements,ELEM ! Creates a named selection of the selected elementsn*GET,numOfElem,ELEM,0,COUNT ! Find the number of elements in the selectionn*CFOPEN,elements,txt ! Create a text file called elements.txt nselElem=0n*DO,iter,1,numOfElem,1 ! Start looping over elements of material 6nselElem=ELNEXT(selElem) ! Advances to the next highest element in the selectionnA = 0 ! A is the maximum temperature among all nodes of the current elementnNSLE,S,ALL ! Selects the nodes associated with the selected elementn*GET,numNodeInEle,NODE,0,COUNT ! Finds the number of nodes in the selected setnselNode = 0n*DO,iter2,1,numNodeInEle,1 ! Start looping over nodes in an elementnselNode=NDNEXT(selNode)nNSEL,S,NODE,,selNode,selNoden*IF,TEMP(selNode),GT,A,THENnA=TEMP(selNode)n*ENDIFn*ENDDO ! End looping over nodes in an elementnCMSEL,S,selectedElements,ELEMn*IF,A,LT,1600,THEN n*VWRITE,selElem n(ES20.5) n*ENDIFn*ENDDO ! End looping over elements of material 6n*CFCLOSnALLSELn
November 6, 2020 at 9:52 amAniketAnsys EmployeeI am sorry Ansys employees can not debug user models or commands snippets, but I would recommend following:nThere is an 2 nested do loops in your code so it is going to be computationally intensive depending on the number of elements and nodes. Initially try with smallest model possible, as your code is simple post processing, try with simpler model with least number of elements possible and see if that is working.nAlso, you can check *VGET, *VFUN and *VMASK commands instead of using nested do loops and see if that helps.n-AniketnHow to access Ansys help linksnGuidelines for Posting on Ansys Learning Forumn
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- How to calculate the residual stress on a coating by Vickers indentation?
- An Unknown error occurred during solution. Check the Solver Output…..
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- whether have the difference between using contact and target bodies
- Colors and Mesh Display
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- Massive amount of memory (RAM) required for solve
- What is the difference between bonded contact region and fixed joint
© 2022 Copyright ANSYS, Inc. All rights reserved.