CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Single v.s. double precision

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 1 Post By Confused
  • 1 Post By deLuther
  • 6 Post By Glenn Horrocks
  • 1 Post By Glenn Horrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2004, 04:05
Default Single v.s. double precision
  #1
Confused
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?

Vinay94 likes this.
  Reply With Quote

Old   April 7, 2004, 06:06
Default Re: Single v.s. double precision
  #2
deLuther
Guest
 
Posts: n/a
I also noticed that double precision is better even for relatively simple case. Because single precision can give wrong results...
Vinay94 likes this.
  Reply With Quote

Old   April 7, 2004, 20:13
Default Re: Single v.s. double precision
  #3
Glenn Horrocks
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
  Reply With Quote

Old   April 8, 2004, 07:48
Default Re: Single v.s. double precision
  #4
Rui
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
  Reply With Quote

Old   April 12, 2004, 19:42
Default Re: Single v.s. double precision
  #5
Glenn Horrocks
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
Vinay94 likes this.
  Reply With Quote

Old   April 17, 2004, 00:49
Default Re: Single v.s. double precision
  #6
Neale
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
  Reply With Quote

Old   April 18, 2004, 07:23
Default Re: Single v.s. double precision
  #7
Atit
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"?
  Reply With Quote

Old   April 18, 2004, 19:21
Default Re: Single v.s. double precision
  #8
Glenn Horrocks
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
  Reply With Quote

Old   April 19, 2004, 06:30
Default Re: Single v.s. double precision
  #9
Atit
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
  Reply With Quote

Old   April 19, 2004, 19:33
Default Re: Single v.s. double precision
  #10
Glenn Horrocks
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
  Reply With Quote

Old   August 26, 2016, 08:19
Default
  #11
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 12
urosgrivc is on a distinguished road
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
urosgrivc is offline   Reply With Quote

Old   August 26, 2016, 09:34
Default
  #12
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   August 26, 2016, 15:03
Default
  #13
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 12
urosgrivc is on a distinguished road
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.
urosgrivc is offline   Reply With Quote

Old   August 27, 2016, 07:39
Default
  #14
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
OK, I will take your word for it. I do not use remote solve manager so cannot help you there.
ghorrocks is offline   Reply With Quote

Old   November 10, 2016, 05:36
Default how to enable double precision in fluent.
  #15
New Member
 
abhijeet jaiswal
Join Date: Sep 2016
Posts: 7
Rep Power: 10
abhijeet is on a distinguished road
Quote:
Originally Posted by Glenn Horrocks
;68698
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
dear sir,
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...
abhijeet is offline   Reply With Quote

Old   November 10, 2016, 05:42
Default
  #16
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 12
urosgrivc is on a distinguished road
There are 2 comon ways of seting double precision:

1- in cfx-solver manager

2- in execution control in CFXpre
urosgrivc is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 15:49.