CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Single v.s. double precision (http://www.cfd-online.com/Forums/cfx/20286-single-v-s-double-precision.html)

Confused April 7, 2004 03:05

Single v.s. double precision
 
I have seen it so many times now, when I compare the solution in single and double precision there is a huge difference. Wonder why I still bother to calculate in single :(

I believe that my mesh is fine enough, I have used 750000 pure Hexahedral cells for a small geometry. I use high resolution for the advection scheme. The convergence rate and level is similar for the single and double precision calculation. Solver CFX5.5

But why does this happens, Is it always like that?


deLuther April 7, 2004 05:06

Re: Single v.s. double precision
 
I also noticed that double precision is better even for relatively simple case. Because single precision can give wrong results...

Glenn Horrocks April 7, 2004 19:13

Re: Single v.s. double precision
 
Hi,

Double precision will be significant if tiny relative differences are significant. Examples where you would expect double precision to make a difference are natural convection (especially if modelled with the fully compressible option); meshes with a large difference between the largest and smallest element sizes; large geometries with small but significant features; flows with large pressure/velocity/temperature variations etc etc.

Double precision is always more accurate, but does run slower (on 32 bit machines at least) and takes up more memory.

Glenn

Rui April 8, 2004 06:48

Re: Single v.s. double precision
 
Hi,

Is it possible to estimate how slower a double precision simulation is, compared to a single precision one?

Thanks,

Rui

Glenn Horrocks April 12, 2004 18:42

Re: Single v.s. double precision
 
Hi Rui,

I think from memory my last comparison (on a Intel Xeon/WinXP machine) double precision took 30%-50% longer than single precision. This assumes that the simulation converges OK with both single and double precision.

regards, Glenn

Neale April 16, 2004 23:49

Re: Single v.s. double precision
 
Are you sure you are not running in absolute pressure mode. i.e. you set the reference pressure to zero and set all your boundary conditions in absolute pressure?

If the pressure variation in your problem is not huge then you should use a pressure that represents the average pressure.

Neale

Atit April 18, 2004 06:23

Re: Single v.s. double precision
 
My problem is about natural convection. I use the adaptive mesh also. The maximum iterations in each adaption step is 200. When each adaption step end, I got the message: ---------------------------------- WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/BETA/ENERGY

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/CONDUCT_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/CVVOL

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/DENSITY_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/DRHODP_T_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/ENTHSTAT_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/ENTROPY_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/MACH_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/PRES

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/PTOT

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/SPHEATP_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/SSTRNR_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/TEMP_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/TTOT_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/VEL_FL1

Where = ZN1/VX

When = 200

WARNING: The following data is being reduced from double

precision to single precision on interpolation.

What = G/VISCDYN_FL1

Where = ZN1/VX

When = 200 ------------------------------------------ What does it mean? and what is "FL1"?

Glenn Horrocks April 18, 2004 18:21

Re: Single v.s. double precision
 
Hi Atit,

From another post I understand you are using 10 refinement levels in your mesh adaption. I suspect single precision will not be accurate enough to capture the very fine meshes this could create. It might even be so fine double precision can't capture it.

As I said in my previous post, 10 refinement levels is too much. Reduce it to between 3 and 5.

Glenn

Atit April 19, 2004 05:30

Re: Single v.s. double precision
 
Dear Mr.Horrocks, Thank you for your answer. Yes now I reduce to 5 steps as you recommend. However I am sorry, but I do not understand your suggestion on SP and DP. Does you mean I should use double precision? Furthermore, do you know why CFX change the calculation from DP to SP in some region? Thank you very much.

Atit

Glenn Horrocks April 19, 2004 18:33

Re: Single v.s. double precision
 
Hi Atit,

My comments regarding SP and DP relate to the fact that with 10 refinement levels you will get some extremely small elements in relation to the rest of the grid. I suspect that a SP number will not have enough resolution to resolve these small elements accurately, leading to problems with accurate predictions of the fluxes etc etc, ultimately leading to unstable solver behaviour and probable divergence.

I have no idea why CFX hanged to SP in some regions. I have not experienced it in any of my work.

Glenn

urosgrivc August 26, 2016 07:19

Hi

Does somebody know how to set double precision as a DEFAULT for cfx?

When solving sistems with RSM there is only option for number of threads and not for SP or DP?

Execution control in cfx pre is acting kinda strange, if I set Execution controls in cfxpre (no. of cores, DP...) the solver fails.

Thank you

ghorrocks August 26, 2016 08:34

This is a 12 year old thread. The fact that I posted on this thread way back then explains why I have creaky bones now.

I don't think you can set double precision as a default. You will just have to make a habit of clicking the double precision tick when you set up a new simulation.

I do not understand your RSM comment. The choice of double or single precision has nothing to do with what physics you have selected - at least to my knowledge.

I do not understand your comment on execution control in CFX-Pre. It works fine for me. But it is easily set in solver manager or command line, so it is not a big hassle to work-around.

urosgrivc August 26, 2016 14:03

Thank you,
I ment Remote Solve Manager; if I use it, there is no other way to solve it in Double Precision than to set an execuiton control in pre as there is no settings for sp or dp.

ghorrocks August 27, 2016 06:39

OK, I will take your word for it. I do not use remote solve manager so cannot help you there.


All times are GMT -4. The time now is 14:46.