Home      |     Contact Us      |     Users Site SEARCH:       


Single vs. Double Precision Versions?

A typical FLOW-3D installation includes two versions of the pre-processor and solver executables – a Single precision version and a Double precision version. Users can choose which version to run through the Preference > Runtime menu of the GUI, or by setting the F3D_VERSION environment variable to "single" or "double" when running in a command window. The double precision version is the default selection because it is more accurate in representing floating point variables. The post-processor is only available in single precision.

A floating point single precision value is comprised of four bytes, while a floating point double precision value is comprised of eight bytes. What this ultimately leads to is a typical accuracy of 7 significant digits in single precision and an accuracy of about 15 significant digits in double precision. The remaining digits are called the roundoff error. Roundoff errors are handled differently by different compilers and hardware platforms, and may be random numbers or all zeros.

In a single arithmetic operation the roundoff error is usually insignificant. But after millions of operations, the errors may accumulate and affect the numerical solution. Obviously, these errors are larger and can accumulate faster when the single precision code is used. The effect of these errors on the solution depends on the problem at hand. For instance, a jet of water sprayed upward against gravity has an inherent physical instability, which can be triggered unphysically by roundoff errors.

Roundoff error can be significant even in a single arithmetic operation, e.g, when finding the difference between two large numbers of similar magnitudes. The result will be much smaller than either of the numbers and may be comparable with the roundoff error. Such errors can sometimes be seen when processing topographic geometry input data used in water engineering simulations. If the topographic data employs absolute coordinates, then small details may be missing after processing it using the single precision pre-processor. To eliminate the problem, the data domain needs to be translated to a relative coordinate system.

So when would the user employ the single precision version of FLOW-3D? The advantage of the single precision version is that larger jobs, with almost twice as many computational cells as in double precision, can be submitted. This can be greatly beneficial for problems requiring very large meshes like in high pressure die casting.

However, so long as mesh size is not a problem, we recommend using the double precision version. The size of the output files is the same for either version. The speed of the execution is not significantly affected by your selection of single or double precision.