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

Why Does Double Precision Fail in CFX While Single Precision Works?

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

Like Tree1Likes
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2025, 11:34
Question Why Does Double Precision Fail in CFX While Single Precision Works?
  #1
Member
 
Han Zhang
Join Date: Apr 2025
Location: Nan Jing, China
Posts: 40
Rep Power: 2
zhanghuicheng@nnu.edu.cn is on a distinguished road
I am using ANSYS CFX to simulate steam flow with non-equilibrium condensation inside a steam turbine.

When I run the solver with double precision and 60 parallel cores, the simulation fails (either diverges or crashes).
However, with single precision and only 30 cores, the simulation completes without any problems.

Why would enabling double precision cause the simulation to fail?Any insights would be greatly appreciated.
zhanghuicheng@nnu.edu.cn is offline   Reply With Quote

Old   July 23, 2025, 16:46
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,945
Rep Power: 34
Opaque will become famous soon enough
Quote:
Originally Posted by zhanghuicheng@nnu.edu.cn View Post
I am using ANSYS CFX to simulate steam flow with non-equilibrium condensation inside a steam turbine.

When I run the solver with double precision and 60 parallel cores, the simulation fails (either diverges or crashes).
However, with single precision and only 30 cores, the simulation completes without any problems.

Why would enabling double precision cause the simulation to fail?Any insights would be greatly appreciated.
you are comparing apples to oranges. To conclude anything you must run the EXACT same number of partitions with either precision. No mix and match.

In your evaluation, you changed two variables at the same time: precision on numbers (like droplet size, nucleation rates, etc), and domain decomposition coupling of the linear equations.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   July 24, 2025, 04:02
Default
  #3
Member
 
Han Zhang
Join Date: Apr 2025
Location: Nan Jing, China
Posts: 40
Rep Power: 2
zhanghuicheng@nnu.edu.cn is on a distinguished road
Quote:
Originally Posted by Opaque View Post
you are comparing apples to oranges. To conclude anything you must run the EXACT same number of partitions with either precision. No mix and match.

In your evaluation, you changed two variables at the same time: precision on numbers (like droplet size, nucleation rates, etc), and domain decomposition coupling of the linear equations.
I sincerely appreciate your advice. Following your suggestion, I ran the simulation using the same number of partitions for both cases. However, the double-precision solver still failed to proceed, whereas the single-precision solver successfully completed the run.
zhanghuicheng@nnu.edu.cn is offline   Reply With Quote

Old   July 24, 2025, 06:11
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 18,017
Rep Power: 146
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I suspect you will find this result is more due to luck than a firm reason. Your simulation is obviously borderline numerically unstable, so whether it goes stable or not is dependent on a tiny factor. In this case it could be that the single precision simulation cannot resolve a feature (like a small separation) which is just too much for the solver to handle and it tips the simulation over the edge and it fails.

I do not think it worth much effort to try to find a reason for this, as it is likely to be more luck than anything. The conclusion I would draw from this is that your simulation is very unstable and anything you do to improve that stability will help you immensely - you simulation will be faster, more accurate and not crash every now and again.

So I would improve mesh quality, check your time step size, check your convergence criteria and use a better initial guess.
Opaque likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   July 25, 2025, 06:19
Default
  #5
Member
 
Han Zhang
Join Date: Apr 2025
Location: Nan Jing, China
Posts: 40
Rep Power: 2
zhanghuicheng@nnu.edu.cn is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
I suspect you will find this result is more due to luck than a firm reason. Your simulation is obviously borderline numerically unstable, so whether it goes stable or not is dependent on a tiny factor. In this case it could be that the single precision simulation cannot resolve a feature (like a small separation) which is just too much for the solver to handle and it tips the simulation over the edge and it fails.

I do not think it worth much effort to try to find a reason for this, as it is likely to be more luck than anything. The conclusion I would draw from this is that your simulation is very unstable and anything you do to improve that stability will help you immensely - you simulation will be faster, more accurate and not crash every now and again.

So I would improve mesh quality, check your time step size, check your convergence criteria and use a better initial guess.
Thank you very much for your insights and suggestions. I really appreciate your time and explanation. I will definitely look into improving the mesh quality, time step size, and initial conditions to enhance the stability of the simulation.
zhanghuicheng@nnu.edu.cn is offline   Reply With Quote

Reply

Tags
cfx, double precision solver

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single precision better than double precision? 140raiders CFX 1 July 30, 2015 03:32
[swak4Foam] #codeStream options & includes, swak4Foam dEntropy OpenFOAM Community Contributions 10 July 29, 2015 06:10
double precision cfx pat CFX 5 November 11, 2008 07:45
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23
Double precision CFX Vanessa CFX 8 August 13, 2006 05:34


All times are GMT -4. The time now is 01:08.