Skip to main content

Defining Ansys Superelement SUB File Manually

Photo by  James Owen  on  Unsplash A surprisingly popular blog-post written here is Exporting Stiffness Matrix from Ansys . A sensible follow up question is what can one do with the exported stiffness matrix? In a recent Xansys Forum post, a question was raised on how we can edit the stiffness matrix of a superelement and use it for our model.  An approach presented below is to first create a superelement that has the same number of DOF and nodal location that will serve as a template. An APDL script can then be written to edit the stiffness matrix entries as desired before exporting to a new superelement *.SUB file for use in future models. The self-contained script below demonstrates this.  /prep7 et ,1, 185 mp , ex, 1, 200e3 mp , prxy, 1, 0.33 w = 0.1 ! single element (note nodal locations) n , 1, w, -w, -w n , 2, w, w, -w n , 3, -w, w, -w n , 4, -w, -w, -w n , 5, w, -w, w n , 6, w, w, w n , 7, -w, w, w n , 8, -w, -w, w e , 1, 2, 3, 4, 5, 6, 7, 8 /solu antype , substr     ! analy

Unintended Mesh Interference

If you're not careful, you'll end up like me with unintended interference. The problem can be illustrated with a pin and hole-part assembly. Three identical geometry assemblies are created. From left to right, firstly a Tet mesh, then two others of different Hex mesh controls (Figure 1). Though the pin has the same diameter as the hole diameter, there may be interference in the model due to geometry discretization.

Figure 1: Identical Geometry but Different Mesh

The difference in results are clear from the contact pressure shown in Figure 2:
Figure 2: Contact Pressure at Frictionless Contacts

The coarse Tet mesh does not 'curve' well (Figure 3) thus bumping into each other. The interference in the second assembly with hex mesh is less acute but still present (Figure 4). The third assembly with hex mesh with nodes of both the pin and hole aligned has no interference (Figure 5) hence almost no pressure.

Figure 3: End View Tet Mesh Shows Interference at Hole

Figure 4: End View of Hex Mesh (Not Aligned) Has Interference

Figure 5: End View of Aligned Hex Mesh

In summary, a good mesh size and controlled hexahedral meshing does make a difference. The v18.1 archived WB file can be downloaded here.