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

CMS circa Ansys 2019 R3

CMS circa 2019R3

Roughly a year ago, I wrote about how you could reuse CMS elements using APDL snippets within Ansys Mechanical. The new feature of Condensed Geometry in recent releases unfortunately does not completely solve the problem; but does get you half way there.

To recap, the goal here is to have a part (A) that is complicated/huge but now condensed into a teeny-tiny Super-Element. Changes can be quickly made to other parts (B). When combined together (C/D), the model as a whole is smaller and faster to solve since A is reused.

This blog post is an update to the earlier post that uses the same technique but takes advantage of two new tools: Condensed Geometry & Mesh Numbering.

To get started, download the Ansys 2019R3 archived file to follow along.
Archived File with RST (177.0MB)   Link or
Archived File without RST (1.5MB)  Link

The rough procedure:
  1. Create and mesh both Analysis A for CMS part and Analysis B for other parts. 
  2. Note down maximum node and element number for Analysis B. 
  3. In Analysis A, use Mesh Numbering to offset the starting number of nodes and elements to be larger than the maximum node and element number of Analysis B. Or use a huge number. This is to avoid conflicting numbers later so that the node numbers persist between analysis. 
  4. In Analysis A, insert Condensed Geometry Object. After generating the condensed part, right click on the Condensed Part in the tree to "Open Solver File Directory". In it, you will see all the files generated including a *.sub file. Note down the directory name and path for use in APDL snippet later. 
  5. Create Analysis C (your intended final analysis, e.g. Modal Analysis).
  6. Connect Analysis A (CMS part) Model to Analysis C Model, THEN double click on Model of Analysis C to start Mechanical (this is critical before the next step). 
  7. Connect Analysis B Model to Analysis C Model. The already-opened Ansys Mechanical Analysis C should automatically update to reflect the added parts. 
  8. In Analysis C, use Solution APDL snippets to perform Modal or Harmonic Analysis that replaces part A with the CMS equivalent. Expansion of results is also included.  

In the toy model in the archived file above, the results are similar to the naked eye.
No CMS: Elapsed time of 94s

With CMS: Elapsed time of 60s


  1. good job! what makes step6 so important? I have strange result if I dont perform step 6.

    1. Step 6 is important as it retains the order of the numbering scheme. By the way, this post is possibly outdated as Ansys R2 2020 has introduced the capability of importing condensed part.

    2. Hi Jason,

      Firstly, good job on all the work you have done on this website !

      Secondly, I am working in a relative new company and they have Ansys R2 2020. How exactly do you import condensed part ? Do you know a tutorial explaining step by step how to do it ?

      Thank you!

  2. Hi Jason,
    I tried to use 'hbmat' command to extract mass matrix from the *.sub file, but the result mass file is too big. The *.sub file is 118 MB, but the mass file in 'txt' format is 213 MB. Do you know why the mass file is so big and what shoud I do to reduce the size of it?
    Thank you!

    1. Hi YangSu, I believe *.sub is a binary file which is more efficient than hbmat text format. Perhaps look into Pyansys to see if dealing with binary files directly will work for you.

  3. Hello Jason,

    Could you please share the file with condensed geometry in ANSYS R2021. I am using new version and facing issue with condensed geometry. Thanks.

    1. Hi Nilesh,
      I expect this blog post is outdated. Ansys came up with *.cpa condensed part file for export/import. Please see the help files on "Working with Substructures".

  4. Hi Jason. I'm trying to understand and develop some normalization or 'protocol' for generating condensed parts and saving-out matrices for the spacecraft community (vis-a-vis the Craig-Bampton method) to make equivalent Siemens' "External Superelement" of spacecraft that are destined for a Coupled Loads Analysis on a rocket. The NASA community favors NASTRAN/FEMAP, so I thank you for insight to the CMS that ANSYS is now availing in the Mechanical interface. I'm still learning the MAPDL, too, so I'm keen on your illustrations of leveraging the Mechanical Interface as much as possible and integrate MAPDL as snippets = very useful!


Post a Comment