View Issue Details

IDProjectCategoryView StatusLast Update
0003465OpenFOAMBugpublic2020-03-11 12:46
ReporterjoegiAssigned Tohenry 
Status closedResolutionno change required 
Platformopensuse 15.1OSOtherOS Version(please specify)
Product Version7 
Fixed in Version 
Summary0003465: sampling difference between binary and ascii format
DescriptionIn the attached case, there is a difference in the sampling output between ascii and binary format.
Even if the artifacts that appear in the binary sampling output are small, I think they shouldn't be there.

I have seem the same behavior in different cases dealing with incompressible solvers. I haven't verified this with compressible solvers.

The issue is present in both serial and parallel simulations.

In the attached figures you can see the difference in the output.
Steps To ReproduceJust execute the included script:


Also, change the format for binary to ascii or viceversa.
TagsNo tags attached.



2020-03-06 15:08


ascii1.png (29,918 bytes)
ascii1.png (29,918 bytes)
ascii2.png (26,828 bytes)
ascii2.png (26,828 bytes)
binary1.png (29,982 bytes)
binary1.png (29,982 bytes)
binary2.png (27,021 bytes)
binary2.png (27,021 bytes)
casebug.tar.gz (115,578 bytes)


2020-03-09 10:24

manager   ~0011235

I ran the casebug case with ascii and binary output in OpenFOAM-dev and see no difference in the results, do you have an OpenFOAM-dev installation you can try?

Looking at your files it appears that there is an inconsistency in your installation, it says that it is version 7 of ESI's fork of OpenFOAM, but they do not release their fork using the official numbering of the OpenFOAM Foundation.


2020-03-09 10:29

reporter   ~0011236


The case setup is for version 7 of I will install the dev version and check.



2020-03-09 10:47

manager   ~0011237

The file headers are inconsistent:

| \\ / O peration | Version: 7 |
| \\ / A nd | Web: |

indicating that the version in 7 but of ESI's fork of OpenFOAM, but ESI have not released a version 7.


2020-03-09 11:21

reporter   ~0011238

Putting aside the issue of the header. I ran the case using OF7, OFDEV and OF1912. And in all version I got those artifacts in the binary output.


2020-03-09 11:31

manager   ~0011239

The header issue indicates that there is something inconsistent with your installation.

I am able to reproduce the problem in OpenFOAM-7 but not in OpenFOAM-dev, in fact if I run the OpenFOAM-dev postProcess on the OpenFOAM-7 results I also do not see the artifacts. Maybe your OpenFOAM-dev installation is rather old or also inconsistent.


2020-03-09 11:41

reporter   ~0011240


I am updating the installation. In any-case, I updated the header and the problem still is present in OF7 and OF1912.


2020-03-09 11:55

manager   ~0011241

OF1912 is a fork of OpenFOAM produced by ESI, we take no responsibility for it and ESI choose not to contribute to OpenFOAM development, see


2020-03-09 16:28

reporter   ~0011242

I still see the artifacts in the dev version. Though they are different from version 7, which is even weirder (see attached figure).

 I am using this branch: 3659fb478b8517081f53deafdee7c4a3619bc152

I also updated the headers so they are consistent with the OF version.


2020-03-09 17:00

manager   ~0011243

Last edited: 2020-03-09 18:39

View 2 revisions

I am still unable to reproduce the problem in OpenFOAM-dev, I have attached the results from the binary run.


2020-03-09 18:40


s1_p.pdf (8,886 bytes)
Ux.pdf (11,749 bytes)


2020-03-09 19:37

reporter   ~0011244

I can reproduce this with latest dev, but only when running parallel. Serial works without issues.

binary_bug.png (27,261 bytes)
binary_bug.png (27,261 bytes)


2020-03-10 05:36

reporter   ~0011245

I did some further tests and I can also reproduce it with ASCII if I increase the precision to 18. The problem seems to be related to parallel sampling, because reconstructing and then postProcessing works. It seems that if the mesh is decomposed with binary or high precision ASCII and then sampled in parallel, the location of the sampling points will be slightly different than in serial with some near duplicate points. The output depends on the decomposition type and number of processors, so probably something to do with how the sampling line and processor domains are aligned.

Here are sampled points with just decomposing 0-time and running postProcess in serial and parallel.

serial_0.png (17,007 bytes)
serial_0.png (17,007 bytes)
parallel_0.png (17,155 bytes)
parallel_0.png (17,155 bytes)


2020-03-10 07:45

reporter   ~0011246

One further comment: the sampling line is exactly aligned with the mesh grid and is in between two cell rows (there is even number of cells). This means there is 50/50 odds for each cell pair which cell the sampling should pick. Any slight perturbation might mean that the line cuts through different rows of cells and thus produces jitter.

sampling_line.png (97,735 bytes)
sampling_line.png (97,735 bytes)


2020-03-11 12:46

manager   ~0011247

User error.

If you sample exactly along a line of cell faces using

interpolationScheme cell;

the result is not well defined as it is not clear which cell on either side of the faces should be sampled. You should either use

interpolationScheme cellPoint;

or another interpolating method which will provide a consistent interpolation to the sampling points. Alternatively set the line such that it passes through the cells rather than along cell faces.

Issue History

Date Modified Username Field Change
2020-03-06 15:08 joegi New Issue
2020-03-06 15:08 joegi File Added: ascii1.png
2020-03-06 15:08 joegi File Added: ascii2.png
2020-03-06 15:08 joegi File Added: binary1.png
2020-03-06 15:08 joegi File Added: binary2.png
2020-03-06 15:08 joegi File Added: casebug.tar.gz
2020-03-09 10:24 henry Note Added: 0011235
2020-03-09 10:29 joegi Note Added: 0011236
2020-03-09 10:47 henry Note Added: 0011237
2020-03-09 11:21 joegi Note Added: 0011238
2020-03-09 11:31 henry Note Added: 0011239
2020-03-09 11:41 joegi Note Added: 0011240
2020-03-09 11:55 henry Note Added: 0011241
2020-03-09 16:28 joegi File Added: Annotation 2020-03-09 172712.png
2020-03-09 16:28 joegi Note Added: 0011242
2020-03-09 17:00 henry Note Added: 0011243
2020-03-09 18:39 henry Note Edited: 0011243 View Revisions
2020-03-09 18:40 henry File Added: s1_p.pdf
2020-03-09 18:40 henry File Added: Ux.pdf
2020-03-09 19:37 tniemi File Added: binary_bug.png
2020-03-09 19:37 tniemi Note Added: 0011244
2020-03-10 05:36 tniemi File Added: serial_0.png
2020-03-10 05:36 tniemi File Added: parallel_0.png
2020-03-10 05:36 tniemi Note Added: 0011245
2020-03-10 07:45 tniemi File Added: sampling_line.png
2020-03-10 07:45 tniemi Note Added: 0011246
2020-03-11 12:46 henry Assigned To => henry
2020-03-11 12:46 henry Status new => closed
2020-03-11 12:46 henry Resolution open => no change required
2020-03-11 12:46 henry Note Added: 0011247