CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Double precision (https://www.cfd-online.com/Forums/main/5612-double-precision.html)

Mark Render January 7, 2003 08:28

Double precision
 
Hi,

could someone tell how one knows when to run cfd jobs in double precision ?

What are indicators that a single precision run is not sufficient ?

Regards,

Mark

versi January 8, 2003 19:27

Re: Double precision
 
I think you must use double precision with dimensional variables or with large scale computation. It is always preferable to use double precision. Sometimes a code can convergence to 1.E-6 but it really has a bug, a single precision calculation can not find out this bug.

rusås January 9, 2003 13:23

Re: Double precision
 
I did once in the past mainly for fun tried to make the same run as double precision, the difference was huge for my case. (It could be due to much lower residual values) I have almost ever since been calculating with double precision.

Jim Park January 9, 2003 14:42

Re: Double precision
 
Another bit of experience:

In the dark ages, I was computing a turbulent wall flow on a UNIVAC 1108 (yes, dark ages!). That machine's default was a 36-bit word. The process was interrupted by transferring the problem to an IBM system 360, where the default word was 32 bits (4 bytes). The developing transients showed a distinct shift in slope (value vs. time) as the solution continued to develop. When I converted the code to double precision (64 bits), the character of the solution shifted back to the patterns obtained using 36 bits.

So, for that code and those processors, I concluded that there was a rather abrupt change in the form of the error for a word length somewhere between 32 and 36-bit words.

More recently, I've seen at least a few calculations using CFX-4 in which the single and double-precision versions gave essentially the same answer. This was on UNIX boxes.

Of course the double length words cost twice the storage space, but (as I recall) the penalty in computing time was only about 20%.

I think the rule might be to "do it in double precision (64 bit words) if you can afford it." If you can't afford it, be very careful what you claim about your solution!

Jan Rusås January 9, 2003 18:50

Re: Double precision
 
So true!! One should always obtain a double precison - if you can afford it :)))

Martin Bowers January 17, 2003 14:25

Re: Double precision
 
I think you should always run in double precision even if you think you can't quite afford it.

I had an old experience with CFX-4 in which double precision took about 20% more time per iteration, but it only took half as many iterations to reach the same residual reduction. Therefore it was faster to run in double.

In TASCflow they provide a poff that helps with running in single precision when your pressure level does not vary much in the absolute sense. If you don't set a reasonable poff, double precision is required to get good convergence. I haven't explored what happens when you say have a pressure range from 1-3 MPa and set an offset of 2 MPa. The local pressure still varies from -1 to +1 MPa which takes as many significant digits as if you just ran from 0-1 MPa..

In CFX-5 there is no such poff besides manually adjusting to relative BCs. That's a massive undertaking for me because in compressible flow one is always dealing with absolute pressures. This means I really need double precision, except for the OS I run on there is only single precision....

Neale January 18, 2003 01:21

Re: Double precision
 
Double precision and 64 bit solaris are coming in 5.6. Sorry Martin.

Neale


All times are GMT -4. The time now is 20:53.