Page 1 of 1

Using Matlab to read the Code Saturne result file

Posted: Tue Oct 02, 2018 6:47 pm
by Jundi He
Hi Code Saturne team:

I have a steady state simulation done by Code Saturne, and I am going to read the result file. As I know, different variables are stored in different files, for example, temperature field is stored in file "results.tempc.00001" which is binary. And now I am going to read the temperature field into an array in Matlab, so that I can do other data processing or calculation using the result data, anyone know how to do that? If there is a Matlab file, it's perfect. If there is not, could someone tell me the structure of the output file "results.tempc.00001", how many numbers are in this file and what's the type of these numbers, because in Matlab, I need to specify the type of numbers ("float 64" or "int32"...) and the number of the total numbers stored in the file. I suppose for example I have 12000 cells in my fluid domain, there will be 12000 temperature values stored in this file, so that I can use the global cell index to find out the temperature of this cell. Thanks for the time.

Regards!
Jundi

Re: Using Matlab to read the Code Saturne result file

Posted: Wed Oct 03, 2018 9:54 am
by Yvan Fournier
Hello,

The different post-processing output formats are detailed in the user manual (pdf).

What type of post-processing do you need to do ? If you need spatial information, the fields in the post-processing mesh will not be enough. You will also need mesh-related info.

I recommend checking what formats Matlab can read, and comparing that to those Code_Saturne can output. ParaView may also hep converting between formats.

Regards,

Yvan

Re: Using Matlab to read the Code Saturne result file

Posted: Wed Oct 03, 2018 11:20 am
by Jundi He
Hi Yvan:

OK, thanks, I am reading the user manual to know the structure of the output file.

Regards!
Jundi

Re: Using Matlab to read the Code Saturne result file

Posted: Wed Oct 03, 2018 5:19 pm
by C.FLAG.
Hello,

You might want to check this matlab library https://www.mathworks.com/matlabcentral ... ile-format

The file format is actually not so complicated, and I was able to write some fortran program to read simple Ensight files, see this link for instance: https://repo.ijs.si/CFLAG/CS-fluid-soli ... eo.f90#L66

Regards,
Cédric