-
-
November 28, 2023 at 7:05 pmDawid LewnaSubscriber
Good morning everyone.
I hope I have chosen the right section, if not then please correct me.
I am looking for an expert who is well versed in writing scripts in APDL inside Workbench. I'm doing a thermal-structural analysis and have encountered the following problem. I have a temperature distribution from the "transient thermal" modules. I imported the result of the last calculation step into the "transient structural" module. Inside the "transient structural" module, I want to divide the finite elements into groups according to what temperature they have. To do this, I wrote APDL code that looks like the following (this is a piece of code that later based on the groups assigns them the appropriate critical value and kills the elements):
group1=0
group2=0
group3=0
group4=0
group5=0
group6=0
group7=0*get, NUMELEM, ELEM, 0, COUNT
*do, i, 1, NUMELEM
 *get, temp_val, elem, i, temp ! Group 1
 *if, temp_val, le, 20
  *if, temp_val, gt, 0
   group1 = 1
  *endif ! Group 2
 *if, temp_val, le, 0
  *if, temp_val, gt, -40
   group2 = 1
  *endif ! Group 3
 *if, temp_val, le, -40
  *if, temp_val, gt, -60
   group3 = 1
  *endif ! Group 4
 *if, temp_val, le, -60
  *if, temp_val, gt, -100
   group4 = 1
  *endif ! Group 5
 *if, temp_val, le, -100
  *if, temp_val, gt, -130
   group5 = 1
  *endif ! Group 6
 *if, temp_val, le, -130
  *if, temp_val, gt, -160
   group6 = 1
  *endif ! Group 7
 *if, temp_val, le, -160
  group7 = 1
 *endif
*enddocmgroup,group1,1
cmgroup,group2,2
cmgroup,group3,3
cmgroup,group4,4
cmgroup,group5,5
cmgroup,group6,6
cmgroup,group7,7
I get the following error, which I can't solve myself:"Unknown label in field 5 ( temp ) of *GET command.                    Â
 Line= *get, temp_val, elem, i, temp                                  Â
 The *GET command is ignored."
I'm hoping to find someone here who can help me fix it. -
November 29, 2023 at 2:18 pmdloomanAnsys Employee
There is no *get of element temperature mentioned in the *get documentation. It appears you would need to be in post1, create an element table for temp (etab,temp,temp) and then *get the etable item. If you can't be in post1 when you issue these commands you could *get one of the nodes of the element and *get its temperature.Â
Also, I'm pretty sure the *if command needs to end with then, *if, temp_val, le, 20,then. You could replace the two *if commands with one:  *if, temp_val, le, 20,and,temp_val,gt,0,then
-
- The topic ‘Grouping elements with a command in APDL’ is closed to new replies.
- Problem with access to session files
- Ayuda con Error: “Unable to access the source: EngineeringData”
- Reaction forces and moments during random vibration at local coordinate systems
- At least one body has been found to have only 1 element in at least 2 directions
- Using APDL to extract stresses on a beam element.
- How to select the interface delamination surface of a laminate?
- Geometric stiffness matrix for solid elements
- Timestep range set for animation export
- Non-linear convergence issue
- Computation Accleration
-
1141
-
471
-
468
-
225
-
201
© 2024 Copyright ANSYS, Inc. All rights reserved.