Page 1 of 1

Output files precision

Posted: Tue Aug 13, 2013 8:57 pm
by knewlands
Hello,

I apologise for the rather basic question, but I'm using version 2.0.5 and I would like to know if there is a way to obtain the output text files in double precision format?

I'm running LES calculations and I've been having some trouble with the energy spectra displaying a tail at the higher frequencies that neither grid refinement nor time step reduction seem to have eliminated. It doesn't look like energy pile up, but more like an error due to lack of precision. I know that in some cases switching to double precision has solved the problem and I notice that the numbers in the probe files saved in the History folder only have 7 decimal places. The post-processing format I selected is EnSight Gold Text, which may be read by Matlab for the post-processing. Is there anything I can do to improve the precision of the saved data?

Thank you,

Kristin

Re: Output files precision

Posted: Wed Aug 21, 2013 10:35 am
by Brian Angel
Hello Kristin,

In order to increase the precision of the output data from sensors you can use the "cs_users_extra_operations" user routine (or its equivalent for v2.0.5) where you can specify the format to be used.

The alternative is to modify the source code and recompile Code_Saturne.

Brian Angel.

Re: Output files precision

Posted: Thu Aug 22, 2013 3:11 am
by Yvan Fournier
Hello,

The EnSight gold format assumes single precision, so if you modify it, you probably won't be able to read it... The MED format is double precision, but probably not known by Matlab. CGNS may use single or double precision, but I don't remember which we use (but this would be easy to change in FVM's fvm_to_cgns.c source).

Computing energy spectra by linking an appropriate library and calling it from usproj.f90 (cs_user_extra_operations.f90 in later versions) would be a better solution, though a bit more involved, as you would require less I/O and storage.

Regards,

Yvan