CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

precision difference OF-2.3.0 and OF-2.3.1

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2016, 03:41
Default precision difference OF-2.3.0 and OF-2.3.1
  #1
New Member
 
Matthias Stammen
Join Date: Oct 2010
Posts: 8
Rep Power: 15
MatzeS is on a distinguished road
Hello,

for some special analysis I need a very high numerical precision of of the flow field (so, double precision everywhere). And accidentally, I came along a small difference between the versions OF-2.3.0 and OF-2.3.1.
Running the same code in the same case, I get max. velocities which differ after 6 digits.
Some example results:
code compiled with OF-2.3.0
Umax max(mag(U)) [0 1 -1 0 0 0 0] 1.90072158967443
Umax max(mag(U)) [0 1 -1 0 0 0 0] 1.90072234086763
Umax max(mag(U)) [0 1 -1 0 0 0 0] 1.9007235882843

code compiled with OF-2.3.1
Umax max(mag(U)) [0 1 -1 0 0 0 0] 1.90072222726156
Umax max(mag(U)) [0 1 -1 0 0 0 0] 1.90072298134827
Umax max(mag(U)) [0 1 -1 0 0 0 0] 1.9007242315462

I compiled the two different OF-versions on the same machine, using the same compiler, but I always get these small differences (in serial and parallel). I searched in the src folder (using meld), but didn't find the files which could explain this difference.

Does anyone has an idea?

Thanks,
Matze

PS: It is a simple 2D airfoil using the SIMPLE algorithm and inletOutlet BCs on a circular domain. writePrecision is set to 15.
MatzeS is offline   Reply With Quote

Old   June 22, 2016, 07:41
Default
  #2
New Member
 
Matthias Stammen
Join Date: Oct 2010
Posts: 8
Rep Power: 15
MatzeS is on a distinguished road
After running several more simulations and checking the codes again, I found that the relevant difference is the delta() function in
src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C
OF-2.3.0:
return Cf() - Cn();
OF-2.3.1:
// Use patch-normal delta for all non-coupled BCs
const vectorField nHat(nf());
return nHat*(nHat & (Cf() - Cn()));
So, the difference is that in OF-2.3.1 only the normal part of the cell-centre to face-centre vector is used.
As far as I know, this delta is used for the computation of the Laplacian term, but I'm still not sure which one is correct and why this change was done...
Any ideas?
MatzeS is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



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