General Mechanical

General Mechanical

How to change the Element ID numbers manually in ANSYS Mechanical?

    • Rameez_ul_Haq
      Subscriber

      Hello there. Below picture shows a simple 20 by 40 mm surface body, where I have generated mesh of the size 2 mm, with a total elements equal to 200. The highlighted mesh element in green color represents the mesh element which has been assigned an element ID of 1 by the software randomly.

      As observed, the element with ID = 1 lies somewhere in the middle of the surface body, which is not desired. Instead, what I desire is that the element which has to have an element ID = 1 should begin from the the lower left corner, and continue from there horizontally, and then move up the row, and continue until the last element on the top right corner has been assigned the final element ID of 200. How can I achieve this task? Kindly help.

      I have a few ideas in mind, which might be viable but I don't know how to proceed with each. First idea suggests that I shall manually assign an ID number to each element on the Mechanical interface, possibly through options under the mesh settings. Other idea suggests that I shall be able to import the complete mesh data into a text file, modify the element IDs and then import it back into the mechanical and implement that mesh onto the surface body. For both of these ideas, I don't know they can actually be executed. Please assist. Thanks.

      PS: I am using ANSYS Workbench 2021R1 version.

    • Erik Kostson
      Ansys Employee

      Hi
      If you use the meshing inside mechanical then we do not have any or much control of numbering (e.g., element).
      The best way to do what you want is to write a small script (python, matlab, etc.) that writes the nodes and element numbers as you want (this can be done for regular geometry shown). So in essence you will write a .cdb or ds.dat file with the node numbers (using N command or NBLOCK) as you want, and element numbers (using E command or EBLOCK) as needed, and then read that in via external model (that should preserve the numbering defined in the files).
      All the best
      Erik

       

    • Rameez_ul_Haq
      Subscriber

       

      Thank you for your response. Yes sure I can write a MATLAB code, which explicitly shall define which elements and nodes should be assigned what numbers. However, I am unaware of what should be the format and pattern of the code, such that it could smoothly be imported into the external model module. Could you kindly provide an example here?

      Plus, the type of MATLAB file where code is written would be .m, and I don’t know how to relate this type of file with the required types, as like you have mentioned in your reply, namely .cdb or ds.dat. 

      And one more thing, does there exist a possibility to insert an APDL command in the mechanical interface, under any of the tabs like Geometry or Mesh located in the Model tree, such that it can enable me to achieve what I want? Thanks.

       

    • Erik Kostson
      Ansys Employee

       

      Hi

      Perhaps it is much easier to do it in mapdl where we can use *DO (for loops) to create nodes (N commands) as needed, and elements (E commands). See the help manual for more info on logic and looping, and the N command on how to define nodes and E for elements.

      When the mesh is done, then we can issue the CDWRITE command in mapdl. This will write the .cdb file that can be read into external model in WB.

      All the best

      Erik

       

    • peteroznewman
      Subscriber

      Hi Rameez,

      I find that if the surface is in the XY plane, the elements are numbered in your preferred order. Look for the ID number on the bottom edge of the image.

      When the surface is in the YZ plane, the element IDs are numbered in an odd way that you showed.

      Why do you need the elements ordered in a particular way?

      Users sometimes need to map results from one analysis to be the load on a new analysis. For example a Steady State Thermal analysis calculates the temperature distribution on a surface. Those temperatures are to be input into a Static Structural analysis to calculate thermal expansion in the structure. The way Ansys imports result data from an external program to use as a load is by XYZ coordinates. In that way, the element numbers used in either analysis are irrelevant and the mesh can even be different.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.