|
[Sponsors] |
November 25, 2015, 12:11 |
Problem with the precision of scalar values
|
#1 |
Member
|
Dear everyone,
I am working with a modified version of the ChtMultiRegion Solver, and the DP (double precision) is the one I set for the compiler. I am working on a 64-bit unit. My problem is that when the solver computes a very large number - say -1.45 to the power 21, to take an actual example - and stacks it in the allocated memory by passing this value to an existing variable, it is converted to 0. So of course, when I later use this variable in a division I get a segmentation fault. I do not understand how this process works, and because I use the DP, I do not see how to fix the issue. Could anyone give me a hand with this matter please ? PS. In case it helps: I just ran a test where I state a=-1.45e+21, and "print" the value which is returned correctly by the solver. But when I do not use the "e" exponent and enter the full value (with 19 zeros) I get 0 in return. So I guess the issue/limitation comes from the number of digits, any ideas ?? Thanks ! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Negative values in scalar transport | jnally | OpenFOAM Running, Solving & CFD | 5 | August 23, 2018 15:32 |
sonicFoam Wedge, Max. Iterations Exceeded, hConstThermo, | v199ah | OpenFOAM Running, Solving & CFD | 4 | March 15, 2016 09:39 |
Non-Uniform Scalar Values | Shabirmean | OpenFOAM Running, Solving & CFD | 0 | August 27, 2014 13:12 |
[swak4Foam] Problem: Defining a linear scalar BC with groovyBC | holp | OpenFOAM Community Contributions | 3 | July 19, 2012 20:19 |
NEAGTIVE SCALAR VALUES | Mario | Siemens | 1 | November 18, 2002 02:01 |