
[Sponsors] 
April 7, 2004, 04:05 
Single v.s. double precision

#1 
Guest
Posts: n/a

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? 

April 7, 2004, 06:06 
Re: Single v.s. double precision

#2 
Guest
Posts: n/a

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


April 7, 2004, 20:13 
Re: Single v.s. double precision

#3 
Guest
Posts: n/a

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 

April 8, 2004, 07:48 
Re: Single v.s. double precision

#4 
Guest
Posts: n/a

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

April 12, 2004, 19:42 
Re: Single v.s. double precision

#5 
Guest
Posts: n/a

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 

April 17, 2004, 00:49 
Re: Single v.s. double precision

#6 
Guest
Posts: n/a

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 

April 18, 2004, 07:23 
Re: Single v.s. double precision

#7 
Guest
Posts: n/a

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"? 

April 18, 2004, 19:21 
Re: Single v.s. double precision

#8 
Guest
Posts: n/a

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 

April 19, 2004, 06:30 
Re: Single v.s. double precision

#9 
Guest
Posts: n/a

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 

April 19, 2004, 19:33 
Re: Single v.s. double precision

#10 
Guest
Posts: n/a

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 

August 26, 2016, 08:19 

#11 
Senior Member
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 363
Rep Power: 8 
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 

August 26, 2016, 09:34 

#12 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 16,538
Rep Power: 128 
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 CFXPre. It works fine for me. But it is easily set in solver manager or command line, so it is not a big hassle to workaround. 

August 26, 2016, 15:03 

#13 
Senior Member
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 363
Rep Power: 8 
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. 

August 27, 2016, 07:39 

#14 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 16,538
Rep Power: 128 
OK, I will take your word for it. I do not use remote solve manager so cannot help you there.


November 10, 2016, 05:36 
how to enable double precision in fluent.

#15  
New Member
abhijeet jaiswal
Join Date: Sep 2016
Posts: 7
Rep Power: 6 
Quote:
myself abhijeet jaiswal and i am working on the simulation of jet blast defelector with density based model,high Re,and also temperature neara about 650K and i have same error problem as you discuss above so sir can you explain me how to change to double precision from single precision to solve this problem to get better result... 

November 10, 2016, 05:42 

#16 
Senior Member
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 363
Rep Power: 8 
There are 2 comon ways of seting double precision:
1 in cfxsolver manager 2 in execution control in CFXpre 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Continuing User Defined Real Gas Model issues  aeroman  FLUENT  6  April 8, 2016 04:34 
Parallel User Defined Real Gas Model  aeroman  FLUENT  4  July 1, 2015 07:09 
Missing math.h header  Travis  FLUENT  4  January 15, 2009 12:48 
what's wrong about my code for 2d burgers equation  morxio  Main CFD Forum  3  April 27, 2007 11:38 
REAL GAS UDF  brian  FLUENT  6  September 11, 2006 09:23 