CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Problem with the precision of scalar values

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 25, 2015, 12:11
Default Problem with the precision of scalar values
  #1
Member
 
fouad abi
Join Date: Nov 2015
Location: Geneva, Switzerland
Posts: 42
Rep Power: 10
faab is on a distinguished road
Send a message via Skype™ to faab
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 !
faab is offline   Reply With Quote

 


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
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


All times are GMT -4. The time now is 07:57.