ANSYS Static Structural Export format to Paraview

Hey @HeidiYe
Did you find a way to convert ANSYS results to a format Paraview can read?

Best regards

Unfortunately no.

Hello, I am also a Ansys user, and in need to read Static Structural results from Ansys into Paraview. It its interesting that Paraview can read .inp files, because this is an “input” file format in Ansys APDL, but the “output” formats in Ansys are both .rst or optionally .cdb. A .cdb file is a format I didn’t try yet. I will test it and post it if I am successful. Regards,

Hello, I found out that the .inp file format, corresponds to:

Format: AVS UCD Format

This is an Example ASCII UCD File for a single hexahedral cell with 8 nodes. The first line header indicates 8 nodes, 1 element, 2 node attributes, 0 element attributes, 0 model attributes. In the section where attributes are defined, the first line indicates there are 2 attributes, both scalar. After the first attribute line is the list of attribute names along with their type.

8 1 2 0 0
1 0.000 0.000 1.000
2 1.000 0.000 1.000
3 1.000 1.000 1.000
4 0.000 1.000 1.000
5 0.000 0.000 0.000
6 1.000 0.000 0.000
7 1.000 1.000 0.000
8 0.000 1.000 0.000
1 1 hex 1 2 3 4 5 6 7 8
002 1 1
layer, integer
stress, real
1 1 4999.9999
2 1 18749.9999
3 1 37500.0000
4 1 56250.0000
5 0 74999.9999
6 0 93750.0001
7 0 107500.0003
8 0 5000.0001

In order to convert Ansys Mechanical APDL .res file into this format, I tried the following:
-Open the file in APDL
-Read the result
-Select all the elements in the model ALLSEL,ALL
-Write a .cdb file CDWRITE
-Write an ASCII results file with PRNSOL
-Merge both files manually in Notepad++
-Save the result with the format shown, with the .inp extension

Hope it helps!

1 Like

Hello, @jose0233 !
Did you really manage to export the model and results from Ansys MAPDL to Paraview? Perhaps you have some new experience on this topic? The idea is clear to rename the cdb file to inp. But what about the results? PRNSOL command produces regular page text, not APDL code. And what about solution times (steps)?

2 Likes

It seems that the function of importing data from ANSYS MAPDL/Workbench is inoperable, and this problem has been known for many years, as we see here: https://vtk.org/Bug/view.php?id=15160

It should be noted that the INP format is not a standard ANSYS format. Apparently, the import function works with a text file of the CDB format (renamed to INP), which contains the model building macro in the APDL language (but the file does not contain the calculation results). It is likely that @jose0233 managed to import some unusual model (perhaps it was created from legacy finite element types and created by an outdated version of ANSYS)

I suppose that today the most realistic way to transfer an ANSYS MAPDL/Workbench structural model to Paraview is to create text files of legacy VTK format from ANSYS using a macro in the APDL language. An example of such a macro is given:

1 Like

Hello @Andrei ,
Sorry for the delay in responding.
Yes, I managed to export an Ansys Mechanical model into Paraview, firstly by opening the model in Ansys MAPDL and, laboriusly, manually, exporting it from there and then converting all the data into AVS UCD file format. It is ONLY for LINEAR elements (This is, 4-node tetrahedra, 8-node hex, and so on). Again, this is very time consuming, not recommendable, but still possible.
From MAPDL:
-Export the Ansys mesh using CDWRITE command
-Export the Ansys results using the PRNSOL command
Then from any text editor:
-Process and assembly all the files into a single AVS UCD file
-Save this file with the .inp extension, and Paraview will read it with this format

I am very interested in the vtk file format, with the macro that you posted, I tried but still didnt make it work correctly, I am almost there…

On the other hand, in the video posted, it seems to me that they have a custom ACT (this is an App Customization Toolkit inside Ansys), but not all the Ansys users have access to this particular converter to VTK.

Regards

1 Like

Hello @jose0233 !
Thank you very much for the information!

Please clarify, this procedure for merging files (obtained as a result of the CDWRITE and PRNSOL commands) is only merging several files into one, or the files themselves need to be modified in some way. What description of the AVS UCD format did you use to understand this issue.

As for the APDL macro, which was mentioned above, this method generally works, but requires some adaptation in accordance with a specific problem. As for the ACT extension, I don’t know anything about it.

Hello,
I did this procedure manually, and it will be very complicated to put it in a list, because it requires the MAPDL expertise.
On the other hand, what is really intriguing is that somebody already programmed an ANSYS interface in Paraview. I tried to export ANSYS results in many different ways, but no luck . Please have a look at the attached image. Is there somebody that could clarify which ANSYS format it is already established?

Thank you

CapturaParaview

1 Like

I would suggest you look at the C++ source code for avtANSYSFileFormat

1 Like

The only native .inp reader of Paraview is AVS UCD, the other one you see are not from ParaVirew.

In any case, this Reader seems to work fine for me with sample inp file I have.

1 Like

Is it possible to share this *.inp sample file so that ANSYS users can identify what it is and how it was created. The difficulty is that * .inp files are not used in ANSYS to present the results, so users cannot understand how and in what format the results should be exported

Hello,
It finally worked! I just exported a sample MAPL mechanical model into Paraview by running the vtk.inp file from the link that @Andrei posted ! The VTK format works fine and did it for Ansys MAPDL models (and even if you have an Ansys Workbench Mechanical Model, you can always open it from MAPDL and export it).
I repeat the Link to download the converter:

1 Like

Did you also try exporting your model from ANSYS workbench to Nastran and loading that file instead?

I have toyed with the idea of writing a FEMAP plugin for paraview. I’m not sure how many people would use it though.

2 Likes

Not sure if this problem has been solved perfectly, it seems that the whole process is still complicated. Can paraview directly read the cdb and rst files of ansys now?

I guess ParaView still can’t read ANSYS files directly. But this problem can be solved, when it is really necessary, using APDL programming (hyperlinks above in this discussion ANSYS Static Structural Export format to Paraview - #13 by Andrei). This solution requires debugging with respect to specific finite element types in your FEM model. But if you debug it, then it will work for FEM models of a certain type.

I transferred temperature data from ansys to paraview by this method; In ansys classic, prepare node coord arrays and temperature array in ansys by fill array menu. Then use *vwrite menu command for writing formatted x,y,z and temperature data into a text file. then in ansys workbench, export the mesh into a stl file. Stl model and text data are imported into paraview. data table is transferred into point data. Finally point data can be interpolated on the stl model. I hope this is usefull for you.

I also found these youtube videos they are very helpfull for data manipulation and interpolation in paraview. thank you.

1 Like

Dear all,

I I have followed the script provided here by DaveD

How to read Ansys data files in ParaView?

But I am unable to get a result that Paraview can import. I attach a few screenshots, because several warnings came out while the script was being run. I got a vtk as output (360 MB, so I guess it contains something…), but Paraview displays the following error:

ERROR: In C:\glr\builds\paraview\paraview-ci\source-paraview\VTK\IO\Legacy\vtkUnstructuredGridReader.cxx, line 320 vtkUnstructuredGridReader (000001CECD70BC00): Unrecognized keyword: 0.00000e+00

I have never used APDL, so I will be happy if the author of the script or someone experienced using it could tell me what I did wrong (I continued clicking “yes” through all the windows and I got the output.vtk as I mentioned)

Thanks a lot in advance. Any hint will be really appreciated

I did not see the script (could you share it?) . It gives the error probably due to a typing error in the script.
Other warnings are related with redimensioning and it is normal when you run the script second time. These arrays are already defined and script tries to redim them. You should click “Yes” multiple times.

Paraview seems to find unexpected keyword. VTK file may not be written properly due to APDL error.

Hi,

The link where I downloaded the script is:

Many thanks in advance for taking the time to check it!