CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Binary or Ascii? (

dancfd May 4, 2013 18:33

Binary or Ascii?
Hello all,

My hard disk is starting to run out of space, so I began to experiment with compressing the results and using binary instead of ascii by changing the appropriate controlDict tags. I noticed that ascii was the largest, binary was slightly smaller, then binary compressed, but the smallest was ascii compressed. I would like to know why binary would be selected - is it more accurate than ascii with writePrecision less than some integer?



haakon May 5, 2013 04:19

The binary format store raw binary data, as they are stred in computer memory. I guess it is stored in 64 bits precision, independent on the writePrecision setting. The other option would have been to store it in 32 bit precision when writePrecision is below some threshold. However I am not sure about this behaviour. If someone knows, please inform us.

I guess that one really good reason for choosing binary write without compression, is that the compression costs when it comes to CPU usage and performance. Writing raw binary data is the cheapest when it comes to CPU cycles, and I guess that the final size compared to compressed ASCII is comparable (say within 10-20 percent of each other).

All in all I never use compression... If I want to save space I compress the case folders as whole when I am finished analysing and post-processing.

dancfd May 6, 2013 21:26

Hello Hakon,

Thanks for your response! I will try that option.



All times are GMT -4. The time now is 03:35.