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

Single v.s. double precision

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 7, 2004, 03: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?

  Reply With Quote

Old   April 7, 2004, 05: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...
  Reply With Quote

Old   April 7, 2004, 19: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, 06: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, 18: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
  Reply With Quote

Old   April 16, 2004, 23: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, 06: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, 18: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, 05: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, 18: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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel User Defined Real Gas Model aeroman FLUENT 4 July 1, 2015 06:09
Continuing User Defined Real Gas Model issues aeroman FLUENT 5 May 1, 2015 02:57
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 10:38
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23


All times are GMT -4. The time now is 12:18.