|
[Sponsors] |
Are you writing solvers for single or double precision? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 16, 2021, 08:18 |
Are you writing solvers for single or double precision?
|
#1 |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
Hello everyone,
I saw that one expert I know, only writes their solvers with double precision. It seems a little unproductive to me, since I also like to do simulations with single precision, since they're 2X faster, but only half as accurate. In most cases, the results are good enough, and I can explore design changes easily. So, for my own solver, I'm making sure that both single and double precision can be used. What do others in the forum do? PS : Having a single precision solver has other advantages too. Main one is to be able to run fast simulations during the solver development phase and profile the performance of the code. Thanks and regards ~sayan Last edited by aerosayan; January 16, 2021 at 10:24. |
|
January 16, 2021, 12:09 |
|
#2 |
Senior Member
|
I strictly prefer double precision in development, because there are several little subtle issues in a general CFD code that won't come out in single precision or you couldn't be sure about them. Single precision is tested just after that.
In production it's just up to the user but, again, my personal preference is for double for the same reasons above. Probably after a first single precision run |
|
January 16, 2021, 14:28 |
|
#3 | |
Senior Member
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8 |
Quote:
I mainly use single precision because it's extremely fast. |
||
January 16, 2021, 14:37 |
|
#4 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
As Paolo addressed, the issue should be explored by experiencing what happens for some iterative methods applied on some particular matrix. Maybe more than a CFD topic, is a numerical analysis topic.
Briefly speaking, single precision can cause an accumulation of the error. |
|
January 16, 2021, 14:55 |
|
#5 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Just a very simple example of the problem
https://www.ibm.com/support/pages/si...point-accuracy |
|
January 16, 2021, 15:20 |
|
#6 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
Have come across cases that do not converge in single precision or in mixed precision. One of the them actually wasted 2 weeks before someone run it in double precision where it finally converged without issues. |
||
January 16, 2021, 15:23 |
|
#7 |
Senior Member
|
As mentioned by Filippo, the main reason is that, in single precision, you need to be a sort of magician to have everything under control. I simply don't have time to analyze every single math operation when I develop in the beginning, maybe later.
More generally, you want to be sure that things actually work in double precision as well. Also, some CFD pieces have inherent discontinuities (wall functions, gradient limiters, etc.) that might kick in unexpectedly, and spoil your convergence. When you develop you want to be sure that you catch them |
|
January 16, 2021, 15:28 |
|
#8 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
||
January 16, 2021, 15:29 |
|
#9 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
||
January 18, 2021, 07:36 |
|
#11 |
Senior Member
andy
Join Date: May 2009
Posts: 322
Rep Power: 18 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Switching between single and double precision in Fortran | aerosayan | Main CFD Forum | 12 | November 20, 2020 08:24 |
How to Mix AIR and WATER | Elvis1991 | FLUENT | 12 | December 1, 2016 13:28 |
Continuing User Defined Real Gas Model issues | aeroman | FLUENT | 6 | April 8, 2016 04:34 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 09:23 |
Double precision CFX | Vanessa | CFX | 8 | August 13, 2006 05:34 |