CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Time is always zero (http://www.cfd-online.com/Forums/openfoam-solving/59417-time-always-zero.html)

kian September 24, 2007 16:04

Hello OpenFoam Users, I hav
 
Hello OpenFoam Users,

I have 1.4.1, compiled with single precision.
I noticed that when I use a deltaT lower than 1.0E-05, it is basically regarded as zero. In other words, time is always zero!
I checked the deltaT.value() in the code (sonicFoam), and it contains the correct value.

Any advice is appreciated,

Kian

kian September 24, 2007 23:16

I compiled with double precisi
 
I compiled with double precision, and the problem is gone now.

mattijs September 25, 2007 13:53

See Time.C around line 620.
 
See Time.C around line 620.

The problem in single precision is that there are only 6 significant digits. There is some truncation in operator++ to reach time 0 exactly which is probably too strict for your case.

kian September 26, 2007 10:15

In the code segment you pointe
 
In the code segment you pointed to (the ++ operator), time is set to
value() + deltaT_
then it is forced to zero if its value is less than 10*SMALL or 1E-5, perhaps for aesthetics?!

I can't understand why it is not forced to zero in double precisions, when your deltaT is say 1E-8?

kian September 26, 2007 10:24

OK, I was wrong about SMALL be
 
OK, I was wrong about SMALL being 1E-6 in double precision, that value is for single precision.

The actual value of SMALL is 1E-15 in dp.

I wanted to get rid of that if statement, but I'm going to stick with the dp version instead, since it is better tested.


All times are GMT -4. The time now is 00:49.