|
[Sponsors] |
January 22, 2013, 04:11 |
Solution diverging on using double precision
|
#1 |
New Member
Join Date: Jun 2010
Posts: 20
Rep Power: 16 |
Hi,
I have an incompressible Navier Stokes code that was working fine as long as I was using single precision. When I converted to double precision, the residues are very high. Why is this happening? Thanks! Qrie |
|
January 22, 2013, 12:29 |
|
#2 |
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 500
Rep Power: 19 |
A bug in your code?
Sometimes issues like the following may occur if (xx == 0.0) { then do something } Under single precision this might work but double does not if xx is very small but not equal to 0.0, for example xx=1.0e-12. Single precision would round value to zero. Error tolerances should be used. if (abs(xx) < 1.0e-8) { then do something } |
|
January 23, 2013, 00:11 |
|
#3 |
New Member
Join Date: Jun 2010
Posts: 20
Rep Power: 16 |
That helps! Thank you!
|
|
Tags |
divergence, double precision |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parallel rasInterFoam | openfoam_user | OpenFOAM Running, Solving & CFD | 4 | November 1, 2008 05:14 |
When to use double precision | Mark Render | Main CFD Forum | 10 | January 21, 2008 13:16 |
re: Double precision and grid quality | Wooster | CFX | 5 | July 26, 2007 11:10 |
UDF & Double precision; Please help?? | Asghari | FLUENT | 0 | January 31, 2007 14:14 |
HELP! Diverging Solution for Incompressible Prob. | Bob | FLUENT | 3 | April 16, 2006 20:33 |