CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Binary vs Ascii (https://www.cfd-online.com/Forums/openfoam-solving/122151-binary-vs-ascii.html)

immortality August 13, 2013 07:53

Binary vs Ascii
 
whats the usage differences and advantages of each one?
I have tested that Binary run takes 1/4 space of Ascii run but its a bit slower(I'm not sure,only it looks in terminal) than Ascii and I read somewhere that Binary is more accurate than Ascii.
are my conclusions true or not? :)

cdm August 15, 2013 12:48

In general, binary is faster for read/write since the computer does not have to convert to a human-readable format. However, there are advantages (and disadvantages) to each.

For example, say you have a large (fine mesh) simulation where you plan on outputting hundreds or thousands of timesteps. In this case, binary would be better because writing many data points and many timesteps can be done relatively instantaneously (compared to converting and writing thousands of ASCII files).

Alternatively, if you have a small case and you're outputting relatively few timesteps, you can use ASCII without any significant performance hit and you can even open up the timestep files in a text editor to peruse them.

ASCII
- for large meshes, file size can be significant
- can view/modify the files in text editor
- no problem for smaller cases and/or writing few timesteps

BINARY
- smaller file sizes
- fast write of data
- cannot view/modify in text editor
- good for large cases and/or writing many timesteps

Just a note: you can switch between the two write methods on the fly by modifying the controlDict entry while your case is running.


All times are GMT -4. The time now is 18:27.