Conversion from csv or cgns to .med

Hello,
I’m currently doing CFD simulations with ANSYS CFX and I need to transfer the mesh and fields to Code_Aster for mechanical simulations. Is there a simple way to convert the output files from CFX (Ensight, CGNS, csv,…) to a .med file, that would be readable by Code_Aster? I quickly checked the MEDCoupling documentation and couldn’t find an answer.
Are there Python scripts that could be used for that?

I hope this is the right channel for my question.

Best regards,

Christophe

Hello Christophe,
You can import CGNS file in SMESH (File Menu > Import > CGNS file), then use it directly or export it to MED format if you want.
You can also use meshio to convert to med format.
Note that meshio is integrated in SMESH (File Menu > Import > other formats).

And yes this can be done in Python, see the documentation or dump your study to Python to have example.

Thanks Fred, I will try that for the mesh but just to be sure: the fields from the CFD (temperature, pressure,…) can also be converted at the same time with the mesh into a .MED file?

Hi,

to convert the fields, you can open the cgns file in PARAVIS and export to med format via the menu File> Save data.

Christophe