CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   precision difference OF-2.3.0 and OF-2.3.1 (https://www.cfd-online.com/Forums/openfoam-bugs/173487-precision-difference-2-3-0-2-3-1-a.html)

MatzeS June 21, 2016 03:41

precision difference OF-2.3.0 and OF-2.3.1
 
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 June 22, 2016 07:41

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?


All times are GMT -4. The time now is 06:02.